From d59bfb8a56c2ecd1125745aa595ce894a9ff34d8 Mon Sep 17 00:00:00 2001 From: dismine Date: Thu, 1 Jan 2015 14:00:17 +0200 Subject: [PATCH 001/186] Url to user manual for unstable builds. --HG-- branch : develop --- src/app/mainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index 86d1161b6..be206e7cb 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -1454,7 +1454,7 @@ void MainWindow::RepotBug() void MainWindow::OnlineHelp() { qCDebug(vMainWindow)<<"Showing online help"; - QDesktopServices::openUrl(QUrl("https://bitbucket.org/dismine/valentina/wiki/manual/v0.2.9/Content")); + QDesktopServices::openUrl(QUrl("https://bitbucket.org/dismine/valentina/wiki/manual/Content")); } //--------------------------------------------------------------------------------------------------------------------- From 1a593961961924e33832660e98d7319c08a9cc41 Mon Sep 17 00:00:00 2001 From: dismine Date: Fri, 2 Jan 2015 13:00:20 +0200 Subject: [PATCH 002/186] Method CheckLoops return wrong list of points if points less then 4. --HG-- branch : develop --- src/app/geometry/vequidistant.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/geometry/vequidistant.cpp b/src/app/geometry/vequidistant.cpp index 16ed9a8aa..6593e54dd 100644 --- a/src/app/geometry/vequidistant.cpp +++ b/src/app/geometry/vequidistant.cpp @@ -234,12 +234,12 @@ QPainterPath VEquidistant::Equidistant(QVector points, const Equidistan QVector ekvPoints; if ( points.size() < 3 ) { - qDebug()<<"Not enough points for building the equidistant.\n"; + qDebug()<<"Not enough points for building the equidistant."; return ekv; } if (width <= 0) { - qDebug()<<"Width <= 0.\n"; + qDebug()<<"Width <= 0."; return ekv; } for (qint32 i = 0; i < points.size(); ++i ) @@ -306,7 +306,8 @@ QVector VEquidistant::CheckLoops(const QVector &points) /*If we got less than 4 points no need seek loops.*/ if (points.size() < 4) { - return ekvPoints; + qDebug()<<"Less then 4 points. Doesn't need check for loops."; + return points; } bool closed = false; if (points.at(0) == points.at(points.size()-1)) From 4bb5930cad6a73c8a9e419ce1b53a4c086d57a54 Mon Sep 17 00:00:00 2001 From: dismine Date: Fri, 2 Jan 2015 13:08:24 +0200 Subject: [PATCH 003/186] Default value for seam allowence is 1 cm. But pattern have different units, so just set 1 in dialog not enough. --HG-- branch : develop --- src/app/dialogs/tools/dialogdetail.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app/dialogs/tools/dialogdetail.cpp b/src/app/dialogs/tools/dialogdetail.cpp index 4605084a4..d8ca3604f 100644 --- a/src/app/dialogs/tools/dialogdetail.cpp +++ b/src/app/dialogs/tools/dialogdetail.cpp @@ -35,6 +35,7 @@ #include "../../geometry/vsplinepath.h" #include "../../container/vcontainer.h" #include "../../libs/ifc/xml/vdomdocument.h" +#include "../../xml/vabstractmeasurements.h" //--------------------------------------------------------------------------------------------------------------------- /** @@ -51,6 +52,9 @@ DialogDetail::DialogDetail(const VContainer *data, const quint32 &toolId, QWidge ui.labelUnitX->setText(VDomDocument::UnitsToStr(qApp->patternUnit(), true)); ui.labelUnitY->setText(VDomDocument::UnitsToStr(qApp->patternUnit(), true)); + // Default value for seam allowence is 1 cm. But pattern have different units, so just set 1 in dialog not enough. + ui.doubleSpinBoxSeams->setValue(VAbstractMeasurements::UnitConvertor(1, Unit::Cm, qApp->patternUnit())); + bOk = ui.buttonBox->button(QDialogButtonBox::Ok); SCASSERT(bOk != nullptr); connect(bOk, &QPushButton::clicked, this, &DialogTool::DialogAccepted); From 7d6f22d01b937d3aa700be7318d6a1dfa06670ca Mon Sep 17 00:00:00 2001 From: dismine Date: Fri, 2 Jan 2015 13:13:14 +0200 Subject: [PATCH 004/186] Better use method here. --HG-- branch : develop --- src/app/tools/nodeDetails/vnodepoint.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/tools/nodeDetails/vnodepoint.cpp b/src/app/tools/nodeDetails/vnodepoint.cpp index 19a930f5c..952d1e4e6 100644 --- a/src/app/tools/nodeDetails/vnodepoint.cpp +++ b/src/app/tools/nodeDetails/vnodepoint.cpp @@ -55,7 +55,7 @@ VNodePoint::VNodePoint(VPattern *doc, VContainer *data, quint32 id, quint32 idPo :VAbstractNode(doc, data, id, idPoint, idTool, qoParent), QGraphicsEllipseItem(parent), radius(0), namePoint(nullptr), lineName(nullptr) { - radius = (1.5/*mm*/ / 25.4) * VApplication::PrintDPI; + radius = qApp->toPixel(DefPointRadius/*mm*/, Unit::Mm); namePoint = new VGraphicsSimpleTextItem(this); lineName = new QGraphicsLineItem(this); connect(namePoint, &VGraphicsSimpleTextItem::NameChangePosition, this, From 44372c7e6b879a9d0d751e265c0ddfb7e06b295c Mon Sep 17 00:00:00 2001 From: dismine Date: Fri, 2 Jan 2015 15:53:36 +0200 Subject: [PATCH 005/186] Initial commit for static library VLayout. --HG-- branch : feature --- src/libs/libs.pro | 3 +- src/libs/vlayout/stable.cpp | 30 +++++++++ src/libs/vlayout/stable.h | 48 ++++++++++++++ src/libs/vlayout/vlayout.pri | 10 +++ src/libs/vlayout/vlayout.pro | 90 +++++++++++++++++++++++++++ src/libs/vlayout/vlayoutgenerator.cpp | 34 ++++++++++ src/libs/vlayout/vlayoutgenerator.h | 40 ++++++++++++ 7 files changed, 254 insertions(+), 1 deletion(-) create mode 100644 src/libs/vlayout/stable.cpp create mode 100644 src/libs/vlayout/stable.h create mode 100644 src/libs/vlayout/vlayout.pri create mode 100644 src/libs/vlayout/vlayout.pro create mode 100644 src/libs/vlayout/vlayoutgenerator.cpp create mode 100644 src/libs/vlayout/vlayoutgenerator.h diff --git a/src/libs/libs.pro b/src/libs/libs.pro index 1828fc39e..508095bbf 100644 --- a/src/libs/libs.pro +++ b/src/libs/libs.pro @@ -3,4 +3,5 @@ CONFIG += ordered SUBDIRS = qmuparser \ vpropertyexplorer \ ifc \ - vobj + vobj \ + vlayout diff --git a/src/libs/vlayout/stable.cpp b/src/libs/vlayout/stable.cpp new file mode 100644 index 000000000..71d31cdba --- /dev/null +++ b/src/libs/vlayout/stable.cpp @@ -0,0 +1,30 @@ +/************************************************************************ + ** + ** @file stable.cpp + ** @author Roman Telezhynskyi + ** @date 2 1, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2013 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +// Build the precompiled headers. +#include "stable.h" diff --git a/src/libs/vlayout/stable.h b/src/libs/vlayout/stable.h new file mode 100644 index 000000000..8a4f7cdfc --- /dev/null +++ b/src/libs/vlayout/stable.h @@ -0,0 +1,48 @@ +/************************************************************************ + ** + ** @file stable.h + ** @author Roman Telezhynskyi + ** @date 2 1, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2013 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef STABLE_H +#define STABLE_H + +/* I like to include this pragma too, so the build log indicates if pre-compiled headers were in use. */ +#ifndef __clang__ +#pragma message("Compiling precompiled headers for VLayout library.\n") +#endif + +/* Add C includes here */ + +#if defined __cplusplus +/* Add C++ includes here */ + +#ifdef QT_CORE_LIB +#include +#endif + +#endif/*__cplusplus*/ + +#endif // STABLE_H diff --git a/src/libs/vlayout/vlayout.pri b/src/libs/vlayout/vlayout.pri new file mode 100644 index 000000000..5f07bede4 --- /dev/null +++ b/src/libs/vlayout/vlayout.pri @@ -0,0 +1,10 @@ +# ADD TO EACH PATH $$PWD VARIABLE!!!!!! +# This need for corect working file translations.pro + +HEADERS += \ + $$PWD/stable.h \ + $$PWD/vlayoutgenerator.h + +SOURCES += \ + $$PWD/stable.cpp \ + $$PWD/vlayoutgenerator.cpp diff --git a/src/libs/vlayout/vlayout.pro b/src/libs/vlayout/vlayout.pro new file mode 100644 index 000000000..96f9fd549 --- /dev/null +++ b/src/libs/vlayout/vlayout.pro @@ -0,0 +1,90 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2015-01-02T15:39:01 +# +#------------------------------------------------- + +# File with common stuff for whole project +include(../../../Valentina.pri) + +# We don't need gui library. +QT -= gui + +# Name of library +TARGET = vlayout + +# We want create library +TEMPLATE = lib + +CONFIG += \ + staticlib \# Making static library + c++11 # We use C++11 standard + +# Use out-of-source builds (shadow builds) +CONFIG -= debug_and_release debug_and_release_target + +# Since Qt 5.4.0 the source code location is recorded only in debug builds. +# We need this information also in release builds. For this need define QT_MESSAGELOGCONTEXT. +DEFINES += QT_MESSAGELOGCONTEXT + +include(vlayout.pri) + +# This is static library so no need in "make install" + +# directory for executable file +DESTDIR = bin + +# files created moc +MOC_DIR = moc + +# objecs files +OBJECTS_DIR = obj + +# Set using ccache. Function enable_ccache() defined in Valentina.pri. +$$enable_ccache() + +# Set precompiled headers. Function set_PCH() defined in Valentina.pri. +$$set_PCH() + +CONFIG(debug, debug|release){ + # Debug mode + unix { + #Turn on compilers warnings. + *-g++{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$GCC_DEBUG_CXXFLAGS # See Valentina.pri for more details. + + #gcc’s 4.8.0 Address Sanitizer + #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ + QMAKE_CFLAGS+=-fsanitize=address -fno-omit-frame-pointer + QMAKE_LFLAGS+=-fsanitize=address + } + clang*{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$CLANG_DEBUG_CXXFLAGS # See Valentina.pri for more details. + } + } else { + *-g++{ + QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See Valentina.pri for more details. + } + } + +}else{ + # Release mode + DEFINES += V_NO_ASSERT + !unix:*-g++{ + QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll + } + + !macx:!win32-msvc*{ + # Turn on debug symbols in release mode on Unix systems. + # On Mac OS X temporarily disabled. TODO: find way how to strip binary file. + QMAKE_CXXFLAGS_RELEASE += -g -gdwarf-3 + QMAKE_CFLAGS_RELEASE += -g -gdwarf-3 + QMAKE_LFLAGS_RELEASE = + } +} diff --git a/src/libs/vlayout/vlayoutgenerator.cpp b/src/libs/vlayout/vlayoutgenerator.cpp new file mode 100644 index 000000000..2f719e99b --- /dev/null +++ b/src/libs/vlayout/vlayoutgenerator.cpp @@ -0,0 +1,34 @@ +/************************************************************************ + ** + ** @file vlayoutgenerator.cpp + ** @author Roman Telezhynskyi + ** @date 2 1, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#include "vlayoutgenerator.h" + + +VLayoutGenerator::VLayoutGenerator() +{ +} diff --git a/src/libs/vlayout/vlayoutgenerator.h b/src/libs/vlayout/vlayoutgenerator.h new file mode 100644 index 000000000..191446010 --- /dev/null +++ b/src/libs/vlayout/vlayoutgenerator.h @@ -0,0 +1,40 @@ +/************************************************************************ + ** + ** @file vlayoutgenerator.h + ** @author Roman Telezhynskyi + ** @date 2 1, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef VLAYOUTGENERATOR_H +#define VLAYOUTGENERATOR_H + + +class VLayoutGenerator +{ + +public: + VLayoutGenerator(); +}; + +#endif // VLAYOUTGENERATOR_H From 68bf51c884875efa5c3687602d5dd5ddedfa2eb7 Mon Sep 17 00:00:00 2001 From: dismine Date: Fri, 2 Jan 2015 16:06:14 +0200 Subject: [PATCH 006/186] Support translation for library. --HG-- branch : feature --- share/translations.pro | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/share/translations.pro b/share/translations.pro index 108b2a8e3..ba2acf717 100644 --- a/share/translations.pro +++ b/share/translations.pro @@ -12,13 +12,15 @@ DEPENDPATH += \ ../src/libs/qmuparser \ ../src/libs/vpropertyexplorer \ ../src/libs/ifc \ - ../src/libs/vobj + ../src/libs/vobj \ + ../src/libs/vlayout include(../src/app/app.pri) include(../src/libs/qmuparser/qmuparser.pri) include(../src/libs/vpropertyexplorer/vpropertyexplorer.pri) include(../src/libs/ifc/ifc.pri) include(../src/libs/vobj/vobj.pri) +include(../src/libs/vlayout/vlayout.pri) # Add here path to new translation file with name "valentina_*_*.ts" if you want to add new language. # Same paths in variable INSTALL_TRANSLATIONS (app.pro). From 67c93e2b5bced2213b60b625671ecde3a2505311 Mon Sep 17 00:00:00 2001 From: dismine Date: Fri, 2 Jan 2015 16:14:28 +0200 Subject: [PATCH 007/186] Initial commit for class VLayoutDetail. --HG-- branch : feature --- src/libs/vlayout/vlayout.pri | 6 +++-- src/libs/vlayout/vlayoutdetail.cpp | 33 ++++++++++++++++++++++++++ src/libs/vlayout/vlayoutdetail.h | 38 ++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 src/libs/vlayout/vlayoutdetail.cpp create mode 100644 src/libs/vlayout/vlayoutdetail.h diff --git a/src/libs/vlayout/vlayout.pri b/src/libs/vlayout/vlayout.pri index 5f07bede4..0bd4da172 100644 --- a/src/libs/vlayout/vlayout.pri +++ b/src/libs/vlayout/vlayout.pri @@ -3,8 +3,10 @@ HEADERS += \ $$PWD/stable.h \ - $$PWD/vlayoutgenerator.h + $$PWD/vlayoutgenerator.h \ + $$PWD/vlayoutdetail.h SOURCES += \ $$PWD/stable.cpp \ - $$PWD/vlayoutgenerator.cpp + $$PWD/vlayoutgenerator.cpp \ + $$PWD/vlayoutdetail.cpp diff --git a/src/libs/vlayout/vlayoutdetail.cpp b/src/libs/vlayout/vlayoutdetail.cpp new file mode 100644 index 000000000..08d9f0f40 --- /dev/null +++ b/src/libs/vlayout/vlayoutdetail.cpp @@ -0,0 +1,33 @@ +/************************************************************************ + ** + ** @file vlayoutdetail.cpp + ** @author Roman Telezhynskyi + ** @date 2 1, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#include "vlayoutdetail.h" + +VLayoutDetail::VLayoutDetail() +{ +} diff --git a/src/libs/vlayout/vlayoutdetail.h b/src/libs/vlayout/vlayoutdetail.h new file mode 100644 index 000000000..7aded6536 --- /dev/null +++ b/src/libs/vlayout/vlayoutdetail.h @@ -0,0 +1,38 @@ +/************************************************************************ + ** + ** @file vlayoutdetail.h + ** @author Roman Telezhynskyi + ** @date 2 1, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef VLAYOUTDETAIL_H +#define VLAYOUTDETAIL_H + +class VLayoutDetail +{ +public: + VLayoutDetail(); +}; + +#endif // VLAYOUTDETAIL_H From 112dbd7f4e3f37c7fd71cb76f1c58733880caa9a Mon Sep 17 00:00:00 2001 From: dismine Date: Fri, 2 Jan 2015 18:32:26 +0200 Subject: [PATCH 008/186] Class for abstract detail. --HG-- branch : feature --- src/libs/vlayout/vabstractdetail.cpp | 168 +++++++++++++++++++++++++++ src/libs/vlayout/vabstractdetail.h | 66 +++++++++++ src/libs/vlayout/vabstractdetail_p.h | 71 +++++++++++ src/libs/vlayout/vlayout.pri | 7 +- 4 files changed, 310 insertions(+), 2 deletions(-) create mode 100644 src/libs/vlayout/vabstractdetail.cpp create mode 100644 src/libs/vlayout/vabstractdetail.h create mode 100644 src/libs/vlayout/vabstractdetail_p.h diff --git a/src/libs/vlayout/vabstractdetail.cpp b/src/libs/vlayout/vabstractdetail.cpp new file mode 100644 index 000000000..078a8b157 --- /dev/null +++ b/src/libs/vlayout/vabstractdetail.cpp @@ -0,0 +1,168 @@ +/************************************************************************ + ** + ** @file vabstractdetail.cpp + ** @author Roman Telezhynskyi + ** @date 2 1, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#include "vabstractdetail.h" +#include "vabstractdetail_p.h" + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VAbstractDetail default contructor. Create empty detail. + */ +VAbstractDetail::VAbstractDetail() + :d(new VAbstractDetailData) +{} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VAbstractDetail constructor. + * @param name detail name. + */ +VAbstractDetail::VAbstractDetail(const QString &name) + :d(new VAbstractDetailData(name)) +{} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VAbstractDetail copy constructor. + * @param detail detail. + */ +VAbstractDetail::VAbstractDetail(const VAbstractDetail &detail) + :d (detail.d) +{} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief operator = assignment operator. + * @param detail detail. + * @return new detail. + */ +VAbstractDetail &VAbstractDetail::operator=(const VAbstractDetail &detail) +{ + if ( &detail == this ) + { + return *this; + } + d = detail.d; + return *this; +} + +//--------------------------------------------------------------------------------------------------------------------- +VAbstractDetail::~VAbstractDetail() +{} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief Clear detail full clear. + */ +void VAbstractDetail::Clear() +{ + d->name.clear(); + d->seamAllowance = false; + d->closed = true; + d->width = 0; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getName return detail name. + * @return name. + */ +QString VAbstractDetail::getName() const +{ + return d->name; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief setName set detail name. + * @param value new name. + */ +void VAbstractDetail::setName(const QString &value) +{ + d->name = value; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getSeamAllowance keep status for seam allowance detail. + * @return true - need seam allowance, false - no need seam allowance. + */ +bool VAbstractDetail::getSeamAllowance() const +{ + return d->seamAllowance; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief setSeamAllowance set status for seam allowance detail. + * @param value true - need seam allowance, false - no need seam allowance. + */ +void VAbstractDetail::setSeamAllowance(bool value) +{ + d->seamAllowance = value; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getClosed keep close status for detail equdistant. + * @return true - close equdistant, false - don't close equdistant. + */ +bool VAbstractDetail::getClosed() const +{ + return d->closed; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief setClosed set close status for detail equdistant. + * @param value true - close equdistant, false - don't close equdistant. + */ +void VAbstractDetail::setClosed(bool value) +{ + d->closed = value; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getWidth return value detail seam allowance. + * @return value in mm. + */ +qreal VAbstractDetail::getWidth() const +{ + return d->width; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief setWidth set value detail seam allowance. + * @param value width in mm. + */ +void VAbstractDetail::setWidth(const qreal &value) +{ + d->width = value; +} diff --git a/src/libs/vlayout/vabstractdetail.h b/src/libs/vlayout/vabstractdetail.h new file mode 100644 index 000000000..046793bce --- /dev/null +++ b/src/libs/vlayout/vabstractdetail.h @@ -0,0 +1,66 @@ +/************************************************************************ + ** + ** @file vabstractdetail.h + ** @author Roman Telezhynskyi + ** @date 2 1, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef VABSTRACTDETAIL_H +#define VABSTRACTDETAIL_H + +#include + +class QString; +class VAbstractDetailData; + +/** + * @brief The VAbstractDetail class abstract class for all details. + */ +class VAbstractDetail +{ +public: + VAbstractDetail(); + VAbstractDetail(const QString &name); + VAbstractDetail(const VAbstractDetail &detail); + VAbstractDetail &operator=(const VAbstractDetail &detail); + ~VAbstractDetail(); + + void Clear(); + + QString getName() const; + void setName(const QString &value); + + bool getSeamAllowance() const; + void setSeamAllowance(bool value); + + bool getClosed() const; + void setClosed(bool value); + + qreal getWidth() const; + void setWidth(const qreal &value); +private: + QSharedDataPointer d; +}; + +#endif // VABSTRACTDETAIL_H diff --git a/src/libs/vlayout/vabstractdetail_p.h b/src/libs/vlayout/vabstractdetail_p.h new file mode 100644 index 000000000..17826ed76 --- /dev/null +++ b/src/libs/vlayout/vabstractdetail_p.h @@ -0,0 +1,71 @@ +/************************************************************************ + ** + ** @file vabstractdetail_p.h + ** @author Roman Telezhynskyi + ** @date 2 1, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef VABSTRACTDETAIL_P_H +#define VABSTRACTDETAIL_P_H + +#include + +#ifdef Q_CC_GNU + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Weffc++" +#endif + +class VAbstractDetailData : public QSharedData +{ +public: + VAbstractDetailData() + :name(QString()), seamAllowance(false), closed(true), width(0) + {} + + VAbstractDetailData(const QString &name) + :name(name), seamAllowance(false), closed(true), width(0) + {} + + VAbstractDetailData(const VAbstractDetailData &detail) + :QSharedData(detail), name(detail.name), seamAllowance(detail.seamAllowance), closed(detail.closed), + width(detail.width) + {} + + ~VAbstractDetailData() {} + + /** @brief name detail name. */ + QString name; + /** @brief seamAllowance status seamAllowance detail. */ + bool seamAllowance; + /** @brief closed status equdistant detail. */ + bool closed; + /** @brief width value seamAllowance in mm. */ + qreal width; +}; + +#ifdef Q_CC_GNU + #pragma GCC diagnostic pop +#endif + +#endif // VABSTRACTDETAIL_P_H diff --git a/src/libs/vlayout/vlayout.pri b/src/libs/vlayout/vlayout.pri index 0bd4da172..2e203b6e1 100644 --- a/src/libs/vlayout/vlayout.pri +++ b/src/libs/vlayout/vlayout.pri @@ -4,9 +4,12 @@ HEADERS += \ $$PWD/stable.h \ $$PWD/vlayoutgenerator.h \ - $$PWD/vlayoutdetail.h + $$PWD/vlayoutdetail.h \ + $$PWD/vabstractdetail.h \ + $$PWD/vabstractdetail_p.h SOURCES += \ $$PWD/stable.cpp \ $$PWD/vlayoutgenerator.cpp \ - $$PWD/vlayoutdetail.cpp + $$PWD/vlayoutdetail.cpp \ + $$PWD/vabstractdetail.cpp From 4ba488d0c0fbc0e4cd14aec2eb74c114986fcb6d Mon Sep 17 00:00:00 2001 From: dismine Date: Fri, 2 Jan 2015 19:02:07 +0200 Subject: [PATCH 009/186] VAbstractDetail parent class for VDetail. --HG-- branch : feature --- src/app/app.pro | 9 ++ src/app/geometry/vdetail.cpp | 183 +++++++++++++++++-------- src/app/geometry/vdetail.h | 206 ++++------------------------- src/app/geometry/vdetail_p.h | 45 ++----- src/libs/vlayout/vabstractdetail.h | 2 +- 5 files changed, 174 insertions(+), 271 deletions(-) diff --git a/src/app/app.pro b/src/app/app.pro index 2f2885803..fcc923638 100644 --- a/src/app/app.pro +++ b/src/app/app.pro @@ -393,6 +393,15 @@ DEPENDPATH += $$PWD/../libs/vobj win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vobj/$${DESTDIR}/vobj.lib else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vobj/$${DESTDIR}/libvobj.a +# VLayout static library +unix|win32: LIBS += -L$$OUT_PWD/../libs/vlayout/$${DESTDIR}/ -lvlayout + +INCLUDEPATH += $$PWD/../libs/vlayout +DEPENDPATH += $$PWD/../libs/vlayout + +win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vlayout/$${DESTDIR}/vlayout.lib +else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vlayout/$${DESTDIR}/libvlayout.a + # Strip after you link all libaries. CONFIG(release, debug|release){ diff --git a/src/app/geometry/vdetail.cpp b/src/app/geometry/vdetail.cpp index d0322f4d3..e9a0eb17e 100644 --- a/src/app/geometry/vdetail.cpp +++ b/src/app/geometry/vdetail.cpp @@ -32,27 +32,45 @@ #include //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VDetail default contructor. Create empty detail. + */ VDetail::VDetail() - :d(new VDetailData) + :VAbstractDetail(), d(new VDetailData) {} //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VDetail constructor. + * @param name detail name. + * @param nodes list of nodes. + */ VDetail::VDetail(const QString &name, const QVector &nodes) - :d(new VDetailData(name, nodes)) + :VAbstractDetail(name), d(new VDetailData(nodes)) {} //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VDetail copy constructor. + * @param detail detail. + */ VDetail::VDetail(const VDetail &detail) - :d (detail.d) + :VAbstractDetail(detail), d (detail.d) {} //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief operator = assignment operator. + * @param detail detail. + * @return new detail. + */ VDetail &VDetail::operator =(const VDetail &detail) { if ( &detail == this ) { return *this; } + VAbstractDetail::operator=(detail); d = detail.d; return *this; } @@ -62,24 +80,31 @@ VDetail::~VDetail() {} //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief Clear detail full clear. + */ void VDetail::Clear() { d->nodes.clear(); - d->name.clear(); d->mx = 0; d->my = 0; - d->seamAllowance = true; - d->closed = true; - d->width = 0; } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief ClearNodes clear list of nodes. + */ void VDetail::ClearNodes() { d->nodes.clear(); } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief Containes check if detail containe this id. + * @param id object id. + * @return true if containe. + */ bool VDetail::Containes(const quint32 &id) const { for (int i = 0; i < d->nodes.size(); ++i) @@ -94,36 +119,66 @@ bool VDetail::Containes(const quint32 &id) const } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief operator [] find node by index in list. + * @param indx index node in list. + * @return node + */ VNodeDetail &VDetail::operator [](int indx) { return d->nodes[indx]; } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief at find node by index in list. + * @param indx index node in list. + * @return const node. + */ const VNodeDetail &VDetail::at(int indx) const { return d->nodes.at(indx); } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief indexOfNode return index in list node using id object. + * @param id object (arc, point, spline, splinePath) id. + * @return index in list or -1 id can't find. + */ int VDetail::indexOfNode(const quint32 &id) const { return indexOfNode(d->nodes, id); } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief id return id detail in list data. + * @return id. + */ quint32 VDetail::id() const { return d->_id; } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief setId set id detail in list data. + * @param id detail id. + */ void VDetail::setId(const quint32 &id) { d->_id = id; } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief OnEdge checks if two poins located on the edge. Edge is line between two points. If between two points + * located arcs or splines ignore this. + * @param p1 id first point. + * @param p2 id second point. + * @return true - on edge, false - no. + */ bool VDetail::OnEdge(const quint32 &p1, const quint32 &p2) const { QVector list = listNodePoint(); @@ -162,6 +217,13 @@ bool VDetail::OnEdge(const quint32 &p1, const quint32 &p2) const } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief Edge return edge index in detail. Edge is line between two points. If between two points + * located arcs or splines ignore this. + * @param p1 id first point. + * @param p2 id second point. + * @return edge index or -1 if points don't located on edge + */ int VDetail::Edge(const quint32 &p1, const quint32 &p2) const { if (OnEdge(p1, p2) == false) @@ -187,6 +249,12 @@ int VDetail::Edge(const quint32 &p1, const quint32 &p2) const } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief NodeOnEdge return nodes located on edge with index. + * @param index index of edge. + * @param p1 first node. + * @param p2 second node. + */ void VDetail::NodeOnEdge(const quint32 &index, VNodeDetail &p1, VNodeDetail &p2) const { QVector list = listNodePoint(); @@ -207,6 +275,11 @@ void VDetail::NodeOnEdge(const quint32 &index, VNodeDetail &p1, VNodeDetail &p2) } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief RemoveEdge return detail without edge with index. + * @param index idex of edge. + * @return detail without edge with index. + */ VDetail VDetail::RemoveEdge(const quint32 &index) const { VDetail det(*this); @@ -250,6 +323,12 @@ VDetail VDetail::RemoveEdge(const quint32 &index) const } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief Missing find missing ids in detail. When we deleted object in detail and return this detail need + * understand, what nodes need make invisible. + * @param det changed detail. + * @return list with missing detail. + */ QList VDetail::Missing(const VDetail &det) const { if (d->nodes.size() == det.CountNode()) @@ -275,6 +354,10 @@ QList VDetail::Missing(const VDetail &det) const } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief listNodePoint return list nodes only with points. + * @return list points node. + */ QVector VDetail::listNodePoint() const { QVector list; @@ -289,6 +372,12 @@ QVector VDetail::listNodePoint() const } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief indexOfNode return index in list node using id object. + * @param list list nodes detail. + * @param id object (arc, point, spline, splinePath) id. + * @return index in list or -1 id can't find. + */ int VDetail::indexOfNode(const QVector &list, const quint32 &id) { for (int i = 0; i < list.size(); ++i) @@ -303,96 +392,80 @@ int VDetail::indexOfNode(const QVector &list, const quint32 &id) } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief append append in the end of list node. + * @param node new node. + */ void VDetail::append(const VNodeDetail &node) { d->nodes.append(node); } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief CountNode return count nodes. + * @return count. + */ qint32 VDetail::CountNode() const { return d->nodes.size(); } //--------------------------------------------------------------------------------------------------------------------- -QString VDetail::getName() const -{ - return d->name; -} - -//--------------------------------------------------------------------------------------------------------------------- -void VDetail::setName(const QString &value) -{ - d->name = value; -} - -//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getMx return bias for X axis. + * @return x bias. + */ qreal VDetail::getMx() const { return d->mx; } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief setMx set bias for X axis. + * @param value new x bias. + */ void VDetail::setMx(const qreal &value) { d->mx = value; } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getMy get bias for y axis. + * @return y axis. + */ qreal VDetail::getMy() const { return d->my; } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief setMy set bias for y axis. + * @param value new y bias. + */ void VDetail::setMy(const qreal &value) { d->my = value; } //--------------------------------------------------------------------------------------------------------------------- -bool VDetail::getSeamAllowance() const -{ - return d->seamAllowance; -} - -//--------------------------------------------------------------------------------------------------------------------- -void VDetail::setSeamAllowance(bool value) -{ - d->seamAllowance = value; -} - -//--------------------------------------------------------------------------------------------------------------------- -bool VDetail::getClosed() const -{ - return d->closed; -} - -//--------------------------------------------------------------------------------------------------------------------- -void VDetail::setClosed(bool value) -{ - d->closed = value; -} - -//--------------------------------------------------------------------------------------------------------------------- -qreal VDetail::getWidth() const -{ - return d->width; -} - -//--------------------------------------------------------------------------------------------------------------------- -void VDetail::setWidth(const qreal &value) -{ - d->width = value; -} - -//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getNodes return list of nodes. + * @return list of nodes. + */ QVector VDetail::getNodes() const { return d->nodes; } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief setNodes set list of nodes + * @param value list of nodes + */ void VDetail::setNodes(const QVector &value) { d->nodes = value; diff --git a/src/app/geometry/vdetail.h b/src/app/geometry/vdetail.h index 50a3ac12c..2e9bef2f4 100644 --- a/src/app/geometry/vdetail.h +++ b/src/app/geometry/vdetail.h @@ -30,212 +30,56 @@ #define VDETAIL_H #include "vnodedetail.h" -#include #include -class QString; +#include "../libs/vlayout/vabstractdetail.h" + class VDetailData; /** * @brief The VDetail class for path of object (points, arcs, splines). */ -class VDetail +class VDetail :public VAbstractDetail { public: - /** - * @brief VDetail default contructor. Create empty detail. - */ VDetail(); - /** - * @brief VDetail constructor. - * @param name detail name. - * @param nodes list of nodes. - */ VDetail(const QString &name, const QVector &nodes); - /** - * @brief VDetail copy constructor. - * @param detail detail. - */ VDetail(const VDetail &detail); - /** - * @brief operator = assignment operator. - * @param detail detail. - * @return new detail. - */ VDetail &operator=(const VDetail &detail); - ~VDetail(); - /** - * @brief append append in the end of list node. - * @param node new node. - */ + virtual ~VDetail(); + void append(const VNodeDetail &node); - /** - * @brief Clear detail full clear. - */ void Clear(); - /** - * @brief ClearNodes clear list of nodes. - */ void ClearNodes(); - /** - * @brief CountNode return count nodes. - * @return count. - */ qint32 CountNode() const; - /** - * @brief Containes check if detail containe this id. - * @param id object id. - * @return true if containe. - */ bool Containes(const quint32 &id)const; - /** - * @brief operator [] find node by index in list. - * @param indx index node in list. - * @return node - */ VNodeDetail & operator[](int indx); - /** - * @brief at find node by index in list. - * @param indx index node in list. - * @return const node. - */ const VNodeDetail & at ( int indx ) const; - /** - * @brief getName return detail name. - * @return name. - */ - QString getName() const; - /** - * @brief setName set detail name. - * @param value new name. - */ - void setName(const QString &value); - /** - * @brief getMx return bias for X axis. - * @return x bias. - */ - qreal getMx() const; - /** - * @brief setMx set bias for X axis. - * @param value new x bias. - */ - void setMx(const qreal &value); - /** - * @brief getMy get bias for y axis. - * @return y axis. - */ - qreal getMy() const; - /** - * @brief setMy set bias for y axis. - * @param value new y bias. - */ - void setMy(const qreal &value); - /** - * @brief getSeamAllowance keep status for seam allowance detail. - * @return true - need seam allowance, false - no need seam allowance. - */ - bool getSeamAllowance() const; - /** - * @brief setSeamAllowance set status for seam allowance detail. - * @param value true - need seam allowance, false - no need seam allowance. - */ - void setSeamAllowance(bool value); - /** - * @brief getClosed keep close status for detail equdistant. - * @return true - close equdistant, false - don't close equdistant. - */ - bool getClosed() const; - /** - * @brief setClosed set close status for detail equdistant. - * @param value true - close equdistant, false - don't close equdistant. - */ - void setClosed(bool value); - /** - * @brief getWidth return value detail seam allowance. - * @return value in mm. - */ - qreal getWidth() const; - /** - * @brief setWidth set value detail seam allowance. - * @param value width in mm. - */ - void setWidth(const qreal &value); - /** - * @brief getNodes return list of nodes. - * @return list of nodes. - */ + + qreal getMx() const; + void setMx(const qreal &value); + + qreal getMy() const; + void setMy(const qreal &value); + + quint32 id() const; + void setId(const quint32 &id); + QVector getNodes() const; - /** - * @brief setNodes set list of nodes - * @param value list of nodes - */ - void setNodes(const QVector &value); - /** - * @brief indexOfNode return index in list node using id object. - * @param id object (arc, point, spline, splinePath) id. - * @return index in list or -1 id can't find. - */ - int indexOfNode(const quint32 &id) const; - /** - * @brief id return id detail in list data. - * @return id. - */ - quint32 id() const; - /** - * @brief setId set id detail in list data. - * @param id detail id. - */ - void setId(const quint32 &id); - /** - * @brief OnEdge checks if two poins located on the edge. Edge is line between two points. If between two points - * located arcs or splines ignore this. - * @param p1 id first point. - * @param p2 id second point. - * @return true - on edge, false - no. - */ - bool OnEdge(const quint32 &p1, const quint32 &p2)const; - /** - * @brief Edge return edge index in detail. Edge is line between two points. If between two points - * located arcs or splines ignore this. - * @param p1 id first point. - * @param p2 id second point. - * @return edge index or -1 if points don't located on edge - */ - int Edge(const quint32 &p1, const quint32 &p2)const; - /** - * @brief NodeOnEdge return nodes located on edge with index. - * @param index index of edge. - * @param p1 first node. - * @param p2 second node. - */ - void NodeOnEdge(const quint32 &index, VNodeDetail &p1, VNodeDetail &p2)const; - /** - * @brief RemoveEdge return detail without edge with index. - * @param index idex of edge. - * @return detail without edge with index. - */ - VDetail RemoveEdge(const quint32 &index) const; - /** - * @brief Missing find missing ids in detail. When we deleted object in detail and return this detail need - * understand, what nodes need make invisible. - * @param det changed detail. - * @return list with missing detail. - */ + void setNodes(const QVector &value); + + int indexOfNode(const quint32 &id) const; + bool OnEdge(const quint32 &p1, const quint32 &p2)const; + int Edge(const quint32 &p1, const quint32 &p2)const; + void NodeOnEdge(const quint32 &index, VNodeDetail &p1, VNodeDetail &p2)const; + VDetail RemoveEdge(const quint32 &index) const; + QList Missing(const VDetail &det) const; private: QSharedDataPointer d; - /** - * @brief listNodePoint return list nodes only with points. - * @return list points node. - */ + QVector listNodePoint()const; - /** - * @brief indexOfNode return index in list node using id object. - * @param list list nodes detail. - * @param id object (arc, point, spline, splinePath) id. - * @return index in list or -1 id can't find. - */ - static int indexOfNode(const QVector &list, const quint32 &id); + static int indexOfNode(const QVector &list, const quint32 &id); }; #endif // VDETAIL_H diff --git a/src/app/geometry/vdetail_p.h b/src/app/geometry/vdetail_p.h index cfb880992..097d5b835 100644 --- a/src/app/geometry/vdetail_p.h +++ b/src/app/geometry/vdetail_p.h @@ -42,53 +42,30 @@ class VDetailData : public QSharedData { public: VDetailData() - :_id(NULL_ID), nodes(QVector()), name(QString()), mx(0), my(0), seamAllowance(true), closed(true), - width(0) + :_id(NULL_ID), nodes(QVector()), mx(0), my(0) {} - VDetailData(const QString &name, const QVector &nodes) - :_id(NULL_ID), nodes(nodes), name(name), mx(0), my(0), seamAllowance(true), closed(true), width(0) + VDetailData(const QVector &nodes) + :_id(NULL_ID), nodes(nodes), mx(0), my(0) {} VDetailData(const VDetailData &detail) - :QSharedData(detail), _id(NULL_ID), nodes(detail.nodes), name(detail.name), mx(detail.mx), my(detail.my), - seamAllowance(detail.seamAllowance), closed(detail.closed), width(detail.width) + :QSharedData(detail), _id(NULL_ID), nodes(detail.nodes), mx(detail.mx), my(detail.my) {} ~VDetailData() {} - /** - * @brief _id id detail. - */ + /** @brief _id id detail. */ quint32 _id; - /** - * @brief nodes list detail nodes. - */ + + /** @brief nodes list detail nodes. */ QVector nodes; - /** - * @brief name detail name. - */ - QString name; - /** - * @brief mx bias x axis. - */ + + /** @brief mx bias x axis. */ qreal mx; - /** - * @brief my bias y axis. - */ + + /** @brief my bias y axis. */ qreal my; - /** - * @brief seamAllowance status seamAllowance detail. - */ - bool seamAllowance; - /** - * @brief closed status equdistant detail. - */ - bool closed; - /** - * @brief width value seamAllowance in mm. - */ - qreal width; }; #ifdef Q_CC_GNU diff --git a/src/libs/vlayout/vabstractdetail.h b/src/libs/vlayout/vabstractdetail.h index 046793bce..d22f0f4e7 100644 --- a/src/libs/vlayout/vabstractdetail.h +++ b/src/libs/vlayout/vabstractdetail.h @@ -44,7 +44,7 @@ public: VAbstractDetail(const QString &name); VAbstractDetail(const VAbstractDetail &detail); VAbstractDetail &operator=(const VAbstractDetail &detail); - ~VAbstractDetail(); + virtual ~VAbstractDetail(); void Clear(); From 06e945d8a3e406f65c2a0a2516a351c632d6ef35 Mon Sep 17 00:00:00 2001 From: dismine Date: Sat, 3 Jan 2015 14:22:55 +0200 Subject: [PATCH 010/186] Detail must return contour points and seam allowence points yourself. --HG-- branch : feature --- src/app/geometry/vdetail.cpp | 150 +++++++++++++++++++++++++++++++++++ src/app/geometry/vdetail.h | 9 +++ 2 files changed, 159 insertions(+) diff --git a/src/app/geometry/vdetail.cpp b/src/app/geometry/vdetail.cpp index e9a0eb17e..edc286def 100644 --- a/src/app/geometry/vdetail.cpp +++ b/src/app/geometry/vdetail.cpp @@ -28,6 +28,9 @@ #include "vdetail.h" #include "vdetail_p.h" +#include "../container/vcontainer.h" +#include "vpointf.h" + #include #include @@ -353,6 +356,84 @@ QList VDetail::Missing(const VDetail &det) const return set3.toList(); } +//--------------------------------------------------------------------------------------------------------------------- +QVector VDetail::ContourPoints(const VContainer *data) const +{ + QVector points; + for (int i = 0; i< CountNode(); ++i) + { + switch (at(i).getTypeTool()) + { + case (Tool::NodePoint): + { + const QSharedPointer point = data->GeometricObject(at(i).getId()); + points.append(point->toQPointF()); + } + break; + case (Tool::NodeArc): + case (Tool::NodeSpline): + case (Tool::NodeSplinePath): + { + const QSharedPointer curve = data->GeometricObject(at(i).getId()); + + const QPointF begin = StartSegment(data, i); + const QPointF end = EndSegment(data, i); + + points << curve->GetSegmentPoints(begin, end, at(i).getReverse()); + } + break; + default: + qDebug()<<"Get wrong tool type. Ignore."<< static_cast(at(i).getTypeTool()); + break; + } + } + return points; +} + +//--------------------------------------------------------------------------------------------------------------------- +QVector VDetail::SeamAllowancePoints(const VContainer *data) const +{ + QVector pointsEkv; + for (int i = 0; i< CountNode(); ++i) + { + switch (at(i).getTypeTool()) + { + case (Tool::NodePoint): + { + const QSharedPointer point = data->GeometricObject(at(i).getId()); + if (getSeamAllowance() == true) + { + QPointF pEkv = point->toQPointF(); + pEkv.setX(pEkv.x()+at(i).getMx()); + pEkv.setY(pEkv.y()+at(i).getMy()); + pointsEkv.append(pEkv); + } + } + break; + case (Tool::NodeArc): + case (Tool::NodeSpline): + case (Tool::NodeSplinePath): + { + const QSharedPointer curve = data->GeometricObject(at(i).getId()); + + const QPointF begin = StartSegment(data, i); + const QPointF end = EndSegment(data, i); + + QVector nodePoints = curve->GetSegmentPoints(begin, end, at(i).getReverse()); + if (getSeamAllowance() == true) + { + pointsEkv << biasPoints(nodePoints, at(i).getMx(), at(i).getMy()); + } + } + break; + default: + qDebug()<<"Get wrong tool type. Ignore."<< static_cast(at(i).getTypeTool()); + break; + } + } + return pointsEkv; +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief listNodePoint return list nodes only with points. @@ -391,6 +472,75 @@ int VDetail::indexOfNode(const QVector &list, const quint32 &id) return -1; } +//--------------------------------------------------------------------------------------------------------------------- +QPointF VDetail::StartSegment(const VContainer *data, const int &i) const +{ + QPointF begin; + if (CountNode() > 1) + { + if (i == 0) + { + if (at(CountNode()-1).getTypeTool() == Tool::NodePoint) + { + begin = data->GeometricObject(at(CountNode()-1).getId())->toQPointF(); + } + } + else + { + if (at(i-1).getTypeTool() == Tool::NodePoint) + { + begin = data->GeometricObject(at(i-1).getId())->toQPointF(); + } + } + } + return begin; +} + +//--------------------------------------------------------------------------------------------------------------------- +QPointF VDetail::EndSegment(const VContainer *data, const int &i) const +{ + QPointF end; + if (CountNode() > 2) + { + if (i == CountNode() - 1) + { + if (at(0).getTypeTool() == Tool::NodePoint) + { + end = data->GeometricObject(at(0).getId())->toQPointF(); + } + } + else + { + if (at(i+1).getTypeTool() == Tool::NodePoint) + { + end = data->GeometricObject(at(i+1).getId())->toQPointF(); + } + } + } + return end; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief biasPoints bias point. + * @param points vector of points. + * @param mx offset respect to x. + * @param my offset respect to y. + * @return new vector biased points. + */ +QVector VDetail::biasPoints(const QVector &points, const qreal &mx, const qreal &my) +{ + QVector p; + for (qint32 i = 0; i < points.size(); ++i) + { + QPointF point = points.at(i); + point.setX(point.x() + mx); + point.setY(point.y() + my); + p.append(point); + } + return p; +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief append append in the end of list node. diff --git a/src/app/geometry/vdetail.h b/src/app/geometry/vdetail.h index 2e9bef2f4..366f7afaa 100644 --- a/src/app/geometry/vdetail.h +++ b/src/app/geometry/vdetail.h @@ -35,6 +35,7 @@ #include "../libs/vlayout/vabstractdetail.h" class VDetailData; +class VContainer; /** * @brief The VDetail class for path of object (points, arcs, splines). @@ -75,11 +76,19 @@ public: VDetail RemoveEdge(const quint32 &index) const; QList Missing(const VDetail &det) const; + + QVector ContourPoints(const VContainer *data) const; + QVector SeamAllowancePoints(const VContainer *data) const; private: QSharedDataPointer d; QVector listNodePoint()const; static int indexOfNode(const QVector &list, const quint32 &id); + + QPointF StartSegment(const VContainer *data, const int &i) const; + QPointF EndSegment(const VContainer *data, const int &i) const; + + static QVector biasPoints(const QVector &points, const qreal &mx, const qreal &my); }; #endif // VDETAIL_H From a0e2348bb19b9cb52ff8711b153a05fd74587374 Mon Sep 17 00:00:00 2001 From: dismine Date: Sun, 4 Jan 2015 12:50:29 +0200 Subject: [PATCH 011/186] Version changes in rpm spec file. --HG-- branch : develop --- dist/rpm/valentina.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/rpm/valentina.spec b/dist/rpm/valentina.spec index 633415889..c092a06fa 100644 --- a/dist/rpm/valentina.spec +++ b/dist/rpm/valentina.spec @@ -25,7 +25,7 @@ BuildRequires: ccache BuildRequires: update-desktop-files %endif -Version: 0.2.8 +Version: 0.2.9 Release: 0 URL: https://bitbucket.org/dismine/valentina License: GPL-3.0+ From a68c8e95a814f56c44bb996f9888ebe8bc735c42 Mon Sep 17 00:00:00 2001 From: dismine Date: Sun, 4 Jan 2015 13:05:22 +0200 Subject: [PATCH 012/186] Version changes for creation deb package. --HG-- branch : develop --- dist/debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/debian/changelog b/dist/debian/changelog index c5c709e33..e32aca73a 100644 --- a/dist/debian/changelog +++ b/dist/debian/changelog @@ -1,4 +1,4 @@ -valentina (0.2.8-alpha) trusty; urgency=low +valentina (0.2.9) trusty; urgency=low * Auto build. From 0b80c2b9f85182ddfecb5c02196a85e6a55369f1 Mon Sep 17 00:00:00 2001 From: dismine Date: Sun, 4 Jan 2015 18:11:00 +0200 Subject: [PATCH 013/186] =?UTF-8?q?We=20alwayse=20need=20information=20abo?= =?UTF-8?q?ut=20=E2=80=9Cthe=20current=20parent=20of=20the=20working=20dir?= =?UTF-8?q?ectory=E2=80=9D.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : develop --- src/app/app.pro | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/app.pro b/src/app/app.pro index 2f2885803..981de58c5 100644 --- a/src/app/app.pro +++ b/src/app/app.pro @@ -109,7 +109,7 @@ CONFIG(debug, debug|release){ #Calculate latest tag distance and build revision only in release mode. Change number each time requare #recompilation precompiled headers file. DEFINES += "LATEST_TAG_DISTANCE=0" - DEFINES += "BUILD_REVISION=\\\"uknown\\\"" + DEFINES += "BUILD_REVISION=\\\"unknown\\\"" }else{ # Release mode DEFINES += V_NO_ASSERT @@ -126,7 +126,7 @@ CONFIG(debug, debug|release){ } #latest tag distance number for using in version - HG_DISTANCE=$$system(hg log -r tip --template '{latesttagdistance}') + HG_DISTANCE=$$system(hg log -r. --template '{latesttagdistance}') isEmpty(HG_DISTANCE){ HG_DISTANCE = 0 # if we can't find local revision left 0. } @@ -135,10 +135,10 @@ CONFIG(debug, debug|release){ #build revision number for using in version unix { - HG_HESH=$$system("hg log -r tip --template '{node|short}'") + HG_HESH=$$system("hg log -r. --template '{node|short}'") } else { # Use escape character before "|" on Windows - HG_HESH=$$system(hg log -r tip --template "{node^|short}") + HG_HESH=$$system(hg log -r. --template "{node^|short}") } isEmpty(HG_HESH){ HG_HESH = "unknown" # if we can't find build revision left unknown. From feb1d9945e4b6eabb379825f0f4f1fbbd0b947f8 Mon Sep 17 00:00:00 2001 From: dismine Date: Sun, 4 Jan 2015 18:22:06 +0200 Subject: [PATCH 014/186] Version changes for nsis script. --HG-- branch : develop --- dist/nsis/valentina.nsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/nsis/valentina.nsi b/dist/nsis/valentina.nsi index 09b811912..83c88332c 100644 --- a/dist/nsis/valentina.nsi +++ b/dist/nsis/valentina.nsi @@ -14,7 +14,7 @@ SetCompressor /FINAL /SOLID lzma !define MUI_FILE "valentina" !insertmacro GetPEVersionLocal "c:\pack\valentina\valentina.exe" ver -!define MUI_VERSION "${ver_1}.${ver_2}.${ver_3}-alpha" +!define MUI_VERSION "${ver_1}.${ver_2}.${ver_3}" !define MUI_BRANDINGTEXT "Valentina ${MUI_VERSION}" !define WEBSITE_LINK "http://www.valentina-project.org/" From 9effd8af02cdbbe59c25d557e31201bd4a4b2638 Mon Sep 17 00:00:00 2001 From: dismine Date: Wed, 7 Jan 2015 18:54:43 +0200 Subject: [PATCH 015/186] Layout detail. --HG-- branch : feature --- src/app/geometry/geometry.pri | 2 - src/app/geometry/vdetail.cpp | 44 +++ src/app/geometry/vdetail.h | 3 + src/app/geometry/vequidistant.cpp | 445 --------------------------- src/app/geometry/vequidistant.h | 113 ------- src/app/mainwindow.cpp | 13 +- src/app/mainwindow.h | 5 +- src/app/options.h | 1 - src/app/tablewindow.cpp | 174 +++++------ src/app/tablewindow.h | 8 +- src/app/tools/vtooldetail.cpp | 5 +- src/libs/vlayout/vabstractdetail.cpp | 295 ++++++++++++++++++ src/libs/vlayout/vabstractdetail.h | 13 + src/libs/vlayout/vlayout.pri | 4 +- src/libs/vlayout/vlayout.pro | 3 - src/libs/vlayout/vlayoutdef.h | 34 ++ src/libs/vlayout/vlayoutdetail.cpp | 139 +++++++++ src/libs/vlayout/vlayoutdetail.h | 38 ++- src/libs/vlayout/vlayoutdetail_p.h | 77 +++++ 19 files changed, 750 insertions(+), 666 deletions(-) delete mode 100644 src/app/geometry/vequidistant.cpp delete mode 100644 src/app/geometry/vequidistant.h create mode 100644 src/libs/vlayout/vlayoutdef.h create mode 100644 src/libs/vlayout/vlayoutdetail_p.h diff --git a/src/app/geometry/geometry.pri b/src/app/geometry/geometry.pri index 708385de8..9c8bf58c9 100644 --- a/src/app/geometry/geometry.pri +++ b/src/app/geometry/geometry.pri @@ -10,7 +10,6 @@ HEADERS += \ $$PWD/varc.h \ $$PWD/vgobject.h \ $$PWD/vpointf.h \ - $$PWD/vequidistant.h \ $$PWD/vabstractcurve.h \ $$PWD/vnodedetail_p.h \ $$PWD/vdetail_p.h \ @@ -30,5 +29,4 @@ SOURCES += \ $$PWD/varc.cpp \ $$PWD/vgobject.cpp \ $$PWD/vpointf.cpp \ - $$PWD/vequidistant.cpp \ $$PWD/vabstractcurve.cpp diff --git a/src/app/geometry/vdetail.cpp b/src/app/geometry/vdetail.cpp index edc286def..c1ce9a6fe 100644 --- a/src/app/geometry/vdetail.cpp +++ b/src/app/geometry/vdetail.cpp @@ -30,6 +30,7 @@ #include "vdetail_p.h" #include "../container/vcontainer.h" #include "vpointf.h" +#include "../core/vapplication.h" #include #include @@ -434,6 +435,49 @@ QVector VDetail::SeamAllowancePoints(const VContainer *data) const return pointsEkv; } +//--------------------------------------------------------------------------------------------------------------------- +QPainterPath VDetail::ContourPath(const VContainer *data) const +{ + QVector points = ContourPoints(data); + QVector pointsEkv = SeamAllowancePoints(data); + + QPainterPath path; + + // contour + path.moveTo(points[0]); + for (qint32 i = 1; i < points.count(); ++i) + { + path.lineTo(points.at(i)); + } + path.lineTo(points.at(0)); + + // seam allowence + if (getSeamAllowance() == true) + { + QPainterPath ekv; + QVector p; + if (getClosed() == true) + { + p = Equidistant(pointsEkv, EquidistantType::CloseEquidistant, qApp->toPixel(getWidth())); + } + else + { + p = Equidistant(pointsEkv, EquidistantType::OpenEquidistant, qApp->toPixel(getWidth())); + } + + ekv.moveTo(p.at(0)); + for (qint32 i = 1; i < p.count(); ++i) + { + ekv.lineTo(p.at(i)); + } + + path.addPath(ekv); + path.setFillRule(Qt::WindingFill); + } + + return path; +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief listNodePoint return list nodes only with points. diff --git a/src/app/geometry/vdetail.h b/src/app/geometry/vdetail.h index 366f7afaa..8100248e4 100644 --- a/src/app/geometry/vdetail.h +++ b/src/app/geometry/vdetail.h @@ -36,6 +36,7 @@ class VDetailData; class VContainer; +class QPainterPath; /** * @brief The VDetail class for path of object (points, arcs, splines). @@ -79,6 +80,8 @@ public: QVector ContourPoints(const VContainer *data) const; QVector SeamAllowancePoints(const VContainer *data) const; + + QPainterPath ContourPath(const VContainer *data) const; private: QSharedDataPointer d; diff --git a/src/app/geometry/vequidistant.cpp b/src/app/geometry/vequidistant.cpp deleted file mode 100644 index 6593e54dd..000000000 --- a/src/app/geometry/vequidistant.cpp +++ /dev/null @@ -1,445 +0,0 @@ -/************************************************************************ - ** - ** @file vequidistant.cpp - ** @author Roman Telezhynskyi - ** @date 28 1, 2014 - ** - ** @brief - ** @copyright - ** This source code is part of the Valentine project, a pattern making - ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project - ** All Rights Reserved. - ** - ** Valentina is free software: you can redistribute it and/or modify - ** it under the terms of the GNU General Public License as published by - ** the Free Software Foundation, either version 3 of the License, or - ** (at your option) any later version. - ** - ** Valentina is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with Valentina. If not, see . - ** - *************************************************************************/ - -#include "varc.h" -#include "vequidistant.h" -#include "vpointf.h" -#include "vspline.h" -#include "vsplinepath.h" -#include "../core/vapplication.h" -#include -#include -#include "../container/vcontainer.h" -#include - -//--------------------------------------------------------------------------------------------------------------------- -VEquidistant::VEquidistant(const VContainer *data) - :data(data) -{ - SCASSERT(data != nullptr); -} - -//--------------------------------------------------------------------------------------------------------------------- -QPainterPath VEquidistant::ContourPath(const quint32 &idDetail) const -{ - SCASSERT(data != nullptr); - VDetail detail = data->GetDetail(idDetail); - QVector points; - QVector pointsEkv; - for (int i = 0; i< detail.CountNode(); ++i) - { - switch (detail.at(i).getTypeTool()) - { - case (Tool::NodePoint): - { - const QSharedPointer point = data->GeometricObject(detail.at(i).getId()); - points.append(point->toQPointF()); - if (detail.getSeamAllowance() == true) - { - QPointF pEkv = point->toQPointF(); - pEkv.setX(pEkv.x()+detail.at(i).getMx()); - pEkv.setY(pEkv.y()+detail.at(i).getMy()); - pointsEkv.append(pEkv); - } - } - break; - case (Tool::NodeArc): - case (Tool::NodeSpline): - case (Tool::NodeSplinePath): - { - const QSharedPointer curve=data->GeometricObject(detail.at(i).getId()); - - const QPointF begin = StartSegment(detail, i); - const QPointF end = EndSegment(detail, i); - - QVector nodePoints = curve->GetSegmentPoints(begin, end, detail.at(i).getReverse()); - points << nodePoints; - if (detail.getSeamAllowance() == true) - { - pointsEkv << biasPoints(nodePoints, detail.at(i).getMx(), detail.at(i).getMy()); - } - } - break; - default: - qDebug()<<"Get wrong tool type. Ignore."<< static_cast(detail.at(i).getTypeTool()); - break; - } - } - - QPainterPath path; - path.moveTo(points[0]); - for (qint32 i = 1; i < points.count(); ++i) - { - path.lineTo(points.at(i)); - } - path.lineTo(points.at(0)); - - pointsEkv = CorrectEquidistantPoints(pointsEkv); - pointsEkv = CheckLoops(pointsEkv); - - if (detail.getSeamAllowance() == true) - { - QPainterPath ekv; - if (detail.getClosed() == true) - { - ekv = Equidistant(pointsEkv, EquidistantType::CloseEquidistant, qApp->toPixel(detail.getWidth())); - } - else - { - ekv = Equidistant(pointsEkv, EquidistantType::OpenEquidistant, qApp->toPixel(detail.getWidth())); - } - path.addPath(ekv); - path.setFillRule(Qt::WindingFill); - } - return path; -} - -//--------------------------------------------------------------------------------------------------------------------- -QPointF VEquidistant::StartSegment(const VDetail &detail, const int &i) const -{ - QPointF begin; - if (detail.CountNode() > 1) - { - if (i == 0) - { - if (detail.at(detail.CountNode()-1).getTypeTool() == Tool::NodePoint) - { - begin = data->GeometricObject(detail.at(detail.CountNode()-1).getId())->toQPointF(); - } - } - else - { - if (detail.at(i-1).getTypeTool() == Tool::NodePoint) - { - begin = data->GeometricObject(detail.at(i-1).getId())->toQPointF(); - } - } - } - return begin; -} - -//--------------------------------------------------------------------------------------------------------------------- -QPointF VEquidistant::EndSegment(const VDetail &detail, const int &i) const -{ - QPointF end; - if (detail.CountNode() > 2) - { - if (i == detail.CountNode() - 1) - { - if (detail.at(0).getTypeTool() == Tool::NodePoint) - { - end = data->GeometricObject(detail.at(0).getId())->toQPointF(); - } - } - else - { - if (detail.at(i+1).getTypeTool() == Tool::NodePoint) - { - end = data->GeometricObject(detail.at(i+1).getId())->toQPointF(); - } - } - } - return end; -} - -//--------------------------------------------------------------------------------------------------------------------- -QVector VEquidistant::biasPoints(const QVector &points, const qreal &mx, const qreal &my) -{ - QVector p; - for (qint32 i = 0; i < points.size(); ++i) - { - QPointF point = points.at(i); - point.setX(point.x() + mx); - point.setY(point.y() + my); - p.append(point); - } - return p; -} - -//--------------------------------------------------------------------------------------------------------------------- -QVector VEquidistant::CorrectEquidistantPoints(const QVector &points) -{ - QVector correctPoints; - if (points.size()<4)//Better don't check if only three points. We can destroy equidistant. - { - qDebug()<<"Only three points."; - return points; - } - //Clear equivalent points - for (qint32 i = 0; i points, const EquidistantType &eqv, const qreal &width) -{ - QPainterPath ekv; - QVector ekvPoints; - if ( points.size() < 3 ) - { - qDebug()<<"Not enough points for building the equidistant."; - return ekv; - } - if (width <= 0) - { - qDebug()<<"Width <= 0."; - return ekv; - } - for (qint32 i = 0; i < points.size(); ++i ) - { - if (i != points.size()-1) - { - if (points.at(i) == points.at(i+1)) - { - points.remove(i+1); - } - } - else - { - if (points.at(i) == points.at(0)) - { - points.remove(i); - } - } - } - if (eqv == EquidistantType::CloseEquidistant) - { - points.append(points.at(0)); - } - for (qint32 i = 0; i < points.size(); ++i ) - { - if ( i == 0 && eqv == EquidistantType::CloseEquidistant) - {//first point, polyline closed - ekvPoints< VEquidistant::CheckLoops(const QVector &points) -{ - QVector ekvPoints; - /*If we got less than 4 points no need seek loops.*/ - if (points.size() < 4) - { - qDebug()<<"Less then 4 points. Doesn't need check for loops."; - return points; - } - bool closed = false; - if (points.at(0) == points.at(points.size()-1)) - { - closed = true; - } - qint32 i, j; - for (i = 0; i < points.size(); ++i) - { - /*Last three points no need check.*/ - if (i >= points.size()-3) - { - ekvPoints.append(points.at(i)); - continue; - } - QPointF crosPoint; - QLineF::IntersectType intersect = QLineF::NoIntersection; - QLineF line1(points.at(i), points.at(i+1)); - for (j = i+2; j < points.size()-1; ++j) - { - QLineF line2(points.at(j), points.at(j+1)); - intersect = line1.intersect(line2, &crosPoint); - if (intersect == QLineF::BoundedIntersection) - { - break; - } - } - if (intersect == QLineF::BoundedIntersection) - { - if (i == 0 && j+1 == points.size()-1 && closed) - { - /*We got closed contour.*/ - ekvPoints.append(points.at(i)); - } - else - { - /*We found loop.*/ - ekvPoints.append(points.at(i)); - ekvPoints.append(crosPoint); - i = j; - } - } - else - { - /*We did not found loop.*/ - ekvPoints.append(points.at(i)); - } - } - return ekvPoints; -} - -//--------------------------------------------------------------------------------------------------------------------- -QVector VEquidistant::EkvPoint(const QLineF &line1, const QLineF &line2, const qreal &width) -{ - SCASSERT(width > 0); - QVector points; - if (line1.p2() != line2.p2()) - { - qDebug()<<"Last points of two lines must be equal."; - return QVector(); - } - QPointF CrosPoint; - QLineF bigLine1 = ParallelLine(line1, width ); - QLineF bigLine2 = ParallelLine(QLineF(line2.p2(), line2.p1()), width ); - QLineF::IntersectType type = bigLine1.intersect( bigLine2, &CrosPoint ); - switch (type) - { - case (QLineF::BoundedIntersection): - points.append(CrosPoint); - return points; - break; - case (QLineF::UnboundedIntersection): - { - QLineF line( line1.p2(), CrosPoint ); - const qreal length = line.length(); - if (length > width*2.4) - { // Cutting too long an acute angle - line.setLength(width); // Not sure about width value here - QLineF cutLine(line.p2(), CrosPoint); // Cut line is a perpendicular - cutLine.setLength(length); // Decided take this length - - // We do not check intersection type because intersection must alwayse exist - QPointF px; - cutLine.setAngle(cutLine.angle()+90); - QLineF::IntersectType type = bigLine1.intersect( cutLine, &px ); - if (type == QLineF::NoIntersection) - { - qDebug()<<"Couldn't find intersection with cut line."; - } - points.append(px); - - cutLine.setAngle(cutLine.angle()-180); - type = bigLine2.intersect( cutLine, &px ); - if (type == QLineF::NoIntersection) - { - qDebug()<<"Couldn't find intersection with cut line."; - } - points.append(px); - } - else - { - points.append(CrosPoint); - return points; - } - break; - } - case (QLineF::NoIntersection): - /*If we have correct lines this means lines lie on a line.*/ - points.append(bigLine1.p2()); - return points; - break; - default: - break; - } - return points; -} - -//--------------------------------------------------------------------------------------------------------------------- -QLineF VEquidistant::ParallelLine(const QLineF &line, qreal width) -{ - SCASSERT(width > 0); - QLineF paralel = QLineF (SingleParallelPoint(line, 90, width), SingleParallelPoint(QLineF(line.p2(), line.p1()), - -90, width)); - return paralel; -} - -//--------------------------------------------------------------------------------------------------------------------- -QPointF VEquidistant::SingleParallelPoint(const QLineF &line, const qreal &angle, const qreal &width) -{ - SCASSERT(width > 0); - QLineF pLine = line; - pLine.setAngle( pLine.angle() + angle ); - pLine.setLength( width ); - return pLine.p2(); -} diff --git a/src/app/geometry/vequidistant.h b/src/app/geometry/vequidistant.h deleted file mode 100644 index 9e19df5d5..000000000 --- a/src/app/geometry/vequidistant.h +++ /dev/null @@ -1,113 +0,0 @@ -/************************************************************************ - ** - ** @file vequidistant.h - ** @author Roman Telezhynskyi - ** @date 28 1, 2014 - ** - ** @brief - ** @copyright - ** This source code is part of the Valentine project, a pattern making - ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project - ** All Rights Reserved. - ** - ** Valentina is free software: you can redistribute it and/or modify - ** it under the terms of the GNU General Public License as published by - ** the Free Software Foundation, either version 3 of the License, or - ** (at your option) any later version. - ** - ** Valentina is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with Valentina. If not, see . - ** - *************************************************************************/ - -#ifndef VEQUIDISTANT_H -#define VEQUIDISTANT_H - -#include "vdetail.h" - -class QPainterPath; -class VContainer; -class QPointF; -class QLineF; - -/** - * @brief The VEquidistant class calculate equidistant for detail. - */ -class VEquidistant -{ -public: - VEquidistant(const VContainer *data); - ~VEquidistant(){} - /** - * @brief ContourPath create painter path for detail. - * @param idDetail id of detail. - * @param data container with objects (points, arcs, splines). - * @return return painter path of contour detail. - */ - QPainterPath ContourPath(const quint32 &idDetail) const; -private: - Q_DISABLE_COPY(VEquidistant) - const VContainer *data; - /** - * @brief biasPoints bias point. - * @param points vector of points. - * @param mx offset respect to x. - * @param my offset respect to y. - * @return new vector biased points. - */ - static QVector biasPoints(const QVector &points, const qreal &mx, const qreal &my); - /** - * @brief CorrectEquidistantPoints clear equivalent points and remove point on line from equdistant. - * @param points list of points equdistant. - * @return corrected list. - */ - static QVector CorrectEquidistantPoints(const QVector &points); - /** - * @brief Equidistant create equidistant painter path for detail. - * @param points vector of points. - * @param eqv type of equidistant. - * @param width width of equidistant. - * @return return painter path of equidistant. - */ - static QPainterPath Equidistant(QVector points, const EquidistantType &eqv, const qreal &width); - /** - * @brief CheckLoops seek and delete loops in equidistant. - * @param points vector of points of equidistant. - * @return vector of points of equidistant. - */ - static QVector CheckLoops(const QVector &points); - /** - * @brief EkvPoint return vector of points of equidistant two lines. Last point of two lines must be equal. - * @param line1 first line. - * @param line2 second line. - * @param width width of equidistant. - * @return vector of points. - */ - static QVector EkvPoint(const QLineF &line1, const QLineF &line2, const qreal &width); - /** - * @brief ParallelLine create parallel line. - * @param line starting line. - * @param width width to parallel line. - * @return parallel line. - */ - static QLineF ParallelLine(const QLineF &line, qreal width ); - /** - * @brief SingleParallelPoint return point of parallel line. - * @param line starting line. - * @param angle angle in degree. - * @param width width to parallel line. - * @return point of parallel line. - */ - static QPointF SingleParallelPoint(const QLineF &line, const qreal &angle, const qreal &width); - - QPointF StartSegment(const VDetail &detail, const int &i) const; - QPointF EndSegment(const VDetail &detail, const int &i) const; -}; - -#endif // VEQUIDISTANT_H diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index be206e7cb..4396651ed 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -29,7 +29,6 @@ #include "mainwindow.h" #include "ui_mainwindow.h" #include "geometry/vspline.h" -#include "geometry/vequidistant.h" #include "exception/vexceptionobjecterror.h" #include "exception/vexceptionconversionerror.h" #include "exception/vexceptionemptyparameter.h" @@ -1908,7 +1907,7 @@ void MainWindow::ActionLayout(bool checked) { Q_UNUSED(checked); ActionDetails(true);//Get all list of details. - QVector listDetails; + QVector listDetails; const QHash *details = pattern->DataDetails(); if (details->count() == 0) { @@ -1919,8 +1918,14 @@ void MainWindow::ActionLayout(bool checked) while (idetail.hasNext()) { idetail.next(); - QPainterPath path = VEquidistant(pattern).ContourPath(idetail.key()); - listDetails.append(new VItem(path, listDetails.size())); + VLayoutDetail det = VLayoutDetail(); + det.SetCountour(idetail.value().ContourPoints(pattern)); + det.SetSeamAllowencePoints(idetail.value().SeamAllowancePoints(pattern)); + det.setSeamAllowance(idetail.value().getSeamAllowance()); + det.setName(idetail.value().getName()); + det.SetLayoutAllowence(); + + listDetails.append(det); } QString description = doc->GetDescription(); diff --git a/src/app/mainwindow.h b/src/app/mainwindow.h index 0463bd06c..20f1dc927 100644 --- a/src/app/mainwindow.h +++ b/src/app/mainwindow.h @@ -32,12 +32,12 @@ #include #include "widgets/vmaingraphicsscene.h" #include "widgets/vmaingraphicsview.h" -#include "widgets/vitem.h" #include "dialogs/dialogs.h" #include "tools/vtooldetail.h" #include "tools/vtooluniondetails.h" #include "tools/drawTools/drawtools.h" #include "xml/vdomdocument.h" +#include "../libs/vlayout/vlayoutdetail.h" namespace Ui { @@ -136,7 +136,8 @@ signals: * @param listDetails list of details. * @param description pattern description. */ - void ModelChosen(QVector listDetails, const QString &curFile, const QString &description); + void ModelChosen(QVector listDetails, const QString &curFile, + const QString &description); void RefreshHistory(); protected: virtual void keyPressEvent(QKeyEvent *event); diff --git a/src/app/options.h b/src/app/options.h index 6c640a075..2a4e72fa0 100644 --- a/src/app/options.h +++ b/src/app/options.h @@ -118,7 +118,6 @@ enum class Source : char { FromGui, FromFile, FromTool }; enum class Draw : char { Calculation, Modeling }; enum class NodeDetail : char { Contour, Modeling }; enum class Contour : char { OpenContour, CloseContour }; -enum class EquidistantType : char { OpenEquidistant, CloseEquidistant }; enum class GOType : char { Point, Arc, Spline, SplinePath, Unknown }; enum class SplinePointPosition : char { FirstPoint, LastPoint }; enum class VarType : char { Measurement, Increment, LineLength, SplineLength, ArcLength, LineAngle, Unknown }; diff --git a/src/app/tablewindow.cpp b/src/app/tablewindow.cpp index 525c5fe2c..632b37f20 100644 --- a/src/app/tablewindow.cpp +++ b/src/app/tablewindow.cpp @@ -48,7 +48,7 @@ */ TableWindow::TableWindow(QWidget *parent) :QMainWindow(parent), numberDetal(nullptr), colission(nullptr), ui(new Ui::TableWindow), - listDetails(QVector()), outItems(false), collidingItems(false), tableScene(nullptr), + listDetails(QVector()), outItems(false), collidingItems(false), tableScene(nullptr), paper(nullptr), shadowPaper(nullptr), listOutItems(nullptr), listCollidingItems(QList()), indexDetail(0), sceneRect(QRectF()), fileName(QString()), description(QString()) { @@ -112,30 +112,30 @@ void TableWindow::AddPaper() */ void TableWindow::AddDetail() { - if (indexDetailclearSelection(); - VItem* Detail = listDetails[indexDetail]; - SCASSERT(Detail != nullptr); - connect(Detail, &VItem::itemOut, this, &TableWindow::itemOut); - connect(Detail, &VItem::itemColliding, this, &TableWindow::itemColliding); - connect(this, &TableWindow::LengthChanged, Detail, &VItem::LengthChanged); - Detail->setPen(QPen(Qt::black, 1)); - Detail->setBrush(QBrush(Qt::white)); - Detail->setPos(paper->boundingRect().center()); - Detail->setFlag(QGraphicsItem::ItemIsMovable, true); - Detail->setFlag(QGraphicsItem::ItemIsSelectable, true); - Detail->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); - Detail->setPaper(paper); - tableScene->addItem(Detail); - Detail->setSelected(true); - indexDetail++; - if (indexDetail==listDetails.count()) - { - ui->actionSave->setEnabled(true); - } - } - numberDetal->setText(QString(tr("%1 details left.")).arg(listDetails.count()-indexDetail)); +// if (indexDetailclearSelection(); +// VItem* Detail = listDetails[indexDetail]; +// SCASSERT(Detail != nullptr); +// connect(Detail, &VItem::itemOut, this, &TableWindow::itemOut); +// connect(Detail, &VItem::itemColliding, this, &TableWindow::itemColliding); +// connect(this, &TableWindow::LengthChanged, Detail, &VItem::LengthChanged); +// Detail->setPen(QPen(Qt::black, 1)); +// Detail->setBrush(QBrush(Qt::white)); +// Detail->setPos(paper->boundingRect().center()); +// Detail->setFlag(QGraphicsItem::ItemIsMovable, true); +// Detail->setFlag(QGraphicsItem::ItemIsSelectable, true); +// Detail->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); +// Detail->setPaper(paper); +// tableScene->addItem(Detail); +// Detail->setSelected(true); +// indexDetail++; +// if (indexDetail==listDetails.count()) +// { +// ui->actionSave->setEnabled(true); +// } +// } +// numberDetal->setText(QString(tr("%1 details left.")).arg(listDetails.count()-indexDetail)); } //--------------------------------------------------------------------------------------------------------------------- @@ -147,7 +147,7 @@ void TableWindow::AddDetail() /* * Get details for creation layout. */ -void TableWindow::ModelChosen(QVector listDetails, const QString &fileName, const QString &description) +void TableWindow::ModelChosen(QVector listDetails, const QString &fileName, const QString &description) { this->description = description; @@ -390,67 +390,67 @@ void TableWindow::itemOut(int number, bool flag) void TableWindow::itemColliding(QList list, int number) { //qDebug()<<"number="<1) - { - for ( int i = 0; i < listCollidingItems.count(); ++i ) - { - QList lis = listCollidingItems.at(i)->collidingItems(); - if (lis.size()-2 <= 0) - { - VItem * bitem = qgraphicsitem_cast ( listCollidingItems.at(i) ); - SCASSERT(bitem != nullptr); - bitem->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()))); - listCollidingItems.removeAt(i); - } - } - } - else if (listCollidingItems.size()==1) - { - VItem * bitem = qgraphicsitem_cast ( listCollidingItems.at(0) ); - SCASSERT(bitem != nullptr); - bitem->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()))); - listCollidingItems.clear(); - collidingItems = true; - } - } - else - { - collidingItems = true; - } - } - else - { - collidingItems = true; - } - } - else if (number==1) - { - if (list.contains(paper)==true) - { - list.removeAt(list.indexOf(paper)); - } - if (list.contains(shadowPaper)==true) - { - list.removeAt(list.indexOf(shadowPaper)); - } - for ( int i = 0; i < list.count(); ++i ) - { - if (listCollidingItems.contains(list.at(i))==false) - { - listCollidingItems.append(list.at(i)); - } - } - collidingItems = false; - } - qDebug()<<"itemColliding::outItems="<1) +// { +// for ( int i = 0; i < listCollidingItems.count(); ++i ) +// { +// QList lis = listCollidingItems.at(i)->collidingItems(); +// if (lis.size()-2 <= 0) +// { +// VItem * bitem = qgraphicsitem_cast ( listCollidingItems.at(i) ); +// SCASSERT(bitem != nullptr); +// bitem->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()))); +// listCollidingItems.removeAt(i); +// } +// } +// } +// else if (listCollidingItems.size()==1) +// { +// VItem * bitem = qgraphicsitem_cast ( listCollidingItems.at(0) ); +// SCASSERT(bitem != nullptr); +// bitem->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()))); +// listCollidingItems.clear(); +// collidingItems = true; +// } +// } +// else +// { +// collidingItems = true; +// } +// } +// else +// { +// collidingItems = true; +// } +// } +// else if (number==1) +// { +// if (list.contains(paper)==true) +// { +// list.removeAt(list.indexOf(paper)); +// } +// if (list.contains(shadowPaper)==true) +// { +// list.removeAt(list.indexOf(shadowPaper)); +// } +// for ( int i = 0; i < list.count(); ++i ) +// { +// if (listCollidingItems.contains(list.at(i))==false) +// { +// listCollidingItems.append(list.at(i)); +// } +// } +// collidingItems = false; +// } +// qDebug()<<"itemColliding::outItems="< #include -#include "widgets/vitem.h" + +#include "../../libs/vlayout/vlayoutdetail.h" namespace Ui { @@ -55,7 +56,8 @@ public: ~TableWindow(); public slots: - void ModelChosen(QVector listDetails, const QString &fileName, const QString &description); + void ModelChosen(QVector listDetails, const QString &fileName, + const QString &description); void StopTable(); @@ -96,7 +98,7 @@ private: Ui::TableWindow* ui; /** @brief listDetails list of details. */ - QVector listDetails; + QVector listDetails; /** @brief outItems true if we have details out paper sheet. */ bool outItems; diff --git a/src/app/tools/vtooldetail.cpp b/src/app/tools/vtooldetail.cpp index 9205c334f..38af795f4 100644 --- a/src/app/tools/vtooldetail.cpp +++ b/src/app/tools/vtooldetail.cpp @@ -30,7 +30,6 @@ #include "nodeDetails/nodedetails.h" #include "../geometry/varc.h" #include "../geometry/vsplinepath.h" -#include "../geometry/vequidistant.h" #include "../widgets/vmaingraphicsscene.h" #include "../dialogs/tools/dialogtool.h" #include "../dialogs/tools/dialogdetail.h" @@ -511,10 +510,8 @@ void VToolDetail::ShowVisualization(bool show) void VToolDetail::RefreshGeometry() { this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, false); - QPainterPath path = VEquidistant(this->getData()).ContourPath(id); - this->setPath(path); - VDetail detail = VAbstractTool::data.GetDetail(id); + this->setPath(detail.ContourPath(this->getData())); this->setPos(detail.getMx(), detail.getMy()); this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); } diff --git a/src/libs/vlayout/vabstractdetail.cpp b/src/libs/vlayout/vabstractdetail.cpp index 078a8b157..6df4a9176 100644 --- a/src/libs/vlayout/vabstractdetail.cpp +++ b/src/libs/vlayout/vabstractdetail.cpp @@ -29,6 +29,10 @@ #include "vabstractdetail.h" #include "vabstractdetail_p.h" +#include +#include +#include + //--------------------------------------------------------------------------------------------------------------------- /** * @brief VAbstractDetail default contructor. Create empty detail. @@ -166,3 +170,294 @@ void VAbstractDetail::setWidth(const qreal &value) { d->width = value; } + +//--------------------------------------------------------------------------------------------------------------------- +QVector VAbstractDetail::Equidistant(const QVector &points, const EquidistantType &eqv, qreal width) +{ + QVector ekvPoints; + + if (width <= 0) + { + qDebug()<<"Width <= 0."; + return QVector(); + } + + QVector p = CorrectEquidistantPoints(points); + if ( p.size() < 3 ) + { + qDebug()<<"Not enough points for building the equidistant."; + return QVector(); + } + + if (eqv == EquidistantType::CloseEquidistant) + { + p.append(points.at(0)); + } + for (qint32 i = 0; i < points.size(); ++i ) + { + if ( i == 0 && eqv == EquidistantType::CloseEquidistant) + {//first point, polyline closed + ekvPoints< VAbstractDetail::RemoveDublicates(const QVector &points) +{ + QVector p = points; + for(int i = 0; i < p.size(); i++) + { + QPointF current = p.at(i); + + for(int j = i; j < p.size(); j++) + { + if(j == i) + { + continue; + } + else + { + QPointF temp = p.at(j); + if(current == temp) + { + QVector::iterator iter = p.begin() + j; + p.erase(iter); + j--; + } + } + } + } + + return p; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief CorrectEquidistantPoints clear equivalent points and remove point on line from equdistant. + * @param points list of points equdistant. + * @return corrected list. + */ +QVector VAbstractDetail::CorrectEquidistantPoints(const QVector &points) +{ + QVector correctPoints; + if (points.size()<4)//Better don't check if only three points. We can destroy equidistant. + { + qDebug()<<"Only three points."; + return points; + } + + //Clear equivalent points + correctPoints = RemoveDublicates(points); + + if (correctPoints.size()<3) + { + return correctPoints; + } + //Remove point on line + QPointF point; + for (qint32 i = 1; i VAbstractDetail::CheckLoops(const QVector &points) +{ + QVector ekvPoints; + /*If we got less than 4 points no need seek loops.*/ + if (points.size() < 4) + { + qDebug()<<"Less then 4 points. Doesn't need check for loops."; + return points; + } + bool closed = false; + if (points.at(0) == points.at(points.size()-1)) + { + closed = true; + } + qint32 i, j; + for (i = 0; i < points.size(); ++i) + { + /*Last three points no need check.*/ + if (i >= points.size()-3) + { + ekvPoints.append(points.at(i)); + continue; + } + QPointF crosPoint; + QLineF::IntersectType intersect = QLineF::NoIntersection; + QLineF line1(points.at(i), points.at(i+1)); + for (j = i+2; j < points.size()-1; ++j) + { + QLineF line2(points.at(j), points.at(j+1)); + intersect = line1.intersect(line2, &crosPoint); + if (intersect == QLineF::BoundedIntersection) + { + break; + } + } + if (intersect == QLineF::BoundedIntersection) + { + if (i == 0 && j+1 == points.size()-1 && closed) + { + /*We got closed contour.*/ + ekvPoints.append(points.at(i)); + } + else + { + /*We found loop.*/ + ekvPoints.append(points.at(i)); + ekvPoints.append(crosPoint); + i = j; + } + } + else + { + /*We did not found loop.*/ + ekvPoints.append(points.at(i)); + } + } + return ekvPoints; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief EkvPoint return vector of points of equidistant two lines. Last point of two lines must be equal. + * @param line1 first line. + * @param line2 second line. + * @param width width of equidistant. + * @return vector of points. + */ +QVector VAbstractDetail::EkvPoint(const QLineF &line1, const QLineF &line2, const qreal &width) +{ + if (width <= 0) + { + return QVector(); + } + QVector points; + if (line1.p2() != line2.p2()) + { + qDebug()<<"Last points of two lines must be equal."; + return QVector(); + } + QPointF CrosPoint; + QLineF bigLine1 = ParallelLine(line1, width ); + QLineF bigLine2 = ParallelLine(QLineF(line2.p2(), line2.p1()), width ); + QLineF::IntersectType type = bigLine1.intersect( bigLine2, &CrosPoint ); + switch (type) + { + case (QLineF::BoundedIntersection): + points.append(CrosPoint); + return points; + break; + case (QLineF::UnboundedIntersection): + { + QLineF line( line1.p2(), CrosPoint ); + const qreal length = line.length(); + if (length > width*2.4) + { // Cutting too long an acute angle + line.setLength(width); // Not sure about width value here + QLineF cutLine(line.p2(), CrosPoint); // Cut line is a perpendicular + cutLine.setLength(length); // Decided take this length + + // We do not check intersection type because intersection must alwayse exist + QPointF px; + cutLine.setAngle(cutLine.angle()+90); + QLineF::IntersectType type = bigLine1.intersect( cutLine, &px ); + if (type == QLineF::NoIntersection) + { + qDebug()<<"Couldn't find intersection with cut line."; + } + points.append(px); + + cutLine.setAngle(cutLine.angle()-180); + type = bigLine2.intersect( cutLine, &px ); + if (type == QLineF::NoIntersection) + { + qDebug()<<"Couldn't find intersection with cut line."; + } + points.append(px); + } + else + { + points.append(CrosPoint); + return points; + } + break; + } + case (QLineF::NoIntersection): + /*If we have correct lines this means lines lie on a line.*/ + points.append(bigLine1.p2()); + return points; + break; + default: + break; + } + return points; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief ParallelLine create parallel line. + * @param line starting line. + * @param width width to parallel line. + * @return parallel line. + */ +QLineF VAbstractDetail::ParallelLine(const QLineF &line, qreal width) +{ + QLineF paralel = QLineF (SingleParallelPoint(line, 90, width), SingleParallelPoint(QLineF(line.p2(), line.p1()), + -90, width)); + return paralel; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief SingleParallelPoint return point of parallel line. + * @param line starting line. + * @param angle angle in degree. + * @param width width to parallel line. + * @return point of parallel line. + */ +QPointF VAbstractDetail::SingleParallelPoint(const QLineF &line, const qreal &angle, const qreal &width) +{ + QLineF pLine = line; + pLine.setAngle( pLine.angle() + angle ); + pLine.setLength( width ); + return pLine.p2(); +} diff --git a/src/libs/vlayout/vabstractdetail.h b/src/libs/vlayout/vabstractdetail.h index d22f0f4e7..f5c08f256 100644 --- a/src/libs/vlayout/vabstractdetail.h +++ b/src/libs/vlayout/vabstractdetail.h @@ -31,8 +31,12 @@ #include +#include "vlayoutdef.h" + class QString; class VAbstractDetailData; +class QPointF; +class QLineF; /** * @brief The VAbstractDetail class abstract class for all details. @@ -59,8 +63,17 @@ public: qreal getWidth() const; void setWidth(const qreal &value); + + static QVector Equidistant(const QVector &points, const EquidistantType &eqv, qreal width); private: QSharedDataPointer d; + + static QVector RemoveDublicates(const QVector &points); + static QVector CorrectEquidistantPoints(const QVector &points); + static QVector CheckLoops(const QVector &points); + static QVector EkvPoint(const QLineF &line1, const QLineF &line2, const qreal &width); + static QLineF ParallelLine(const QLineF &line, qreal width ); + static QPointF SingleParallelPoint(const QLineF &line, const qreal &angle, const qreal &width); }; #endif // VABSTRACTDETAIL_H diff --git a/src/libs/vlayout/vlayout.pri b/src/libs/vlayout/vlayout.pri index 2e203b6e1..c7ab13fdd 100644 --- a/src/libs/vlayout/vlayout.pri +++ b/src/libs/vlayout/vlayout.pri @@ -6,7 +6,9 @@ HEADERS += \ $$PWD/vlayoutgenerator.h \ $$PWD/vlayoutdetail.h \ $$PWD/vabstractdetail.h \ - $$PWD/vabstractdetail_p.h + $$PWD/vabstractdetail_p.h \ + $$PWD/vlayoutdetail_p.h \ + $$PWD/vlayoutdef.h SOURCES += \ $$PWD/stable.cpp \ diff --git a/src/libs/vlayout/vlayout.pro b/src/libs/vlayout/vlayout.pro index 96f9fd549..7cee445cc 100644 --- a/src/libs/vlayout/vlayout.pro +++ b/src/libs/vlayout/vlayout.pro @@ -7,9 +7,6 @@ # File with common stuff for whole project include(../../../Valentina.pri) -# We don't need gui library. -QT -= gui - # Name of library TARGET = vlayout diff --git a/src/libs/vlayout/vlayoutdef.h b/src/libs/vlayout/vlayoutdef.h new file mode 100644 index 000000000..25d09a59d --- /dev/null +++ b/src/libs/vlayout/vlayoutdef.h @@ -0,0 +1,34 @@ +/************************************************************************ + ** + ** @file vlayoutdef.h + ** @author Roman Telezhynskyi + ** @date 7 1, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef VLAYOUTDEF_H +#define VLAYOUTDEF_H + +enum class EquidistantType : char { OpenEquidistant, CloseEquidistant }; + +#endif // VLAYOUTDEF_H diff --git a/src/libs/vlayout/vlayoutdetail.cpp b/src/libs/vlayout/vlayoutdetail.cpp index 08d9f0f40..1e0c2dcd4 100644 --- a/src/libs/vlayout/vlayoutdetail.cpp +++ b/src/libs/vlayout/vlayoutdetail.cpp @@ -27,7 +27,146 @@ *************************************************************************/ #include "vlayoutdetail.h" +#include "vlayoutdetail_p.h" +//--------------------------------------------------------------------------------------------------------------------- VLayoutDetail::VLayoutDetail() + :VAbstractDetail(), d(new VLayoutDetailData) +{} + +//--------------------------------------------------------------------------------------------------------------------- +VLayoutDetail::VLayoutDetail(const VLayoutDetail &detail) + :VAbstractDetail(detail), d (detail.d) +{} + +//--------------------------------------------------------------------------------------------------------------------- +VLayoutDetail &VLayoutDetail::operator=(const VLayoutDetail &detail) { + if ( &detail == this ) + { + return *this; + } + VAbstractDetail::operator=(detail); + d = detail.d; + return *this; +} + +//--------------------------------------------------------------------------------------------------------------------- +VLayoutDetail::~VLayoutDetail() +{} + +//--------------------------------------------------------------------------------------------------------------------- +QVector VLayoutDetail::GetContour() const +{ + return d->contour; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutDetail::SetCountour(const QVector &points) +{ + d->contour = points; +} + +//--------------------------------------------------------------------------------------------------------------------- +QVector VLayoutDetail::GetSeamAllowencePoints() const +{ + return d->seamAllowence; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutDetail::SetSeamAllowencePoints(const QVector &points) +{ + d->seamAllowence = points; +} + +//--------------------------------------------------------------------------------------------------------------------- +QVector VLayoutDetail::GetLayoutAllowence() const +{ + return Map(d->layoutAllowence); +} + +//--------------------------------------------------------------------------------------------------------------------- +QMatrix VLayoutDetail::GetMatrix() const +{ + return d->matrix; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutDetail::SetMatrix(const QMatrix &matrix) +{ + d->matrix = matrix; +} + +//--------------------------------------------------------------------------------------------------------------------- +qreal VLayoutDetail::GetLayoutWidth() const +{ + return d->layoutWidth; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutDetail::SetLayoutWidth(const qreal &value) +{ + d->layoutWidth = value; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutDetail::translate(qreal dx, qreal dy) +{ + const QMatrix m = d->matrix.translate(dx, dy); + d->matrix = m; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutDetail::rotate(qreal degrees) +{ + const QMatrix m = d->matrix.rotate(degrees); + d->matrix = m; +} + +//--------------------------------------------------------------------------------------------------------------------- +int VLayoutDetail::EdgesCount() const +{ + return d->layoutAllowence.count()-1; +} + +//--------------------------------------------------------------------------------------------------------------------- +QLineF VLayoutDetail::Edge(int i) const +{ + if (i < 1 || i > EdgesCount()) + { // Doesn't exist such edge + return QLineF(); + } + const QLineF line(d->layoutAllowence.at(i-1), d->layoutAllowence.at(i)); + return line; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutDetail::SetLayoutAllowence() +{ + if (d->layoutWidth > 0) + { + if (getSeamAllowance()) + { + d->layoutAllowence = Equidistant(d->seamAllowence, EquidistantType::CloseEquidistant, d->layoutWidth); + } + else + { + d->layoutAllowence = Equidistant(d->contour, EquidistantType::CloseEquidistant, d->layoutWidth); + } + } + else + { + d->layoutAllowence.clear(); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +QVector VLayoutDetail::Map(const QVector &points) const +{ + QVector p; + for (int i = 0; i < points.size(); ++i) + { + p.append(d->matrix.map(points.at(i))); + } + return p; } diff --git a/src/libs/vlayout/vlayoutdetail.h b/src/libs/vlayout/vlayoutdetail.h index 7aded6536..8699ef242 100644 --- a/src/libs/vlayout/vlayoutdetail.h +++ b/src/libs/vlayout/vlayoutdetail.h @@ -29,10 +29,46 @@ #ifndef VLAYOUTDETAIL_H #define VLAYOUTDETAIL_H -class VLayoutDetail +#include "vabstractdetail.h" + +#include +#include + +class VLayoutDetailData; + +class VLayoutDetail :public VAbstractDetail { public: VLayoutDetail(); + VLayoutDetail(const VLayoutDetail &detail); + VLayoutDetail &operator=(const VLayoutDetail &detail); + virtual ~VLayoutDetail(); + + QVector GetContour() const; + void SetCountour(const QVector &points); + + QVector GetSeamAllowencePoints() const; + void SetSeamAllowencePoints(const QVector &points); + + QVector GetLayoutAllowence() const; + void SetLayoutAllowence(); + + QMatrix GetMatrix() const; + void SetMatrix(const QMatrix &matrix); + + qreal GetLayoutWidth() const; + void SetLayoutWidth(const qreal &value); + + void translate(qreal dx, qreal dy); + void rotate(qreal degrees); + + int EdgesCount() const; + QLineF Edge(int i) const; + +private: + QSharedDataPointer d; + + QVector Map(const QVector &points) const; }; #endif // VLAYOUTDETAIL_H diff --git a/src/libs/vlayout/vlayoutdetail_p.h b/src/libs/vlayout/vlayoutdetail_p.h new file mode 100644 index 000000000..a15dd1e5e --- /dev/null +++ b/src/libs/vlayout/vlayoutdetail_p.h @@ -0,0 +1,77 @@ +/************************************************************************ + ** + ** @file vlayoutdetail_p.h + ** @author Roman Telezhynskyi + ** @date 3 1, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef VLAYOUTDETAIL_P_H +#define VLAYOUTDETAIL_P_H + +#include +#include +#include +#include + +#ifdef Q_CC_GNU + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Weffc++" +#endif + +class VLayoutDetailData : public QSharedData +{ +public: + VLayoutDetailData() + :contour(QVector()), seamAllowence(QVector()), layoutAllowence(QVector()), + matrix(QMatrix()), layoutWidth(0) + {} + + VLayoutDetailData(const VLayoutDetailData &detail) + :QSharedData(detail), contour(detail.contour), seamAllowence(detail.seamAllowence), + layoutAllowence(detail.layoutAllowence), matrix(detail.matrix), layoutWidth(detail.layoutWidth) + {} + + ~VLayoutDetailData() {} + + /** @brief contour list of contour points. */ + QVector contour; + + /** @brief seamAllowence list of seam allowence points. */ + QVector seamAllowence; + + /** @brief layoutAllowence list of layout allowence points. */ + QVector layoutAllowence; + + /** @brief matrix transformation matrix*/ + QMatrix matrix; + + /** @brief layoutWidth value layout allowence width in pixels. */ + qreal layoutWidth; +}; + +#ifdef Q_CC_GNU + #pragma GCC diagnostic pop +#endif + +#endif // VLAYOUTDETAIL_P_H From 007bc1466fa1c05ae7032ea1d792b0f7c27bb58f Mon Sep 17 00:00:00 2001 From: dismine Date: Sat, 10 Jan 2015 15:47:46 +0200 Subject: [PATCH 016/186] Layout paper. Main algorithm. --HG-- branch : feature --- src/libs/vlayout/vlayout.pri | 7 +- src/libs/vlayout/vlayoutdetail.cpp | 95 ++++- src/libs/vlayout/vlayoutdetail.h | 8 +- src/libs/vlayout/vlayoutpaper.cpp | 564 +++++++++++++++++++++++++++++ src/libs/vlayout/vlayoutpaper.h | 91 +++++ src/libs/vlayout/vlayoutpaper_p.h | 78 ++++ 6 files changed, 830 insertions(+), 13 deletions(-) create mode 100644 src/libs/vlayout/vlayoutpaper.cpp create mode 100644 src/libs/vlayout/vlayoutpaper.h create mode 100644 src/libs/vlayout/vlayoutpaper_p.h diff --git a/src/libs/vlayout/vlayout.pri b/src/libs/vlayout/vlayout.pri index c7ab13fdd..fe1d8e5ae 100644 --- a/src/libs/vlayout/vlayout.pri +++ b/src/libs/vlayout/vlayout.pri @@ -8,10 +8,13 @@ HEADERS += \ $$PWD/vabstractdetail.h \ $$PWD/vabstractdetail_p.h \ $$PWD/vlayoutdetail_p.h \ - $$PWD/vlayoutdef.h + $$PWD/vlayoutdef.h \ + $$PWD/vlayoutpaper.h \ + vlayoutpaper_p.h SOURCES += \ $$PWD/stable.cpp \ $$PWD/vlayoutgenerator.cpp \ $$PWD/vlayoutdetail.cpp \ - $$PWD/vabstractdetail.cpp + $$PWD/vabstractdetail.cpp \ + $$PWD/vlayoutpaper.cpp diff --git a/src/libs/vlayout/vlayoutdetail.cpp b/src/libs/vlayout/vlayoutdetail.cpp index 1e0c2dcd4..74d3a3b80 100644 --- a/src/libs/vlayout/vlayoutdetail.cpp +++ b/src/libs/vlayout/vlayoutdetail.cpp @@ -65,6 +65,11 @@ QVector VLayoutDetail::GetContour() const void VLayoutDetail::SetCountour(const QVector &points) { d->contour = points; + // Contour can't be closed + if (d->contour.first() == d->contour.last()) + { + d->contour.removeLast(); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -77,6 +82,11 @@ QVector VLayoutDetail::GetSeamAllowencePoints() const void VLayoutDetail::SetSeamAllowencePoints(const QVector &points) { d->seamAllowence = points; + // Seam allowence can't be closed + if (d->seamAllowence.first() == d->seamAllowence.last()) + { + d->seamAllowence.removeLast(); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -110,23 +120,39 @@ void VLayoutDetail::SetLayoutWidth(const qreal &value) } //--------------------------------------------------------------------------------------------------------------------- -void VLayoutDetail::translate(qreal dx, qreal dy) +void VLayoutDetail::Translate(qreal dx, qreal dy) { - const QMatrix m = d->matrix.translate(dx, dy); - d->matrix = m; + d->matrix = d->matrix.translate(dx, dy); } //--------------------------------------------------------------------------------------------------------------------- -void VLayoutDetail::rotate(qreal degrees) +void VLayoutDetail::Rotate(const QPointF &originPoint, qreal degrees) { - const QMatrix m = d->matrix.rotate(degrees); - d->matrix = m; + Translate(-originPoint.x(), -originPoint.y()); + d->matrix = d->matrix.rotate(degrees); + Translate(originPoint.x(), originPoint.y()); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutDetail::Mirror(const QLineF &edge) +{ + if (edge.isNull()) + { + return; + } + + QLineF axis = QLineF(edge.x1(), edge.y1(), 100, edge.y2()); // Ox axis + + qreal angle = edge.angleTo(axis); + Rotate(edge.p1(), angle); + d->matrix = d->matrix.scale(d->matrix.m11()*-1, d->matrix.m22()); + Rotate(edge.p1(), 360 - angle); } //--------------------------------------------------------------------------------------------------------------------- int VLayoutDetail::EdgesCount() const { - return d->layoutAllowence.count()-1; + return d->layoutAllowence.count(); } //--------------------------------------------------------------------------------------------------------------------- @@ -136,8 +162,49 @@ QLineF VLayoutDetail::Edge(int i) const { // Doesn't exist such edge return QLineF(); } - const QLineF line(d->layoutAllowence.at(i-1), d->layoutAllowence.at(i)); - return line; + const QVector points = GetLayoutAllowence(); + QLineF edge; + if (i < EdgesCount()) + { + edge = QLineF(points.at(i-1), points.at(i)); + } + else + { + edge = QLineF(points.at(EdgesCount()-1), points.at(0)); + } + return edge; +} + +//--------------------------------------------------------------------------------------------------------------------- +int VLayoutDetail::EdgeByPoint(const QPointF &p1) const +{ + if (p1.isNull()) + { + return 0; + } + + if (EdgesCount() < 3) + { + return 0; + } + + const QVector points = GetLayoutAllowence(); + for (int i=0; i< points.size(); i++) + { + if (points.at(i) == p1) + { + return i+1; + } + } + return 0; // Did not find edge +} + +//--------------------------------------------------------------------------------------------------------------------- +QRectF VLayoutDetail::BoundingRect() const +{ + QVector points = GetLayoutAllowence(); + points.append(points.first()); + return QPolygonF(points).boundingRect(); } //--------------------------------------------------------------------------------------------------------------------- @@ -168,5 +235,15 @@ QVector VLayoutDetail::Map(const QVector &points) const { p.append(d->matrix.map(points.at(i))); } + + if (d->matrix.m11() < 0) + { + QList list = p.toList(); + for(int k=0, s=list.size(), max=(s/2); k d; diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp new file mode 100644 index 000000000..d3d7cd962 --- /dev/null +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -0,0 +1,564 @@ +/************************************************************************ + ** + ** @file vlayoutpaper.cpp + ** @author Roman Telezhynskyi + ** @date 7 1, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#include "vlayoutpaper.h" +#include "vlayoutpaper_p.h" + +#include +#include + +class BestResult +{ +public: + BestResult(); + + void NewResult(qint64 square, int i, int j, const QMatrix &matrix); + + qint64 BestSquare() const; + int GContourEdge() const; + int DetailEdge() const; + QMatrix Matrix() const; + bool ValideResult() const; + +private: + // All nedded information about best result + int resI; // Edge of global contour + int resJ; // Edge of detail + QMatrix resMatrix; // Matrix for rotation and translation detail + qint64 resSquare; // Best square size (least). For begin set max value. + bool valideResult; +}; + +//===================================================BestResult======================================================== +//--------------------------------------------------------------------------------------------------------------------- +BestResult::BestResult() + :resI(0), resJ(0), resMatrix(QMatrix()), resSquare(LLONG_MAX),valideResult(false) +{} + +//--------------------------------------------------------------------------------------------------------------------- +void BestResult::NewResult(qint64 square, int i, int j, const QMatrix &matrix) +{ + if (square <= resSquare && square > 0) + { + resI = i; + resJ = j; + resMatrix = matrix; + resSquare = square; + valideResult = true; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +qint64 BestResult::BestSquare() const +{ + return resSquare; +} + +//--------------------------------------------------------------------------------------------------------------------- +int BestResult::GContourEdge() const +{ + return resI; +} + +//--------------------------------------------------------------------------------------------------------------------- +int BestResult::DetailEdge() const +{ + return resJ; +} + +//--------------------------------------------------------------------------------------------------------------------- +QMatrix BestResult::Matrix() const +{ + return resMatrix; +} + +//--------------------------------------------------------------------------------------------------------------------- +bool BestResult::ValideResult() const +{ + return valideResult; +} + +//===================================================VLayoutPaper====================================================== +//--------------------------------------------------------------------------------------------------------------------- +VLayoutPaper::VLayoutPaper() + :d(new VLayoutPaperData) +{} + +//--------------------------------------------------------------------------------------------------------------------- +VLayoutPaper::VLayoutPaper(int height, int width) + :d(new VLayoutPaperData(height, width)) +{} + +//--------------------------------------------------------------------------------------------------------------------- +VLayoutPaper::VLayoutPaper(const VLayoutPaper &paper) + :d (paper.d) +{} + +//--------------------------------------------------------------------------------------------------------------------- +VLayoutPaper &VLayoutPaper::operator=(const VLayoutPaper &paper) +{ + if ( &paper == this ) + { + return *this; + } + d = paper.d; + return *this; +} + +//--------------------------------------------------------------------------------------------------------------------- +VLayoutPaper::~VLayoutPaper() +{} + +//--------------------------------------------------------------------------------------------------------------------- +int VLayoutPaper::GetHeight() const +{ + return d->paperHeight; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutPaper::SetHeight(int height) +{ + d->paperHeight = height; +} + +//--------------------------------------------------------------------------------------------------------------------- +int VLayoutPaper::GetWidth() const +{ + return d->paperWidth; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutPaper::SetWidth(int width) +{ + d->paperWidth = width; +} + +//--------------------------------------------------------------------------------------------------------------------- +bool VLayoutPaper::ArrangeDetail(const VLayoutDetail &detail) +{ + // First need set size of paper + if (d->paperHeight <= 0 || d->paperWidth <= 0) + { + return false; + } + + if (detail.EdgesCount() < 3) + { + return false;//Not enough edges + } + + if (Count() == 0) + { + return AddToBlankSheet(detail); + } + else + { + return AddToSheet(detail); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +int VLayoutPaper::Count() const +{ + return d->details.count(); +} + +//--------------------------------------------------------------------------------------------------------------------- +bool VLayoutPaper::AddToBlankSheet(const VLayoutDetail &detail) +{ + BestResult bestResult; + + // We should use copy of the detail. + VLayoutDetail workDetail = detail; + + for (int i=1; i<= detail.EdgesCount(); i++) + { + int dEdge = i;// For mirror detail edge will be different + if (CheckPosition(workDetail, 1, dEdge)) + { + const QRectF rec = workDetail.BoundingRect(); + if (SheetContains(rec)) + { + bestResult.NewResult(static_cast(rec.width()*rec.height()), 1, dEdge, workDetail.GetMatrix()); + } + else + { + continue; // Outside of sheet. + } + } + } + + if (bestResult.ValideResult()) + { + VLayoutDetail workDetail = detail; + workDetail.SetMatrix(bestResult.Matrix());// Don't forget set matrix + d->details.append(workDetail); + // First detail, just simple take all points + d->globalContour = workDetail.GetLayoutAllowence(); + } + + return bestResult.ValideResult(); // Do we have the best result? +} + +//--------------------------------------------------------------------------------------------------------------------- +bool VLayoutPaper::AddToSheet(const VLayoutDetail &detail) +{ + BestResult bestResult; + + for (int j=1; j <= EdgesCount(); ++j) + { + // We should use copy of the detail. + VLayoutDetail workDetail = detail; + + for (int i=1; i<= workDetail.EdgesCount(); i++) + { + int dEdge = i;// For mirror detail edge will be different + if (CheckPosition(workDetail, j, dEdge)) + { + if (SheetContains(workDetail.BoundingRect())) + { + QVector newGContour = UniteWithContour(workDetail, j, dEdge); + newGContour.append(newGContour.first()); + const QRectF rec = QPolygonF(newGContour).boundingRect(); + bestResult.NewResult(static_cast(rec.width()*rec.height()), j, dEdge, + workDetail.GetMatrix()); + } + else + { + continue; // Outside of sheet. + } + } + } + } + + if (bestResult.ValideResult()) + { + VLayoutDetail workDetail = detail; + workDetail.SetMatrix(bestResult.Matrix());// Don't forget set matrix + const QVector newGContour = UniteWithContour(workDetail, bestResult.GContourEdge(), + bestResult.DetailEdge()); + if (newGContour.isEmpty()) + { + return false; + } + d->details.append(workDetail); + // First detail, just simple take all points + d->globalContour = newGContour; + } + + return bestResult.ValideResult(); // Do we have the best result? +} + +//--------------------------------------------------------------------------------------------------------------------- +bool VLayoutPaper::CheckPosition(VLayoutDetail &detail, int j, int &dEdge) const +{ + const QLineF globalEdge = GlobalEdge(j); + bool flagMirror = false; + bool flagSquare = false; + + CombineEdges(detail, globalEdge, dEdge); + + switch (Crossing(detail, j, dEdge)) + { + case CrossingType::EdgeError: + return false; + case CrossingType::Intersection: + detail.Mirror(globalEdge); + flagMirror = true; + break; + case CrossingType::NoIntersection: + { + switch (InsideContour(detail, dEdge)) + { + case InsideType::EdgeError: + return false; + case InsideType::Inside: + detail.Mirror(globalEdge); + flagMirror = true; + break; + case InsideType::Outside: + flagSquare = true; + break; + default: + break; + } + } + default: + break; + } + + if (flagMirror) + { + dEdge = detail.EdgeByPoint(globalEdge.p2()); + if (dEdge <= 0) + { + return false; + } + + switch (Crossing(detail, j, dEdge)) + { + case CrossingType::EdgeError: + return false; + case CrossingType::Intersection: + flagSquare = false; + break; + case CrossingType::NoIntersection: + { + switch (InsideContour(detail, dEdge)) + { + case InsideType::EdgeError: + return false; + case InsideType::Inside: + flagSquare = false; + break; + case InsideType::Outside: + flagSquare = true; + break; + default: + break; + } + } + default: + break; + } + } + return flagSquare; +} + +//--------------------------------------------------------------------------------------------------------------------- +VLayoutPaper::CrossingType VLayoutPaper::Crossing(const VLayoutDetail &detail, int globalI, int detailI) const +{ + int globalEdgesCount = EdgesCount(); + if (globalEdgesCount == 0) + { + globalEdgesCount = 1;// For blank sheet + } + + const int detailEdgesCount = detail.EdgesCount(); + if (detailEdgesCount < 3) + { + return CrossingType::EdgeError; + } + + for(int i = 1; i <= globalEdgesCount; i++) + { + const QLineF globalEdge = GlobalEdge(i); + if (globalEdge.isNull()) // Got null edge + { + return CrossingType::EdgeError; + } + + for(int j = 1; j <= detailEdgesCount; j++) + { + if (i == globalI && j == detailI) + { + continue; + } + + const QLineF detailEdge = detail.Edge(j); + if (detailEdge.isNull()) // Got null edge + { + return CrossingType::EdgeError; + } + + QPointF xPoint; + QLineF::IntersectType type = globalEdge.intersect(detailEdge, &xPoint); + + if (type == QLineF::BoundedIntersection) + { + return CrossingType::Intersection; + } + } + } + + return CrossingType::NoIntersection; +} + +//--------------------------------------------------------------------------------------------------------------------- +VLayoutPaper::InsideType VLayoutPaper::InsideContour(const VLayoutDetail &detail, int detailI) const +{ + if (detail.EdgesCount() < 3) + { + return InsideType::EdgeError; + } + + const QVector lPoints = detail.GetLayoutAllowence(); + + const QLineF detailEdge = detail.Edge(detailI); + if (detailEdge.isNull()) // Got null edge + { + return InsideType::EdgeError; + } + + if (d->details.isEmpty()) + { + const QLineF globalEdge = GlobalEdge(1); + for(int i = 0; i < lPoints.count(); i++) + { + if (CheckSide(globalEdge, lPoints.at(i)) < 0) + { + return InsideType::Inside; + } + } + } + else + { + const QPolygonF gPoly = GlobalPolygon(); + for(int i = 0; i < lPoints.count(); i++) + { + const QPointF p = lPoints.at(i); + if (p.isNull()) + { + return InsideType::EdgeError; + } + + if (p != detailEdge.p1() && p != detailEdge.p2()) + { + if (gPoly.containsPoint(p, Qt::OddEvenFill)) + { + return InsideType::Inside; + } + } + } + } + return InsideType::Outside; +} + +//--------------------------------------------------------------------------------------------------------------------- +qreal VLayoutPaper::CheckSide(const QLineF &edge, const QPointF &p) const +{ + return (edge.x2() - edge.x1()) * (p.y() - edge.y1()) - (edge.y2() - edge.y1()) * (p.x() - edge.x1()); +} + +//--------------------------------------------------------------------------------------------------------------------- +bool VLayoutPaper::SheetContains(const QRectF &rect) const +{ + const QRectF bRect(0, 0, d->paperWidth, d->paperHeight); + return bRect.contains(rect); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutPaper::CombineEdges(VLayoutDetail &detail, const QLineF &globalEdge, int dEdge) const +{ + QLineF detailEdge = detail.Edge(dEdge); + + // Find distance between two edges for two begin vertex. + const qreal dx = globalEdge.x2() - detailEdge.x2(); + const qreal dy = globalEdge.y2() - detailEdge.y2(); + + detailEdge.translate(dx, dy); // Use values for translate detail edge. + + const qreal angle_between = globalEdge.angleTo(detailEdge); // Seek angle between two edges. + + // Now we move detail to position near to global contour edge. + detail.Translate(dx, dy); + detail.Rotate(globalEdge.p2(), angle_between); +} + +//--------------------------------------------------------------------------------------------------------------------- +QVector VLayoutPaper::UniteWithContour(const VLayoutDetail &detail, int globalI, int detJ) const +{ + if (d->globalContour.isEmpty()) + { + return detail.GetLayoutAllowence(); + } + + if (globalI <= 0 || globalI > EdgesCount()) + { + return QVector(); + } + + if (detJ <= 0 || detJ > detail.EdgesCount()) + { + return QVector(); + } + + QVector newContour; + for(int i=0; i < d->globalContour.count(); ++i) + { + newContour.append(d->globalContour.at(i)); + ++i; + if (i==globalI) + { + const QVector dPoints = detail.GetLayoutAllowence(); + const int nD = dPoints.count(); + int processedPoints = 0; + int j = detJ; + do + { + if (j > nD-1) + { + j=0; + } + newContour.append(dPoints.at(j)); + ++processedPoints; + ++j; + }while (processedPointsdetails.isEmpty()) + { + // Because sheet is blank we have one global edge for all cases - Ox axis. + return QLineF(0, 0, d->paperWidth, 0); + } + + if (i < 1 || i > EdgesCount()) + { // Doesn't exist such edge + return QLineF(); + } + QLineF edge; + if (i < EdgesCount()) + { + edge = QLineF(d->globalContour.at(i-1), d->globalContour.at(i)); + } + else + { // Closed countour + edge = QLineF(d->globalContour.at(EdgesCount()-1), d->globalContour.at(0)); + } + return edge; +} + +//--------------------------------------------------------------------------------------------------------------------- +int VLayoutPaper::EdgesCount() const +{ + return d->globalContour.count(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QPolygonF VLayoutPaper::GlobalPolygon() const +{ + QVector points = d->globalContour; + points.append(points.first()); + return QPolygonF(points); +} diff --git a/src/libs/vlayout/vlayoutpaper.h b/src/libs/vlayout/vlayoutpaper.h new file mode 100644 index 000000000..5e231fc0e --- /dev/null +++ b/src/libs/vlayout/vlayoutpaper.h @@ -0,0 +1,91 @@ +/************************************************************************ + ** + ** @file vlayoutpaper.h + ** @author Roman Telezhynskyi + ** @date 7 1, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef VLAYOUTPAPER_H +#define VLAYOUTPAPER_H + +#include + +class VLayoutPaperData; +class VLayoutDetail; +class QPointF; +class QLineF; +class QPolygonF; + +class VLayoutPaper +{ +public: + VLayoutPaper(); + VLayoutPaper(int height, int width); + VLayoutPaper(const VLayoutPaper &paper); + VLayoutPaper &operator=(const VLayoutPaper &paper); + virtual ~VLayoutPaper(); + + int GetHeight() const; + void SetHeight(int height); + + int GetWidth() const; + void SetWidth(int width); + + bool ArrangeDetail(const VLayoutDetail &detail); + int Count() const; +private: + QSharedDataPointer d; + + enum class CrossingType : char + { + NoIntersection = 0, + Intersection = 1, + EdgeError = 2 + }; + + enum class InsideType : char + { + Outside = 0, + Inside = 1, + EdgeError = 2 + }; + + bool AddToBlankSheet(const VLayoutDetail &detail); + bool AddToSheet(const VLayoutDetail &detail); + + bool CheckPosition(VLayoutDetail &detail, int j, int &dEdge) const; + CrossingType Crossing(const VLayoutDetail &detail, int globalI, int detailI) const; + InsideType InsideContour(const VLayoutDetail &detail, int detailI) const; + qreal CheckSide(const QLineF &edge, const QPointF &p) const; + bool SheetContains(const QRectF &rect) const; + void CombineEdges(VLayoutDetail &detail, const QLineF &globalEdge, int dEdge) const; + QVector UniteWithContour(const VLayoutDetail &detail, int globalI, int detJ) const; + + QLineF GlobalEdge(int i) const; + int EdgesCount() const; + + QPolygonF GlobalPolygon() const; +}; + +#endif // VLAYOUTPAPER_H diff --git a/src/libs/vlayout/vlayoutpaper_p.h b/src/libs/vlayout/vlayoutpaper_p.h new file mode 100644 index 000000000..3a9e3b23b --- /dev/null +++ b/src/libs/vlayout/vlayoutpaper_p.h @@ -0,0 +1,78 @@ +/************************************************************************ + ** + ** @file vlayoutpaper_p.h + ** @author Roman Telezhynskyi + ** @date 8 1, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef VLAYOUTPAPER_P_H +#define VLAYOUTPAPER_P_H + +#include +#include +#include + +#include "vlayoutdetail.h" + +#ifdef Q_CC_GNU + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Weffc++" +#endif + +class VLayoutPaperData : public QSharedData +{ +public: + VLayoutPaperData() + :details(QVector()), globalContour(QVector()), paperHeight(0), paperWidth(0) + {} + + VLayoutPaperData(int height, int width) + :details(QVector()), globalContour(QVector()), paperHeight(height), paperWidth(width) + {} + + VLayoutPaperData(const VLayoutPaperData &paper) + :QSharedData(paper), details(paper.details), globalContour(paper.globalContour), paperHeight(paper.paperHeight), + paperWidth(paper.paperWidth) + {} + + ~VLayoutPaperData() {} + + /** @brief details list of arranged details. */ + QVector details; + + /** @brief globalContour list of global points contour. */ + QVector globalContour; + + /** @brief paperHeight height of paper in pixels*/ + int paperHeight; + + /** @brief paperWidth width of paper in pixels*/ + int paperWidth; +}; + +#ifdef Q_CC_GNU + #pragma GCC diagnostic pop +#endif + +#endif // VLAYOUTPAPER_P_H From b53d32225a580396c16c9f6ac94e51f6ddcadc21 Mon Sep 17 00:00:00 2001 From: dismine Date: Sun, 11 Jan 2015 15:11:56 +0200 Subject: [PATCH 017/186] Class that handle choose next detail. --HG-- branch : feature --- src/app/mainwindow.cpp | 4 +- src/libs/vlayout/vbank.cpp | 383 +++++++++++++++++++++++++++++ src/libs/vlayout/vbank.h | 89 +++++++ src/libs/vlayout/vlayout.pri | 6 +- src/libs/vlayout/vlayoutdetail.cpp | 83 ++++++- src/libs/vlayout/vlayoutdetail.h | 11 +- src/libs/vlayout/vlayoutpaper.cpp | 8 +- 7 files changed, 565 insertions(+), 19 deletions(-) create mode 100644 src/libs/vlayout/vbank.cpp create mode 100644 src/libs/vlayout/vbank.h diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index 4396651ed..3bf1a2cf4 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -1919,11 +1919,11 @@ void MainWindow::ActionLayout(bool checked) { idetail.next(); VLayoutDetail det = VLayoutDetail(); - det.SetCountour(idetail.value().ContourPoints(pattern)); + det.SetCountourPoints(idetail.value().ContourPoints(pattern)); det.SetSeamAllowencePoints(idetail.value().SeamAllowancePoints(pattern)); det.setSeamAllowance(idetail.value().getSeamAllowance()); det.setName(idetail.value().getName()); - det.SetLayoutAllowence(); + det.SetLayoutAllowencePoints(); listDetails.append(det); } diff --git a/src/libs/vlayout/vbank.cpp b/src/libs/vlayout/vbank.cpp new file mode 100644 index 000000000..15fb5ce79 --- /dev/null +++ b/src/libs/vlayout/vbank.cpp @@ -0,0 +1,383 @@ +/************************************************************************ + ** + ** @file vbank.cpp + ** @author Roman Telezhynskyi + ** @date 11 1, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#include "vbank.h" +#include "vlayoutdetail.h" + +#include +#include + +//--------------------------------------------------------------------------------------------------------------------- +VBank::VBank() + :details(QVector()), unsorted(QHash()), big(QHash()), + middle(QHash()), small(QHash()), layoutWidth(0), caseType(Cases::CaseDesc), + prepare(false) +{} + +//--------------------------------------------------------------------------------------------------------------------- +qreal VBank::GetLayoutWidth() const +{ + return layoutWidth; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VBank::SetLayoutWidth(const qreal &value) +{ + layoutWidth = value; + Reset(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VBank::SetDetails(const QVector &details) +{ + this->details = details; + Reset(); +} + +//--------------------------------------------------------------------------------------------------------------------- +int VBank::GetTiket() +{ + if (prepare == false) + { + return -1; + } + + if (LeftArrange() == 0) + { + if (unsorted.isEmpty()) + { + return -1; + } + else + { + PrepareGroup(); + } + } + + switch(caseType) + { + case Cases::CaseThreeGroup: + return GetNextThreeGroups(); + case Cases::CaseTwoGroup: + return GetNextTwoGroups(); + case Cases::CaseDesc: + return GetNextDescGroup(); + default: + return -1; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +VLayoutDetail VBank::GetDetail(int i) const +{ + if (i >= 0 && i < details.size()) + { + return details.at(i); + } + else + { + return VLayoutDetail(); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void VBank::Arranged(int i) +{ + if (big.contains(i)) + { + big.remove(i); + return; + } + + if (middle.contains(i)) + { + middle.remove(i); + return; + } + + if (small.contains(i)) + { + small.remove(i); + return; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void VBank::NotArranged(int i) +{ + if (big.contains(i)) + { + unsorted.insert(i, big.value(i)); + big.remove(i); + return; + } + + if (middle.contains(i)) + { + unsorted.insert(i, middle.value(i)); + middle.remove(i); + return; + } + + if (small.contains(i)) + { + unsorted.insert(i, small.value(i)); + small.remove(i); + return; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +bool VBank::Prepare() +{ + if (layoutWidth <= 0) + { + prepare = false; + return prepare; + } + + if (details.isEmpty()) + { + prepare = false; + return prepare; + } + + for (int i=0; i < details.size(); ++i) + { + details[i].SetLayoutWidth(layoutWidth); + details[i].SetLayoutAllowencePoints(); + const qint64 square = details.at(i).Square(); + if (square <= 0) + { + prepare = false; + return prepare; + } + unsorted.insert(i, square); + } + + PrepareGroup(); + + prepare = true; + return prepare; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VBank::Reset() +{ + prepare = false; + unsorted.clear(); + big.clear(); + middle.clear(); + small.clear(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VBank::SetCaseType(Cases caseType) +{ + this->caseType = caseType; +} + +//--------------------------------------------------------------------------------------------------------------------- +int VBank::AllDetailsCount() const +{ + return unsorted.count() + big.count() + middle.count() + small.count(); +} + +//--------------------------------------------------------------------------------------------------------------------- +int VBank::LeftArrange() const +{ + return big.count() + middle.count() + small.count(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VBank::PrepareGroup() +{ + switch(caseType) + { + case Cases::CaseThreeGroup: + PrepareThreeGroups(); + break; + case Cases::CaseTwoGroup: + PrepareTwoGroups(); + break; + case Cases::CaseDesc: + PrepareDescGroup(); + break; + default: + break; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void VBank::PrepareThreeGroups() +{ + qint64 sMax = LLONG_MIN; + qint64 sMin = LLONG_MAX; + + SqMaxMin(sMax, sMin); + + const qint64 s1 = sMax - (sMax - sMin)/3; + const qint64 s2 = sMin + (sMax - sMin)/3; + + QHash::const_iterator i = unsorted.constBegin(); + while (i != unsorted.constEnd()) + { + if (i.value() > s1) + { + big.insert(i.key(), i.value()); + } + else if (s1 > i.value() && i.value() > s2) + { + middle.insert(i.key(), i.value()); + } + else + { + small.insert(i.key(), i.value()); + } + ++i; + } + unsorted.clear(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VBank::PrepareTwoGroups() +{ + qint64 sMax = LLONG_MIN; + qint64 sMin = LLONG_MAX; + + SqMaxMin(sMax, sMin); + + const qint64 s = (sMax + sMin)/2; + QHash::const_iterator i = unsorted.constBegin(); + while (i != unsorted.constEnd()) + { + if (i.value() >= s) + { + big.insert(i.key(), i.value()); + } + else + { + small.insert(i.key(), i.value()); + } + ++i; + } + unsorted.clear(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VBank::PrepareDescGroup() +{ + big = unsorted; + unsorted.clear(); +} + +//--------------------------------------------------------------------------------------------------------------------- +int VBank::GetNextThreeGroups() const +{ + if (big.isEmpty() == false) + { + QHash::const_iterator i = big.constBegin(); + return i.key(); + } + + if (middle.isEmpty() == false) + { + QHash::const_iterator i = middle.constBegin(); + return i.key(); + } + + if (small.isEmpty() == false) + { + QHash::const_iterator i = small.constBegin(); + return i.key(); + } + + return -1; +} + +//--------------------------------------------------------------------------------------------------------------------- +int VBank::GetNextTwoGroups() const +{ + if (big.isEmpty() == false) + { + QHash::const_iterator i = big.constBegin(); + return i.key(); + } + + if (small.isEmpty() == false) + { + QHash::const_iterator i = small.constBegin(); + return i.key(); + } + + return -1; +} + +//--------------------------------------------------------------------------------------------------------------------- +int VBank::GetNextDescGroup() const +{ + int index = -1; + qint64 sMax = LLONG_MIN; + + QHash::const_iterator i = big.constBegin(); + while (i != big.constEnd()) + { + if (i.value() > sMax) + { + sMax = i.value(); + index = i.key(); + } + + ++i; + } + + return index; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VBank::SqMaxMin(qint64 &sMax, qint64 &sMin) const +{ + sMax = LLONG_MIN; + sMin = LLONG_MAX; + + QHash::const_iterator i = unsorted.constBegin(); + while (i != unsorted.constEnd()) + { + if (i.value() < sMin) + { + sMin = i.value(); + } + + if (i.value() > sMax) + { + sMax = i.value(); + } + ++i; + } + +} diff --git a/src/libs/vlayout/vbank.h b/src/libs/vlayout/vbank.h new file mode 100644 index 000000000..da8bb5edb --- /dev/null +++ b/src/libs/vlayout/vbank.h @@ -0,0 +1,89 @@ +/************************************************************************ + ** + ** @file vbank.h + ** @author Roman Telezhynskyi + ** @date 11 1, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef VBANK_H +#define VBANK_H + +#include +#include + +class QPointF; +class VLayoutDetail; + +enum class Cases : char { CaseThreeGroup, CaseTwoGroup, CaseDesc}; + +class VBank +{ +public: + VBank(); + + qreal GetLayoutWidth() const; + void SetLayoutWidth(const qreal &value); + + void SetDetails(const QVector &details); + int GetTiket(); + VLayoutDetail GetDetail(int i) const; + + void Arranged(int i); + void NotArranged(int i); + + bool Prepare(); + void Reset(); + void SetCaseType(Cases caseType); + + int AllDetailsCount() const; + int LeftArrange() const; + +private: + Q_DISABLE_COPY(VBank) + QVector details; + QHash unsorted; + + QHash big; + QHash middle; + QHash small; + + qreal layoutWidth; + + Cases caseType; + bool prepare; + + void PrepareGroup(); + + void PrepareThreeGroups(); + void PrepareTwoGroups(); + void PrepareDescGroup(); + + int GetNextThreeGroups() const; + int GetNextTwoGroups() const; + int GetNextDescGroup() const; + + void SqMaxMin(qint64 &sMax, qint64 &sMin) const; +}; + +#endif // VBANK_H diff --git a/src/libs/vlayout/vlayout.pri b/src/libs/vlayout/vlayout.pri index fe1d8e5ae..25e9eb556 100644 --- a/src/libs/vlayout/vlayout.pri +++ b/src/libs/vlayout/vlayout.pri @@ -10,11 +10,13 @@ HEADERS += \ $$PWD/vlayoutdetail_p.h \ $$PWD/vlayoutdef.h \ $$PWD/vlayoutpaper.h \ - vlayoutpaper_p.h + $$PWD/vlayoutpaper_p.h \ + $$PWD/vbank.h SOURCES += \ $$PWD/stable.cpp \ $$PWD/vlayoutgenerator.cpp \ $$PWD/vlayoutdetail.cpp \ $$PWD/vabstractdetail.cpp \ - $$PWD/vlayoutpaper.cpp + $$PWD/vlayoutpaper.cpp \ + $$PWD/vbank.cpp diff --git a/src/libs/vlayout/vlayoutdetail.cpp b/src/libs/vlayout/vlayoutdetail.cpp index 74d3a3b80..7edee057b 100644 --- a/src/libs/vlayout/vlayoutdetail.cpp +++ b/src/libs/vlayout/vlayoutdetail.cpp @@ -29,6 +29,8 @@ #include "vlayoutdetail.h" #include "vlayoutdetail_p.h" +#include + //--------------------------------------------------------------------------------------------------------------------- VLayoutDetail::VLayoutDetail() :VAbstractDetail(), d(new VLayoutDetailData) @@ -56,13 +58,13 @@ VLayoutDetail::~VLayoutDetail() {} //--------------------------------------------------------------------------------------------------------------------- -QVector VLayoutDetail::GetContour() const +QVector VLayoutDetail::GetContourPoints() const { return d->contour; } //--------------------------------------------------------------------------------------------------------------------- -void VLayoutDetail::SetCountour(const QVector &points) +void VLayoutDetail::SetCountourPoints(const QVector &points) { d->contour = points; // Contour can't be closed @@ -90,7 +92,7 @@ void VLayoutDetail::SetSeamAllowencePoints(const QVector &points) } //--------------------------------------------------------------------------------------------------------------------- -QVector VLayoutDetail::GetLayoutAllowence() const +QVector VLayoutDetail::GetLayoutAllowencePoints() const { return Map(d->layoutAllowence); } @@ -162,7 +164,7 @@ QLineF VLayoutDetail::Edge(int i) const { // Doesn't exist such edge return QLineF(); } - const QVector points = GetLayoutAllowence(); + const QVector points = GetLayoutAllowencePoints(); QLineF edge; if (i < EdgesCount()) { @@ -188,7 +190,7 @@ int VLayoutDetail::EdgeByPoint(const QPointF &p1) const return 0; } - const QVector points = GetLayoutAllowence(); + const QVector points = GetLayoutAllowencePoints(); for (int i=0; i< points.size(); i++) { if (points.at(i) == p1) @@ -202,13 +204,80 @@ int VLayoutDetail::EdgeByPoint(const QPointF &p1) const //--------------------------------------------------------------------------------------------------------------------- QRectF VLayoutDetail::BoundingRect() const { - QVector points = GetLayoutAllowence(); + QVector points = GetLayoutAllowencePoints(); points.append(points.first()); return QPolygonF(points).boundingRect(); } //--------------------------------------------------------------------------------------------------------------------- -void VLayoutDetail::SetLayoutAllowence() +bool VLayoutDetail::isNull() const +{ + if (d->contour.isEmpty() == false && d->layoutWidth > 0) + { + if (getSeamAllowance() && d->seamAllowence.isEmpty() == false) + { + return false; + } + else + { + return true; + } + } + else + { + return true; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +qint64 VLayoutDetail::Square() const +{ + if (d->layoutAllowence.isEmpty()) + { + return 0; + } + + const int n = d->layoutAllowence.count(); + qreal s, res = 0; + qint64 sq = 0; + + QVector x; + QVector y; + + for(int i=0; i < n; ++i) + { + x.append(d->layoutAllowence.at(i).x()); + y.append(d->layoutAllowence.at(i).y()); + } + + // Calculation a polygon area through the sum of the areas of trapezoids + for (int i = 0; i < n; ++i) + { + if (i == 0) + { + s = x.at(i)*(y.at(n-1) - y.at(i+1)); //if i == 0, then y[i-1] replace on y[n-1] + res += s; + } + else + { + if (i == n-1) + { + s = x.at(i)*(y.at(i-1) - y.at(0)); // if i == n-1, then y[i+1] replace on y[0] + res += s; + } + else + { + s = x.at(i)*(y.at(i-1) - y.at(i+1)); + res += s; + } + } + } + sq = qFloor(qAbs(res/2.0)); + return sq; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutDetail::SetLayoutAllowencePoints() { if (d->layoutWidth > 0) { diff --git a/src/libs/vlayout/vlayoutdetail.h b/src/libs/vlayout/vlayoutdetail.h index 38f60981e..9021516f5 100644 --- a/src/libs/vlayout/vlayoutdetail.h +++ b/src/libs/vlayout/vlayoutdetail.h @@ -44,14 +44,14 @@ public: VLayoutDetail &operator=(const VLayoutDetail &detail); virtual ~VLayoutDetail(); - QVector GetContour() const; - void SetCountour(const QVector &points); + QVector GetContourPoints() const; + void SetCountourPoints(const QVector &points); QVector GetSeamAllowencePoints() const; void SetSeamAllowencePoints(const QVector &points); - QVector GetLayoutAllowence() const; - void SetLayoutAllowence(); + QVector GetLayoutAllowencePoints() const; + void SetLayoutAllowencePoints(); QMatrix GetMatrix() const; void SetMatrix(const QMatrix &matrix); @@ -69,6 +69,9 @@ public: QRectF BoundingRect() const; + bool isNull() const; + qint64 Square() const; + private: QSharedDataPointer d; diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index d3d7cd962..7c9fd071b 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -219,7 +219,7 @@ bool VLayoutPaper::AddToBlankSheet(const VLayoutDetail &detail) workDetail.SetMatrix(bestResult.Matrix());// Don't forget set matrix d->details.append(workDetail); // First detail, just simple take all points - d->globalContour = workDetail.GetLayoutAllowence(); + d->globalContour = workDetail.GetLayoutAllowencePoints(); } return bestResult.ValideResult(); // Do we have the best result? @@ -407,7 +407,7 @@ VLayoutPaper::InsideType VLayoutPaper::InsideContour(const VLayoutDetail &detail return InsideType::EdgeError; } - const QVector lPoints = detail.GetLayoutAllowence(); + const QVector lPoints = detail.GetLayoutAllowencePoints(); const QLineF detailEdge = detail.Edge(detailI); if (detailEdge.isNull()) // Got null edge @@ -485,7 +485,7 @@ QVector VLayoutPaper::UniteWithContour(const VLayoutDetail &detail, int { if (d->globalContour.isEmpty()) { - return detail.GetLayoutAllowence(); + return detail.GetLayoutAllowencePoints(); } if (globalI <= 0 || globalI > EdgesCount()) @@ -505,7 +505,7 @@ QVector VLayoutPaper::UniteWithContour(const VLayoutDetail &detail, int ++i; if (i==globalI) { - const QVector dPoints = detail.GetLayoutAllowence(); + const QVector dPoints = detail.GetLayoutAllowencePoints(); const int nD = dPoints.count(); int processedPoints = 0; int j = detJ; From 98d5dde2e1e4c527a6f8b439f94fe29430cb21c8 Mon Sep 17 00:00:00 2001 From: dismine Date: Mon, 12 Jan 2015 14:12:15 +0200 Subject: [PATCH 018/186] Class that drive all process, also speak with outside world. --HG-- branch : feature --- src/libs/vlayout/vbank.cpp | 41 +++++++- src/libs/vlayout/vbank.h | 5 + src/libs/vlayout/vlayoutdef.h | 9 ++ src/libs/vlayout/vlayoutgenerator.cpp | 142 +++++++++++++++++++++++++- src/libs/vlayout/vlayoutgenerator.h | 49 ++++++++- 5 files changed, 240 insertions(+), 6 deletions(-) diff --git a/src/libs/vlayout/vbank.cpp b/src/libs/vlayout/vbank.cpp index 15fb5ce79..08323bf9a 100644 --- a/src/libs/vlayout/vbank.cpp +++ b/src/libs/vlayout/vbank.cpp @@ -31,12 +31,13 @@ #include #include +#include //--------------------------------------------------------------------------------------------------------------------- VBank::VBank() :details(QVector()), unsorted(QHash()), big(QHash()), middle(QHash()), small(QHash()), layoutWidth(0), caseType(Cases::CaseDesc), - prepare(false) + prepare(false), boundingRect(QRectF()) {} //--------------------------------------------------------------------------------------------------------------------- @@ -180,6 +181,7 @@ bool VBank::Prepare() unsorted.insert(i, square); } + BiggestBoundingRect(); PrepareGroup(); prepare = true; @@ -194,6 +196,7 @@ void VBank::Reset() big.clear(); middle.clear(); small.clear(); + boundingRect = QRectF(); } //--------------------------------------------------------------------------------------------------------------------- @@ -214,6 +217,40 @@ int VBank::LeftArrange() const return big.count() + middle.count() + small.count(); } +//--------------------------------------------------------------------------------------------------------------------- +void VBank::BiggestBoundingRect() +{ + int index = -1; + qint64 sMax = LLONG_MIN; + + QHash::const_iterator i = unsorted.constBegin(); + while (i != unsorted.constEnd()) + { + if (i.value() > sMax) + { + sMax = i.value(); + index = i.key(); + } + + ++i; + } + + if (index >= 0 && index < details.size()) + { + boundingRect = QPolygonF(details.at(index).GetLayoutAllowencePoints()).boundingRect(); + } + else + { + boundingRect = QRectF(); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +QRectF VBank::GetBiggestBoundingRect() const +{ + return boundingRect; +} + //--------------------------------------------------------------------------------------------------------------------- void VBank::PrepareGroup() { @@ -251,7 +288,7 @@ void VBank::PrepareThreeGroups() { big.insert(i.key(), i.value()); } - else if (s1 > i.value() && i.value() > s2) + else if (s1 >= i.value() && i.value() > s2) { middle.insert(i.key(), i.value()); } diff --git a/src/libs/vlayout/vbank.h b/src/libs/vlayout/vbank.h index da8bb5edb..316826585 100644 --- a/src/libs/vlayout/vbank.h +++ b/src/libs/vlayout/vbank.h @@ -34,6 +34,7 @@ class QPointF; class VLayoutDetail; +class QRectF; enum class Cases : char { CaseThreeGroup, CaseTwoGroup, CaseDesc}; @@ -59,6 +60,8 @@ public: int AllDetailsCount() const; int LeftArrange() const; + QRectF GetBiggestBoundingRect() const; + private: Q_DISABLE_COPY(VBank) QVector details; @@ -72,6 +75,7 @@ private: Cases caseType; bool prepare; + QRectF boundingRect; void PrepareGroup(); @@ -84,6 +88,7 @@ private: int GetNextDescGroup() const; void SqMaxMin(qint64 &sMax, qint64 &sMin) const; + void BiggestBoundingRect(); }; #endif // VBANK_H diff --git a/src/libs/vlayout/vlayoutdef.h b/src/libs/vlayout/vlayoutdef.h index 25d09a59d..ecadc2977 100644 --- a/src/libs/vlayout/vlayoutdef.h +++ b/src/libs/vlayout/vlayoutdef.h @@ -31,4 +31,13 @@ enum class EquidistantType : char { OpenEquidistant, CloseEquidistant }; +enum class LayoutErrors : char +{ + NoError, + PrepareLayoutError, + PaperSizeError, + ProcessStoped, + EmptyPaperError +}; + #endif // VLAYOUTDEF_H diff --git a/src/libs/vlayout/vlayoutgenerator.cpp b/src/libs/vlayout/vlayoutgenerator.cpp index 2f719e99b..b4e6782df 100644 --- a/src/libs/vlayout/vlayoutgenerator.cpp +++ b/src/libs/vlayout/vlayoutgenerator.cpp @@ -27,8 +27,148 @@ *************************************************************************/ #include "vlayoutgenerator.h" +#include "vlayoutpaper.h" +#include "vlayoutdetail.h" +#include -VLayoutGenerator::VLayoutGenerator() +//--------------------------------------------------------------------------------------------------------------------- +VLayoutGenerator::VLayoutGenerator(QObject *parent) + :QObject(parent), papers(QVector()), bank(new VBank()), paperHeight(0), paperWidth(0), + stopGeneration(false), state(LayoutErrors::NoError) +{} + +//--------------------------------------------------------------------------------------------------------------------- +VLayoutGenerator::~VLayoutGenerator() { + delete bank; } + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutGenerator::SetDetails(const QVector &details) +{ + bank->SetDetails(details); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutGenerator::SetLayoutWidth(qreal width) +{ + bank->SetLayoutWidth(width); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutGenerator::SetCaseType(Cases caseType) +{ + bank->SetCaseType(caseType); +} + +//--------------------------------------------------------------------------------------------------------------------- +int VLayoutGenerator::DetailsCount() +{ + return bank->AllDetailsCount(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutGenerator::Generate() +{ + stopGeneration = false; + papers.clear(); + state = LayoutErrors::NoError; + emit Start(); + + if (bank->Prepare()) + { + CheckDetailsSize(); + do + { + if (stopGeneration) + { + state = LayoutErrors::ProcessStoped; + break; + } + + VLayoutPaper paper(paperHeight, paperWidth); + if (bank->LeftArrange() > 0) + { + const int index = bank->GetTiket(); + if (paper.ArrangeDetail(bank->GetDetail(index))) + { + bank->Arranged(index); + } + else + { + bank->NotArranged(index); + } + } + else + { + if (paper.Count() > 0) + { + papers.append(paper); + } + else + { + state = LayoutErrors::EmptyPaperError; + emit Error(state); + return; + } + } + + } while (bank->AllDetailsCount() > 0); + } + else + { + state = LayoutErrors::PrepareLayoutError; + emit Error(state); + return; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +LayoutErrors VLayoutGenerator::State() const +{ + return state; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutGenerator::Abort() +{ + stopGeneration = true; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutGenerator::CheckDetailsSize() +{ + const QRectF rec = bank->GetBiggestBoundingRect(); + if (rec.width() > paperWidth || rec.height() > paperHeight) + { + state = LayoutErrors::PaperSizeError; + emit Error(state); + stopGeneration = true; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +int VLayoutGenerator::GetPaperWidth() const +{ + return paperWidth; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutGenerator::SetPaperWidth(int value) +{ + paperWidth = value; +} + +//--------------------------------------------------------------------------------------------------------------------- +int VLayoutGenerator::GetPaperHeight() const +{ + return paperHeight; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutGenerator::SetPaperHeight(int value) +{ + paperHeight = value; +} + diff --git a/src/libs/vlayout/vlayoutgenerator.h b/src/libs/vlayout/vlayoutgenerator.h index 191446010..b70fab62e 100644 --- a/src/libs/vlayout/vlayoutgenerator.h +++ b/src/libs/vlayout/vlayoutgenerator.h @@ -29,12 +29,55 @@ #ifndef VLAYOUTGENERATOR_H #define VLAYOUTGENERATOR_H +#include -class VLayoutGenerator +#include "vlayoutdef.h" +#include "vbank.h" + +class VLayoutPaper; +class VLayoutDetail; + +class VLayoutGenerator :public QObject { - + Q_OBJECT public: - VLayoutGenerator(); + VLayoutGenerator(QObject *parent = 0); + virtual ~VLayoutGenerator(); + + void SetDetails(const QVector &details); + void SetLayoutWidth(qreal width); + void SetCaseType(Cases caseType); + int DetailsCount(); + + int GetPaperHeight() const; + void SetPaperHeight(int value); + + int GetPaperWidth() const; + void SetPaperWidth(int value); + + void Generate(); + + LayoutErrors State() const; + +signals: + void Start(); + void Arranged(int count); + void Error(const LayoutErrors &state); + void Finished(); + +public slots: + void Abort(); + +private: + Q_DISABLE_COPY(VLayoutGenerator) + QVector papers; + VBank *bank; + int paperHeight; + int paperWidth; + bool stopGeneration; + LayoutErrors state; + + void CheckDetailsSize(); }; #endif // VLAYOUTGENERATOR_H From 8dec59ef009fb8095362f1a9a7136c4afe017d45 Mon Sep 17 00:00:00 2001 From: dismine Date: Mon, 12 Jan 2015 17:23:25 +0200 Subject: [PATCH 019/186] Also check shift for each edge. --HG-- branch : feature --- src/libs/vlayout/vlayoutgenerator.cpp | 16 +- src/libs/vlayout/vlayoutgenerator.h | 4 + src/libs/vlayout/vlayoutpaper.cpp | 276 ++++++++++++++++++-------- src/libs/vlayout/vlayoutpaper.h | 7 + src/libs/vlayout/vlayoutpaper_p.h | 9 +- 5 files changed, 223 insertions(+), 89 deletions(-) diff --git a/src/libs/vlayout/vlayoutgenerator.cpp b/src/libs/vlayout/vlayoutgenerator.cpp index b4e6782df..396fedabe 100644 --- a/src/libs/vlayout/vlayoutgenerator.cpp +++ b/src/libs/vlayout/vlayoutgenerator.cpp @@ -35,7 +35,7 @@ //--------------------------------------------------------------------------------------------------------------------- VLayoutGenerator::VLayoutGenerator(QObject *parent) :QObject(parent), papers(QVector()), bank(new VBank()), paperHeight(0), paperWidth(0), - stopGeneration(false), state(LayoutErrors::NoError) + stopGeneration(false), state(LayoutErrors::NoError), shift(0) {} //--------------------------------------------------------------------------------------------------------------------- @@ -88,6 +88,7 @@ void VLayoutGenerator::Generate() } VLayoutPaper paper(paperHeight, paperWidth); + paper.SetShift(shift); if (bank->LeftArrange() > 0) { const int index = bank->GetTiket(); @@ -160,6 +161,18 @@ void VLayoutGenerator::SetPaperWidth(int value) paperWidth = value; } +//--------------------------------------------------------------------------------------------------------------------- +unsigned int VLayoutGenerator::GetShift() const +{ + return shift; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutGenerator::SetShift(unsigned int shift) +{ + this->shift = shift; +} + //--------------------------------------------------------------------------------------------------------------------- int VLayoutGenerator::GetPaperHeight() const { @@ -171,4 +184,3 @@ void VLayoutGenerator::SetPaperHeight(int value) { paperHeight = value; } - diff --git a/src/libs/vlayout/vlayoutgenerator.h b/src/libs/vlayout/vlayoutgenerator.h index b70fab62e..8ebfc8d89 100644 --- a/src/libs/vlayout/vlayoutgenerator.h +++ b/src/libs/vlayout/vlayoutgenerator.h @@ -55,6 +55,9 @@ public: int GetPaperWidth() const; void SetPaperWidth(int value); + unsigned int GetShift() const; + void SetShift(unsigned int shift); + void Generate(); LayoutErrors State() const; @@ -76,6 +79,7 @@ private: int paperWidth; bool stopGeneration; LayoutErrors state; + unsigned int shift; void CheckDetailsSize(); }; diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index 7c9fd071b..3119ad74a 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -31,6 +31,7 @@ #include #include +#include class BestResult { @@ -158,6 +159,18 @@ void VLayoutPaper::SetWidth(int width) d->paperWidth = width; } +//--------------------------------------------------------------------------------------------------------------------- +unsigned int VLayoutPaper::GetShift() const +{ + return d->shift; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutPaper::SetShift(unsigned int shift) +{ + d->shift = shift; +} + //--------------------------------------------------------------------------------------------------------------------- bool VLayoutPaper::ArrangeDetail(const VLayoutDetail &detail) { @@ -193,36 +206,31 @@ bool VLayoutPaper::AddToBlankSheet(const VLayoutDetail &detail) { BestResult bestResult; - // We should use copy of the detail. - VLayoutDetail workDetail = detail; - - for (int i=1; i<= detail.EdgesCount(); i++) + for (int j=1; j <= EdgesCount(); ++j) { - int dEdge = i;// For mirror detail edge will be different - if (CheckPosition(workDetail, 1, dEdge)) + // We should use copy of the detail. + VLayoutDetail workDetail = detail; + + for (int i=1; i<= detail.EdgesCount(); i++) { - const QRectF rec = workDetail.BoundingRect(); - if (SheetContains(rec)) + int dEdge = i;// For mirror detail edge will be different + if (CheckPosition(workDetail, j, dEdge)) { - bestResult.NewResult(static_cast(rec.width()*rec.height()), 1, dEdge, workDetail.GetMatrix()); - } - else - { - continue; // Outside of sheet. + const QRectF rec = workDetail.BoundingRect(); + if (SheetContains(rec)) + { + bestResult.NewResult(static_cast(rec.width()*rec.height()), j, dEdge, + workDetail.GetMatrix()); + } + else + { + continue; // Outside of sheet. + } } } } - if (bestResult.ValideResult()) - { - VLayoutDetail workDetail = detail; - workDetail.SetMatrix(bestResult.Matrix());// Don't forget set matrix - d->details.append(workDetail); - // First detail, just simple take all points - d->globalContour = workDetail.GetLayoutAllowencePoints(); - } - - return bestResult.ValideResult(); // Do we have the best result? + return SaveResult(bestResult, detail); } //--------------------------------------------------------------------------------------------------------------------- @@ -256,22 +264,7 @@ bool VLayoutPaper::AddToSheet(const VLayoutDetail &detail) } } - if (bestResult.ValideResult()) - { - VLayoutDetail workDetail = detail; - workDetail.SetMatrix(bestResult.Matrix());// Don't forget set matrix - const QVector newGContour = UniteWithContour(workDetail, bestResult.GContourEdge(), - bestResult.DetailEdge()); - if (newGContour.isEmpty()) - { - return false; - } - d->details.append(workDetail); - // First detail, just simple take all points - d->globalContour = newGContour; - } - - return bestResult.ValideResult(); // Do we have the best result? + return SaveResult(bestResult, detail); } //--------------------------------------------------------------------------------------------------------------------- @@ -483,42 +476,63 @@ void VLayoutPaper::CombineEdges(VLayoutDetail &detail, const QLineF &globalEdge, //--------------------------------------------------------------------------------------------------------------------- QVector VLayoutPaper::UniteWithContour(const VLayoutDetail &detail, int globalI, int detJ) const { + QVector newContour; if (d->globalContour.isEmpty()) { - return detail.GetLayoutAllowencePoints(); - } - - if (globalI <= 0 || globalI > EdgesCount()) - { - return QVector(); - } - - if (detJ <= 0 || detJ > detail.EdgesCount()) - { - return QVector(); - } - - QVector newContour; - for(int i=0; i < d->globalContour.count(); ++i) - { - newContour.append(d->globalContour.at(i)); - ++i; - if (i==globalI) + int processedEdges = 0; + const int nD = detail.EdgesCount(); + int j = detJ+1; + do { - const QVector dPoints = detail.GetLayoutAllowencePoints(); - const int nD = dPoints.count(); - int processedPoints = 0; - int j = detJ; - do + if (j > nD) { - if (j > nD-1) + j=0; + } + const QVector points = CutEdge(detail.Edge(j)); + for (int i = 0; i < points.size()-1; ++i) + { + newContour.append(points.at(i)); + } + ++processedEdges; + ++j; + }while (processedEdges < nD); + } + else + { + if (globalI <= 0 || globalI > EdgesCount()) + { + return QVector(); + } + + if (detJ <= 0 || detJ > detail.EdgesCount()) + { + return QVector(); + } + + for(int i=0; i < d->globalContour.count(); ++i) + { + newContour.append(d->globalContour.at(i)); + ++i; + if (i==globalI) + { + int processedEdges = 0; + const int nD = detail.EdgesCount(); + int j = detJ+1; + do { - j=0; - } - newContour.append(dPoints.at(j)); - ++processedPoints; - ++j; - }while (processedPoints nD) + { + j=0; + } + const QVector points = CutEdge(detail.Edge(j)); + for (int i = 0; i < points.size()-1; ++i) + { + newContour.append(points.at(i)); + } + ++processedEdges; + ++j; + }while (processedEdges < nD); + } } } return newContour; @@ -530,29 +544,73 @@ QLineF VLayoutPaper::GlobalEdge(int i) const if (d->details.isEmpty()) { // Because sheet is blank we have one global edge for all cases - Ox axis. - return QLineF(0, 0, d->paperWidth, 0); - } + const QLineF axis = QLineF(0, 0, d->paperWidth, 0); + if (d->shift == 0) + { + return axis; + } - if (i < 1 || i > EdgesCount()) - { // Doesn't exist such edge - return QLineF(); - } - QLineF edge; - if (i < EdgesCount()) - { - edge = QLineF(d->globalContour.at(i-1), d->globalContour.at(i)); + const int n = qFloor(axis.length()/d->shift); + + if (i < 1 || i > n) + { // Doesn't exist such edge + return QLineF(); + } + + if (n <= 0) + { + return axis; + } + else + { + const qreal nShift = axis.length()/n; + return QLineF(nShift*(i-1), 0, nShift*i, 0); + } } else - { // Closed countour - edge = QLineF(d->globalContour.at(EdgesCount()-1), d->globalContour.at(0)); + { + if (i < 1 || i > EdgesCount()) + { // Doesn't exist such edge + return QLineF(); + } + QLineF edge; + if (i < EdgesCount()) + { + edge = QLineF(d->globalContour.at(i-1), d->globalContour.at(i)); + } + else + { // Closed countour + edge = QLineF(d->globalContour.at(EdgesCount()-1), d->globalContour.at(0)); + } + return edge; } - return edge; } //--------------------------------------------------------------------------------------------------------------------- int VLayoutPaper::EdgesCount() const { - return d->globalContour.count(); + if (d->details.isEmpty()) + { + if (d->shift == 0) + { + return 1; + } + + const QLineF axis = QLineF(0, 0, d->paperWidth, 0); + const int n = qFloor(axis.length()/d->shift); + if (n <= 0) + { + return 1; + } + else + { + return n; + } + } + else + { + return d->globalContour.count(); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -562,3 +620,53 @@ QPolygonF VLayoutPaper::GlobalPolygon() const points.append(points.first()); return QPolygonF(points); } + +//--------------------------------------------------------------------------------------------------------------------- +QVector VLayoutPaper::CutEdge(const QLineF &edge) const +{ + QVector points; + if (d->shift == 0) + { + points.append(edge.p1()); + points.append(edge.p2()); + } + + const int n = qFloor(edge.length()/d->shift); + + if (n <= 0) + { + points.append(edge.p1()); + points.append(edge.p2()); + } + else + { + const qreal nShift = edge.length()/n; + for (int i = 1; i <= n+1; ++i) + { + QLineF l1 = edge; + l1.setLength(nShift*(i-1)); + points.append(l1.p2()); + } + } + return points; +} + +//--------------------------------------------------------------------------------------------------------------------- +bool VLayoutPaper::SaveResult(const BestResult &bestResult, const VLayoutDetail &detail) +{ + if (bestResult.ValideResult()) + { + VLayoutDetail workDetail = detail; + workDetail.SetMatrix(bestResult.Matrix());// Don't forget set matrix + const QVector newGContour = UniteWithContour(workDetail, bestResult.GContourEdge(), + bestResult.DetailEdge()); + if (newGContour.isEmpty()) + { + return false; + } + d->details.append(workDetail); + d->globalContour = newGContour; + } + + return bestResult.ValideResult(); // Do we have the best result? +} diff --git a/src/libs/vlayout/vlayoutpaper.h b/src/libs/vlayout/vlayoutpaper.h index 5e231fc0e..d22682be5 100644 --- a/src/libs/vlayout/vlayoutpaper.h +++ b/src/libs/vlayout/vlayoutpaper.h @@ -36,6 +36,7 @@ class VLayoutDetail; class QPointF; class QLineF; class QPolygonF; +class BestResult; class VLayoutPaper { @@ -52,6 +53,9 @@ public: int GetWidth() const; void SetWidth(int width); + unsigned int GetShift() const; + void SetShift(unsigned int shift); + bool ArrangeDetail(const VLayoutDetail &detail); int Count() const; private: @@ -86,6 +90,9 @@ private: int EdgesCount() const; QPolygonF GlobalPolygon() const; + QVector CutEdge(const QLineF &edge) const; + + bool SaveResult(const BestResult &bestResult, const VLayoutDetail &detail); }; #endif // VLAYOUTPAPER_H diff --git a/src/libs/vlayout/vlayoutpaper_p.h b/src/libs/vlayout/vlayoutpaper_p.h index 3a9e3b23b..523e7aec3 100644 --- a/src/libs/vlayout/vlayoutpaper_p.h +++ b/src/libs/vlayout/vlayoutpaper_p.h @@ -44,16 +44,17 @@ class VLayoutPaperData : public QSharedData { public: VLayoutPaperData() - :details(QVector()), globalContour(QVector()), paperHeight(0), paperWidth(0) + :details(QVector()), globalContour(QVector()), paperHeight(0), paperWidth(0), shift(0) {} VLayoutPaperData(int height, int width) - :details(QVector()), globalContour(QVector()), paperHeight(height), paperWidth(width) + :details(QVector()), globalContour(QVector()), paperHeight(height), paperWidth(width), + shift(0) {} VLayoutPaperData(const VLayoutPaperData &paper) :QSharedData(paper), details(paper.details), globalContour(paper.globalContour), paperHeight(paper.paperHeight), - paperWidth(paper.paperWidth) + paperWidth(paper.paperWidth), shift(paper.shift) {} ~VLayoutPaperData() {} @@ -69,6 +70,8 @@ public: /** @brief paperWidth width of paper in pixels*/ int paperWidth; + + unsigned int shift; }; #ifdef Q_CC_GNU From 789dcea6bcfe002137d41a72b52f722f41967240 Mon Sep 17 00:00:00 2001 From: dismine Date: Mon, 12 Jan 2015 17:59:15 +0200 Subject: [PATCH 020/186] Standard way arrange first detail on paper not always allow find position. For such cases best way is rotate detail around vertex. --HG-- branch : feature --- src/libs/vlayout/vlayoutpaper.cpp | 83 +++++++++++++++++++++++++++---- src/libs/vlayout/vlayoutpaper.h | 17 ++++--- 2 files changed, 85 insertions(+), 15 deletions(-) diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index 3119ad74a..1a9efb9ab 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -208,13 +208,13 @@ bool VLayoutPaper::AddToBlankSheet(const VLayoutDetail &detail) for (int j=1; j <= EdgesCount(); ++j) { - // We should use copy of the detail. - VLayoutDetail workDetail = detail; - for (int i=1; i<= detail.EdgesCount(); i++) { - int dEdge = i;// For mirror detail edge will be different - if (CheckPosition(workDetail, j, dEdge)) + // We should use copy of the detail. + VLayoutDetail workDetail = detail; + + int dEdge = i;// For mirrored detail edge will be different + if (CheckCombineEdges(workDetail, j, dEdge)) { const QRectF rec = workDetail.BoundingRect(); if (SheetContains(rec)) @@ -222,9 +222,21 @@ bool VLayoutPaper::AddToBlankSheet(const VLayoutDetail &detail) bestResult.NewResult(static_cast(rec.width()*rec.height()), j, dEdge, workDetail.GetMatrix()); } - else + } + + for (int angle = 0; angle < 360; ++angle) + { + // We should use copy of the detail. + VLayoutDetail workDetail = detail; + + if (CheckRotationEdges(workDetail, j, i, angle)) { - continue; // Outside of sheet. + const QRectF rec = workDetail.BoundingRect(); + if (SheetContains(rec)) + { + bestResult.NewResult(static_cast(rec.width()*rec.height()), j, i, + workDetail.GetMatrix()); + } } } } @@ -246,7 +258,7 @@ bool VLayoutPaper::AddToSheet(const VLayoutDetail &detail) for (int i=1; i<= workDetail.EdgesCount(); i++) { int dEdge = i;// For mirror detail edge will be different - if (CheckPosition(workDetail, j, dEdge)) + if (CheckCombineEdges(workDetail, j, dEdge)) { if (SheetContains(workDetail.BoundingRect())) { @@ -268,7 +280,7 @@ bool VLayoutPaper::AddToSheet(const VLayoutDetail &detail) } //--------------------------------------------------------------------------------------------------------------------- -bool VLayoutPaper::CheckPosition(VLayoutDetail &detail, int j, int &dEdge) const +bool VLayoutPaper::CheckCombineEdges(VLayoutDetail &detail, int j, int &dEdge) const { const QLineF globalEdge = GlobalEdge(j); bool flagMirror = false; @@ -343,6 +355,43 @@ bool VLayoutPaper::CheckPosition(VLayoutDetail &detail, int j, int &dEdge) const return flagSquare; } +//--------------------------------------------------------------------------------------------------------------------- +bool VLayoutPaper::CheckRotationEdges(VLayoutDetail &detail, int j, int dEdge, int angle) const +{ + const QLineF globalEdge = GlobalEdge(j); + bool flagSquare = false; + + RotateEdges(detail, globalEdge, dEdge, angle); + + switch (Crossing(detail, j, dEdge)) + { + case CrossingType::EdgeError: + return false; + case CrossingType::Intersection: + flagSquare = false; + break; + case CrossingType::NoIntersection: + { + switch (InsideContour(detail, dEdge)) + { + case InsideType::EdgeError: + return false; + case InsideType::Inside: + flagSquare = false; + break; + case InsideType::Outside: + flagSquare = true; + break; + default: + break; + } + } + default: + break; + } + return flagSquare; +} + //--------------------------------------------------------------------------------------------------------------------- VLayoutPaper::CrossingType VLayoutPaper::Crossing(const VLayoutDetail &detail, int globalI, int detailI) const { @@ -473,6 +522,22 @@ void VLayoutPaper::CombineEdges(VLayoutDetail &detail, const QLineF &globalEdge, detail.Rotate(globalEdge.p2(), angle_between); } +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutPaper::RotateEdges(VLayoutDetail &detail, const QLineF &globalEdge, int dEdge, int angle) const +{ + QLineF detailEdge = detail.Edge(dEdge); + + // Find distance between two edges for two begin vertex. + const qreal dx = globalEdge.x2() - detailEdge.x2(); + const qreal dy = globalEdge.y2() - detailEdge.y2(); + + detailEdge.translate(dx, dy); // Use values for translate detail edge. + + // Now we move detail to position near to global contour edge. + detail.Translate(dx, dy); + detail.Rotate(globalEdge.p2(), angle); +} + //--------------------------------------------------------------------------------------------------------------------- QVector VLayoutPaper::UniteWithContour(const VLayoutDetail &detail, int globalI, int detJ) const { diff --git a/src/libs/vlayout/vlayoutpaper.h b/src/libs/vlayout/vlayoutpaper.h index d22682be5..d47fc9543 100644 --- a/src/libs/vlayout/vlayoutpaper.h +++ b/src/libs/vlayout/vlayoutpaper.h @@ -78,12 +78,17 @@ private: bool AddToBlankSheet(const VLayoutDetail &detail); bool AddToSheet(const VLayoutDetail &detail); - bool CheckPosition(VLayoutDetail &detail, int j, int &dEdge) const; - CrossingType Crossing(const VLayoutDetail &detail, int globalI, int detailI) const; - InsideType InsideContour(const VLayoutDetail &detail, int detailI) const; - qreal CheckSide(const QLineF &edge, const QPointF &p) const; - bool SheetContains(const QRectF &rect) const; - void CombineEdges(VLayoutDetail &detail, const QLineF &globalEdge, int dEdge) const; + bool CheckCombineEdges(VLayoutDetail &detail, int j, int &dEdge) const; + bool CheckRotationEdges(VLayoutDetail &detail, int j, int dEdge, int angle) const; + + CrossingType Crossing(const VLayoutDetail &detail, int globalI, int detailI) const; + InsideType InsideContour(const VLayoutDetail &detail, int detailI) const; + qreal CheckSide(const QLineF &edge, const QPointF &p) const; + bool SheetContains(const QRectF &rect) const; + + void CombineEdges(VLayoutDetail &detail, const QLineF &globalEdge, int dEdge) const; + void RotateEdges(VLayoutDetail &detail, const QLineF &globalEdge, int dEdge, int angle) const; + QVector UniteWithContour(const VLayoutDetail &detail, int globalI, int detJ) const; QLineF GlobalEdge(int i) const; From 166f2fbcdb3dbbdaedd2d723d32e16c2e530d356 Mon Sep 17 00:00:00 2001 From: dismine Date: Mon, 12 Jan 2015 22:35:32 +0200 Subject: [PATCH 021/186] Save each frame to png file for debuging creation layout. --HG-- branch : feature --- src/app/mainwindow.cpp | 2 +- src/libs/vlayout/vlayoutdef.h | 8 ++ src/libs/vlayout/vlayoutdetail.cpp | 41 +++++++++ src/libs/vlayout/vlayoutdetail.h | 1 + src/libs/vlayout/vlayoutgenerator.cpp | 11 +++ src/libs/vlayout/vlayoutpaper.cpp | 122 ++++++++++++++++++++++++++ src/libs/vlayout/vlayoutpaper.h | 8 ++ src/libs/vlayout/vlayoutpaper_p.h | 9 +- 8 files changed, 198 insertions(+), 4 deletions(-) diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index 3bf1a2cf4..01097d8de 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -1923,7 +1923,7 @@ void MainWindow::ActionLayout(bool checked) det.SetSeamAllowencePoints(idetail.value().SeamAllowancePoints(pattern)); det.setSeamAllowance(idetail.value().getSeamAllowance()); det.setName(idetail.value().getName()); - det.SetLayoutAllowencePoints(); + det.setWidth(qApp->toPixel(idetail.value().getWidth())); listDetails.append(det); } diff --git a/src/libs/vlayout/vlayoutdef.h b/src/libs/vlayout/vlayoutdef.h index ecadc2977..30f7593ab 100644 --- a/src/libs/vlayout/vlayoutdef.h +++ b/src/libs/vlayout/vlayoutdef.h @@ -40,4 +40,12 @@ enum class LayoutErrors : char EmptyPaperError }; +#define LAYOUT_DEBUG // Enable debug mode + +#ifdef LAYOUT_DEBUG +# define SHOW_VERTICES // Show contour vertices +# define SHOW_DIRECTION // Show contour direction +# define ARRANGED_DETAILS // Show already arranged details +#endif//LAYOUT_DEBUG + #endif // VLAYOUTDEF_H diff --git a/src/libs/vlayout/vlayoutdetail.cpp b/src/libs/vlayout/vlayoutdetail.cpp index 7edee057b..4d427d6ba 100644 --- a/src/libs/vlayout/vlayoutdetail.cpp +++ b/src/libs/vlayout/vlayoutdetail.cpp @@ -29,6 +29,7 @@ #include "vlayoutdetail.h" #include "vlayoutdetail_p.h" +#include #include //--------------------------------------------------------------------------------------------------------------------- @@ -316,3 +317,43 @@ QVector VLayoutDetail::Map(const QVector &points) const } return p; } + +//--------------------------------------------------------------------------------------------------------------------- +QPainterPath VLayoutDetail::ContourPath() const +{ + QPainterPath path; + + // contour + path.moveTo(d->contour[0]); + for (qint32 i = 1; i < d->contour.count(); ++i) + { + path.lineTo(d->contour.at(i)); + } + path.lineTo(d->contour.at(0)); + + // seam allowence + if (getSeamAllowance() == true) + { + QPainterPath ekv; + QVector p; + if (getClosed() == true) + { + p = Equidistant(d->seamAllowence, EquidistantType::CloseEquidistant, getWidth()); + } + else + { + p = Equidistant(d->seamAllowence, EquidistantType::OpenEquidistant, getWidth()); + } + + ekv.moveTo(p.at(0)); + for (qint32 i = 1; i < p.count(); ++i) + { + ekv.lineTo(p.at(i)); + } + + path.addPath(ekv); + path.setFillRule(Qt::WindingFill); + } + + return path; +} diff --git a/src/libs/vlayout/vlayoutdetail.h b/src/libs/vlayout/vlayoutdetail.h index 9021516f5..922f3abfa 100644 --- a/src/libs/vlayout/vlayoutdetail.h +++ b/src/libs/vlayout/vlayoutdetail.h @@ -71,6 +71,7 @@ public: bool isNull() const; qint64 Square() const; + QPainterPath ContourPath() const; private: QSharedDataPointer d; diff --git a/src/libs/vlayout/vlayoutgenerator.cpp b/src/libs/vlayout/vlayoutgenerator.cpp index 396fedabe..d494a09e0 100644 --- a/src/libs/vlayout/vlayoutgenerator.cpp +++ b/src/libs/vlayout/vlayoutgenerator.cpp @@ -31,6 +31,8 @@ #include "vlayoutdetail.h" #include +#include +#include //--------------------------------------------------------------------------------------------------------------------- VLayoutGenerator::VLayoutGenerator(QObject *parent) @@ -74,6 +76,14 @@ void VLayoutGenerator::Generate() stopGeneration = false; papers.clear(); state = LayoutErrors::NoError; + +#ifdef LAYOUT_DEBUG + const QString path = QDir::homePath()+QStringLiteral("/LayoutDebug"); + QDir debugDir(path); + debugDir.removeRecursively(); + debugDir.mkpath(path); +#endif + emit Start(); if (bank->Prepare()) @@ -89,6 +99,7 @@ void VLayoutGenerator::Generate() VLayoutPaper paper(paperHeight, paperWidth); paper.SetShift(shift); + paper.SetPaperIndex(papers.count()); if (bank->LeftArrange() > 0) { const int index = bank->GetTiket(); diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index 1a9efb9ab..6c3b475f0 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -32,6 +32,9 @@ #include #include #include +#include +#include +#include class BestResult { @@ -171,6 +174,12 @@ void VLayoutPaper::SetShift(unsigned int shift) d->shift = shift; } +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutPaper::SetPaperIndex(quint32 index) +{ + d->paperIndex = index; +} + //--------------------------------------------------------------------------------------------------------------------- bool VLayoutPaper::ArrangeDetail(const VLayoutDetail &detail) { @@ -185,6 +194,8 @@ bool VLayoutPaper::ArrangeDetail(const VLayoutDetail &detail) return false;//Not enough edges } + d->frame = 0; + if (Count() == 0) { return AddToBlankSheet(detail); @@ -223,6 +234,7 @@ bool VLayoutPaper::AddToBlankSheet(const VLayoutDetail &detail) workDetail.GetMatrix()); } } + ++d->frame; for (int angle = 0; angle < 360; ++angle) { @@ -238,6 +250,7 @@ bool VLayoutPaper::AddToBlankSheet(const VLayoutDetail &detail) workDetail.GetMatrix()); } } + ++d->frame; } } } @@ -273,6 +286,7 @@ bool VLayoutPaper::AddToSheet(const VLayoutDetail &detail) continue; // Outside of sheet. } } + ++d->frame; } } @@ -288,6 +302,10 @@ bool VLayoutPaper::CheckCombineEdges(VLayoutDetail &detail, int j, int &dEdge) c CombineEdges(detail, globalEdge, dEdge); +#ifdef LAYOUT_DEBUG + DrawDebug(detail); +#endif + switch (Crossing(detail, j, dEdge)) { case CrossingType::EdgeError: @@ -363,6 +381,10 @@ bool VLayoutPaper::CheckRotationEdges(VLayoutDetail &detail, int j, int dEdge, i RotateEdges(detail, globalEdge, dEdge, angle); +#ifdef LAYOUT_DEBUG + DrawDebug(detail); +#endif + switch (Crossing(detail, j, dEdge)) { case CrossingType::EdgeError: @@ -735,3 +757,103 @@ bool VLayoutPaper::SaveResult(const BestResult &bestResult, const VLayoutDetail return bestResult.ValideResult(); // Do we have the best result? } + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutPaper::DrawDebug(const VLayoutDetail &detail) const +{ + QImage frameImage ( d->paperWidth, d->paperHeight, QImage::Format_RGB32 ); + frameImage.fill(Qt::white); + QPainter paint; + paint.setPen(QPen(Qt::black, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); + paint.begin(&frameImage); + + if (d->globalContour.isEmpty()) + { + paint.drawPath(DrawContour(CutEdge(QLineF(0, 0, d->paperWidth, 0)))); + } + else + { + paint.drawPath(DrawContour(d->globalContour)); + } + + paint.setPen(QPen(Qt::darkGreen, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); + paint.drawPath(DrawContour(detail.GetLayoutAllowencePoints())); + +#ifdef ARRANGED_DETAILS + paint.setPen(QPen(Qt::blue, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); + paint.drawPath(DrawDetails()); +#endif + + paint.end(); + const QString path = QDir::homePath()+QStringLiteral("/LayoutDebug/")+QString("%1_%2.png").arg(d->paperIndex) + .arg(d->frame); + frameImage.save (path); +} + +//--------------------------------------------------------------------------------------------------------------------- +QPainterPath VLayoutPaper::ShowDirection(const QLineF &edge) const +{ + QLineF arrow = edge; + arrow.setLength(edge.length()/2.0); + + //Reverse line because we want start arrow from this point + arrow = QLineF(arrow.p2(), arrow.p1()); + const qreal angle = arrow.angle();//we each time change line angle, better save original angle value + arrow.setLength(14);//arrow length in pixels + + QPainterPath path; + arrow.setAngle(angle-35); + path.moveTo(arrow.p1()); + path.lineTo(arrow.p2()); + + arrow.setAngle(angle+35); + path.moveTo(arrow.p1()); + path.lineTo(arrow.p2()); + return path; +} + +//--------------------------------------------------------------------------------------------------------------------- +QPainterPath VLayoutPaper::DrawContour(const QVector &points) const +{ + QPainterPath path; + path.setFillRule(Qt::WindingFill); + if (points.count() >= 2) + { + for (qint32 i = 0; i < points.count()-1; ++i) + { + path.moveTo(points.at(i)); + path.lineTo(points.at(i+1)); + } + path.lineTo(points.at(0)); + +#ifdef SHOW_DIRECTION + for (qint32 i = 0; i < points.count()-1; ++i) + { + path.addPath(ShowDirection(QLineF(points.at(i), points.at(i+1)))); + } +#endif + +#ifdef SHOW_VERTICES + for (qint32 i = 0; i < points.count(); ++i) + { + path.addRect(points.at(i).x()-3, points.at(i).y()-3, 6, 6); + } +#endif + } + return path; +} + +//--------------------------------------------------------------------------------------------------------------------- +QPainterPath VLayoutPaper::DrawDetails() const +{ + QPainterPath path; + path.setFillRule(Qt::WindingFill); + if (Count() > 0) + { + for (int i = 0; i < d->details.size(); ++i) + { + path.addPath(d->details.at(i).ContourPath()); + } + } + return path; +} diff --git a/src/libs/vlayout/vlayoutpaper.h b/src/libs/vlayout/vlayoutpaper.h index d47fc9543..2317839eb 100644 --- a/src/libs/vlayout/vlayoutpaper.h +++ b/src/libs/vlayout/vlayoutpaper.h @@ -37,6 +37,7 @@ class QPointF; class QLineF; class QPolygonF; class BestResult; +class QPainterPath; class VLayoutPaper { @@ -56,6 +57,8 @@ public: unsigned int GetShift() const; void SetShift(unsigned int shift); + void SetPaperIndex(quint32 index); + bool ArrangeDetail(const VLayoutDetail &detail); int Count() const; private: @@ -98,6 +101,11 @@ private: QVector CutEdge(const QLineF &edge) const; bool SaveResult(const BestResult &bestResult, const VLayoutDetail &detail); + + void DrawDebug(const VLayoutDetail &detail) const; + QPainterPath ShowDirection(const QLineF &edge) const; + QPainterPath DrawContour(const QVector &points) const; + QPainterPath DrawDetails() const; }; #endif // VLAYOUTPAPER_H diff --git a/src/libs/vlayout/vlayoutpaper_p.h b/src/libs/vlayout/vlayoutpaper_p.h index 523e7aec3..62e37923c 100644 --- a/src/libs/vlayout/vlayoutpaper_p.h +++ b/src/libs/vlayout/vlayoutpaper_p.h @@ -44,17 +44,18 @@ class VLayoutPaperData : public QSharedData { public: VLayoutPaperData() - :details(QVector()), globalContour(QVector()), paperHeight(0), paperWidth(0), shift(0) + :details(QVector()), globalContour(QVector()), paperHeight(0), paperWidth(0), shift(0), + paperIndex(0), frame(0) {} VLayoutPaperData(int height, int width) :details(QVector()), globalContour(QVector()), paperHeight(height), paperWidth(width), - shift(0) + shift(0), paperIndex(0), frame(0) {} VLayoutPaperData(const VLayoutPaperData &paper) :QSharedData(paper), details(paper.details), globalContour(paper.globalContour), paperHeight(paper.paperHeight), - paperWidth(paper.paperWidth), shift(paper.shift) + paperWidth(paper.paperWidth), shift(paper.shift), paperIndex(paper.paperIndex), frame(paper.frame) {} ~VLayoutPaperData() {} @@ -72,6 +73,8 @@ public: int paperWidth; unsigned int shift; + quint32 paperIndex; + quint32 frame; }; #ifdef Q_CC_GNU From 3ed87757c4f9aebbb01724219108c30d7fc807ba Mon Sep 17 00:00:00 2001 From: dismine Date: Tue, 13 Jan 2015 12:38:51 +0200 Subject: [PATCH 022/186] Return QGraphicsItems with sheet and all details for show on scene. --HG-- branch : feature --- src/libs/vlayout/vlayout.pro | 2 ++ src/libs/vlayout/vlayoutdetail.cpp | 23 +++++++++++++++++------ src/libs/vlayout/vlayoutdetail.h | 2 ++ src/libs/vlayout/vlayoutgenerator.cpp | 12 ++++++++++++ src/libs/vlayout/vlayoutgenerator.h | 4 ++++ src/libs/vlayout/vlayoutpaper.cpp | 15 +++++++++++++++ src/libs/vlayout/vlayoutpaper.h | 3 +++ 7 files changed, 55 insertions(+), 6 deletions(-) diff --git a/src/libs/vlayout/vlayout.pro b/src/libs/vlayout/vlayout.pro index 7cee445cc..4744dd938 100644 --- a/src/libs/vlayout/vlayout.pro +++ b/src/libs/vlayout/vlayout.pro @@ -7,6 +7,8 @@ # File with common stuff for whole project include(../../../Valentina.pri) +QT += core gui widgets + # Name of library TARGET = vlayout diff --git a/src/libs/vlayout/vlayoutdetail.cpp b/src/libs/vlayout/vlayoutdetail.cpp index 4d427d6ba..bbdc0e38c 100644 --- a/src/libs/vlayout/vlayoutdetail.cpp +++ b/src/libs/vlayout/vlayoutdetail.cpp @@ -29,6 +29,7 @@ #include "vlayoutdetail.h" #include "vlayoutdetail_p.h" +#include #include #include @@ -324,25 +325,27 @@ QPainterPath VLayoutDetail::ContourPath() const QPainterPath path; // contour - path.moveTo(d->contour[0]); - for (qint32 i = 1; i < d->contour.count(); ++i) + QVector points = Map(d->contour); + path.moveTo(points.at(0)); + for (qint32 i = 1; i < points.count(); ++i) { - path.lineTo(d->contour.at(i)); + path.lineTo(points.at(i)); } - path.lineTo(d->contour.at(0)); + path.lineTo(points.at(0)); // seam allowence if (getSeamAllowance() == true) { QPainterPath ekv; QVector p; + points = Map(d->seamAllowence); if (getClosed() == true) { - p = Equidistant(d->seamAllowence, EquidistantType::CloseEquidistant, getWidth()); + p = Equidistant(points, EquidistantType::CloseEquidistant, getWidth()); } else { - p = Equidistant(d->seamAllowence, EquidistantType::OpenEquidistant, getWidth()); + p = Equidistant(points, EquidistantType::OpenEquidistant, getWidth()); } ekv.moveTo(p.at(0)); @@ -357,3 +360,11 @@ QPainterPath VLayoutDetail::ContourPath() const return path; } + +//--------------------------------------------------------------------------------------------------------------------- +QGraphicsItem *VLayoutDetail::GetItem() const +{ + QGraphicsPathItem *item = new QGraphicsPathItem(); + item->setPath(ContourPath()); + return item; +} diff --git a/src/libs/vlayout/vlayoutdetail.h b/src/libs/vlayout/vlayoutdetail.h index 922f3abfa..40b7c9632 100644 --- a/src/libs/vlayout/vlayoutdetail.h +++ b/src/libs/vlayout/vlayoutdetail.h @@ -35,6 +35,7 @@ #include class VLayoutDetailData; +class QGraphicsItem; class VLayoutDetail :public VAbstractDetail { @@ -72,6 +73,7 @@ public: bool isNull() const; qint64 Square() const; QPainterPath ContourPath() const; + QGraphicsItem *GetItem() const; private: QSharedDataPointer d; diff --git a/src/libs/vlayout/vlayoutgenerator.cpp b/src/libs/vlayout/vlayoutgenerator.cpp index d494a09e0..f9f20712a 100644 --- a/src/libs/vlayout/vlayoutgenerator.cpp +++ b/src/libs/vlayout/vlayoutgenerator.cpp @@ -33,6 +33,7 @@ #include #include #include +#include //--------------------------------------------------------------------------------------------------------------------- VLayoutGenerator::VLayoutGenerator(QObject *parent) @@ -142,6 +143,17 @@ LayoutErrors VLayoutGenerator::State() const return state; } +//--------------------------------------------------------------------------------------------------------------------- +QList VLayoutGenerator::GetItems() const +{ + QList list; + for (int i=0; i < papers.count(); ++i) + { + list.append(papers.at(i).GetItem()); + } + return list; +} + //--------------------------------------------------------------------------------------------------------------------- void VLayoutGenerator::Abort() { diff --git a/src/libs/vlayout/vlayoutgenerator.h b/src/libs/vlayout/vlayoutgenerator.h index 8ebfc8d89..5146a19ff 100644 --- a/src/libs/vlayout/vlayoutgenerator.h +++ b/src/libs/vlayout/vlayoutgenerator.h @@ -30,12 +30,14 @@ #define VLAYOUTGENERATOR_H #include +#include #include "vlayoutdef.h" #include "vbank.h" class VLayoutPaper; class VLayoutDetail; +class QGraphicsItem; class VLayoutGenerator :public QObject { @@ -62,6 +64,8 @@ public: LayoutErrors State() const; + QList GetItems() const; + signals: void Start(); void Arranged(int count); diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index 6c3b475f0..bb6621b41 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -35,6 +35,7 @@ #include #include #include +#include class BestResult { @@ -857,3 +858,17 @@ QPainterPath VLayoutPaper::DrawDetails() const } return path; } + +//--------------------------------------------------------------------------------------------------------------------- +QGraphicsItem *VLayoutPaper::GetItem() const +{ + QGraphicsRectItem *paper = new QGraphicsRectItem(QRectF(0, 0, d->paperWidth, d->paperHeight)); + paper->setPen(QPen(Qt::black, 1)); + paper->setBrush(QBrush(Qt::white)); + for (int i=0; i < d->details.count(); ++i) + { + QGraphicsItem *item = d->details.at(i).GetItem(); + item->setParentItem(paper); + } + return paper; +} diff --git a/src/libs/vlayout/vlayoutpaper.h b/src/libs/vlayout/vlayoutpaper.h index 2317839eb..81f2b8d39 100644 --- a/src/libs/vlayout/vlayoutpaper.h +++ b/src/libs/vlayout/vlayoutpaper.h @@ -38,6 +38,7 @@ class QLineF; class QPolygonF; class BestResult; class QPainterPath; +class QGraphicsItem; class VLayoutPaper { @@ -61,6 +62,8 @@ public: bool ArrangeDetail(const VLayoutDetail &detail); int Count() const; + QGraphicsItem *GetItem() const; + private: QSharedDataPointer d; From a121845407264c14fb322e79f227d4c6fa2a884a Mon Sep 17 00:00:00 2001 From: dismine Date: Wed, 14 Jan 2015 16:14:51 +0200 Subject: [PATCH 023/186] Dialog layout settings. --HG-- branch : feature --- src/app/core/vapplication.cpp | 48 +-- src/app/dialogs/app/dialoglayoutsettings.cpp | 376 ++++++++++++++++++ src/app/dialogs/app/dialoglayoutsettings.h | 90 +++++ src/app/dialogs/app/dialoglayoutsettings.ui | 343 ++++++++++++++++ src/app/dialogs/dialogs.pri | 9 +- src/app/share/resources/icon.qrc | 3 + .../share/resources/icon/16x16/landscape.png | Bin 0 -> 398 bytes .../share/resources/icon/16x16/portrait.png | Bin 0 -> 536 bytes .../share/resources/icon/16x16/template.png | Bin 0 -> 497 bytes src/app/tablewindow.cpp | 9 + src/app/tablewindow.h | 1 + src/app/tablewindow.ui | 6 + src/app/xml/vabstractmeasurements.cpp | 22 + src/libs/ifc/ifcdef.h | 2 +- src/libs/ifc/xml/vdomdocument.cpp | 16 +- src/libs/ifc/xml/vdomdocument.h | 1 + src/libs/vlayout/vlayoutpaper.cpp | 2 +- 17 files changed, 896 insertions(+), 32 deletions(-) create mode 100644 src/app/dialogs/app/dialoglayoutsettings.cpp create mode 100644 src/app/dialogs/app/dialoglayoutsettings.h create mode 100644 src/app/dialogs/app/dialoglayoutsettings.ui create mode 100644 src/app/share/resources/icon/16x16/landscape.png create mode 100644 src/app/share/resources/icon/16x16/portrait.png create mode 100644 src/app/share/resources/icon/16x16/template.png diff --git a/src/app/core/vapplication.cpp b/src/app/core/vapplication.cpp index 1167308ee..57a6feb96 100644 --- a/src/app/core/vapplication.cpp +++ b/src/app/core/vapplication.cpp @@ -292,22 +292,20 @@ bool VApplication::notify(QObject *receiver, QEvent *event) //--------------------------------------------------------------------------------------------------------------------- double VApplication::toPixel(double val, const Unit &unit) const { - double result = 0; switch (unit) { - case Unit::Mm: - result = (val / 25.4) * PrintDPI; - break; - case Unit::Cm: - result = ((val * 10.0) / 25.4) * PrintDPI; - break; - case Unit::Inch: - result = val * PrintDPI; - break; - default: - break; + case Unit::Mm: + return (val / 25.4) * PrintDPI; + case Unit::Cm: + return ((val * 10.0) / 25.4) * PrintDPI; + case Unit::Inch: + return val * PrintDPI; + case Unit::Px: + return val; + default: + break; } - return result; + return 0; } //--------------------------------------------------------------------------------------------------------------------- @@ -319,22 +317,20 @@ double VApplication::toPixel(double val) const //--------------------------------------------------------------------------------------------------------------------- double VApplication::fromPixel(double pix, const Unit &unit) const { - double result = 0; switch (unit) { - case Unit::Mm: - result = (pix / PrintDPI) * 25.4; - break; - case Unit::Cm: - result = ((pix / PrintDPI) * 25.4) / 10.0; - break; - case Unit::Inch: - result = pix / PrintDPI; - break; - default: - break; + case Unit::Mm: + return (pix / PrintDPI) * 25.4; + case Unit::Cm: + return ((pix / PrintDPI) * 25.4) / 10.0; + case Unit::Inch: + return pix / PrintDPI; + case Unit::Px: + return pix; + default: + break; } - return result; + return 0; } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/app/dialoglayoutsettings.cpp b/src/app/dialogs/app/dialoglayoutsettings.cpp new file mode 100644 index 000000000..a233f6d22 --- /dev/null +++ b/src/app/dialogs/app/dialoglayoutsettings.cpp @@ -0,0 +1,376 @@ +/************************************************************************ + ** + ** @file dialoglayoutsettings.cpp + ** @author Roman Telezhynskyi + ** @date 13 1, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#include "dialoglayoutsettings.h" +#include "ui_dialoglayoutsettings.h" +#include "../../core/vapplication.h" +#include "../../libs/ifc/xml/vdomdocument.h" +#include "../../core/vsettings.h" +#include "../../xml/vabstractmeasurements.h" + +#include + +enum class PaperSizeTemplate : char { A0, A1, A2, A3, A4 }; + +//--------------------------------------------------------------------------------------------------------------------- +DialogLayoutSettings::DialogLayoutSettings(QWidget *parent) + : QDialog(parent), ui(new Ui::DialogLayoutSettings), oldPaperUnit(Unit::Mm), oldLayoutUnit(Unit::Mm) +{ + ui->setupUi(this); + InitPaperUnits(); + InitLayoutUnits(); + InitTemplates(); + + connect(ui->comboBoxTemplates, static_cast(&QComboBox::currentIndexChanged), + this, &DialogLayoutSettings::TemplateSelected); + connect(ui->comboBoxPaperSizeUnit, static_cast(&QComboBox::currentIndexChanged), + this, &DialogLayoutSettings::ConvertPaperSize); + connect(ui->doubleSpinBoxPaperWidth, static_cast(&QDoubleSpinBox::valueChanged), + this, &DialogLayoutSettings::PaperSizeChanged); + connect(ui->doubleSpinBoxPaperHeight, static_cast(&QDoubleSpinBox::valueChanged), + this, &DialogLayoutSettings::PaperSizeChanged); + connect(ui->toolButtonPortrate, &QToolButton::toggled, this, &DialogLayoutSettings::Swap); + connect(ui->toolButtonLandscape, &QToolButton::toggled, this, &DialogLayoutSettings::Swap); + connect(ui->comboBoxLayoutUnit, static_cast(&QComboBox::currentIndexChanged), + this, &DialogLayoutSettings::ConvertLayoutSize); + connect(ui->doubleSpinBoxLayoutWidth, static_cast(&QDoubleSpinBox::valueChanged), + this, &DialogLayoutSettings::LayoutWidthChanged); +} + +//--------------------------------------------------------------------------------------------------------------------- +DialogLayoutSettings::~DialogLayoutSettings() +{ + delete ui; +} + +//--------------------------------------------------------------------------------------------------------------------- +int DialogLayoutSettings::GetPaperHeight() const +{ + return qFloor(VAbstractMeasurements::UnitConvertor(ui->doubleSpinBoxPaperHeight->value(), oldPaperUnit, Unit::Px)); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::SetPaperHeight(int value) +{ + ui->doubleSpinBoxPaperHeight->setValue(VAbstractMeasurements::UnitConvertor(value, Unit::Px, PaperUnit())); +} + +//--------------------------------------------------------------------------------------------------------------------- +int DialogLayoutSettings::GetPaperWidth() const +{ + return qFloor(VAbstractMeasurements::UnitConvertor(ui->doubleSpinBoxPaperWidth->value(), oldPaperUnit, Unit::Px)); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::SetPaperWidth(int value) +{ + ui->doubleSpinBoxPaperWidth->setValue(VAbstractMeasurements::UnitConvertor(value, Unit::Px, PaperUnit())); +} + +//--------------------------------------------------------------------------------------------------------------------- +unsigned int DialogLayoutSettings::GetShift() const +{ + return qFloor(VAbstractMeasurements::UnitConvertor(ui->doubleSpinBoxShift->value(), oldLayoutUnit, Unit::Px)); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::SetShift(unsigned int value) +{ + ui->doubleSpinBoxShift->setValue(VAbstractMeasurements::UnitConvertor(value, Unit::Px, LayoutUnit())); +} + +//--------------------------------------------------------------------------------------------------------------------- +unsigned int DialogLayoutSettings::GetLayoutWidth() const +{ + return qFloor(VAbstractMeasurements::UnitConvertor(ui->doubleSpinBoxLayoutWidth->value(), oldLayoutUnit, Unit::Px)); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::SetLayoutWidth(unsigned int value) +{ + ui->doubleSpinBoxLayoutWidth->setValue(VAbstractMeasurements::UnitConvertor(value, Unit::Px, LayoutUnit())); +} + +//--------------------------------------------------------------------------------------------------------------------- +Cases DialogLayoutSettings::GetGroup() const +{ + if (ui->radioButtonThreeGroups->isChecked()) + { + return Cases::CaseThreeGroup; + } + else if (ui->radioButtonTwoGroups->isChecked()) + { + return Cases::CaseTwoGroup; + } + else + { + return Cases::CaseDesc; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::SetGroup(const Cases &value) +{ + switch (value) + { + case Cases::CaseThreeGroup: + ui->radioButtonThreeGroups->setChecked(true); + break; + case Cases::CaseTwoGroup: + ui->radioButtonTwoGroups->setChecked(true); + break; + case Cases::CaseDesc: + ui->radioButtonDescendingArea->setChecked(true); + break; + default: + ui->radioButtonDescendingArea->setChecked(true); + break; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::TemplateSelected() +{ + const QSizeF size = Template(); + ui->doubleSpinBoxPaperWidth->setValue(size.width()); + ui->doubleSpinBoxPaperHeight->setValue(size.height()); + oldPaperUnit = PaperUnit(); + CorrectDecimals(); + PaperSizeChanged(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::ConvertPaperSize() +{ + const Unit paperUnit = PaperUnit(); + const qreal width = ui->doubleSpinBoxPaperWidth->value(); + const qreal height = ui->doubleSpinBoxPaperHeight->value(); + ui->doubleSpinBoxPaperWidth->setValue(VAbstractMeasurements::UnitConvertor(width, oldPaperUnit, paperUnit)); + ui->doubleSpinBoxPaperHeight->setValue(VAbstractMeasurements::UnitConvertor(height, oldPaperUnit, paperUnit)); + oldPaperUnit = paperUnit; + CorrectDecimals(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::ConvertLayoutSize() +{ + const Unit unit = LayoutUnit(); + const qreal layoutWidth = ui->doubleSpinBoxLayoutWidth->value(); + const qreal shift = ui->doubleSpinBoxShift->value(); + ui->doubleSpinBoxLayoutWidth->setValue(VAbstractMeasurements::UnitConvertor(layoutWidth, oldLayoutUnit, unit)); + ui->doubleSpinBoxShift->setValue(VAbstractMeasurements::UnitConvertor(shift, oldLayoutUnit, unit)); + oldLayoutUnit = unit; +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::PaperSizeChanged() +{ + QDoubleSpinBox *box = qobject_cast(sender()); + if (box != nullptr) + { + if (box->value() <= 0) + { + box->blockSignals(true); + box->setValue(1); + box->blockSignals(false); + } + } + + if (ui->doubleSpinBoxPaperHeight->value() > ui->doubleSpinBoxPaperWidth->value()) + { + ui->toolButtonPortrate->blockSignals(true); + ui->toolButtonPortrate->setChecked(true); + ui->toolButtonPortrate->blockSignals(false); + } + else + { + ui->toolButtonLandscape->blockSignals(true); + ui->toolButtonLandscape->setChecked(true); + ui->toolButtonLandscape->blockSignals(false); + } + + Label(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::LayoutWidthChanged() +{ + QDoubleSpinBox *box = qobject_cast(sender()); + if (box != nullptr) + { + if (box->value() <= 0) + { + box->blockSignals(true); + box->setValue(1); + box->blockSignals(false); + } + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::Swap(bool checked) +{ + if (checked) + { + const qreal width = ui->doubleSpinBoxPaperWidth->value(); + const qreal height = ui->doubleSpinBoxPaperHeight->value(); + + ui->doubleSpinBoxPaperWidth->blockSignals(true); + ui->doubleSpinBoxPaperWidth->setValue(height); + ui->doubleSpinBoxPaperWidth->blockSignals(false); + + ui->doubleSpinBoxPaperHeight->blockSignals(true); + ui->doubleSpinBoxPaperHeight->setValue(width); + ui->doubleSpinBoxPaperHeight->blockSignals(false); + + Label(); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::InitPaperUnits() +{ + ui->comboBoxPaperSizeUnit->addItem(tr("Millimiters"), QVariant(VDomDocument::UnitsToStr(Unit::Mm))); + ui->comboBoxPaperSizeUnit->addItem(tr("Centimeters"), QVariant(VDomDocument::UnitsToStr(Unit::Cm))); + ui->comboBoxPaperSizeUnit->addItem(tr("Inches"), QVariant(VDomDocument::UnitsToStr(Unit::Inch))); + ui->comboBoxPaperSizeUnit->addItem(tr("Pixels"), QVariant(VDomDocument::UnitsToStr(Unit::Px))); + + // set default unit + oldPaperUnit = VDomDocument::StrToUnits(qApp->getSettings()->GetUnit()); + const qint32 indexUnit = ui->comboBoxPaperSizeUnit->findData(qApp->getSettings()->GetUnit()); + if (indexUnit != -1) + { + ui->comboBoxPaperSizeUnit->setCurrentIndex(indexUnit); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::InitLayoutUnits() +{ + ui->comboBoxLayoutUnit->addItem(tr("Centimeters"), QVariant(VDomDocument::UnitsToStr(Unit::Cm))); + ui->comboBoxLayoutUnit->addItem(tr("Millimiters"), QVariant(VDomDocument::UnitsToStr(Unit::Mm))); + ui->comboBoxLayoutUnit->addItem(tr("Inches"), QVariant(VDomDocument::UnitsToStr(Unit::Inch))); + + // set default unit + oldLayoutUnit = VDomDocument::StrToUnits(qApp->getSettings()->GetUnit()); + const qint32 indexUnit = ui->comboBoxLayoutUnit->findData(qApp->getSettings()->GetUnit()); + if (indexUnit != -1) + { + ui->comboBoxLayoutUnit->setCurrentIndex(indexUnit); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::InitTemplates() +{ + const QIcon ico("://icon/16x16/template.png"); + const QString pdi = QString("(%1ppi)").arg(VApplication::PrintDPI); + + ui->comboBoxTemplates->addItem(ico, "A0 "+pdi, QVariant(static_cast(PaperSizeTemplate::A0))); + ui->comboBoxTemplates->addItem(ico, "A1 "+pdi, QVariant(static_cast(PaperSizeTemplate::A1))); + ui->comboBoxTemplates->addItem(ico, "A2 "+pdi, QVariant(static_cast(PaperSizeTemplate::A2))); + ui->comboBoxTemplates->addItem(ico, "A3 "+pdi, QVariant(static_cast(PaperSizeTemplate::A3))); + ui->comboBoxTemplates->addItem(ico, "A4 "+pdi, QVariant(static_cast(PaperSizeTemplate::A4))); + + TemplateSelected(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QSizeF DialogLayoutSettings::Template() +{ + const PaperSizeTemplate temp = static_cast(ui->comboBoxTemplates->currentData().toInt()); + const Unit paperUnit = PaperUnit(); + + qreal width = 0; + qreal height = 0; + + switch(temp) + { + case PaperSizeTemplate::A0: + width = VAbstractMeasurements::UnitConvertor(841, Unit::Mm, paperUnit); + height = VAbstractMeasurements::UnitConvertor(1189, Unit::Mm, paperUnit); + return QSizeF(width, height); + case PaperSizeTemplate::A1: + width = VAbstractMeasurements::UnitConvertor(594, Unit::Mm, paperUnit); + height = VAbstractMeasurements::UnitConvertor(841, Unit::Mm, paperUnit); + return QSizeF(width, height); + case PaperSizeTemplate::A2: + width = VAbstractMeasurements::UnitConvertor(420, Unit::Mm, paperUnit); + height = VAbstractMeasurements::UnitConvertor(594, Unit::Mm, paperUnit); + return QSizeF(width, height); + case PaperSizeTemplate::A3: + width = VAbstractMeasurements::UnitConvertor(297, Unit::Mm, paperUnit); + height = VAbstractMeasurements::UnitConvertor(420, Unit::Mm, paperUnit); + return QSizeF(width, height); + case PaperSizeTemplate::A4: + width = VAbstractMeasurements::UnitConvertor(210, Unit::Mm, paperUnit); + height = VAbstractMeasurements::UnitConvertor(297, Unit::Mm, paperUnit); + return QSizeF(width, height); + default: + break; + } + return QSizeF(); +} + +//--------------------------------------------------------------------------------------------------------------------- +Unit DialogLayoutSettings::PaperUnit() const +{ + return VDomDocument::StrToUnits(ui->comboBoxPaperSizeUnit->currentData().toString()); +} + +//--------------------------------------------------------------------------------------------------------------------- +Unit DialogLayoutSettings::LayoutUnit() const +{ + return VDomDocument::StrToUnits(ui->comboBoxLayoutUnit->currentData().toString()); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::CorrectDecimals() +{ + if (oldPaperUnit == Unit::Px) + { + ui->doubleSpinBoxPaperWidth->setDecimals(0); + ui->doubleSpinBoxPaperHeight->setDecimals(0); + } + else + { + ui->doubleSpinBoxPaperWidth->setDecimals(2); + ui->doubleSpinBoxPaperHeight->setDecimals(2); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::Label() +{ + const int width = qFloor(VAbstractMeasurements::UnitConvertor(ui->doubleSpinBoxPaperWidth->value(), PaperUnit(), + Unit::Px)); + const int height = qFloor(VAbstractMeasurements::UnitConvertor(ui->doubleSpinBoxPaperHeight->value(), + PaperUnit(), Unit::Px)); + QString text = QString("%1 x %2 px, \n%3 ppi").arg(width).arg(height).arg(VApplication::PrintDPI); + ui->labelSizeDescription->setText(text); +} diff --git a/src/app/dialogs/app/dialoglayoutsettings.h b/src/app/dialogs/app/dialoglayoutsettings.h new file mode 100644 index 000000000..abed1ac3d --- /dev/null +++ b/src/app/dialogs/app/dialoglayoutsettings.h @@ -0,0 +1,90 @@ +/************************************************************************ + ** + ** @file dialoglayoutsettings.h + ** @author Roman Telezhynskyi + ** @date 13 1, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef DIALOGLAYOUTSETTINGS_H +#define DIALOGLAYOUTSETTINGS_H + +#include + +#include "../../libs/vlayout/vbank.h" +#include "../../libs/ifc/ifcdef.h" + +namespace Ui +{ + class DialogLayoutSettings; +} + +class DialogLayoutSettings : public QDialog +{ + Q_OBJECT +public: + explicit DialogLayoutSettings(QWidget *parent = 0); + ~DialogLayoutSettings(); + + int GetPaperHeight() const; + void SetPaperHeight(int value); + + int GetPaperWidth() const; + void SetPaperWidth(int value); + + unsigned int GetShift() const; + void SetShift(unsigned int value); + + unsigned int GetLayoutWidth() const; + void SetLayoutWidth(unsigned int value); + + Cases GetGroup() const; + void SetGroup(const Cases &value); + +public slots: + void TemplateSelected(); + void ConvertPaperSize(); + void ConvertLayoutSize(); + void PaperSizeChanged(); + void LayoutWidthChanged(); + void Swap(bool checked); + +private: + Q_DISABLE_COPY(DialogLayoutSettings) + Ui::DialogLayoutSettings *ui; + Unit oldPaperUnit; + Unit oldLayoutUnit; + + void InitPaperUnits(); + void InitLayoutUnits(); + void InitTemplates(); + QSizeF Template(); + + Unit PaperUnit() const; + Unit LayoutUnit() const; + + void CorrectDecimals(); + void Label(); +}; + +#endif // DIALOGLAYOUTSETTINGS_H diff --git a/src/app/dialogs/app/dialoglayoutsettings.ui b/src/app/dialogs/app/dialoglayoutsettings.ui new file mode 100644 index 000000000..fdc4d829e --- /dev/null +++ b/src/app/dialogs/app/dialoglayoutsettings.ui @@ -0,0 +1,343 @@ + + + DialogLayoutSettings + + + + 0 + 0 + 659 + 273 + + + + Creation a layout + + + + + + + + Paper size + + + + + + 6 + + + + + + 0 + 0 + + + + Templates: + + + + + + + + + + + + + + + 0 + 0 + + + + + 124 + 0 + + + + + + + + + 0 + 0 + + + + Width: + + + + + + + + 0 + 0 + + + + Height: + + + + + + + + 94 + 0 + + + + 2 + + + 99999.000000000000000 + + + + + + + + 94 + 0 + + + + 2 + + + 99999.990000000005239 + + + + + + + TextLabel + + + + + + + + + ... + + + + :/icon/16x16/portrait.png:/icon/16x16/portrait.png + + + true + + + true + + + true + + + buttonGroup + + + + + + + ... + + + + :/icon/16x16/landscape.png:/icon/16x16/landscape.png + + + true + + + false + + + true + + + buttonGroup + + + + + + + + + + + + + + Creation options + + + + + + + + 0.000000000000000 + + + 99999.990000000005239 + + + 1.000000000000000 + + + + + + + Layout width: + + + + + + + Shift length: + + + + + + + 99999.990000000005239 + + + 10.000000000000000 + + + + + + + + + + + + Principle of choosing the next workpiece + + + + + + + + Three groups: big, middle, small + + + buttonGroupPrinciple + + + + + + + Two groups: big, small + + + false + + + buttonGroupPrinciple + + + + + + + Descending area + + + true + + + buttonGroupPrinciple + + + + + + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + + + buttonBox + accepted() + DialogLayoutSettings + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + DialogLayoutSettings + reject() + + + 316 + 260 + + + 286 + 274 + + + + + + + + + diff --git a/src/app/dialogs/dialogs.pri b/src/app/dialogs/dialogs.pri index 8201e7386..cfb7025cf 100644 --- a/src/app/dialogs/dialogs.pri +++ b/src/app/dialogs/dialogs.pri @@ -41,7 +41,8 @@ HEADERS += \ $$PWD/app/configpages/communitypage.h \ $$PWD/app/configpages/pathpage.h \ $$PWD/app/dialogundo.h \ - $$PWD/tools/dialogcurveintersectaxis.h + $$PWD/tools/dialogcurveintersectaxis.h \ + $$PWD/app/dialoglayoutsettings.h SOURCES += \ $$PWD/tools/dialogtriangle.cpp \ @@ -81,7 +82,8 @@ SOURCES += \ $$PWD/app/configpages/communitypage.cpp \ $$PWD/app/configpages/pathpage.cpp \ $$PWD/app/dialogundo.cpp \ - $$PWD/tools/dialogcurveintersectaxis.cpp + $$PWD/tools/dialogcurveintersectaxis.cpp \ + $$PWD/app/dialoglayoutsettings.cpp FORMS += \ $$PWD/tools/dialogtriangle.ui \ @@ -115,4 +117,5 @@ FORMS += \ $$PWD/app/dialogaboutapp.ui \ $$PWD/app/dialogpatternxmledit.ui \ $$PWD/app/dialogundo.ui \ - $$PWD/tools/dialogcurveintersectaxis.ui + $$PWD/tools/dialogcurveintersectaxis.ui \ + $$PWD/app/dialoglayoutsettings.ui diff --git a/src/app/share/resources/icon.qrc b/src/app/share/resources/icon.qrc index 073e985a0..329cd555f 100644 --- a/src/app/share/resources/icon.qrc +++ b/src/app/share/resources/icon.qrc @@ -52,5 +52,8 @@ icon/32x32/line_intersect_axis.png icon/32x32/arc_intersect_axis.png icon/32x32/curve_intersect_axis.png + icon/16x16/landscape.png + icon/16x16/portrait.png + icon/16x16/template.png diff --git a/src/app/share/resources/icon/16x16/landscape.png b/src/app/share/resources/icon/16x16/landscape.png new file mode 100644 index 0000000000000000000000000000000000000000..a30d3b0caadf33e8be7019a42e081c93e0669d88 GIT binary patch literal 398 zcmV;90df9`P)IvXr1igWgJ7 zCn(?|@!0@Xp&v&8MEwv&$@6?&@Ecx9`jxRC?(WOl*#?&vs>;FsAz${Bm)Df}e77n{ zhUc~L`^OuT$%LopM~;t9u$jem-OaD?Gqc%@R;xvpW!TKp-f44nJp$;K6ZpPgE6DSl s>2!*<7NCT~AR0IQ3*9h?#{7$X19wGrh9+5Q{{R3007*qoM6N<$f?nRE{Qv*} literal 0 HcmV?d00001 diff --git a/src/app/share/resources/icon/16x16/portrait.png b/src/app/share/resources/icon/16x16/portrait.png new file mode 100644 index 0000000000000000000000000000000000000000..75fbbab49b90c1fd1db188d8ad2dcd5d7e36599c GIT binary patch literal 536 zcmV+z0_XjSP)WFU8GbZ8({Xk{QrNlj4iWF>9@00DeSL_t(I%axJAN*hrW zhChuYV5-JSR@qD%-=do?bg6EFE)@C!tBbP)p?ZPfg5;r@s7f1JaaVW`hlw{pkZT0c7ccJrcIbt@_&FP^nlt+g6Oky>lD z>Q=PsR@TO|v*RWVLxLb6=mvDVUBX_-pZj|*uP*RAJ_q}U0N3M?1VB|$RRl#;QBjJY ziu8Itvh!K|j?doiSAgqLW-b8`MG;hiCzt{svWwIkzloxVe!rhsKLHROhC6?KYQIh~ zrj6q`Y;J53MSargG>Z#MTwY!9>I${mDXmtEIDX{ep~cyGlYBl;CX*qT%T1nO1Tbxr zXll0&AD34EC=?1zyn>3LsyI$D(e&I;1jy3_+vOcfrBza?6s6KC+vT120Y+*x>lot^ z$1%ouG@AA40G{y>k>OM#c*dI!Fc=IH-dZ~mF!#UW$&a7BR|&xL6HNoSb&tP)nId;P a`uqcwYu5((6+Hw10000sVX>dc&(Z~k*;MgXd{${ujVdR-nLog6OAR%;c#O7{Et$+@iZ1D2> zM&q&mbLcV$j^hvxhZzh8D5dChIwTSaQYnk=Ei2$)p$A%PY}+Otk7HRDrfHH+r-??R z03?&i)d0gVyc-Y^T-U`g45rg*puD93fNrf02q(QUObshyxuHR0MP680MJ@9pU-Kx+stM&FJG_M7XX2GP%f7P$wHy9 na_k4}pPirn #include "../../libs/vobj/vobjpaintdevice.h" +#include "../dialogs/app/dialoglayoutsettings.h" #ifdef Q_OS_WIN # define PDFTOPS "pdftops.exe" @@ -79,6 +80,7 @@ TableWindow::TableWindow(QWidget *parent) connect(ui->actionAdd, &QAction::triggered, this, &TableWindow::AddLength); connect(ui->actionRemove, &QAction::triggered, this, &TableWindow::RemoveLength); connect(ui->view, &VTableGraphicsView::itemChect, this, &TableWindow::itemChect); + connect(ui->actionLayout, &QAction::triggered, this, &TableWindow::Layout); } //--------------------------------------------------------------------------------------------------------------------- @@ -510,6 +512,13 @@ void TableWindow::RemoveLength() } } +//--------------------------------------------------------------------------------------------------------------------- +void TableWindow::Layout() +{ + DialogLayoutSettings layout(this); + layout.exec(); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief keyPressEvent handle key press events. diff --git a/src/app/tablewindow.h b/src/app/tablewindow.h index b820f9928..effc1fb48 100644 --- a/src/app/tablewindow.h +++ b/src/app/tablewindow.h @@ -74,6 +74,7 @@ public slots: void AddLength(); void RemoveLength(); + void Layout(); signals: /** * @brief closed emit if window is closing. diff --git a/src/app/tablewindow.ui b/src/app/tablewindow.ui index 8f237a1d5..327eebf44 100644 --- a/src/app/tablewindow.ui +++ b/src/app/tablewindow.ui @@ -70,6 +70,7 @@ + @@ -200,6 +201,11 @@ Zoom Out + + + Layout + + diff --git a/src/app/xml/vabstractmeasurements.cpp b/src/app/xml/vabstractmeasurements.cpp index fbf3339b7..4a6189fc1 100644 --- a/src/app/xml/vabstractmeasurements.cpp +++ b/src/app/xml/vabstractmeasurements.cpp @@ -27,6 +27,7 @@ *************************************************************************/ #include "vabstractmeasurements.h" +#include "../core/vapplication.h" const QString VAbstractMeasurements::TagUnit = QStringLiteral("unit"); const QString VAbstractMeasurements::AttrValue = QStringLiteral("value"); @@ -214,6 +215,8 @@ qreal VAbstractMeasurements::UnitConvertor(qreal value, const Unit &from, const return value / 10.0; case Unit::Inch: return value / 25.4; + case Unit::Px: + return (value / 25.4) * VApplication::PrintDPI; default: break; } @@ -227,6 +230,8 @@ qreal VAbstractMeasurements::UnitConvertor(qreal value, const Unit &from, const return value; case Unit::Inch: return value / 2.54; + case Unit::Px: + return ((value * 10.0) / 25.4) * VApplication::PrintDPI; default: break; } @@ -240,6 +245,23 @@ qreal VAbstractMeasurements::UnitConvertor(qreal value, const Unit &from, const return value * 2.54; case Unit::Inch: return value; + case Unit::Px: + return value * VApplication::PrintDPI; + default: + break; + } + break; + case Unit::Px: + switch (to) + { + case Unit::Mm: + return (value / VApplication::PrintDPI) * 25.4; + case Unit::Cm: + return ((value / VApplication::PrintDPI) * 25.4) / 10.0; + case Unit::Inch: + return value / VApplication::PrintDPI; + case Unit::Px: + return value; default: break; } diff --git a/src/libs/ifc/ifcdef.h b/src/libs/ifc/ifcdef.h index 616772c5f..4ca03fff6 100644 --- a/src/libs/ifc/ifcdef.h +++ b/src/libs/ifc/ifcdef.h @@ -36,7 +36,7 @@ extern Q_CORE_EXPORT int qt_ntfs_permission_lookup; #endif /*Q_OS_WIN32*/ -enum class Unit : char { Mm, Cm, Inch }; +enum class Unit : char { Mm, Cm, Inch, Px }; enum class MeasurementsType : char { Standard, Individual }; static const quint32 null_id = 0; diff --git a/src/libs/ifc/xml/vdomdocument.cpp b/src/libs/ifc/xml/vdomdocument.cpp index 0f29fb26f..40480bf0f 100644 --- a/src/libs/ifc/xml/vdomdocument.cpp +++ b/src/libs/ifc/xml/vdomdocument.cpp @@ -96,6 +96,7 @@ const QString VDomDocument::AttrUnit = QStringLiteral("unit"); const QString VDomDocument::UnitMM = QStringLiteral("mm"); const QString VDomDocument::UnitCM = QStringLiteral("cm"); const QString VDomDocument::UnitINCH = QStringLiteral("inch"); +const QString VDomDocument::UnitPX = QStringLiteral("px"); const QString VDomDocument::TagVersion = QStringLiteral("version"); //--------------------------------------------------------------------------------------------------------------------- @@ -499,7 +500,7 @@ void VDomDocument::setXMLContent(const QString &fileName) //--------------------------------------------------------------------------------------------------------------------- Unit VDomDocument::StrToUnits(const QString &unit) { - QStringList units = QStringList() << UnitMM << UnitCM << UnitINCH; + QStringList units = QStringList() << UnitMM << UnitCM << UnitINCH << UnitPX; Unit result = Unit::Cm; switch (units.indexOf(unit)) { @@ -512,6 +513,9 @@ Unit VDomDocument::StrToUnits(const QString &unit) case 2:// inch result = Unit::Inch; break; + case 3:// px + result = Unit::Px; + break; default: result = Unit::Cm; break; @@ -563,6 +567,16 @@ QString VDomDocument::UnitsToStr(const Unit &unit, const bool translate) result = UnitINCH; } break; + case Unit::Px: + if (translate) + { + result = QObject::tr("px"); + } + else + { + result = UnitPX; + } + break; default: if (translate) { diff --git a/src/libs/ifc/xml/vdomdocument.h b/src/libs/ifc/xml/vdomdocument.h index ac2d5029a..633c33b74 100644 --- a/src/libs/ifc/xml/vdomdocument.h +++ b/src/libs/ifc/xml/vdomdocument.h @@ -73,6 +73,7 @@ public: static const QString UnitMM; static const QString UnitCM; static const QString UnitINCH; + static const QString UnitPX; static const QString TagVersion; /** * @param data container with variables diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index bb6621b41..a8b177b58 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -235,7 +235,7 @@ bool VLayoutPaper::AddToBlankSheet(const VLayoutDetail &detail) workDetail.GetMatrix()); } } - ++d->frame; + d->frame = d->frame + 2; for (int angle = 0; angle < 360; ++angle) { From f6380cf7398c9c5d6ec943d7849230d3981a088b Mon Sep 17 00:00:00 2001 From: dismine Date: Wed, 14 Jan 2015 19:52:16 +0200 Subject: [PATCH 024/186] Dialog for showing progress of creation. --HG-- branch : feature --- src/app/dialogs/app/dialoglayoutprogress.cpp | 106 +++++++++++++++++++ src/app/dialogs/app/dialoglayoutprogress.h | 64 +++++++++++ src/app/dialogs/app/dialoglayoutprogress.ui | 66 ++++++++++++ src/app/dialogs/dialogs.pri | 9 +- 4 files changed, 242 insertions(+), 3 deletions(-) create mode 100644 src/app/dialogs/app/dialoglayoutprogress.cpp create mode 100644 src/app/dialogs/app/dialoglayoutprogress.h create mode 100644 src/app/dialogs/app/dialoglayoutprogress.ui diff --git a/src/app/dialogs/app/dialoglayoutprogress.cpp b/src/app/dialogs/app/dialoglayoutprogress.cpp new file mode 100644 index 000000000..670cd90fd --- /dev/null +++ b/src/app/dialogs/app/dialoglayoutprogress.cpp @@ -0,0 +1,106 @@ +/************************************************************************ + ** + ** @file dialoglayoutprogress.cpp + ** @author Roman Telezhynskyi + ** @date 14 1, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#include "dialoglayoutprogress.h" +#include "ui_dialoglayoutprogress.h" +#include "../options.h" + +#include + +//--------------------------------------------------------------------------------------------------------------------- +DialogLayoutProgress::DialogLayoutProgress(int count, QWidget *parent) + :QDialog(parent), ui(new Ui::DialogLayoutProgress) +{ + ui->setupUi(this); + ui->progressBar->setMaximum(count); + ui->progressBar->setValue(0); + + QPushButton *bCancel = ui->buttonBox->button(QDialogButtonBox::Cancel); + SCASSERT(bCancel != nullptr); + connect(bCancel, &QPushButton::clicked, this, &DialogLayoutProgress::StopWorking); + setModal(true); +} + +//--------------------------------------------------------------------------------------------------------------------- +DialogLayoutProgress::~DialogLayoutProgress() +{ + delete ui; +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutProgress::Start() +{ + show(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutProgress::Arranged(int count) +{ + ui->progressBar->setValue(count); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutProgress::Error(const LayoutErrors &state) +{ + QString text; + switch(state) + { + case LayoutErrors::NoError: + return; + case LayoutErrors::PrepareLayoutError: + text = tr("Couldn't prepare data for creation layout"); + QMessageBox::critical(this, tr("Critical error"), text, QMessageBox::Ok, QMessageBox::Ok); + break; + case LayoutErrors::PaperSizeError: + text = tr("Wrong paper size"); + QMessageBox::critical(this, tr("Critical error"), text, QMessageBox::Ok, QMessageBox::Ok); + break; + case LayoutErrors::ProcessStoped: + break; + case LayoutErrors::EmptyPaperError: + text = tr("Several workpieces left not arranged, but none of them match for paper"); + QMessageBox::critical(this, tr("Critical error"), text, QMessageBox::Ok, QMessageBox::Ok); + break; + default: + break; + } + + done(QDialog::Rejected); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutProgress::Finished() +{ + done(QDialog::Accepted); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutProgress::StopWorking() +{ + emit Abort(); +} diff --git a/src/app/dialogs/app/dialoglayoutprogress.h b/src/app/dialogs/app/dialoglayoutprogress.h new file mode 100644 index 000000000..f2deb93fb --- /dev/null +++ b/src/app/dialogs/app/dialoglayoutprogress.h @@ -0,0 +1,64 @@ +/************************************************************************ + ** + ** @file dialoglayoutprogress.h + ** @author Roman Telezhynskyi + ** @date 14 1, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef DIALOGLAYOUTPROGRESS_H +#define DIALOGLAYOUTPROGRESS_H + +#include + +#include "../../libs/vlayout/vlayoutdef.h" + +namespace Ui +{ + class DialogLayoutProgress; +} + +class DialogLayoutProgress : public QDialog +{ + Q_OBJECT + +public: + explicit DialogLayoutProgress(int count, QWidget *parent = 0); + ~DialogLayoutProgress(); + +signals: + void Abort(); + +public slots: + void Start(); + void Arranged(int count); + void Error(const LayoutErrors &state); + void Finished(); + void StopWorking(); + +private: + Q_DISABLE_COPY(DialogLayoutProgress) + Ui::DialogLayoutProgress *ui; +}; + +#endif // DIALOGLAYOUTPROGRESS_H diff --git a/src/app/dialogs/app/dialoglayoutprogress.ui b/src/app/dialogs/app/dialoglayoutprogress.ui new file mode 100644 index 000000000..f2e02ea51 --- /dev/null +++ b/src/app/dialogs/app/dialoglayoutprogress.ui @@ -0,0 +1,66 @@ + + + DialogLayoutProgress + + + Qt::ApplicationModal + + + + 0 + 0 + 566 + 119 + + + + Creation a layout + + + + :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png + + + true + + + + + + + 0 + 0 + + + + <html><head/><body><p>Finding best position for worpieces. Please, waite.</p></body></html> + + + + + + + + 0 + 0 + + + + 24 + + + + + + + QDialogButtonBox::Cancel + + + + + + + + + + diff --git a/src/app/dialogs/dialogs.pri b/src/app/dialogs/dialogs.pri index cfb7025cf..ce99dd510 100644 --- a/src/app/dialogs/dialogs.pri +++ b/src/app/dialogs/dialogs.pri @@ -42,7 +42,8 @@ HEADERS += \ $$PWD/app/configpages/pathpage.h \ $$PWD/app/dialogundo.h \ $$PWD/tools/dialogcurveintersectaxis.h \ - $$PWD/app/dialoglayoutsettings.h + $$PWD/app/dialoglayoutsettings.h \ + $$PWD/app/dialoglayoutprogress.h SOURCES += \ $$PWD/tools/dialogtriangle.cpp \ @@ -83,7 +84,8 @@ SOURCES += \ $$PWD/app/configpages/pathpage.cpp \ $$PWD/app/dialogundo.cpp \ $$PWD/tools/dialogcurveintersectaxis.cpp \ - $$PWD/app/dialoglayoutsettings.cpp + $$PWD/app/dialoglayoutsettings.cpp \ + $$PWD/app/dialoglayoutprogress.cpp FORMS += \ $$PWD/tools/dialogtriangle.ui \ @@ -118,4 +120,5 @@ FORMS += \ $$PWD/app/dialogpatternxmledit.ui \ $$PWD/app/dialogundo.ui \ $$PWD/tools/dialogcurveintersectaxis.ui \ - $$PWD/app/dialoglayoutsettings.ui + $$PWD/app/dialoglayoutsettings.ui \ + $$PWD/app/dialoglayoutprogress.ui From 79325fe91f371703d6c555e04a77ed90d8884805 Mon Sep 17 00:00:00 2001 From: dismine Date: Thu, 15 Jan 2015 15:10:05 +0200 Subject: [PATCH 025/186] Changes for table widows. All prepare for begin testing. --HG-- branch : feature --- src/app/tablewindow.cpp | 758 ++++++++++---------------- src/app/tablewindow.h | 91 +--- src/app/tablewindow.ui | 55 +- src/libs/vlayout/vlayoutgenerator.cpp | 1 + 4 files changed, 367 insertions(+), 538 deletions(-) diff --git a/src/app/tablewindow.cpp b/src/app/tablewindow.cpp index c48726fae..78371a773 100644 --- a/src/app/tablewindow.cpp +++ b/src/app/tablewindow.cpp @@ -29,12 +29,16 @@ #include "tablewindow.h" #include "ui_tablewindow.h" #include "widgets/vtablegraphicsview.h" -#include -#include #include "core/vapplication.h" -#include #include "../../libs/vobj/vobjpaintdevice.h" #include "../dialogs/app/dialoglayoutsettings.h" +#include "../../libs/vlayout/vlayoutgenerator.h" +#include "../dialogs/app/dialoglayoutprogress.h" + +#include +#include +#include +#include #ifdef Q_OS_WIN # define PDFTOPS "pdftops.exe" @@ -48,98 +52,36 @@ * @param parent parent widget. */ TableWindow::TableWindow(QWidget *parent) - :QMainWindow(parent), numberDetal(nullptr), colission(nullptr), ui(new Ui::TableWindow), - listDetails(QVector()), outItems(false), collidingItems(false), tableScene(nullptr), - paper(nullptr), shadowPaper(nullptr), listOutItems(nullptr), listCollidingItems(QList()), - indexDetail(0), sceneRect(QRectF()), fileName(QString()), description(QString()) + :QMainWindow(parent), ui(new Ui::TableWindow), + listDetails(QVector()), papers(QList()), shadows(QList()), + scenes(QList()), fileName(QString()), description(QString()), paperHeight(0), paperWidth(0), + shift(0), layoutWidth(0), group(Cases::CaseDesc), tempScene(nullptr) { ui->setupUi(this); - numberDetal = new QLabel(tr("0 details left."), this); - colission = new QLabel(tr("Collisions not found."), this); - ui->statusBar->addWidget(numberDetal); - ui->statusBar->addWidget(colission); - outItems = collidingItems = false; - sceneRect = QRectF(0, 0, qApp->toPixel(823, Unit::Mm), qApp->toPixel(1171, Unit::Mm)); - tableScene = new QGraphicsScene(sceneRect); + tempScene = new QGraphicsScene(QRectF(0, 0, qApp->toPixel(823, Unit::Mm), qApp->toPixel(1171, Unit::Mm))); QBrush brush; brush.setStyle( Qt::SolidPattern ); brush.setColor( QColor( Qt::gray ) ); - tableScene->setBackgroundBrush( brush ); + tempScene->setBackgroundBrush( brush ); - ui->view->setScene(tableScene); + ui->view->setScene(tempScene); ui->view->fitInView(ui->view->scene()->sceneRect(), Qt::KeepAspectRatio); ui->horizontalLayout->addWidget(ui->view); - connect(tableScene, &QGraphicsScene::selectionChanged, ui->view, &VTableGraphicsView::selectionChanged); - connect(ui->actionTurn, &QAction::triggered, ui->view, &VTableGraphicsView::rotateItems); - connect(ui->actionMirror, &QAction::triggered, ui->view, &VTableGraphicsView::MirrorItem); - connect(ui->actionZoomIn, &QAction::triggered, ui->view, &VTableGraphicsView::ZoomIn); - connect(ui->actionZoomOut, &QAction::triggered, ui->view, &VTableGraphicsView::ZoomOut); + //connect(ui->actionZoomIn, &QAction::triggered, ui->view, &VTableGraphicsView::ZoomIn); + //connect(ui->actionZoomOut, &QAction::triggered, ui->view, &VTableGraphicsView::ZoomOut); connect(ui->actionStop, &QAction::triggered, this, &TableWindow::StopTable); - connect(ui->actionSave, &QAction::triggered, this, &TableWindow::saveScene); - connect(ui->actionNext, &QAction::triggered, this, &TableWindow::GetNextDetail); - connect(ui->actionAdd, &QAction::triggered, this, &TableWindow::AddLength); - connect(ui->actionRemove, &QAction::triggered, this, &TableWindow::RemoveLength); - connect(ui->view, &VTableGraphicsView::itemChect, this, &TableWindow::itemChect); + //connect(ui->actionSave, &QAction::triggered, this, &TableWindow::saveScene); connect(ui->actionLayout, &QAction::triggered, this, &TableWindow::Layout); + connect(ui->listWidget, &QListWidget::currentRowChanged, this, &TableWindow::ShowPaper); } //--------------------------------------------------------------------------------------------------------------------- TableWindow::~TableWindow() { - delete tableScene; + ClearLayout(); delete ui; } -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief AddPaper add to the scene paper and shadow. - */ -void TableWindow::AddPaper() -{ - qreal x1, y1, x2, y2; - sceneRect.getCoords(&x1, &y1, &x2, &y2); - shadowPaper = new QGraphicsRectItem(QRectF(x1+4, y1+4, x2+4, y2+4)); - shadowPaper->setBrush(QBrush(Qt::black)); - tableScene->addItem(shadowPaper); - paper = new QGraphicsRectItem(QRectF(x1, y1, x2, y2)); - paper->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()))); - paper->setBrush(QBrush(Qt::white)); - tableScene->addItem(paper); - qDebug()<rect().size().toSize(); -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief AddDetail show on scene next detail. - */ -void TableWindow::AddDetail() -{ -// if (indexDetailclearSelection(); -// VItem* Detail = listDetails[indexDetail]; -// SCASSERT(Detail != nullptr); -// connect(Detail, &VItem::itemOut, this, &TableWindow::itemOut); -// connect(Detail, &VItem::itemColliding, this, &TableWindow::itemColliding); -// connect(this, &TableWindow::LengthChanged, Detail, &VItem::LengthChanged); -// Detail->setPen(QPen(Qt::black, 1)); -// Detail->setBrush(QBrush(Qt::white)); -// Detail->setPos(paper->boundingRect().center()); -// Detail->setFlag(QGraphicsItem::ItemIsMovable, true); -// Detail->setFlag(QGraphicsItem::ItemIsSelectable, true); -// Detail->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); -// Detail->setPaper(paper); -// tableScene->addItem(Detail); -// Detail->setSelected(true); -// indexDetail++; -// if (indexDetail==listDetails.count()) -// { -// ui->actionSave->setEnabled(true); -// } -// } -// numberDetal->setText(QString(tr("%1 details left.")).arg(listDetails.count()-indexDetail)); -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief ModelChosen show window when user want create new layout. @@ -166,10 +108,6 @@ void TableWindow::ModelChosen(QVector listDetails, const QString this->fileName = fi.baseName(); this->listDetails = listDetails; - listOutItems = new QBitArray(this->listDetails.count()); - AddPaper(); - indexDetail = 0; - AddDetail(); show(); } @@ -214,11 +152,7 @@ void TableWindow::showEvent ( QShowEvent * event ) void TableWindow::StopTable() { hide(); - tableScene->clear(); - delete listOutItems; - listDetails.clear(); - sceneRect = QRectF(0, 0, qApp->toPixel(823, Unit::Mm), qApp->toPixel(1171, Unit::Mm)); - tableScene->setSceneRect(sceneRect); + ClearLayout(); emit closed(); } @@ -228,313 +162,160 @@ void TableWindow::StopTable() */ void TableWindow::saveScene() { - QMap extByMessage; - extByMessage[ tr("Svg files (*.svg)") ] = ".svg"; - extByMessage[ tr("PDF files (*.pdf)") ] = ".pdf"; - extByMessage[ tr("Images (*.png)") ] = ".png"; - extByMessage[ tr("Wavefront OBJ (*.obj)") ] = ".obj"; +// QMap extByMessage; +// extByMessage[ tr("Svg files (*.svg)") ] = ".svg"; +// extByMessage[ tr("PDF files (*.pdf)") ] = ".pdf"; +// extByMessage[ tr("Images (*.png)") ] = ".png"; +// extByMessage[ tr("Wavefront OBJ (*.obj)") ] = ".obj"; - QProcess proc; - proc.start(PDFTOPS); - if (proc.waitForFinished(15000)) - { - extByMessage[ tr("PS files (*.ps)") ] = ".ps"; - extByMessage[ tr("EPS files (*.eps)") ] = ".eps"; - } - else - { - qWarning()< i(extByMessage); - while (i.hasNext()) - { - i.next(); - saveMessage += i.key(); - if (i.hasNext()) - { - saveMessage += ";;"; - } - } - - QString sf; - // the save function - QString dir = QDir::homePath()+"/"+fileName; - QString name = QFileDialog::getSaveFileName(this, tr("Save layout"), dir, saveMessage, &sf); - - if (name.isEmpty()) - { - return; - } - - // what if the user did not specify a suffix...? - QString suf = extByMessage.value(sf); - suf.replace(".", ""); - QFileInfo f( name ); - if (f.suffix().isEmpty() || f.suffix() != suf) - { - name += extByMessage.value(sf); - } - - QBrush *brush = new QBrush(); - brush->setColor( QColor( Qt::white ) ); - tableScene->setBackgroundBrush( *brush ); - tableScene->clearSelection(); // Selections would also render to the file, so need delete them - shadowPaper->setVisible(false); - paper->setPen(QPen(Qt::white, 0.1, Qt::NoPen)); - QFileInfo fi( name ); - QStringList suffix = QStringList() << "svg" << "png" << "pdf" << "eps" << "ps" << "obj"; - switch (suffix.indexOf(fi.suffix())) - { - case 0: //svg - paper->setVisible(false); - SvgFile(name); - paper->setVisible(true); - break; - case 1: //png - PngFile(name); - break; - case 2: //pdf - PdfFile(name); - break; - case 3: //eps - EpsFile(name); - break; - case 4: //ps - PsFile(name); - break; - case 5: //obj - paper->setVisible(false); - ObjFile(name); - paper->setVisible(true); - break; - default: - qDebug() << "Can't recognize file suffix. File file "<setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()))); - brush->setColor( QColor( Qt::gray ) ); - brush->setStyle( Qt::SolidPattern ); - tableScene->setBackgroundBrush( *brush ); - shadowPaper->setVisible(true); - delete brush; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief itemChect turn off rotation button if don't selected detail. - * @param flag true - enable button. - */ -void TableWindow::itemChect(bool flag) -{ - ui->actionTurn->setDisabled(flag); - ui->actionMirror->setDisabled(flag); -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief checkNext disable next detail button if exist colission or out details. - */ -void TableWindow::checkNext() -{ - if (outItems == true && collidingItems == true) - { - colission->setText(tr("Collisions not found.")); - if (indexDetail==listDetails.count()) - { - ui->actionSave->setEnabled(true); - ui->actionNext->setDisabled(true); - } - else - { - ui->actionNext->setDisabled(false); - ui->actionSave->setEnabled(false); - } - } - else - { - colission->setText(tr("Collisions found.")); - ui->actionNext->setDisabled(true); - ui->actionSave->setEnabled(false); - } -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief itemOut handled if detail moved out paper sheet. - * @param number Number detail in list. - * @param flag set state of detail. True if detail moved out paper sheet. - */ -void TableWindow::itemOut(int number, bool flag) -{ - listOutItems->setBit(number, flag); - for ( int i = 0; i < listOutItems->count(); ++i ) - { - if (listOutItems->at(i)==true) - { - outItems=false; - qDebug()<<"itemOut::outItems="< list, int number) -{ - //qDebug()<<"number="< i(extByMessage); +// while (i.hasNext()) +// { +// i.next(); +// saveMessage += i.key(); +// if (i.hasNext()) // { -// if (listCollidingItems.contains(list.at(0))==true) -// { -// listCollidingItems.removeAt(listCollidingItems.indexOf(list.at(0))); -// if (listCollidingItems.size()>1) -// { -// for ( int i = 0; i < listCollidingItems.count(); ++i ) -// { -// QList lis = listCollidingItems.at(i)->collidingItems(); -// if (lis.size()-2 <= 0) -// { -// VItem * bitem = qgraphicsitem_cast ( listCollidingItems.at(i) ); -// SCASSERT(bitem != nullptr); -// bitem->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()))); -// listCollidingItems.removeAt(i); -// } -// } -// } -// else if (listCollidingItems.size()==1) -// { -// VItem * bitem = qgraphicsitem_cast ( listCollidingItems.at(0) ); -// SCASSERT(bitem != nullptr); -// bitem->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()))); -// listCollidingItems.clear(); -// collidingItems = true; -// } -// } -// else -// { -// collidingItems = true; -// } -// } -// else -// { -// collidingItems = true; +// saveMessage += ";;"; // } // } -// else if (number==1) + +// QString sf; +// // the save function +// QString dir = QDir::homePath()+"/"+fileName; +// QString name = QFileDialog::getSaveFileName(this, tr("Save layout"), dir, saveMessage, &sf); + +// if (name.isEmpty()) // { -// if (list.contains(paper)==true) -// { -// list.removeAt(list.indexOf(paper)); -// } -// if (list.contains(shadowPaper)==true) -// { -// list.removeAt(list.indexOf(shadowPaper)); -// } -// for ( int i = 0; i < list.count(); ++i ) -// { -// if (listCollidingItems.contains(list.at(i))==false) -// { -// listCollidingItems.append(list.at(i)); -// } -// } -// collidingItems = false; +// return; // } -// qDebug()<<"itemColliding::outItems="<setColor( QColor( Qt::white ) ); +// tableScene->setBackgroundBrush( *brush ); +// tableScene->clearSelection(); // Selections would also render to the file, so need delete them +// shadowPaper->setVisible(false); +// paper->setPen(QPen(Qt::white, 0.1, Qt::NoPen)); +// QFileInfo fi( name ); +// QStringList suffix = QStringList() << "svg" << "png" << "pdf" << "eps" << "ps" << "obj"; +// switch (suffix.indexOf(fi.suffix())) +// { +// case 0: //svg +// paper->setVisible(false); +// SvgFile(name); +// paper->setVisible(true); +// break; +// case 1: //png +// PngFile(name); +// break; +// case 2: //pdf +// PdfFile(name); +// break; +// case 3: //eps +// EpsFile(name); +// break; +// case 4: //ps +// PsFile(name); +// break; +// case 5: //obj +// paper->setVisible(false); +// ObjFile(name); +// paper->setVisible(true); +// break; +// default: +// qDebug() << "Can't recognize file suffix. File file "<setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()))); +// brush->setColor( QColor( Qt::gray ) ); +// brush->setStyle( Qt::SolidPattern ); +// tableScene->setBackgroundBrush( *brush ); +// shadowPaper->setVisible(true); +// delete brush; } -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief GetNextDetail put next detail on table. - */ -void TableWindow::GetNextDetail() +void TableWindow::ShowPaper(int index) { - AddDetail(); -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief AddLength Add length paper sheet.Збільшує довжину листа на певне значення за один раз. - */ -void TableWindow::AddLength() -{ - QRectF rect = tableScene->sceneRect(); - rect.setHeight(rect.height()+qApp->toPixel(279, Unit::Mm)); - tableScene->setSceneRect(rect); - rect = shadowPaper->rect(); - rect.setHeight(rect.height()+qApp->toPixel(279, Unit::Mm)); - shadowPaper->setRect(rect); - rect = paper->rect(); - rect.setHeight(rect.height()+qApp->toPixel(279, Unit::Mm)); - paper->setRect(rect); - ui->actionRemove->setEnabled(true); - emit LengthChanged(); -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief RemoveLength reduce the length of paper sheet. You can reduce to the minimal value only. - */ -void TableWindow::RemoveLength() -{ - if (sceneRect.height() <= tableScene->sceneRect().height() - 100) + if (index < 0 || index > scenes.size()) { - QRectF rect = tableScene->sceneRect(); - rect.setHeight(rect.height()-qApp->toPixel(279, Unit::Mm)); - tableScene->setSceneRect(rect); - rect = shadowPaper->rect(); - rect.setHeight(rect.height()-qApp->toPixel(279, Unit::Mm)); - shadowPaper->setRect(rect); - rect = paper->rect(); - rect.setHeight(rect.height()-qApp->toPixel(279, Unit::Mm)); - paper->setRect(rect); - if (fabs(sceneRect.height() - tableScene->sceneRect().height()) < 0.01) - { - ui->actionRemove->setDisabled(true); - } - emit LengthChanged(); - } - else - { - ui->actionRemove->setDisabled(true); + ui->view->setScene(tempScene); } + + ui->view->setScene(scenes.at(index)); } //--------------------------------------------------------------------------------------------------------------------- void TableWindow::Layout() { DialogLayoutSettings layout(this); - layout.exec(); -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief keyPressEvent handle key press events. - * @param event key event. - */ -void TableWindow::keyPressEvent ( QKeyEvent * event ) -{ - if ( event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return ) + if (paperHeight != 0) { - if (ui->actionNext->isEnabled() == true ) - { - AddDetail(); - qDebug()<<"Added detail."; - } + layout.SetPaperHeight(paperHeight); + layout.SetPaperWidth(paperWidth); + layout.SetLayoutWidth(layoutWidth); + layout.SetShift(shift); + layout.SetGroup(group); + } + + if (layout.exec() == QDialog::Rejected) + { + return; + } + + paperHeight = layout.GetPaperHeight(); + paperWidth = layout.GetPaperWidth(); + shift = layout.GetShift(); + layoutWidth = layout.GetLayoutWidth(); + group = layout.GetGroup(); + + VLayoutGenerator lGenerator(this); + lGenerator.SetDetails(listDetails); + lGenerator.SetLayoutWidth(layoutWidth); + lGenerator.SetCaseType(group); + lGenerator.SetPaperHeight(paperHeight); + lGenerator.SetPaperWidth(paperWidth); + lGenerator.SetShift(shift); + + DialogLayoutProgress progress(lGenerator.DetailsCount(), this); + + connect(&lGenerator, &VLayoutGenerator::Start, &progress, &DialogLayoutProgress::Start); + connect(&lGenerator, &VLayoutGenerator::Arranged, &progress, &DialogLayoutProgress::Arranged); + connect(&lGenerator, &VLayoutGenerator::Error, &progress, &DialogLayoutProgress::Error); + connect(&lGenerator, &VLayoutGenerator::Finished, &progress, &DialogLayoutProgress::Finished); + connect(&progress, &DialogLayoutProgress::Abort, &lGenerator, &VLayoutGenerator::Abort); + + lGenerator.Generate(); + + if (lGenerator.State() == LayoutErrors::NoError) + { + ClearLayout(); + papers = lGenerator.GetItems(); + CreateShadows(); + CreateScenes(); + // Create previews + PrepareSceneList(); } - QMainWindow::keyPressEvent ( event ); } //--------------------------------------------------------------------------------------------------------------------- @@ -544,21 +325,21 @@ void TableWindow::keyPressEvent ( QKeyEvent * event ) */ void TableWindow::SvgFile(const QString &name) const { - QSvgGenerator generator; - generator.setFileName(name); - generator.setSize(paper->rect().size().toSize()); - generator.setViewBox(paper->rect()); - generator.setTitle("Valentina pattern"); - generator.setDescription(description); - generator.setResolution(static_cast(qApp->PrintDPI)); - QPainter painter; - painter.begin(&generator); - painter.setFont( QFont( "Arial", 8, QFont::Normal ) ); - painter.setRenderHint(QPainter::Antialiasing, true); - painter.setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine()), Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); - painter.setBrush ( QBrush ( Qt::NoBrush ) ); - tableScene->render(&painter); - painter.end(); +// QSvgGenerator generator; +// generator.setFileName(name); +// generator.setSize(paper->rect().size().toSize()); +// generator.setViewBox(paper->rect()); +// generator.setTitle("Valentina pattern"); +// generator.setDescription(description); +// generator.setResolution(static_cast(qApp->PrintDPI)); +// QPainter painter; +// painter.begin(&generator); +// painter.setFont( QFont( "Arial", 8, QFont::Normal ) ); +// painter.setRenderHint(QPainter::Antialiasing, true); +// painter.setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine()), Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); +// painter.setBrush ( QBrush ( Qt::NoBrush ) ); +// tableScene->render(&painter); +// painter.end(); } //--------------------------------------------------------------------------------------------------------------------- @@ -568,19 +349,19 @@ void TableWindow::SvgFile(const QString &name) const */ void TableWindow::PngFile(const QString &name) const { - QRectF r = paper->rect(); - qreal x=0, y=0, w=0, h=0; - r.getRect(&x, &y, &w, &h);// Re-shrink the scene to it's bounding contents - // Create the image with the exact size of the shrunk scene - QImage image(QSize(static_cast(w), static_cast(h)), QImage::Format_ARGB32); - image.fill(Qt::transparent); // Start all pixels transparent - QPainter painter(&image); - painter.setFont( QFont( "Arial", 8, QFont::Normal ) ); - painter.setRenderHint(QPainter::Antialiasing, true); - painter.setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()), Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); - painter.setBrush ( QBrush ( Qt::NoBrush ) ); - tableScene->render(&painter); - image.save(name); +// QRectF r = paper->rect(); +// qreal x=0, y=0, w=0, h=0; +// r.getRect(&x, &y, &w, &h);// Re-shrink the scene to it's bounding contents +// // Create the image with the exact size of the shrunk scene +// QImage image(QSize(static_cast(w), static_cast(h)), QImage::Format_ARGB32); +// image.fill(Qt::transparent); // Start all pixels transparent +// QPainter painter(&image); +// painter.setFont( QFont( "Arial", 8, QFont::Normal ) ); +// painter.setRenderHint(QPainter::Antialiasing, true); +// painter.setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()), Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); +// painter.setBrush ( QBrush ( Qt::NoBrush ) ); +// tableScene->render(&painter); +// image.save(name); } //--------------------------------------------------------------------------------------------------------------------- @@ -590,26 +371,26 @@ void TableWindow::PngFile(const QString &name) const */ void TableWindow::PdfFile(const QString &name) const { - QPrinter printer; - printer.setOutputFormat(QPrinter::PdfFormat); - printer.setOutputFileName(name); - QRectF r = paper->rect(); - qreal x=0, y=0, w=0, h=0; - r.getRect(&x, &y, &w, &h);// Re-shrink the scene to it's bounding contents - printer.setResolution(static_cast(qApp->PrintDPI)); - printer.setPaperSize ( QSizeF(qApp->fromPixel(w, Unit::Mm), qApp->fromPixel(h, Unit::Mm)), QPrinter::Millimeter ); - QPainter painter; - if (painter.begin( &printer ) == false) - { // failed to open file - qCritical("Can't open printer %s", qPrintable(name)); - return; - } - painter.setFont( QFont( "Arial", 8, QFont::Normal ) ); - painter.setRenderHint(QPainter::Antialiasing, true); - painter.setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()), Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); - painter.setBrush ( QBrush ( Qt::NoBrush ) ); - tableScene->render(&painter); - painter.end(); +// QPrinter printer; +// printer.setOutputFormat(QPrinter::PdfFormat); +// printer.setOutputFileName(name); +// QRectF r = paper->rect(); +// qreal x=0, y=0, w=0, h=0; +// r.getRect(&x, &y, &w, &h);// Re-shrink the scene to it's bounding contents +// printer.setResolution(static_cast(qApp->PrintDPI)); +// printer.setPaperSize ( QSizeF(qApp->fromPixel(w, Unit::Mm), qApp->fromPixel(h, Unit::Mm)), QPrinter::Millimeter ); +// QPainter painter; +// if (painter.begin( &printer ) == false) +// { // failed to open file +// qCritical("Can't open printer %s", qPrintable(name)); +// return; +// } +// painter.setFont( QFont( "Arial", 8, QFont::Normal ) ); +// painter.setRenderHint(QPainter::Antialiasing, true); +// painter.setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()), Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); +// painter.setBrush ( QBrush ( Qt::NoBrush ) ); +// tableScene->render(&painter); +// painter.end(); } //--------------------------------------------------------------------------------------------------------------------- @@ -619,13 +400,13 @@ void TableWindow::PdfFile(const QString &name) const */ void TableWindow::EpsFile(const QString &name) const { - QTemporaryFile tmp; - if (tmp.open()) - { - PdfFile(tmp.fileName()); - QStringList params = QStringList() << "-eps" << tmp.fileName() << name; - PdfToPs(params); - } +// QTemporaryFile tmp; +// if (tmp.open()) +// { +// PdfFile(tmp.fileName()); +// QStringList params = QStringList() << "-eps" << tmp.fileName() << name; +// PdfToPs(params); +// } } //--------------------------------------------------------------------------------------------------------------------- @@ -635,13 +416,13 @@ void TableWindow::EpsFile(const QString &name) const */ void TableWindow::PsFile(const QString &name) const { - QTemporaryFile tmp; - if (tmp.open()) - { - PdfFile(tmp.fileName()); - QStringList params = QStringList() << tmp.fileName() << name; - PdfToPs(params); - } +// QTemporaryFile tmp; +// if (tmp.open()) +// { +// PdfFile(tmp.fileName()); +// QStringList params = QStringList() << tmp.fileName() << name; +// PdfToPs(params); +// } } //--------------------------------------------------------------------------------------------------------------------- @@ -652,34 +433,93 @@ void TableWindow::PsFile(const QString &name) const */ void TableWindow::PdfToPs(const QStringList ¶ms) const { -#ifndef QT_NO_CURSOR - QApplication::setOverrideCursor(Qt::WaitCursor); -#endif - QProcess proc; - proc.start(PDFTOPS, params); - proc.waitForFinished(15000); -#ifndef QT_NO_CURSOR - QApplication::restoreOverrideCursor(); -#endif +//#ifndef QT_NO_CURSOR +// QApplication::setOverrideCursor(Qt::WaitCursor); +//#endif +// QProcess proc; +// proc.start(PDFTOPS, params); +// proc.waitForFinished(15000); +//#ifndef QT_NO_CURSOR +// QApplication::restoreOverrideCursor(); +//#endif - QFile f(params.last()); - if (f.exists() == false) - { - QString msg = QString(tr("Creating file '%1' failed! %2")).arg(params.last()).arg(proc.errorString()); - QMessageBox msgBox(QMessageBox::Critical, tr("Critical error!"), msg, QMessageBox::Ok | QMessageBox::Default); - msgBox.exec(); - } +// QFile f(params.last()); +// if (f.exists() == false) +// { +// QString msg = QString(tr("Creating file '%1' failed! %2")).arg(params.last()).arg(proc.errorString()); +// QMessageBox msgBox(QMessageBox::Critical, tr("Critical error!"), msg, QMessageBox::Ok | QMessageBox::Default); +// msgBox.exec(); +// } } //--------------------------------------------------------------------------------------------------------------------- void TableWindow::ObjFile(const QString &name) const { - VObjPaintDevice generator; - generator.setFileName(name); - generator.setSize(paper->rect().size().toSize()); - generator.setResolution(static_cast(qApp->PrintDPI)); - QPainter painter; - painter.begin(&generator); - tableScene->render(&painter); - painter.end(); +// VObjPaintDevice generator; +// generator.setFileName(name); +// generator.setSize(paper->rect().size().toSize()); +// generator.setResolution(static_cast(qApp->PrintDPI)); +// QPainter painter; +// painter.begin(&generator); +// tableScene->render(&painter); +// painter.end(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void TableWindow::ClearLayout() +{ + qDeleteAll (scenes); + scenes.clear(); + listDetails.clear(); + shadows.clear(); + papers.clear(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void TableWindow::CreateShadows() +{ + for (int i=0; i< papers.size(); ++i) + { + qreal x1=0, y1=0, x2=0, y2=0; + QGraphicsRectItem *item = qgraphicsitem_cast(papers.at(i)); + if (item) + { + item->rect().getCoords(&x1, &y1, &x2, &y2); + QGraphicsRectItem *shadowPaper = new QGraphicsRectItem(QRectF(x1+4, y1+4, x2+4, y2+4)); + shadowPaper->setBrush(QBrush(Qt::black)); + shadows.append(shadowPaper); + } + else + { + shadows.append(nullptr); + } + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void TableWindow::CreateScenes() +{ + QBrush brush; + brush.setStyle( Qt::SolidPattern ); + brush.setColor( QColor( Qt::gray ) ); + + for (int i=0; isetBackgroundBrush(brush); + scene->addItem(shadows.at(i)); + scene->addItem(papers.at(i)); + scenes.append(scene); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void TableWindow::PrepareSceneList() +{ + const QIcon ico("://icon/64x64/icon64x64.png"); + for (int i=0; ilistWidget->addItem(item); + } } diff --git a/src/app/tablewindow.h b/src/app/tablewindow.h index effc1fb48..071561ba8 100644 --- a/src/app/tablewindow.h +++ b/src/app/tablewindow.h @@ -33,12 +33,15 @@ #include #include "../../libs/vlayout/vlayoutdetail.h" +#include "../../libs/vlayout/vbank.h" namespace Ui { class TableWindow; } +class QGraphicsScene; + /** * @brief TableWindow class layout window. */ @@ -46,87 +49,37 @@ class TableWindow : public QMainWindow { Q_OBJECT public: - /** @brief numberDetal show count details, what need placed. */ - QLabel* numberDetal; - - /** @brief colission show if exist colissions. */ - QLabel* colission; - explicit TableWindow(QWidget *parent = nullptr); ~TableWindow(); -public slots: +public slots: void ModelChosen(QVector listDetails, const QString &fileName, const QString &description); - - void StopTable(); - - void saveScene(); - - void GetNextDetail(); - - void itemChect(bool flag); - - void itemOut(int number, bool flag); - - void itemColliding(QList list, int number); - - void AddLength(); - - void RemoveLength(); void Layout(); + void StopTable(); + void saveScene(); + void ShowPaper(int index); + signals: - /** - * @brief closed emit if window is closing. - */ + /** @brief closed emit if window is closing. */ void closed(); - /** - * @brief LengthChanged emit if changing length of paper sheet. - */ - void LengthChanged(); + protected: - void closeEvent(QCloseEvent *event); - void moveToCenter(); - void showEvent ( QShowEvent * event ); - void keyPressEvent ( QKeyEvent * event ); private: Q_DISABLE_COPY(TableWindow) /** @brief ui keeps information about user interface */ Ui::TableWindow* ui; /** @brief listDetails list of details. */ - QVector listDetails; + QVector listDetails; - /** @brief outItems true if we have details out paper sheet. */ - bool outItems; - - /** @brief collidingItems true if we have colission details. */ - bool collidingItems; - - /** @brief currentScene pointer to scene. */ - QGraphicsScene* tableScene; - - /** @brief paper paper sheet. */ - QGraphicsRectItem* paper; - - /** @brief shadowPaper paper sheet shadow. */ - QGraphicsRectItem* shadowPaper; - - /** @brief listOutItems list state out each detail. */ - QBitArray* listOutItems; - - /** @brief listCollidingItems list colissed details. */ - QList listCollidingItems; - - /** @brief indexDetail index next detail in list what will be shown. */ - qint32 indexDetail; - - /** @brief sceneRect minimal size of a paper. */ - QRectF sceneRect; + QList papers; + QList shadows; + QList scenes; /** @brief fileName keep name of pattern file. */ QString fileName; @@ -134,9 +87,14 @@ private: /** @brief description pattern description */ QString description; - void checkNext(); - void AddPaper(); - void AddDetail(); + int paperHeight; + int paperWidth; + unsigned int shift; + qreal layoutWidth; + Cases group; + + QGraphicsScene* tempScene; + void SvgFile(const QString &name)const; void PngFile(const QString &name)const; void PdfFile(const QString &name)const; @@ -144,6 +102,11 @@ private: void PsFile(const QString &name)const; void PdfToPs(const QStringList ¶ms)const; void ObjFile(const QString &name)const; + + void ClearLayout(); + void CreateShadows(); + void CreateScenes(); + void PrepareSceneList(); }; #endif // TABLEWINDOW_H diff --git a/src/app/tablewindow.ui b/src/app/tablewindow.ui index 327eebf44..03c642d21 100644 --- a/src/app/tablewindow.ui +++ b/src/app/tablewindow.ui @@ -22,21 +22,6 @@ - - QLayout::SetMinAndMaxSize - - - 9 - - - 9 - - - 9 - - - 9 - @@ -73,6 +58,46 @@ + + + QDockWidget::DockWidgetMovable + + + Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea + + + Pages + + + 1 + + + + + + + + 200 + 200 + + + + QListView::Static + + + QListView::TopToBottom + + + true + + + QListView::IconMode + + + + + + false diff --git a/src/libs/vlayout/vlayoutgenerator.cpp b/src/libs/vlayout/vlayoutgenerator.cpp index f9f20712a..45c161c98 100644 --- a/src/libs/vlayout/vlayoutgenerator.cpp +++ b/src/libs/vlayout/vlayoutgenerator.cpp @@ -135,6 +135,7 @@ void VLayoutGenerator::Generate() emit Error(state); return; } + emit Finished(); } //--------------------------------------------------------------------------------------------------------------------- From 00e42b436877bd5404ffd33bf8e93a67eaf34614 Mon Sep 17 00:00:00 2001 From: dismine Date: Thu, 15 Jan 2015 16:24:37 +0200 Subject: [PATCH 026/186] Fixed broken seam allowence. --HG-- branch : feature --- src/libs/vlayout/vabstractdetail.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/libs/vlayout/vabstractdetail.cpp b/src/libs/vlayout/vabstractdetail.cpp index 6df4a9176..89bdddc8b 100644 --- a/src/libs/vlayout/vabstractdetail.cpp +++ b/src/libs/vlayout/vabstractdetail.cpp @@ -191,34 +191,32 @@ QVector VAbstractDetail::Equidistant(const QVector &points, co if (eqv == EquidistantType::CloseEquidistant) { - p.append(points.at(0)); + p.append(p.at(0)); } - for (qint32 i = 0; i < points.size(); ++i ) + for (qint32 i = 0; i < p.size(); ++i ) { if ( i == 0 && eqv == EquidistantType::CloseEquidistant) {//first point, polyline closed - ekvPoints< Date: Thu, 15 Jan 2015 19:31:42 +0200 Subject: [PATCH 027/186] Dialog must do not allow values smaller than 1 pixel. --HG-- branch : feature --- src/app/dialogs/app/dialoglayoutsettings.cpp | 100 ++++++++++++------- src/app/dialogs/app/dialoglayoutsettings.h | 10 +- src/app/dialogs/app/dialoglayoutsettings.ui | 14 ++- 3 files changed, 83 insertions(+), 41 deletions(-) diff --git a/src/app/dialogs/app/dialoglayoutsettings.cpp b/src/app/dialogs/app/dialoglayoutsettings.cpp index a233f6d22..41fdca2b3 100644 --- a/src/app/dialogs/app/dialoglayoutsettings.cpp +++ b/src/app/dialogs/app/dialoglayoutsettings.cpp @@ -45,6 +45,8 @@ DialogLayoutSettings::DialogLayoutSettings(QWidget *parent) InitPaperUnits(); InitLayoutUnits(); InitTemplates(); + MinimumPaperSize(); + MinimumLayoutSize(); connect(ui->comboBoxTemplates, static_cast(&QComboBox::currentIndexChanged), this, &DialogLayoutSettings::TemplateSelected); @@ -58,8 +60,6 @@ DialogLayoutSettings::DialogLayoutSettings(QWidget *parent) connect(ui->toolButtonLandscape, &QToolButton::toggled, this, &DialogLayoutSettings::Swap); connect(ui->comboBoxLayoutUnit, static_cast(&QComboBox::currentIndexChanged), this, &DialogLayoutSettings::ConvertLayoutSize); - connect(ui->doubleSpinBoxLayoutWidth, static_cast(&QDoubleSpinBox::valueChanged), - this, &DialogLayoutSettings::LayoutWidthChanged); } //--------------------------------------------------------------------------------------------------------------------- @@ -160,7 +160,7 @@ void DialogLayoutSettings::TemplateSelected() ui->doubleSpinBoxPaperWidth->setValue(size.width()); ui->doubleSpinBoxPaperHeight->setValue(size.height()); oldPaperUnit = PaperUnit(); - CorrectDecimals(); + CorrectPaperDecimals(); PaperSizeChanged(); } @@ -173,7 +173,8 @@ void DialogLayoutSettings::ConvertPaperSize() ui->doubleSpinBoxPaperWidth->setValue(VAbstractMeasurements::UnitConvertor(width, oldPaperUnit, paperUnit)); ui->doubleSpinBoxPaperHeight->setValue(VAbstractMeasurements::UnitConvertor(height, oldPaperUnit, paperUnit)); oldPaperUnit = paperUnit; - CorrectDecimals(); + CorrectPaperDecimals(); + MinimumPaperSize(); } //--------------------------------------------------------------------------------------------------------------------- @@ -185,22 +186,13 @@ void DialogLayoutSettings::ConvertLayoutSize() ui->doubleSpinBoxLayoutWidth->setValue(VAbstractMeasurements::UnitConvertor(layoutWidth, oldLayoutUnit, unit)); ui->doubleSpinBoxShift->setValue(VAbstractMeasurements::UnitConvertor(shift, oldLayoutUnit, unit)); oldLayoutUnit = unit; + CorrectLayoutDecimals(); + MinimumLayoutSize(); } //--------------------------------------------------------------------------------------------------------------------- void DialogLayoutSettings::PaperSizeChanged() { - QDoubleSpinBox *box = qobject_cast(sender()); - if (box != nullptr) - { - if (box->value() <= 0) - { - box->blockSignals(true); - box->setValue(1); - box->blockSignals(false); - } - } - if (ui->doubleSpinBoxPaperHeight->value() > ui->doubleSpinBoxPaperWidth->value()) { ui->toolButtonPortrate->blockSignals(true); @@ -217,21 +209,6 @@ void DialogLayoutSettings::PaperSizeChanged() Label(); } -//--------------------------------------------------------------------------------------------------------------------- -void DialogLayoutSettings::LayoutWidthChanged() -{ - QDoubleSpinBox *box = qobject_cast(sender()); - if (box != nullptr) - { - if (box->value() <= 0) - { - box->blockSignals(true); - box->setValue(1); - box->blockSignals(false); - } - } -} - //--------------------------------------------------------------------------------------------------------------------- void DialogLayoutSettings::Swap(bool checked) { @@ -283,6 +260,9 @@ void DialogLayoutSettings::InitLayoutUnits() { ui->comboBoxLayoutUnit->setCurrentIndex(indexUnit); } + + ui->doubleSpinBoxLayoutWidth->setValue(VAbstractMeasurements::UnitConvertor(1, Unit::Mm, oldLayoutUnit)); + ui->doubleSpinBoxShift->setValue(VAbstractMeasurements::UnitConvertor(10, Unit::Mm, oldLayoutUnit)); } //--------------------------------------------------------------------------------------------------------------------- @@ -350,17 +330,48 @@ Unit DialogLayoutSettings::LayoutUnit() const } //--------------------------------------------------------------------------------------------------------------------- -void DialogLayoutSettings::CorrectDecimals() +void DialogLayoutSettings::CorrectPaperDecimals() { - if (oldPaperUnit == Unit::Px) + switch(oldPaperUnit) { - ui->doubleSpinBoxPaperWidth->setDecimals(0); - ui->doubleSpinBoxPaperHeight->setDecimals(0); + case Unit::Cm: + case Unit::Mm: + ui->doubleSpinBoxPaperWidth->setDecimals(2); + ui->doubleSpinBoxPaperHeight->setDecimals(2); + break; + case Unit::Inch: + ui->doubleSpinBoxPaperWidth->setDecimals(5); + ui->doubleSpinBoxPaperHeight->setDecimals(5); + break; + case Unit::Px: + ui->doubleSpinBoxPaperWidth->setDecimals(0); + ui->doubleSpinBoxPaperHeight->setDecimals(0); + break; + default: + break; } - else +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::CorrectLayoutDecimals() +{ + switch(oldLayoutUnit) { - ui->doubleSpinBoxPaperWidth->setDecimals(2); - ui->doubleSpinBoxPaperHeight->setDecimals(2); + case Unit::Cm: + case Unit::Mm: + ui->doubleSpinBoxLayoutWidth->setDecimals(2); + ui->doubleSpinBoxShift->setDecimals(2); + break; + case Unit::Inch: + ui->doubleSpinBoxLayoutWidth->setDecimals(5); + ui->doubleSpinBoxShift->setDecimals(5); + break; + case Unit::Px: + ui->doubleSpinBoxLayoutWidth->setDecimals(0); + ui->doubleSpinBoxShift->setDecimals(0); + break; + default: + break; } } @@ -374,3 +385,18 @@ void DialogLayoutSettings::Label() QString text = QString("%1 x %2 px, \n%3 ppi").arg(width).arg(height).arg(VApplication::PrintDPI); ui->labelSizeDescription->setText(text); } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::MinimumPaperSize() +{ + const qreal value = VAbstractMeasurements::UnitConvertor(1, Unit::Px, oldPaperUnit); + ui->doubleSpinBoxPaperWidth->setMinimum(value); + ui->doubleSpinBoxPaperHeight->setMinimum(value); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::MinimumLayoutSize() +{ + const qreal value = VAbstractMeasurements::UnitConvertor(1, Unit::Px, oldLayoutUnit); + ui->doubleSpinBoxLayoutWidth->setMinimum(value); +} diff --git a/src/app/dialogs/app/dialoglayoutsettings.h b/src/app/dialogs/app/dialoglayoutsettings.h index abed1ac3d..1739d468d 100644 --- a/src/app/dialogs/app/dialoglayoutsettings.h +++ b/src/app/dialogs/app/dialoglayoutsettings.h @@ -62,11 +62,11 @@ public: void SetGroup(const Cases &value); public slots: - void TemplateSelected(); void ConvertPaperSize(); void ConvertLayoutSize(); + + void TemplateSelected(); void PaperSizeChanged(); - void LayoutWidthChanged(); void Swap(bool checked); private: @@ -83,8 +83,12 @@ private: Unit PaperUnit() const; Unit LayoutUnit() const; - void CorrectDecimals(); + void CorrectPaperDecimals(); + void CorrectLayoutDecimals(); void Label(); + + void MinimumPaperSize(); + void MinimumLayoutSize(); }; #endif // DIALOGLAYOUTSETTINGS_H diff --git a/src/app/dialogs/app/dialoglayoutsettings.ui b/src/app/dialogs/app/dialoglayoutsettings.ui index fdc4d829e..f50ad9533 100644 --- a/src/app/dialogs/app/dialoglayoutsettings.ui +++ b/src/app/dialogs/app/dialoglayoutsettings.ui @@ -193,6 +193,12 @@ + + + 94 + 0 + + 0.000000000000000 @@ -220,6 +226,12 @@ + + + 94 + 0 + + 99999.990000000005239 @@ -337,7 +349,7 @@ - + From 3d1100bc3d37a031742dea4f504868f309ff0ecd Mon Sep 17 00:00:00 2001 From: dismine Date: Fri, 16 Jan 2015 14:53:14 +0200 Subject: [PATCH 028/186] Send arranged count of workpieces. --HG-- branch : feature --- src/libs/vlayout/vbank.cpp | 6 ++++++ src/libs/vlayout/vbank.h | 1 + src/libs/vlayout/vlayoutgenerator.cpp | 1 + 3 files changed, 8 insertions(+) diff --git a/src/libs/vlayout/vbank.cpp b/src/libs/vlayout/vbank.cpp index 08323bf9a..ede1c3f3a 100644 --- a/src/libs/vlayout/vbank.cpp +++ b/src/libs/vlayout/vbank.cpp @@ -251,6 +251,12 @@ QRectF VBank::GetBiggestBoundingRect() const return boundingRect; } +//--------------------------------------------------------------------------------------------------------------------- +int VBank::ArrangedCount() const +{ + return details.size() - AllDetailsCount(); +} + //--------------------------------------------------------------------------------------------------------------------- void VBank::PrepareGroup() { diff --git a/src/libs/vlayout/vbank.h b/src/libs/vlayout/vbank.h index 316826585..fd55dadcd 100644 --- a/src/libs/vlayout/vbank.h +++ b/src/libs/vlayout/vbank.h @@ -59,6 +59,7 @@ public: int AllDetailsCount() const; int LeftArrange() const; + int ArrangedCount() const; QRectF GetBiggestBoundingRect() const; diff --git a/src/libs/vlayout/vlayoutgenerator.cpp b/src/libs/vlayout/vlayoutgenerator.cpp index 45c161c98..a4abaa5b7 100644 --- a/src/libs/vlayout/vlayoutgenerator.cpp +++ b/src/libs/vlayout/vlayoutgenerator.cpp @@ -107,6 +107,7 @@ void VLayoutGenerator::Generate() if (paper.ArrangeDetail(bank->GetDetail(index))) { bank->Arranged(index); + emit Arranged(bank->ArrangedCount()); } else { From ab2b894d6968de23196096c5854284dd4dc75928 Mon Sep 17 00:00:00 2001 From: dismine Date: Fri, 16 Jan 2015 14:54:37 +0200 Subject: [PATCH 029/186] Better round points if we want avoid errors. Correct way working with QMatrix in methods translate and rotate. --HG-- branch : feature --- src/libs/vlayout/vlayoutdetail.cpp | 41 ++++++++++++++++---- src/libs/vlayout/vlayoutdetail.h | 1 + src/libs/vlayout/vlayoutpaper.cpp | 62 +++++++++++++++++++++++------- src/libs/vlayout/vlayoutpaper.h | 3 +- 4 files changed, 86 insertions(+), 21 deletions(-) diff --git a/src/libs/vlayout/vlayoutdetail.cpp b/src/libs/vlayout/vlayoutdetail.cpp index bbdc0e38c..610a617c9 100644 --- a/src/libs/vlayout/vlayoutdetail.cpp +++ b/src/libs/vlayout/vlayoutdetail.cpp @@ -74,6 +74,8 @@ void VLayoutDetail::SetCountourPoints(const QVector &points) { d->contour.removeLast(); } + + d->contour = RoundPoints(d->contour); } //--------------------------------------------------------------------------------------------------------------------- @@ -91,6 +93,8 @@ void VLayoutDetail::SetSeamAllowencePoints(const QVector &points) { d->seamAllowence.removeLast(); } + + d->seamAllowence = RoundPoints(d->seamAllowence); } //--------------------------------------------------------------------------------------------------------------------- @@ -126,15 +130,19 @@ void VLayoutDetail::SetLayoutWidth(const qreal &value) //--------------------------------------------------------------------------------------------------------------------- void VLayoutDetail::Translate(qreal dx, qreal dy) { - d->matrix = d->matrix.translate(dx, dy); + QMatrix m; + m.translate(dx, dy); + d->matrix *= m; } //--------------------------------------------------------------------------------------------------------------------- void VLayoutDetail::Rotate(const QPointF &originPoint, qreal degrees) { - Translate(-originPoint.x(), -originPoint.y()); - d->matrix = d->matrix.rotate(degrees); - Translate(originPoint.x(), originPoint.y()); + QMatrix m; + m.translate(originPoint.x(), originPoint.y()); + m.rotate(-degrees); + m.translate(-originPoint.x(), -originPoint.y()); + d->matrix *= m; } //--------------------------------------------------------------------------------------------------------------------- @@ -148,9 +156,9 @@ void VLayoutDetail::Mirror(const QLineF &edge) QLineF axis = QLineF(edge.x1(), edge.y1(), 100, edge.y2()); // Ox axis qreal angle = edge.angleTo(axis); - Rotate(edge.p1(), angle); - d->matrix = d->matrix.scale(d->matrix.m11()*-1, d->matrix.m22()); - Rotate(edge.p1(), 360 - angle); + Rotate(edge.p1(), -angle); + d->matrix *= d->matrix.scale(d->matrix.m11()*-1, d->matrix.m22()); + Rotate(edge.p1(), 360 + angle); } //--------------------------------------------------------------------------------------------------------------------- @@ -286,10 +294,18 @@ void VLayoutDetail::SetLayoutAllowencePoints() if (getSeamAllowance()) { d->layoutAllowence = Equidistant(d->seamAllowence, EquidistantType::CloseEquidistant, d->layoutWidth); + if (d->layoutAllowence.isEmpty() == false) + { + d->layoutAllowence.removeLast(); + } } else { d->layoutAllowence = Equidistant(d->contour, EquidistantType::CloseEquidistant, d->layoutWidth); + if (d->layoutAllowence.isEmpty() == false) + { + d->layoutAllowence.removeLast(); + } } } else @@ -319,6 +335,17 @@ QVector VLayoutDetail::Map(const QVector &points) const return p; } +//--------------------------------------------------------------------------------------------------------------------- +QVector VLayoutDetail::RoundPoints(const QVector &points) const +{ + QVector p; + for (int i=0; i < points.size(); ++i) + { + p.append(QPointF(qRound(points.at(i).x()), qRound(points.at(i).y()))); + } + return p; +} + //--------------------------------------------------------------------------------------------------------------------- QPainterPath VLayoutDetail::ContourPath() const { diff --git a/src/libs/vlayout/vlayoutdetail.h b/src/libs/vlayout/vlayoutdetail.h index 40b7c9632..e926016ed 100644 --- a/src/libs/vlayout/vlayoutdetail.h +++ b/src/libs/vlayout/vlayoutdetail.h @@ -79,6 +79,7 @@ private: QSharedDataPointer d; QVector Map(const QVector &points) const; + QVector RoundPoints(const QVector &points) const; }; #endif // VLAYOUTDETAIL_H diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index a8b177b58..d7aa52a6d 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -36,6 +36,7 @@ #include #include #include +#include class BestResult { @@ -222,6 +223,8 @@ bool VLayoutPaper::AddToBlankSheet(const VLayoutDetail &detail) { for (int i=1; i<= detail.EdgesCount(); i++) { + QCoreApplication::processEvents(); + // We should use copy of the detail. VLayoutDetail workDetail = detail; @@ -237,8 +240,10 @@ bool VLayoutPaper::AddToBlankSheet(const VLayoutDetail &detail) } d->frame = d->frame + 2; - for (int angle = 0; angle < 360; ++angle) + for (int angle = 0; angle <= 360; ++angle) { + QCoreApplication::processEvents(); + // We should use copy of the detail. VLayoutDetail workDetail = detail; @@ -271,6 +276,8 @@ bool VLayoutPaper::AddToSheet(const VLayoutDetail &detail) for (int i=1; i<= workDetail.EdgesCount(); i++) { + QCoreApplication::processEvents(); + int dEdge = i;// For mirror detail edge will be different if (CheckCombineEdges(workDetail, j, dEdge)) { @@ -304,7 +311,7 @@ bool VLayoutPaper::CheckCombineEdges(VLayoutDetail &detail, int j, int &dEdge) c CombineEdges(detail, globalEdge, dEdge); #ifdef LAYOUT_DEBUG - DrawDebug(detail); + DrawDebug(detail, d->frame); #endif switch (Crossing(detail, j, dEdge)) @@ -338,6 +345,10 @@ bool VLayoutPaper::CheckCombineEdges(VLayoutDetail &detail, int j, int &dEdge) c if (flagMirror) { + #ifdef LAYOUT_DEBUG + DrawDebug(detail, d->frame+1); + #endif + dEdge = detail.EdgeByPoint(globalEdge.p2()); if (dEdge <= 0) { @@ -383,7 +394,7 @@ bool VLayoutPaper::CheckRotationEdges(VLayoutDetail &detail, int j, int dEdge, i RotateEdges(detail, globalEdge, dEdge, angle); #ifdef LAYOUT_DEBUG - DrawDebug(detail); + DrawDebug(detail, d->frame); #endif switch (Crossing(detail, j, dEdge)) @@ -536,13 +547,15 @@ void VLayoutPaper::CombineEdges(VLayoutDetail &detail, const QLineF &globalEdge, const qreal dx = globalEdge.x2() - detailEdge.x2(); const qreal dy = globalEdge.y2() - detailEdge.y2(); +// detailEdge = QLineF(detailEdge.x1()+dx, detailEdge.y1()+dy, detailEdge.x2()+dx, detailEdge.y2()+dy); +// angle = detailEdge.angle(); detailEdge.translate(dx, dy); // Use values for translate detail edge. const qreal angle_between = globalEdge.angleTo(detailEdge); // Seek angle between two edges. // Now we move detail to position near to global contour edge. detail.Translate(dx, dy); - detail.Rotate(globalEdge.p2(), angle_between); + detail.Rotate(detailEdge.p2(), -angle_between); } //--------------------------------------------------------------------------------------------------------------------- @@ -760,34 +773,46 @@ bool VLayoutPaper::SaveResult(const BestResult &bestResult, const VLayoutDetail } //--------------------------------------------------------------------------------------------------------------------- -void VLayoutPaper::DrawDebug(const VLayoutDetail &detail) const +void VLayoutPaper::DrawDebug(const VLayoutDetail &detail, int frame) const { - QImage frameImage ( d->paperWidth, d->paperHeight, QImage::Format_RGB32 ); + QImage frameImage(d->paperWidth*3, d->paperHeight*3, QImage::Format_RGB32); frameImage.fill(Qt::white); QPainter paint; - paint.setPen(QPen(Qt::black, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); paint.begin(&frameImage); + paint.setPen(QPen(Qt::darkRed, 3, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); + paint.drawRect(QRectF(d->paperWidth, d->paperHeight, d->paperWidth, d->paperHeight)); + + paint.setPen(QPen(Qt::black, 3, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); + QPainterPath p; if (d->globalContour.isEmpty()) { - paint.drawPath(DrawContour(CutEdge(QLineF(0, 0, d->paperWidth, 0)))); + p = DrawContour(CutEdge(QLineF(0, 0, d->paperWidth, 0))); + p.translate(d->paperWidth, d->paperHeight); + paint.drawPath(p); } else { - paint.drawPath(DrawContour(d->globalContour)); + p = DrawContour(d->globalContour); + p.translate(d->paperWidth, d->paperHeight); + paint.drawPath(p); } - paint.setPen(QPen(Qt::darkGreen, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); - paint.drawPath(DrawContour(detail.GetLayoutAllowencePoints())); + paint.setPen(QPen(Qt::darkGreen, 3, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); + p = DrawContour(detail.GetLayoutAllowencePoints()); + p.translate(d->paperWidth, d->paperHeight); + paint.drawPath(p); #ifdef ARRANGED_DETAILS paint.setPen(QPen(Qt::blue, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); - paint.drawPath(DrawDetails()); + p = DrawDetails(); + p.translate(d->paperWidth, d->paperHeight); + paint.drawPath(p); #endif paint.end(); const QString path = QDir::homePath()+QStringLiteral("/LayoutDebug/")+QString("%1_%2.png").arg(d->paperIndex) - .arg(d->frame); + .arg(frame); frameImage.save (path); } @@ -844,6 +869,17 @@ QPainterPath VLayoutPaper::DrawContour(const QVector &points) const return path; } +//--------------------------------------------------------------------------------------------------------------------- +QVector VLayoutPaper::TranslateContour(const QVector &points, qreal dx, qreal dy) const +{ + QVector p; + for (qint32 i = 0; i < points.count(); ++i) + { + p.append(QPointF(points.at(i).x()+dx, points.at(i).y()+dy)); + } + return p; +} + //--------------------------------------------------------------------------------------------------------------------- QPainterPath VLayoutPaper::DrawDetails() const { diff --git a/src/libs/vlayout/vlayoutpaper.h b/src/libs/vlayout/vlayoutpaper.h index 81f2b8d39..664471c03 100644 --- a/src/libs/vlayout/vlayoutpaper.h +++ b/src/libs/vlayout/vlayoutpaper.h @@ -105,9 +105,10 @@ private: bool SaveResult(const BestResult &bestResult, const VLayoutDetail &detail); - void DrawDebug(const VLayoutDetail &detail) const; + void DrawDebug(const VLayoutDetail &detail, int frame) const; QPainterPath ShowDirection(const QLineF &edge) const; QPainterPath DrawContour(const QVector &points) const; + QVector TranslateContour(const QVector &points, qreal dx, qreal dy) const; QPainterPath DrawDetails() const; }; From 040b9e607bf4b481edbed297d38c62587c4a5296 Mon Sep 17 00:00:00 2001 From: dismine Date: Fri, 16 Jan 2015 15:20:15 +0200 Subject: [PATCH 030/186] Method Mirror now should work. --HG-- branch : feature --- src/libs/vlayout/vlayoutdetail.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/libs/vlayout/vlayoutdetail.cpp b/src/libs/vlayout/vlayoutdetail.cpp index 610a617c9..a47144953 100644 --- a/src/libs/vlayout/vlayoutdetail.cpp +++ b/src/libs/vlayout/vlayoutdetail.cpp @@ -153,12 +153,16 @@ void VLayoutDetail::Mirror(const QLineF &edge) return; } - QLineF axis = QLineF(edge.x1(), edge.y1(), 100, edge.y2()); // Ox axis + const QLineF axis = QLineF(edge.x1(), edge.y1(), 100, edge.y2()); // Ox axis - qreal angle = edge.angleTo(axis); - Rotate(edge.p1(), -angle); - d->matrix *= d->matrix.scale(d->matrix.m11()*-1, d->matrix.m22()); - Rotate(edge.p1(), 360 + angle); + const qreal angle = edge.angleTo(axis); + QMatrix m; + m.translate(edge.p2().x(), edge.p2().y()); + m.rotate(-angle); + m.scale(m.m11(), m.m22()*-1); + m.rotate(360 - (-angle)); + m.translate(-edge.p2().x(), -edge.p2().y()); + d->matrix *= m; } //--------------------------------------------------------------------------------------------------------------------- @@ -323,7 +327,7 @@ QVector VLayoutDetail::Map(const QVector &points) const p.append(d->matrix.map(points.at(i))); } - if (d->matrix.m11() < 0) + if (d->matrix.m22() < 0) { QList list = p.toList(); for(int k=0, s=list.size(), max=(s/2); k Date: Fri, 16 Jan 2015 16:22:42 +0200 Subject: [PATCH 031/186] Ignore intersection in vertices of edges. --HG-- branch : feature --- src/libs/vlayout/vlayoutpaper.cpp | 22 +++++++++++++++++++++- src/libs/vlayout/vlayoutpaper.h | 3 +++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index d7aa52a6d..116875906 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -467,7 +467,10 @@ VLayoutPaper::CrossingType VLayoutPaper::Crossing(const VLayoutDetail &detail, i if (type == QLineF::BoundedIntersection) { - return CrossingType::Intersection; + if (TrueIntersection(globalEdge, detailEdge, xPoint)) + { + return CrossingType::Intersection; + } } } } @@ -895,6 +898,23 @@ QPainterPath VLayoutPaper::DrawDetails() const return path; } +//--------------------------------------------------------------------------------------------------------------------- +bool VLayoutPaper::TrueIntersection(const QLineF &gEdge, const QLineF &dEdge, const QPointF &p) const +{ + const QPointF pX = RoundedPoint(p); + const QPointF gP1 = RoundedPoint(gEdge.p1()); + const QPointF gP2 = RoundedPoint(gEdge.p2()); + const QPointF dP1 = RoundedPoint(dEdge.p1()); + const QPointF dP2 = RoundedPoint(dEdge.p2()); + return pX != gP1 && pX != gP2 && pX != dP1 && pX != dP2; +} + +//--------------------------------------------------------------------------------------------------------------------- +QPointF VLayoutPaper::RoundedPoint(const QPointF &p) const +{ + return QPointF(qRound(p.x()), qRound(p.y())); +} + //--------------------------------------------------------------------------------------------------------------------- QGraphicsItem *VLayoutPaper::GetItem() const { diff --git a/src/libs/vlayout/vlayoutpaper.h b/src/libs/vlayout/vlayoutpaper.h index 664471c03..8c3b2e154 100644 --- a/src/libs/vlayout/vlayoutpaper.h +++ b/src/libs/vlayout/vlayoutpaper.h @@ -110,6 +110,9 @@ private: QPainterPath DrawContour(const QVector &points) const; QVector TranslateContour(const QVector &points, qreal dx, qreal dy) const; QPainterPath DrawDetails() const; + + bool TrueIntersection(const QLineF &gEdge, const QLineF &dEdge, const QPointF &p) const; + QPointF RoundedPoint(const QPointF &p) const; }; #endif // VLAYOUTPAPER_H From f8d210e720086d29203e7c6060d7fc5837ebd41a Mon Sep 17 00:00:00 2001 From: dismine Date: Fri, 16 Jan 2015 16:45:56 +0200 Subject: [PATCH 032/186] Better check more frequently if user want cancel creation layout. --HG-- branch : feature --- src/libs/vlayout/vlayoutgenerator.cpp | 9 +++++++-- src/libs/vlayout/vlayoutpaper.cpp | 25 ++++++++++++++++++++----- src/libs/vlayout/vlayoutpaper.h | 6 +++--- 3 files changed, 30 insertions(+), 10 deletions(-) diff --git a/src/libs/vlayout/vlayoutgenerator.cpp b/src/libs/vlayout/vlayoutgenerator.cpp index a4abaa5b7..a64fa8895 100644 --- a/src/libs/vlayout/vlayoutgenerator.cpp +++ b/src/libs/vlayout/vlayoutgenerator.cpp @@ -94,7 +94,6 @@ void VLayoutGenerator::Generate() { if (stopGeneration) { - state = LayoutErrors::ProcessStoped; break; } @@ -104,7 +103,7 @@ void VLayoutGenerator::Generate() if (bank->LeftArrange() > 0) { const int index = bank->GetTiket(); - if (paper.ArrangeDetail(bank->GetDetail(index))) + if (paper.ArrangeDetail(bank->GetDetail(index), stopGeneration)) { bank->Arranged(index); emit Arranged(bank->ArrangedCount()); @@ -113,6 +112,11 @@ void VLayoutGenerator::Generate() { bank->NotArranged(index); } + + if (stopGeneration) + { + break; + } } else { @@ -160,6 +164,7 @@ QList VLayoutGenerator::GetItems() const void VLayoutGenerator::Abort() { stopGeneration = true; + state = LayoutErrors::ProcessStoped; } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index 116875906..55d84d779 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -183,7 +183,7 @@ void VLayoutPaper::SetPaperIndex(quint32 index) } //--------------------------------------------------------------------------------------------------------------------- -bool VLayoutPaper::ArrangeDetail(const VLayoutDetail &detail) +bool VLayoutPaper::ArrangeDetail(const VLayoutDetail &detail, bool &stop) { // First need set size of paper if (d->paperHeight <= 0 || d->paperWidth <= 0) @@ -200,11 +200,11 @@ bool VLayoutPaper::ArrangeDetail(const VLayoutDetail &detail) if (Count() == 0) { - return AddToBlankSheet(detail); + return AddToBlankSheet(detail, stop); } else { - return AddToSheet(detail); + return AddToSheet(detail, stop); } } @@ -215,7 +215,7 @@ int VLayoutPaper::Count() const } //--------------------------------------------------------------------------------------------------------------------- -bool VLayoutPaper::AddToBlankSheet(const VLayoutDetail &detail) +bool VLayoutPaper::AddToBlankSheet(const VLayoutDetail &detail, bool &stop) { BestResult bestResult; @@ -225,6 +225,11 @@ bool VLayoutPaper::AddToBlankSheet(const VLayoutDetail &detail) { QCoreApplication::processEvents(); + if (stop) + { + return false; + } + // We should use copy of the detail. VLayoutDetail workDetail = detail; @@ -244,6 +249,11 @@ bool VLayoutPaper::AddToBlankSheet(const VLayoutDetail &detail) { QCoreApplication::processEvents(); + if (stop) + { + return false; + } + // We should use copy of the detail. VLayoutDetail workDetail = detail; @@ -265,7 +275,7 @@ bool VLayoutPaper::AddToBlankSheet(const VLayoutDetail &detail) } //--------------------------------------------------------------------------------------------------------------------- -bool VLayoutPaper::AddToSheet(const VLayoutDetail &detail) +bool VLayoutPaper::AddToSheet(const VLayoutDetail &detail, bool &stop) { BestResult bestResult; @@ -278,6 +288,11 @@ bool VLayoutPaper::AddToSheet(const VLayoutDetail &detail) { QCoreApplication::processEvents(); + if (stop) + { + return false; + } + int dEdge = i;// For mirror detail edge will be different if (CheckCombineEdges(workDetail, j, dEdge)) { diff --git a/src/libs/vlayout/vlayoutpaper.h b/src/libs/vlayout/vlayoutpaper.h index 8c3b2e154..0bf62e1b6 100644 --- a/src/libs/vlayout/vlayoutpaper.h +++ b/src/libs/vlayout/vlayoutpaper.h @@ -60,7 +60,7 @@ public: void SetPaperIndex(quint32 index); - bool ArrangeDetail(const VLayoutDetail &detail); + bool ArrangeDetail(const VLayoutDetail &detail, bool &stop); int Count() const; QGraphicsItem *GetItem() const; @@ -81,8 +81,8 @@ private: EdgeError = 2 }; - bool AddToBlankSheet(const VLayoutDetail &detail); - bool AddToSheet(const VLayoutDetail &detail); + bool AddToBlankSheet(const VLayoutDetail &detail, bool &stop); + bool AddToSheet(const VLayoutDetail &detail, bool &stop); bool CheckCombineEdges(VLayoutDetail &detail, int j, int &dEdge) const; bool CheckRotationEdges(VLayoutDetail &detail, int j, int dEdge, int angle) const; From f849d16018465547bbd66f4840562109ed1ca017 Mon Sep 17 00:00:00 2001 From: dismine Date: Fri, 16 Jan 2015 21:33:18 +0200 Subject: [PATCH 033/186] Choose first best result. --HG-- branch : feature --- src/libs/vlayout/vlayoutpaper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index 55d84d779..32f7eedee 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -69,7 +69,7 @@ BestResult::BestResult() //--------------------------------------------------------------------------------------------------------------------- void BestResult::NewResult(qint64 square, int i, int j, const QMatrix &matrix) { - if (square <= resSquare && square > 0) + if (square < resSquare && square > 0) { resI = i; resJ = j; From b04d1f92e72dd9703c29d538a4165b7081b2a08a Mon Sep 17 00:00:00 2001 From: dismine Date: Fri, 16 Jan 2015 21:34:37 +0200 Subject: [PATCH 034/186] Forgot save paper after creation. --HG-- branch : feature --- src/libs/vlayout/vlayoutgenerator.cpp | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/libs/vlayout/vlayoutgenerator.cpp b/src/libs/vlayout/vlayoutgenerator.cpp index a64fa8895..d5f229c20 100644 --- a/src/libs/vlayout/vlayoutgenerator.cpp +++ b/src/libs/vlayout/vlayoutgenerator.cpp @@ -90,7 +90,7 @@ void VLayoutGenerator::Generate() if (bank->Prepare()) { CheckDetailsSize(); - do + while (bank->AllDetailsCount() > 0) { if (stopGeneration) { @@ -100,7 +100,7 @@ void VLayoutGenerator::Generate() VLayoutPaper paper(paperHeight, paperWidth); paper.SetShift(shift); paper.SetPaperIndex(papers.count()); - if (bank->LeftArrange() > 0) + do { const int index = bank->GetTiket(); if (paper.ArrangeDetail(bank->GetDetail(index), stopGeneration)) @@ -117,22 +117,19 @@ void VLayoutGenerator::Generate() { break; } + } while(bank->LeftArrange() > 0); + + if (paper.Count() > 0) + { + papers.append(paper); } else { - if (paper.Count() > 0) - { - papers.append(paper); - } - else - { - state = LayoutErrors::EmptyPaperError; - emit Error(state); - return; - } + state = LayoutErrors::EmptyPaperError; + emit Error(state); + return; } - - } while (bank->AllDetailsCount() > 0); + } } else { From 28b2f97aaa2f342c60d3ffc3acd6030b3ac52f3c Mon Sep 17 00:00:00 2001 From: dismine Date: Fri, 16 Jan 2015 21:35:50 +0200 Subject: [PATCH 035/186] Fixed getting seam allowence points. --HG-- branch : feature --- src/app/geometry/vdetail.cpp | 28 +++++++++++++++------------- src/libs/vlayout/vlayoutdetail.cpp | 16 ++++++---------- 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/src/app/geometry/vdetail.cpp b/src/app/geometry/vdetail.cpp index c1ce9a6fe..3112023ff 100644 --- a/src/app/geometry/vdetail.cpp +++ b/src/app/geometry/vdetail.cpp @@ -432,6 +432,18 @@ QVector VDetail::SeamAllowancePoints(const VContainer *data) const break; } } + + if (getSeamAllowance() == true) + { + if (getClosed() == true) + { + pointsEkv = Equidistant(pointsEkv, EquidistantType::CloseEquidistant, qApp->toPixel(getWidth())); + } + else + { + pointsEkv = Equidistant(pointsEkv, EquidistantType::OpenEquidistant, qApp->toPixel(getWidth())); + } + } return pointsEkv; } @@ -455,20 +467,10 @@ QPainterPath VDetail::ContourPath(const VContainer *data) const if (getSeamAllowance() == true) { QPainterPath ekv; - QVector p; - if (getClosed() == true) + ekv.moveTo(pointsEkv.at(0)); + for (qint32 i = 1; i < pointsEkv.count(); ++i) { - p = Equidistant(pointsEkv, EquidistantType::CloseEquidistant, qApp->toPixel(getWidth())); - } - else - { - p = Equidistant(pointsEkv, EquidistantType::OpenEquidistant, qApp->toPixel(getWidth())); - } - - ekv.moveTo(p.at(0)); - for (qint32 i = 1; i < p.count(); ++i) - { - ekv.lineTo(p.at(i)); + ekv.lineTo(pointsEkv.at(i)); } path.addPath(ekv); diff --git a/src/libs/vlayout/vlayoutdetail.cpp b/src/libs/vlayout/vlayoutdetail.cpp index a47144953..7255da1e2 100644 --- a/src/libs/vlayout/vlayoutdetail.cpp +++ b/src/libs/vlayout/vlayoutdetail.cpp @@ -367,22 +367,18 @@ QPainterPath VLayoutDetail::ContourPath() const // seam allowence if (getSeamAllowance() == true) { - QPainterPath ekv; - QVector p; points = Map(d->seamAllowence); + if (getClosed() == true) { - p = Equidistant(points, EquidistantType::CloseEquidistant, getWidth()); - } - else - { - p = Equidistant(points, EquidistantType::OpenEquidistant, getWidth()); + points.append(points.at(0)); } - ekv.moveTo(p.at(0)); - for (qint32 i = 1; i < p.count(); ++i) + QPainterPath ekv; + ekv.moveTo(points.at(0)); + for (qint32 i = 1; i < points.count(); ++i) { - ekv.lineTo(p.at(i)); + ekv.lineTo(points.at(i)); } path.addPath(ekv); From 56aa09a6392c4fe1a83d7137cdec4b8b48c1196a Mon Sep 17 00:00:00 2001 From: dismine Date: Sat, 17 Jan 2015 15:14:28 +0200 Subject: [PATCH 036/186] Don't save last options for creation a layout. --HG-- branch : feature --- src/app/dialogs/app/dialoglayoutsettings.cpp | 2 +- src/app/tablewindow.cpp | 75 +++++++++++--------- src/app/tablewindow.h | 6 -- src/libs/vlayout/vlayoutdef.h | 3 +- src/libs/vlayout/vlayoutgenerator.cpp | 5 ++ src/libs/vlayout/vlayoutpaper.cpp | 6 +- 6 files changed, 52 insertions(+), 45 deletions(-) diff --git a/src/app/dialogs/app/dialoglayoutsettings.cpp b/src/app/dialogs/app/dialoglayoutsettings.cpp index 41fdca2b3..e5cea7856 100644 --- a/src/app/dialogs/app/dialoglayoutsettings.cpp +++ b/src/app/dialogs/app/dialoglayoutsettings.cpp @@ -262,7 +262,7 @@ void DialogLayoutSettings::InitLayoutUnits() } ui->doubleSpinBoxLayoutWidth->setValue(VAbstractMeasurements::UnitConvertor(1, Unit::Mm, oldLayoutUnit)); - ui->doubleSpinBoxShift->setValue(VAbstractMeasurements::UnitConvertor(10, Unit::Mm, oldLayoutUnit)); + ui->doubleSpinBoxShift->setValue(VAbstractMeasurements::UnitConvertor(50, Unit::Mm, oldLayoutUnit)); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/tablewindow.cpp b/src/app/tablewindow.cpp index 78371a773..bd47d5691 100644 --- a/src/app/tablewindow.cpp +++ b/src/app/tablewindow.cpp @@ -54,8 +54,7 @@ TableWindow::TableWindow(QWidget *parent) :QMainWindow(parent), ui(new Ui::TableWindow), listDetails(QVector()), papers(QList()), shadows(QList()), - scenes(QList()), fileName(QString()), description(QString()), paperHeight(0), paperWidth(0), - shift(0), layoutWidth(0), group(Cases::CaseDesc), tempScene(nullptr) + scenes(QList()), fileName(QString()), description(QString()), tempScene(nullptr) { ui->setupUi(this); tempScene = new QGraphicsScene(QRectF(0, 0, qApp->toPixel(823, Unit::Mm), qApp->toPixel(1171, Unit::Mm))); @@ -67,8 +66,8 @@ TableWindow::TableWindow(QWidget *parent) ui->view->setScene(tempScene); ui->view->fitInView(ui->view->scene()->sceneRect(), Qt::KeepAspectRatio); ui->horizontalLayout->addWidget(ui->view); - //connect(ui->actionZoomIn, &QAction::triggered, ui->view, &VTableGraphicsView::ZoomIn); - //connect(ui->actionZoomOut, &QAction::triggered, ui->view, &VTableGraphicsView::ZoomOut); + connect(ui->actionZoomIn, &QAction::triggered, ui->view, &VTableGraphicsView::ZoomIn); + connect(ui->actionZoomOut, &QAction::triggered, ui->view, &VTableGraphicsView::ZoomOut); connect(ui->actionStop, &QAction::triggered, this, &TableWindow::StopTable); //connect(ui->actionSave, &QAction::triggered, this, &TableWindow::saveScene); connect(ui->actionLayout, &QAction::triggered, this, &TableWindow::Layout); @@ -255,49 +254,39 @@ void TableWindow::saveScene() // delete brush; } +//--------------------------------------------------------------------------------------------------------------------- void TableWindow::ShowPaper(int index) { if (index < 0 || index > scenes.size()) { ui->view->setScene(tempScene); } + else + { + ui->view->setScene(scenes.at(index)); + } - ui->view->setScene(scenes.at(index)); + ui->view->fitInView(ui->view->scene()->sceneRect(), Qt::KeepAspectRatio); } //--------------------------------------------------------------------------------------------------------------------- void TableWindow::Layout() { DialogLayoutSettings layout(this); - if (paperHeight != 0) - { - layout.SetPaperHeight(paperHeight); - layout.SetPaperWidth(paperWidth); - layout.SetLayoutWidth(layoutWidth); - layout.SetShift(shift); - layout.SetGroup(group); - } - if (layout.exec() == QDialog::Rejected) { return; } - paperHeight = layout.GetPaperHeight(); - paperWidth = layout.GetPaperWidth(); - shift = layout.GetShift(); - layoutWidth = layout.GetLayoutWidth(); - group = layout.GetGroup(); - VLayoutGenerator lGenerator(this); lGenerator.SetDetails(listDetails); - lGenerator.SetLayoutWidth(layoutWidth); - lGenerator.SetCaseType(group); - lGenerator.SetPaperHeight(paperHeight); - lGenerator.SetPaperWidth(paperWidth); - lGenerator.SetShift(shift); + lGenerator.SetLayoutWidth(layout.GetLayoutWidth()); + lGenerator.SetCaseType(layout.GetGroup()); + lGenerator.SetPaperHeight(layout.GetPaperHeight()); + lGenerator.SetPaperWidth(layout.GetPaperWidth()); + lGenerator.SetShift(layout.GetShift()); - DialogLayoutProgress progress(lGenerator.DetailsCount(), this); + DialogLayoutProgress progress(listDetails.count(), this); connect(&lGenerator, &VLayoutGenerator::Start, &progress, &DialogLayoutProgress::Start); connect(&lGenerator, &VLayoutGenerator::Arranged, &progress, &DialogLayoutProgress::Arranged); @@ -307,14 +296,25 @@ void TableWindow::Layout() lGenerator.Generate(); - if (lGenerator.State() == LayoutErrors::NoError) + switch (lGenerator.State()) { - ClearLayout(); - papers = lGenerator.GetItems(); - CreateShadows(); - CreateScenes(); - // Create previews - PrepareSceneList(); + case LayoutErrors::NoError: + ClearLayout(); + papers = lGenerator.GetItems(); + CreateShadows(); + CreateScenes(); + // Create previews + PrepareSceneList(); + break; + case LayoutErrors::ProcessStoped: + break; + case LayoutErrors::PrepareLayoutError: + case LayoutErrors::PaperSizeError: + case LayoutErrors::EmptyPaperError: + ClearLayout(); + break; + default: + break; } } @@ -470,9 +470,9 @@ void TableWindow::ClearLayout() { qDeleteAll (scenes); scenes.clear(); - listDetails.clear(); shadows.clear(); papers.clear(); + ui->listWidget->clear(); } //--------------------------------------------------------------------------------------------------------------------- @@ -517,9 +517,14 @@ void TableWindow::CreateScenes() void TableWindow::PrepareSceneList() { const QIcon ico("://icon/64x64/icon64x64.png"); - for (int i=0; ilistWidget->addItem(item); } + + if (scenes.isEmpty() == false) + { + ui->listWidget->setCurrentRow(0); + } } diff --git a/src/app/tablewindow.h b/src/app/tablewindow.h index 071561ba8..d038308d5 100644 --- a/src/app/tablewindow.h +++ b/src/app/tablewindow.h @@ -87,12 +87,6 @@ private: /** @brief description pattern description */ QString description; - int paperHeight; - int paperWidth; - unsigned int shift; - qreal layoutWidth; - Cases group; - QGraphicsScene* tempScene; void SvgFile(const QString &name)const; diff --git a/src/libs/vlayout/vlayoutdef.h b/src/libs/vlayout/vlayoutdef.h index 30f7593ab..3ceb260f8 100644 --- a/src/libs/vlayout/vlayoutdef.h +++ b/src/libs/vlayout/vlayoutdef.h @@ -40,12 +40,13 @@ enum class LayoutErrors : char EmptyPaperError }; -#define LAYOUT_DEBUG // Enable debug mode +//#define LAYOUT_DEBUG // Enable debug mode #ifdef LAYOUT_DEBUG # define SHOW_VERTICES // Show contour vertices # define SHOW_DIRECTION // Show contour direction # define ARRANGED_DETAILS // Show already arranged details +//# define SHOW_ROTATION #endif//LAYOUT_DEBUG #endif // VLAYOUTDEF_H diff --git a/src/libs/vlayout/vlayoutgenerator.cpp b/src/libs/vlayout/vlayoutgenerator.cpp index d5f229c20..01f5b6038 100644 --- a/src/libs/vlayout/vlayoutgenerator.cpp +++ b/src/libs/vlayout/vlayoutgenerator.cpp @@ -119,6 +119,11 @@ void VLayoutGenerator::Generate() } } while(bank->LeftArrange() > 0); + if (stopGeneration) + { + break; + } + if (paper.Count() > 0) { papers.append(paper); diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index 32f7eedee..34e86beaf 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -69,7 +69,7 @@ BestResult::BestResult() //--------------------------------------------------------------------------------------------------------------------- void BestResult::NewResult(qint64 square, int i, int j, const QMatrix &matrix) { - if (square < resSquare && square > 0) + if (square <= resSquare && square > 0) { resI = i; resJ = j; @@ -409,7 +409,9 @@ bool VLayoutPaper::CheckRotationEdges(VLayoutDetail &detail, int j, int dEdge, i RotateEdges(detail, globalEdge, dEdge, angle); #ifdef LAYOUT_DEBUG - DrawDebug(detail, d->frame); + #ifdef SHOW_ROTATION + DrawDebug(detail, d->frame); + #endif #endif switch (Crossing(detail, j, dEdge)) From 1d1ae1acb465f0fdfac26f2ab1db6934009f3a45 Mon Sep 17 00:00:00 2001 From: dismine Date: Sat, 17 Jan 2015 16:00:46 +0200 Subject: [PATCH 037/186] Fixed creation global contour. --HG-- branch : feature --- src/libs/vlayout/vlayoutgenerator.cpp | 1 + src/libs/vlayout/vlayoutpaper.cpp | 29 ++++++++++++++++++++------- src/libs/vlayout/vlayoutpaper.h | 3 +++ src/libs/vlayout/vlayoutpaper_p.h | 8 +++++--- 4 files changed, 31 insertions(+), 10 deletions(-) diff --git a/src/libs/vlayout/vlayoutgenerator.cpp b/src/libs/vlayout/vlayoutgenerator.cpp index 01f5b6038..0501440da 100644 --- a/src/libs/vlayout/vlayoutgenerator.cpp +++ b/src/libs/vlayout/vlayoutgenerator.cpp @@ -99,6 +99,7 @@ void VLayoutGenerator::Generate() VLayoutPaper paper(paperHeight, paperWidth); paper.SetShift(shift); + paper.SetLayoutWidth(bank->GetLayoutWidth()); paper.SetPaperIndex(papers.count()); do { diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index 34e86beaf..8d3f56ef3 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -164,6 +164,21 @@ void VLayoutPaper::SetWidth(int width) d->paperWidth = width; } +//--------------------------------------------------------------------------------------------------------------------- +qreal VLayoutPaper::GetLayoutWidth() const +{ + return d->layoutWidth; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutPaper::SetLayoutWidth(qreal width) +{ + if (width >= 0) + { + d->layoutWidth = width; + } +} + //--------------------------------------------------------------------------------------------------------------------- unsigned int VLayoutPaper::GetShift() const { @@ -607,7 +622,7 @@ QVector VLayoutPaper::UniteWithContour(const VLayoutDetail &detail, int { if (j > nD) { - j=0; + j=1; } const QVector points = CutEdge(detail.Edge(j)); for (int i = 0; i < points.size()-1; ++i) @@ -616,7 +631,7 @@ QVector VLayoutPaper::UniteWithContour(const VLayoutDetail &detail, int } ++processedEdges; ++j; - }while (processedEdges < nD); + }while (processedEdges <= nD); } else { @@ -643,7 +658,7 @@ QVector VLayoutPaper::UniteWithContour(const VLayoutDetail &detail, int { if (j > nD) { - j=0; + j=1; } const QVector points = CutEdge(detail.Edge(j)); for (int i = 0; i < points.size()-1; ++i) @@ -652,7 +667,7 @@ QVector VLayoutPaper::UniteWithContour(const VLayoutDetail &detail, int } ++processedEdges; ++j; - }while (processedEdges < nD); + }while (processedEdges <= nD); } } } @@ -665,7 +680,7 @@ QLineF VLayoutPaper::GlobalEdge(int i) const if (d->details.isEmpty()) { // Because sheet is blank we have one global edge for all cases - Ox axis. - const QLineF axis = QLineF(0, 0, d->paperWidth, 0); + const QLineF axis = QLineF(0, 0, d->paperWidth - d->layoutWidth/2, 0); if (d->shift == 0) { return axis; @@ -831,8 +846,8 @@ void VLayoutPaper::DrawDebug(const VLayoutDetail &detail, int frame) const #endif paint.end(); - const QString path = QDir::homePath()+QStringLiteral("/LayoutDebug/")+QString("%1_%2.png").arg(d->paperIndex) - .arg(frame); + const QString path = QDir::homePath()+QStringLiteral("/LayoutDebug/")+QString("%1_%2_%3.png").arg(d->paperIndex) + .arg(d->details.count()).arg(frame); frameImage.save (path); } diff --git a/src/libs/vlayout/vlayoutpaper.h b/src/libs/vlayout/vlayoutpaper.h index 0bf62e1b6..bc950e5a4 100644 --- a/src/libs/vlayout/vlayoutpaper.h +++ b/src/libs/vlayout/vlayoutpaper.h @@ -55,6 +55,9 @@ public: int GetWidth() const; void SetWidth(int width); + qreal GetLayoutWidth() const; + void SetLayoutWidth(qreal width); + unsigned int GetShift() const; void SetShift(unsigned int shift); diff --git a/src/libs/vlayout/vlayoutpaper_p.h b/src/libs/vlayout/vlayoutpaper_p.h index 62e37923c..6acb7bef4 100644 --- a/src/libs/vlayout/vlayoutpaper_p.h +++ b/src/libs/vlayout/vlayoutpaper_p.h @@ -45,17 +45,18 @@ class VLayoutPaperData : public QSharedData public: VLayoutPaperData() :details(QVector()), globalContour(QVector()), paperHeight(0), paperWidth(0), shift(0), - paperIndex(0), frame(0) + paperIndex(0), frame(0), layoutWidth(0) {} VLayoutPaperData(int height, int width) :details(QVector()), globalContour(QVector()), paperHeight(height), paperWidth(width), - shift(0), paperIndex(0), frame(0) + shift(0), paperIndex(0), frame(0), layoutWidth(0) {} VLayoutPaperData(const VLayoutPaperData &paper) :QSharedData(paper), details(paper.details), globalContour(paper.globalContour), paperHeight(paper.paperHeight), - paperWidth(paper.paperWidth), shift(paper.shift), paperIndex(paper.paperIndex), frame(paper.frame) + paperWidth(paper.paperWidth), shift(paper.shift), paperIndex(paper.paperIndex), frame(paper.frame), + layoutWidth(paper.layoutWidth) {} ~VLayoutPaperData() {} @@ -75,6 +76,7 @@ public: unsigned int shift; quint32 paperIndex; quint32 frame; + qreal layoutWidth; }; #ifdef Q_CC_GNU From 696aaa413b793a1b021bfd4dc5e3a08edfea6af1 Mon Sep 17 00:00:00 2001 From: dismine Date: Sat, 17 Jan 2015 19:23:54 +0200 Subject: [PATCH 038/186] Fixes for method Mirror and debug system. --HG-- branch : feature --- src/libs/vlayout/vlayoutdetail.cpp | 14 ++++++++++++-- src/libs/vlayout/vlayoutpaper.cpp | 22 ++++++++-------------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/libs/vlayout/vlayoutdetail.cpp b/src/libs/vlayout/vlayoutdetail.cpp index 7255da1e2..cc71a6ed2 100644 --- a/src/libs/vlayout/vlayoutdetail.cpp +++ b/src/libs/vlayout/vlayoutdetail.cpp @@ -153,14 +153,24 @@ void VLayoutDetail::Mirror(const QLineF &edge) return; } - const QLineF axis = QLineF(edge.x1(), edge.y1(), 100, edge.y2()); // Ox axis + const QLineF axis = QLineF(edge.x2(), edge.y2(), edge.x2() + 100, edge.y2()); // Ox axis const qreal angle = edge.angleTo(axis); QMatrix m; m.translate(edge.p2().x(), edge.p2().y()); m.rotate(-angle); + m.translate(-edge.p2().x(), -edge.p2().y()); + d->matrix *= m; + + m.reset(); + m.translate(edge.p2().x(), edge.p2().y()); m.scale(m.m11(), m.m22()*-1); - m.rotate(360 - (-angle)); + m.translate(-edge.p2().x(), -edge.p2().y()); + d->matrix *= m; + + m.reset(); + m.translate(edge.p2().x(), edge.p2().y()); + m.rotate(-(360-angle)); m.translate(-edge.p2().x(), -edge.p2().y()); d->matrix *= m; } diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index 8d3f56ef3..a40b35df7 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -260,7 +260,7 @@ bool VLayoutPaper::AddToBlankSheet(const VLayoutDetail &detail, bool &stop) } d->frame = d->frame + 2; - for (int angle = 0; angle <= 360; ++angle) + for (int angle = 0; angle <= 360; angle = angle+5) { QCoreApplication::processEvents(); @@ -319,12 +319,8 @@ bool VLayoutPaper::AddToSheet(const VLayoutDetail &detail, bool &stop) bestResult.NewResult(static_cast(rec.width()*rec.height()), j, dEdge, workDetail.GetMatrix()); } - else - { - continue; // Outside of sheet. - } } - ++d->frame; + d->frame = d->frame + 2; } } @@ -582,8 +578,6 @@ void VLayoutPaper::CombineEdges(VLayoutDetail &detail, const QLineF &globalEdge, const qreal dx = globalEdge.x2() - detailEdge.x2(); const qreal dy = globalEdge.y2() - detailEdge.y2(); -// detailEdge = QLineF(detailEdge.x1()+dx, detailEdge.y1()+dy, detailEdge.x2()+dx, detailEdge.y2()+dy); -// angle = detailEdge.angle(); detailEdge.translate(dx, dy); // Use values for translate detail edge. const qreal angle_between = globalEdge.angleTo(detailEdge); // Seek angle between two edges. @@ -810,38 +804,38 @@ bool VLayoutPaper::SaveResult(const BestResult &bestResult, const VLayoutDetail //--------------------------------------------------------------------------------------------------------------------- void VLayoutPaper::DrawDebug(const VLayoutDetail &detail, int frame) const { - QImage frameImage(d->paperWidth*3, d->paperHeight*3, QImage::Format_RGB32); + QImage frameImage(d->paperWidth*2, d->paperHeight*2, QImage::Format_RGB32); frameImage.fill(Qt::white); QPainter paint; paint.begin(&frameImage); paint.setPen(QPen(Qt::darkRed, 3, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); - paint.drawRect(QRectF(d->paperWidth, d->paperHeight, d->paperWidth, d->paperHeight)); + paint.drawRect(QRectF(d->paperWidth/2, d->paperHeight/2, d->paperWidth, d->paperHeight)); paint.setPen(QPen(Qt::black, 3, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); QPainterPath p; if (d->globalContour.isEmpty()) { p = DrawContour(CutEdge(QLineF(0, 0, d->paperWidth, 0))); - p.translate(d->paperWidth, d->paperHeight); + p.translate(d->paperWidth/2, d->paperHeight/2); paint.drawPath(p); } else { p = DrawContour(d->globalContour); - p.translate(d->paperWidth, d->paperHeight); + p.translate(d->paperWidth/2, d->paperHeight/2); paint.drawPath(p); } paint.setPen(QPen(Qt::darkGreen, 3, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); p = DrawContour(detail.GetLayoutAllowencePoints()); - p.translate(d->paperWidth, d->paperHeight); + p.translate(d->paperWidth/2, d->paperHeight/2); paint.drawPath(p); #ifdef ARRANGED_DETAILS paint.setPen(QPen(Qt::blue, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); p = DrawDetails(); - p.translate(d->paperWidth, d->paperHeight); + p.translate(d->paperWidth/2, d->paperHeight/2); paint.drawPath(p); #endif From c044b334d7fb47c397db3cacd26d77d56ddb40cf Mon Sep 17 00:00:00 2001 From: dismine Date: Sat, 17 Jan 2015 22:51:17 +0200 Subject: [PATCH 039/186] Fix for method UniteWithContour. --HG-- branch : feature --- src/libs/vlayout/vlayoutpaper.cpp | 41 +++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index a40b35df7..8e8c255a0 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -639,11 +639,20 @@ QVector VLayoutPaper::UniteWithContour(const VLayoutDetail &detail, int return QVector(); } - for(int i=0; i < d->globalContour.count(); ++i) + int i2 = 0; + if (globalI == d->globalContour.count()) { - newContour.append(d->globalContour.at(i)); - ++i; - if (i==globalI) + i2 = 0; + } + else + { + i2 = globalI; + } + + int i=0; + while(i < d->globalContour.count()) + { + if (i == i2) { int processedEdges = 0; const int nD = detail.EdgesCount(); @@ -654,15 +663,31 @@ QVector VLayoutPaper::UniteWithContour(const VLayoutDetail &detail, int { j=1; } - const QVector points = CutEdge(detail.Edge(j)); - for (int i = 0; i < points.size()-1; ++i) + if (j != detJ) { - newContour.append(points.at(i)); + const QVector points = CutEdge(detail.Edge(j)); + for (int i = 0; i < points.size()-1; ++i) + { + newContour.append(points.at(i)); + } } ++processedEdges; ++j; - }while (processedEdges <= nD); + }while (processedEdges < nD); } + + if (newContour.isEmpty() == false) + { + if (newContour.last() != d->globalContour.at(i)) + { + newContour.append(d->globalContour.at(i)); + } + } + else + { + newContour.append(d->globalContour.at(i)); + } + ++i; } } return newContour; From c191059ddd46dd4ff2a1e5864d0a27ddd1b713f8 Mon Sep 17 00:00:00 2001 From: dismine Date: Sun, 18 Jan 2015 20:56:01 +0200 Subject: [PATCH 040/186] Changed Point-In-Polygon Algorithm. Additional field for saving mirror state. --HG-- branch : feature --- src/libs/vlayout/vlayoutdef.h | 6 +- src/libs/vlayout/vlayoutdetail.cpp | 26 ++++++-- src/libs/vlayout/vlayoutdetail.h | 7 +- src/libs/vlayout/vlayoutdetail_p.h | 10 +-- src/libs/vlayout/vlayoutpaper.cpp | 102 +++++++++++++++++++++++------ src/libs/vlayout/vlayoutpaper.h | 6 +- 6 files changed, 122 insertions(+), 35 deletions(-) diff --git a/src/libs/vlayout/vlayoutdef.h b/src/libs/vlayout/vlayoutdef.h index 3ceb260f8..ef42dd6e9 100644 --- a/src/libs/vlayout/vlayoutdef.h +++ b/src/libs/vlayout/vlayoutdef.h @@ -40,13 +40,17 @@ enum class LayoutErrors : char EmptyPaperError }; -//#define LAYOUT_DEBUG // Enable debug mode +#define LAYOUT_DEBUG // Enable debug mode #ifdef LAYOUT_DEBUG # define SHOW_VERTICES // Show contour vertices # define SHOW_DIRECTION // Show contour direction # define ARRANGED_DETAILS // Show already arranged details +//# define SHOW_CANDIDATE //# define SHOW_ROTATION +//# define SHOW_COMBINE +//# define SHOW_MIRROR +# define SHOW_BEST #endif//LAYOUT_DEBUG #endif // VLAYOUTDEF_H diff --git a/src/libs/vlayout/vlayoutdetail.cpp b/src/libs/vlayout/vlayoutdetail.cpp index cc71a6ed2..a4cdc5cce 100644 --- a/src/libs/vlayout/vlayoutdetail.cpp +++ b/src/libs/vlayout/vlayoutdetail.cpp @@ -104,13 +104,13 @@ QVector VLayoutDetail::GetLayoutAllowencePoints() const } //--------------------------------------------------------------------------------------------------------------------- -QMatrix VLayoutDetail::GetMatrix() const +QTransform VLayoutDetail::GetMatrix() const { return d->matrix; } //--------------------------------------------------------------------------------------------------------------------- -void VLayoutDetail::SetMatrix(const QMatrix &matrix) +void VLayoutDetail::SetMatrix(const QTransform &matrix) { d->matrix = matrix; } @@ -130,7 +130,7 @@ void VLayoutDetail::SetLayoutWidth(const qreal &value) //--------------------------------------------------------------------------------------------------------------------- void VLayoutDetail::Translate(qreal dx, qreal dy) { - QMatrix m; + QTransform m; m.translate(dx, dy); d->matrix *= m; } @@ -138,7 +138,7 @@ void VLayoutDetail::Translate(qreal dx, qreal dy) //--------------------------------------------------------------------------------------------------------------------- void VLayoutDetail::Rotate(const QPointF &originPoint, qreal degrees) { - QMatrix m; + QTransform m; m.translate(originPoint.x(), originPoint.y()); m.rotate(-degrees); m.translate(-originPoint.x(), -originPoint.y()); @@ -156,7 +156,7 @@ void VLayoutDetail::Mirror(const QLineF &edge) const QLineF axis = QLineF(edge.x2(), edge.y2(), edge.x2() + 100, edge.y2()); // Ox axis const qreal angle = edge.angleTo(axis); - QMatrix m; + QTransform m; m.translate(edge.p2().x(), edge.p2().y()); m.rotate(-angle); m.translate(-edge.p2().x(), -edge.p2().y()); @@ -173,6 +173,8 @@ void VLayoutDetail::Mirror(const QLineF &edge) m.rotate(-(360-angle)); m.translate(-edge.p2().x(), -edge.p2().y()); d->matrix *= m; + + d->mirror = !d->mirror; } //--------------------------------------------------------------------------------------------------------------------- @@ -337,7 +339,7 @@ QVector VLayoutDetail::Map(const QVector &points) const p.append(d->matrix.map(points.at(i))); } - if (d->matrix.m22() < 0) + if (d->mirror) { QList list = p.toList(); for(int k=0, s=list.size(), max=(s/2); ksetPath(ContourPath()); return item; } + +//--------------------------------------------------------------------------------------------------------------------- +bool VLayoutDetail::IsMirror() const +{ + return d->mirror; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutDetail::SetMirror(bool value) +{ + d->mirror = value; +} diff --git a/src/libs/vlayout/vlayoutdetail.h b/src/libs/vlayout/vlayoutdetail.h index e926016ed..2ca4ac76f 100644 --- a/src/libs/vlayout/vlayoutdetail.h +++ b/src/libs/vlayout/vlayoutdetail.h @@ -54,12 +54,15 @@ public: QVector GetLayoutAllowencePoints() const; void SetLayoutAllowencePoints(); - QMatrix GetMatrix() const; - void SetMatrix(const QMatrix &matrix); + QTransform GetMatrix() const; + void SetMatrix(const QTransform &matrix); qreal GetLayoutWidth() const; void SetLayoutWidth(const qreal &value); + bool IsMirror() const; + void SetMirror(bool value); + void Translate(qreal dx, qreal dy); void Rotate(const QPointF &originPoint, qreal degrees); void Mirror(const QLineF &edge); diff --git a/src/libs/vlayout/vlayoutdetail_p.h b/src/libs/vlayout/vlayoutdetail_p.h index a15dd1e5e..296f1c780 100644 --- a/src/libs/vlayout/vlayoutdetail_p.h +++ b/src/libs/vlayout/vlayoutdetail_p.h @@ -32,7 +32,7 @@ #include #include #include -#include +#include #ifdef Q_CC_GNU #pragma GCC diagnostic push @@ -44,12 +44,12 @@ class VLayoutDetailData : public QSharedData public: VLayoutDetailData() :contour(QVector()), seamAllowence(QVector()), layoutAllowence(QVector()), - matrix(QMatrix()), layoutWidth(0) + matrix(QMatrix()), layoutWidth(0), mirror(false) {} VLayoutDetailData(const VLayoutDetailData &detail) :QSharedData(detail), contour(detail.contour), seamAllowence(detail.seamAllowence), - layoutAllowence(detail.layoutAllowence), matrix(detail.matrix), layoutWidth(detail.layoutWidth) + layoutAllowence(detail.layoutAllowence), matrix(detail.matrix), layoutWidth(detail.layoutWidth), mirror(false) {} ~VLayoutDetailData() {} @@ -64,10 +64,12 @@ public: QVector layoutAllowence; /** @brief matrix transformation matrix*/ - QMatrix matrix; + QTransform matrix; /** @brief layoutWidth value layout allowence width in pixels. */ qreal layoutWidth; + + bool mirror; }; #ifdef Q_CC_GNU diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index 8e8c255a0..30f8edab2 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -43,31 +43,33 @@ class BestResult public: BestResult(); - void NewResult(qint64 square, int i, int j, const QMatrix &matrix); + void NewResult(qint64 square, int i, int j, const QTransform &matrix, bool mirror); qint64 BestSquare() const; int GContourEdge() const; int DetailEdge() const; - QMatrix Matrix() const; + QTransform Matrix() const; bool ValideResult() const; + bool Mirror() const; private: // All nedded information about best result int resI; // Edge of global contour int resJ; // Edge of detail - QMatrix resMatrix; // Matrix for rotation and translation detail + QTransform resMatrix; // Matrix for rotation and translation detail qint64 resSquare; // Best square size (least). For begin set max value. bool valideResult; + bool resMirror; }; //===================================================BestResult======================================================== //--------------------------------------------------------------------------------------------------------------------- BestResult::BestResult() - :resI(0), resJ(0), resMatrix(QMatrix()), resSquare(LLONG_MAX),valideResult(false) + :resI(0), resJ(0), resMatrix(QMatrix()), resSquare(LLONG_MAX), valideResult(false), resMirror(false) {} //--------------------------------------------------------------------------------------------------------------------- -void BestResult::NewResult(qint64 square, int i, int j, const QMatrix &matrix) +void BestResult::NewResult(qint64 square, int i, int j, const QTransform &matrix, bool mirror) { if (square <= resSquare && square > 0) { @@ -76,6 +78,7 @@ void BestResult::NewResult(qint64 square, int i, int j, const QMatrix &matrix) resMatrix = matrix; resSquare = square; valideResult = true; + resMirror = mirror; } } @@ -98,7 +101,7 @@ int BestResult::DetailEdge() const } //--------------------------------------------------------------------------------------------------------------------- -QMatrix BestResult::Matrix() const +QTransform BestResult::Matrix() const { return resMatrix; } @@ -109,6 +112,12 @@ bool BestResult::ValideResult() const return valideResult; } +//--------------------------------------------------------------------------------------------------------------------- +bool BestResult::Mirror() const +{ + return resMirror; +} + //===================================================VLayoutPaper====================================================== //--------------------------------------------------------------------------------------------------------------------- VLayoutPaper::VLayoutPaper() @@ -255,12 +264,12 @@ bool VLayoutPaper::AddToBlankSheet(const VLayoutDetail &detail, bool &stop) if (SheetContains(rec)) { bestResult.NewResult(static_cast(rec.width()*rec.height()), j, dEdge, - workDetail.GetMatrix()); + workDetail.GetMatrix(), workDetail.IsMirror()); } } d->frame = d->frame + 2; - for (int angle = 0; angle <= 360; angle = angle+5) + for (int angle = 0; angle <= 360; angle = angle+20) { QCoreApplication::processEvents(); @@ -278,7 +287,7 @@ bool VLayoutPaper::AddToBlankSheet(const VLayoutDetail &detail, bool &stop) if (SheetContains(rec)) { bestResult.NewResult(static_cast(rec.width()*rec.height()), j, i, - workDetail.GetMatrix()); + workDetail.GetMatrix(), workDetail.IsMirror()); } } ++d->frame; @@ -317,7 +326,7 @@ bool VLayoutPaper::AddToSheet(const VLayoutDetail &detail, bool &stop) newGContour.append(newGContour.first()); const QRectF rec = QPolygonF(newGContour).boundingRect(); bestResult.NewResult(static_cast(rec.width()*rec.height()), j, dEdge, - workDetail.GetMatrix()); + workDetail.GetMatrix(), workDetail.IsMirror()); } } d->frame = d->frame + 2; @@ -337,7 +346,9 @@ bool VLayoutPaper::CheckCombineEdges(VLayoutDetail &detail, int j, int &dEdge) c CombineEdges(detail, globalEdge, dEdge); #ifdef LAYOUT_DEBUG - DrawDebug(detail, d->frame); +# ifdef SHOW_COMBINE + DrawDebug(detail, d->frame); +# endif #endif switch (Crossing(detail, j, dEdge)) @@ -372,7 +383,9 @@ bool VLayoutPaper::CheckCombineEdges(VLayoutDetail &detail, int j, int &dEdge) c if (flagMirror) { #ifdef LAYOUT_DEBUG - DrawDebug(detail, d->frame+1); + #ifdef SHOW_MIRROR + DrawDebug(detail, d->frame+1); + #endif #endif dEdge = detail.EdgeByPoint(globalEdge.p2()); @@ -455,7 +468,8 @@ bool VLayoutPaper::CheckRotationEdges(VLayoutDetail &detail, int j, int dEdge, i } //--------------------------------------------------------------------------------------------------------------------- -VLayoutPaper::CrossingType VLayoutPaper::Crossing(const VLayoutDetail &detail, int globalI, int detailI) const +VLayoutPaper::CrossingType VLayoutPaper::Crossing(const VLayoutDetail &detail, const int &globalI, + const int &detailI) const { int globalEdgesCount = EdgesCount(); if (globalEdgesCount == 0) @@ -507,7 +521,7 @@ VLayoutPaper::CrossingType VLayoutPaper::Crossing(const VLayoutDetail &detail, i } //--------------------------------------------------------------------------------------------------------------------- -VLayoutPaper::InsideType VLayoutPaper::InsideContour(const VLayoutDetail &detail, int detailI) const +VLayoutPaper::InsideType VLayoutPaper::InsideContour(const VLayoutDetail &detail, const int &detailI) const { if (detail.EdgesCount() < 3) { @@ -535,10 +549,35 @@ VLayoutPaper::InsideType VLayoutPaper::InsideContour(const VLayoutDetail &detail } else { - const QPolygonF gPoly = GlobalPolygon(); - for(int i = 0; i < lPoints.count(); i++) + const int polyCorners = EdgesCount(); + int j = polyCorners-1; + + QVector constant; + QVector multiple; + + for(int i=0; iglobalContour.at(i).x(); + const qreal xj = d->globalContour.at(j).x(); + const qreal yi = d->globalContour.at(i).y(); + const qreal yj = d->globalContour.at(j).y(); + if(qFuzzyCompare(yj, yi)) + { + constant.insert(i, xi); + multiple.insert(i, 0); + } + else + { + constant.insert(i, xi - (yi*xj)/(yj-yi) + (yi*xi)/(yj-yi)); + multiple.insert(i, (xj-xi)/(yj-yi)); + } + + j=i; + } + + for(int k = 0; k < lPoints.count(); k++) + { + const QPointF p = lPoints.at(k); if (p.isNull()) { return InsideType::EdgeError; @@ -546,7 +585,23 @@ VLayoutPaper::InsideType VLayoutPaper::InsideContour(const VLayoutDetail &detail if (p != detailEdge.p1() && p != detailEdge.p2()) { - if (gPoly.containsPoint(p, Qt::OddEvenFill)) + int j = polyCorners-1; + bool oddNodes = false; + + for (int i=0; iglobalContour.at(i).y(); + const qreal yj = d->globalContour.at(j).y(); + + if (((yi < p.y() && yj >= p.y()) || (yj < p.y() && yi >= p.y()))) + { + oddNodes ^= (p.y() * multiple.at(i) + constant.at(i) < p.x()); + } + + j=i; + } + + if (oddNodes) { return InsideType::Inside; } @@ -570,7 +625,7 @@ bool VLayoutPaper::SheetContains(const QRectF &rect) const } //--------------------------------------------------------------------------------------------------------------------- -void VLayoutPaper::CombineEdges(VLayoutDetail &detail, const QLineF &globalEdge, int dEdge) const +void VLayoutPaper::CombineEdges(VLayoutDetail &detail, const QLineF &globalEdge, const int &dEdge) const { QLineF detailEdge = detail.Edge(dEdge); @@ -813,6 +868,7 @@ bool VLayoutPaper::SaveResult(const BestResult &bestResult, const VLayoutDetail { VLayoutDetail workDetail = detail; workDetail.SetMatrix(bestResult.Matrix());// Don't forget set matrix + workDetail.SetMirror(bestResult.Mirror()); const QVector newGContour = UniteWithContour(workDetail, bestResult.GContourEdge(), bestResult.DetailEdge()); if (newGContour.isEmpty()) @@ -821,6 +877,12 @@ bool VLayoutPaper::SaveResult(const BestResult &bestResult, const VLayoutDetail } d->details.append(workDetail); d->globalContour = newGContour; + +#ifdef LAYOUT_DEBUG +# ifdef SHOW_BEST + DrawDebug(workDetail, UINT_MAX); +# endif +#endif } return bestResult.ValideResult(); // Do we have the best result? @@ -852,10 +914,12 @@ void VLayoutPaper::DrawDebug(const VLayoutDetail &detail, int frame) const paint.drawPath(p); } +#ifdef SHOW_CANDIDATE paint.setPen(QPen(Qt::darkGreen, 3, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); p = DrawContour(detail.GetLayoutAllowencePoints()); p.translate(d->paperWidth/2, d->paperHeight/2); paint.drawPath(p); +#endif #ifdef ARRANGED_DETAILS paint.setPen(QPen(Qt::blue, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); diff --git a/src/libs/vlayout/vlayoutpaper.h b/src/libs/vlayout/vlayoutpaper.h index bc950e5a4..ce74ccf0e 100644 --- a/src/libs/vlayout/vlayoutpaper.h +++ b/src/libs/vlayout/vlayoutpaper.h @@ -90,12 +90,12 @@ private: bool CheckCombineEdges(VLayoutDetail &detail, int j, int &dEdge) const; bool CheckRotationEdges(VLayoutDetail &detail, int j, int dEdge, int angle) const; - CrossingType Crossing(const VLayoutDetail &detail, int globalI, int detailI) const; - InsideType InsideContour(const VLayoutDetail &detail, int detailI) const; + CrossingType Crossing(const VLayoutDetail &detail, const int &globalI, const int &detailI) const; + InsideType InsideContour(const VLayoutDetail &detail, const int &detailI) const; qreal CheckSide(const QLineF &edge, const QPointF &p) const; bool SheetContains(const QRectF &rect) const; - void CombineEdges(VLayoutDetail &detail, const QLineF &globalEdge, int dEdge) const; + void CombineEdges(VLayoutDetail &detail, const QLineF &globalEdge, const int &dEdge) const; void RotateEdges(VLayoutDetail &detail, const QLineF &globalEdge, int dEdge, int angle) const; QVector UniteWithContour(const VLayoutDetail &detail, int globalI, int detJ) const; From 2937a9e59426e0da6a74e58fa4c72a32c381ff0a Mon Sep 17 00:00:00 2001 From: dismine Date: Sun, 18 Jan 2015 22:21:20 +0200 Subject: [PATCH 041/186] Wrong rule for check true intersection. --HG-- branch : feature --- src/libs/vlayout/vlayoutpaper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index 30f8edab2..7d7c548ea 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -1021,7 +1021,7 @@ bool VLayoutPaper::TrueIntersection(const QLineF &gEdge, const QLineF &dEdge, co const QPointF gP2 = RoundedPoint(gEdge.p2()); const QPointF dP1 = RoundedPoint(dEdge.p1()); const QPointF dP2 = RoundedPoint(dEdge.p2()); - return pX != gP1 && pX != gP2 && pX != dP1 && pX != dP2; + return !(pX == gP1 || pX == gP2 || pX == dP1 || pX == dP2); } //--------------------------------------------------------------------------------------------------------------------- From dc2620e0dfa88a5b5921ab8f59b1492b5008c991 Mon Sep 17 00:00:00 2001 From: dismine Date: Mon, 19 Jan 2015 12:14:54 +0200 Subject: [PATCH 042/186] Need additional point on each edge for check if workpiece inside of global contour. --HG-- branch : feature --- src/libs/vlayout/vlayoutpaper.cpp | 58 +++++++++++++++++++++---------- src/libs/vlayout/vlayoutpaper.h | 1 + 2 files changed, 41 insertions(+), 18 deletions(-) diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index 7d7c548ea..ad8975880 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -575,35 +575,44 @@ VLayoutPaper::InsideType VLayoutPaper::InsideContour(const VLayoutDetail &detail j=i; } - for(int k = 0; k < lPoints.count(); k++) + for(int m = 1; m <= detail.EdgesCount(); ++m) { - const QPointF p = lPoints.at(k); - if (p.isNull()) + if (m == detailI) + { + continue; + } + + const QLineF detailEdge = detail.Edge(m); + if (detailEdge.isNull()) // Got null edge { return InsideType::EdgeError; } - if (p != detailEdge.p1() && p != detailEdge.p2()) + const QVector p = Triplet(detailEdge); + for (int n=0; nglobalContour.at(i).y(); - const qreal yj = d->globalContour.at(j).y(); + int j = polyCorners-1; + bool oddNodes = false; - if (((yi < p.y() && yj >= p.y()) || (yj < p.y() && yi >= p.y()))) + for (int i=0; iglobalContour.at(i).y(); + const qreal yj = d->globalContour.at(j).y(); + + if (((yi < p.at(n).y() && yj >= p.at(n).y()) || (yj < p.at(n).y() && yi >= p.at(n).y()))) + { + oddNodes ^= (p.at(n).y() * multiple.at(i) + constant.at(i) < p.at(n).x()); + } + + j=i; } - j=i; - } - - if (oddNodes) - { - return InsideType::Inside; + if (oddNodes) + { + return InsideType::Inside; + } } } } @@ -1030,6 +1039,19 @@ QPointF VLayoutPaper::RoundedPoint(const QPointF &p) const return QPointF(qRound(p.x()), qRound(p.y())); } +//--------------------------------------------------------------------------------------------------------------------- +QVector VLayoutPaper::Triplet(const QLineF &edge) const +{ + QVector p; + QLineF line = edge; + line.setLength(edge.length()/2); + + p.append(edge.p1()); + p.append(line.p2()); + p.append(edge.p2()); + return p; +} + //--------------------------------------------------------------------------------------------------------------------- QGraphicsItem *VLayoutPaper::GetItem() const { diff --git a/src/libs/vlayout/vlayoutpaper.h b/src/libs/vlayout/vlayoutpaper.h index ce74ccf0e..62d477af9 100644 --- a/src/libs/vlayout/vlayoutpaper.h +++ b/src/libs/vlayout/vlayoutpaper.h @@ -116,6 +116,7 @@ private: bool TrueIntersection(const QLineF &gEdge, const QLineF &dEdge, const QPointF &p) const; QPointF RoundedPoint(const QPointF &p) const; + QVector Triplet(const QLineF &edge) const; }; #endif // VLAYOUTPAPER_H From 3c76f32bedffdacc4a5f11a90a5f6724772ce99f Mon Sep 17 00:00:00 2001 From: dismine Date: Mon, 19 Jan 2015 12:36:27 +0200 Subject: [PATCH 043/186] Alwayse first check if workpiece inside of paper sheet rect. --HG-- branch : feature --- src/libs/vlayout/vlayoutdef.h | 2 +- src/libs/vlayout/vlayoutpaper.cpp | 53 +++++++++++++++++++------------ 2 files changed, 33 insertions(+), 22 deletions(-) diff --git a/src/libs/vlayout/vlayoutdef.h b/src/libs/vlayout/vlayoutdef.h index ef42dd6e9..e3307584e 100644 --- a/src/libs/vlayout/vlayoutdef.h +++ b/src/libs/vlayout/vlayoutdef.h @@ -40,7 +40,7 @@ enum class LayoutErrors : char EmptyPaperError }; -#define LAYOUT_DEBUG // Enable debug mode +//#define LAYOUT_DEBUG // Enable debug mode #ifdef LAYOUT_DEBUG # define SHOW_VERTICES // Show contour vertices diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index ad8975880..23dae8cbf 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -261,11 +261,8 @@ bool VLayoutPaper::AddToBlankSheet(const VLayoutDetail &detail, bool &stop) if (CheckCombineEdges(workDetail, j, dEdge)) { const QRectF rec = workDetail.BoundingRect(); - if (SheetContains(rec)) - { - bestResult.NewResult(static_cast(rec.width()*rec.height()), j, dEdge, - workDetail.GetMatrix(), workDetail.IsMirror()); - } + bestResult.NewResult(static_cast(rec.width()*rec.height()), j, dEdge, + workDetail.GetMatrix(), workDetail.IsMirror()); } d->frame = d->frame + 2; @@ -284,11 +281,8 @@ bool VLayoutPaper::AddToBlankSheet(const VLayoutDetail &detail, bool &stop) if (CheckRotationEdges(workDetail, j, i, angle)) { const QRectF rec = workDetail.BoundingRect(); - if (SheetContains(rec)) - { - bestResult.NewResult(static_cast(rec.width()*rec.height()), j, i, - workDetail.GetMatrix(), workDetail.IsMirror()); - } + bestResult.NewResult(static_cast(rec.width()*rec.height()), j, i, + workDetail.GetMatrix(), workDetail.IsMirror()); } ++d->frame; } @@ -320,14 +314,11 @@ bool VLayoutPaper::AddToSheet(const VLayoutDetail &detail, bool &stop) int dEdge = i;// For mirror detail edge will be different if (CheckCombineEdges(workDetail, j, dEdge)) { - if (SheetContains(workDetail.BoundingRect())) - { - QVector newGContour = UniteWithContour(workDetail, j, dEdge); - newGContour.append(newGContour.first()); - const QRectF rec = QPolygonF(newGContour).boundingRect(); - bestResult.NewResult(static_cast(rec.width()*rec.height()), j, dEdge, - workDetail.GetMatrix(), workDetail.IsMirror()); - } + QVector newGContour = UniteWithContour(workDetail, j, dEdge); + newGContour.append(newGContour.first()); + const QRectF rec = QPolygonF(newGContour).boundingRect(); + bestResult.NewResult(static_cast(rec.width()*rec.height()), j, dEdge, + workDetail.GetMatrix(), workDetail.IsMirror()); } d->frame = d->frame + 2; } @@ -351,7 +342,13 @@ bool VLayoutPaper::CheckCombineEdges(VLayoutDetail &detail, int j, int &dEdge) c # endif #endif - switch (Crossing(detail, j, dEdge)) + CrossingType type = CrossingType::Intersection; + if (SheetContains(detail.BoundingRect())) + { + type = Crossing(detail, j, dEdge); + } + + switch (type) { case CrossingType::EdgeError: return false; @@ -394,7 +391,13 @@ bool VLayoutPaper::CheckCombineEdges(VLayoutDetail &detail, int j, int &dEdge) c return false; } - switch (Crossing(detail, j, dEdge)) + CrossingType type = CrossingType::Intersection; + if (SheetContains(detail.BoundingRect())) + { + type = Crossing(detail, j, dEdge); + } + + switch (type) { case CrossingType::EdgeError: return false; @@ -438,7 +441,13 @@ bool VLayoutPaper::CheckRotationEdges(VLayoutDetail &detail, int j, int dEdge, i #endif #endif - switch (Crossing(detail, j, dEdge)) + CrossingType type = CrossingType::Intersection; + if (SheetContains(detail.BoundingRect())) + { + type = Crossing(detail, j, dEdge); + } + + switch (type) { case CrossingType::EdgeError: return false; @@ -935,6 +944,8 @@ void VLayoutPaper::DrawDebug(const VLayoutDetail &detail, int frame) const p = DrawDetails(); p.translate(d->paperWidth/2, d->paperHeight/2); paint.drawPath(p); +#else + Q_UNUSED(detail) #endif paint.end(); From 120f4cf56585f01023938576cd551cf96030f030 Mon Sep 17 00:00:00 2001 From: dismine Date: Mon, 19 Jan 2015 16:13:26 +0200 Subject: [PATCH 044/186] Speed optimization. --HG-- branch : feature --- src/libs/vlayout/vlayoutdetail.cpp | 23 ++++++++++++++++++----- src/libs/vlayout/vlayoutdetail_p.h | 3 ++- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/libs/vlayout/vlayoutdetail.cpp b/src/libs/vlayout/vlayoutdetail.cpp index a4cdc5cce..965f6ade4 100644 --- a/src/libs/vlayout/vlayoutdetail.cpp +++ b/src/libs/vlayout/vlayoutdetail.cpp @@ -190,17 +190,30 @@ QLineF VLayoutDetail::Edge(int i) const { // Doesn't exist such edge return QLineF(); } - const QVector points = GetLayoutAllowencePoints(); - QLineF edge; + + int i1, i2; if (i < EdgesCount()) { - edge = QLineF(points.at(i-1), points.at(i)); + i1 = i-1; + i2 = i; } else { - edge = QLineF(points.at(EdgesCount()-1), points.at(0)); + i1 = EdgesCount()-1; + i2 = 0; + } + + if (d->mirror) + { + const int oldI1 = i1; + i1 = (d->layoutAllowence.size()-1) - i2; + i2 = (d->layoutAllowence.size()-1) - oldI1; + return QLineF(d->matrix.map(d->layoutAllowence.at(i2)), d->matrix.map(d->layoutAllowence.at(i1))); + } + else + { + return QLineF(d->matrix.map(d->layoutAllowence.at(i1)), d->matrix.map(d->layoutAllowence.at(i2))); } - return edge; } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vlayout/vlayoutdetail_p.h b/src/libs/vlayout/vlayoutdetail_p.h index 296f1c780..04c687d05 100644 --- a/src/libs/vlayout/vlayoutdetail_p.h +++ b/src/libs/vlayout/vlayoutdetail_p.h @@ -49,7 +49,8 @@ public: VLayoutDetailData(const VLayoutDetailData &detail) :QSharedData(detail), contour(detail.contour), seamAllowence(detail.seamAllowence), - layoutAllowence(detail.layoutAllowence), matrix(detail.matrix), layoutWidth(detail.layoutWidth), mirror(false) + layoutAllowence(detail.layoutAllowence), matrix(detail.matrix), layoutWidth(detail.layoutWidth), + mirror(detail.mirror) {} ~VLayoutDetailData() {} From 366519781b4b3fd3fd776b898f0690a4fdf8d215 Mon Sep 17 00:00:00 2001 From: dismine Date: Mon, 19 Jan 2015 20:01:42 +0200 Subject: [PATCH 045/186] Fix for method InsideContour. --HG-- branch : feature --- src/libs/vlayout/vlayoutpaper.cpp | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index 23dae8cbf..6838f972d 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -600,28 +600,25 @@ VLayoutPaper::InsideType VLayoutPaper::InsideContour(const VLayoutDetail &detail const QVector p = Triplet(detailEdge); for (int n=0; nglobalContour.at(i).y(); + const qreal yj = d->globalContour.at(j).y(); - for (int i=0; i= p.at(n).y()) || (yj < p.at(n).y() && yi >= p.at(n).y()))) { - const qreal yi = d->globalContour.at(i).y(); - const qreal yj = d->globalContour.at(j).y(); - - if (((yi < p.at(n).y() && yj >= p.at(n).y()) || (yj < p.at(n).y() && yi >= p.at(n).y()))) - { - oddNodes ^= (p.at(n).y() * multiple.at(i) + constant.at(i) < p.at(n).x()); - } - - j=i; + oddNodes ^= (p.at(n).y() * multiple.at(i) + constant.at(i) < p.at(n).x()); } - if (oddNodes) - { - return InsideType::Inside; - } + j=i; + } + + if (oddNodes) + { + return InsideType::Inside; } } } From 2355e435a5ca1efe045c9049ef63b68e3991d09d Mon Sep 17 00:00:00 2001 From: dismine Date: Mon, 19 Jan 2015 20:07:32 +0200 Subject: [PATCH 046/186] Fix for method Crossing. --HG-- branch : feature --- src/libs/vlayout/vlayoutpaper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index 6838f972d..c79bf7939 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -518,7 +518,7 @@ VLayoutPaper::CrossingType VLayoutPaper::Crossing(const VLayoutDetail &detail, c if (type == QLineF::BoundedIntersection) { - if (TrueIntersection(globalEdge, detailEdge, xPoint)) + if (TrueIntersection(GlobalEdge(globalI), detail.Edge(detailI), xPoint)) { return CrossingType::Intersection; } From 7970678575fb87ed2f3908cf1df5302ad3e1cc68 Mon Sep 17 00:00:00 2001 From: dismine Date: Tue, 20 Jan 2015 14:50:24 +0200 Subject: [PATCH 047/186] Fix for method UniteWithContour. --HG-- branch : feature --- src/libs/vlayout/vabstractdetail.h | 5 ++++- src/libs/vlayout/vlayoutdef.h | 1 + src/libs/vlayout/vlayoutdetail.cpp | 7 ++++--- src/libs/vlayout/vlayoutpaper.cpp | 28 ++++++++++++++++++++++++---- 4 files changed, 33 insertions(+), 8 deletions(-) diff --git a/src/libs/vlayout/vabstractdetail.h b/src/libs/vlayout/vabstractdetail.h index f5c08f256..e6958c121 100644 --- a/src/libs/vlayout/vabstractdetail.h +++ b/src/libs/vlayout/vabstractdetail.h @@ -65,10 +65,13 @@ public: void setWidth(const qreal &value); static QVector Equidistant(const QVector &points, const EquidistantType &eqv, qreal width); + +protected: + static QVector RemoveDublicates(const QVector &points); + private: QSharedDataPointer d; - static QVector RemoveDublicates(const QVector &points); static QVector CorrectEquidistantPoints(const QVector &points); static QVector CheckLoops(const QVector &points); static QVector EkvPoint(const QLineF &line1, const QLineF &line2, const qreal &width); diff --git a/src/libs/vlayout/vlayoutdef.h b/src/libs/vlayout/vlayoutdef.h index e3307584e..a69675862 100644 --- a/src/libs/vlayout/vlayoutdef.h +++ b/src/libs/vlayout/vlayoutdef.h @@ -50,6 +50,7 @@ enum class LayoutErrors : char //# define SHOW_ROTATION //# define SHOW_COMBINE //# define SHOW_MIRROR +//# define SHOW_CANDIDATE_BEST # define SHOW_BEST #endif//LAYOUT_DEBUG diff --git a/src/libs/vlayout/vlayoutdetail.cpp b/src/libs/vlayout/vlayoutdetail.cpp index 965f6ade4..d440ba452 100644 --- a/src/libs/vlayout/vlayoutdetail.cpp +++ b/src/libs/vlayout/vlayoutdetail.cpp @@ -75,7 +75,7 @@ void VLayoutDetail::SetCountourPoints(const QVector &points) d->contour.removeLast(); } - d->contour = RoundPoints(d->contour); + d->contour = RemoveDublicates(RoundPoints(d->contour)); } //--------------------------------------------------------------------------------------------------------------------- @@ -94,7 +94,7 @@ void VLayoutDetail::SetSeamAllowencePoints(const QVector &points) d->seamAllowence.removeLast(); } - d->seamAllowence = RoundPoints(d->seamAllowence); + d->seamAllowence = RemoveDublicates(RoundPoints(d->seamAllowence)); } //--------------------------------------------------------------------------------------------------------------------- @@ -245,7 +245,8 @@ QRectF VLayoutDetail::BoundingRect() const { QVector points = GetLayoutAllowencePoints(); points.append(points.first()); - return QPolygonF(points).boundingRect(); + QRectF rec = QPolygonF(points).boundingRect(); + return rec; } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index c79bf7939..fc3936517 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -260,11 +260,18 @@ bool VLayoutPaper::AddToBlankSheet(const VLayoutDetail &detail, bool &stop) int dEdge = i;// For mirrored detail edge will be different if (CheckCombineEdges(workDetail, j, dEdge)) { + #ifdef LAYOUT_DEBUG + # ifdef SHOW_CANDIDATE_BEST + DrawDebug(workDetail, d->frame+2); + + # endif + #endif + const QRectF rec = workDetail.BoundingRect(); bestResult.NewResult(static_cast(rec.width()*rec.height()), j, dEdge, workDetail.GetMatrix(), workDetail.IsMirror()); } - d->frame = d->frame + 2; + d->frame = d->frame + 3; for (int angle = 0; angle <= 360; angle = angle+20) { @@ -280,6 +287,13 @@ bool VLayoutPaper::AddToBlankSheet(const VLayoutDetail &detail, bool &stop) if (CheckRotationEdges(workDetail, j, i, angle)) { + #ifdef LAYOUT_DEBUG + # ifdef SHOW_CANDIDATE_BEST + ++d->frame; + DrawDebug(workDetail, d->frame); + # endif + #endif + const QRectF rec = workDetail.BoundingRect(); bestResult.NewResult(static_cast(rec.width()*rec.height()), j, i, workDetail.GetMatrix(), workDetail.IsMirror()); @@ -314,13 +328,19 @@ bool VLayoutPaper::AddToSheet(const VLayoutDetail &detail, bool &stop) int dEdge = i;// For mirror detail edge will be different if (CheckCombineEdges(workDetail, j, dEdge)) { + #ifdef LAYOUT_DEBUG + # ifdef SHOW_CANDIDATE_BEST + DrawDebug(workDetail, d->frame+2); + # endif + #endif + QVector newGContour = UniteWithContour(workDetail, j, dEdge); newGContour.append(newGContour.first()); const QRectF rec = QPolygonF(newGContour).boundingRect(); bestResult.NewResult(static_cast(rec.width()*rec.height()), j, dEdge, workDetail.GetMatrix(), workDetail.IsMirror()); } - d->frame = d->frame + 2; + d->frame = d->frame + 3; } } @@ -695,7 +715,7 @@ QVector VLayoutPaper::UniteWithContour(const VLayoutDetail &detail, int } ++processedEdges; ++j; - }while (processedEdges <= nD); + }while (processedEdges < nD); } else { @@ -911,7 +931,7 @@ void VLayoutPaper::DrawDebug(const VLayoutDetail &detail, int frame) const QPainter paint; paint.begin(&frameImage); - paint.setPen(QPen(Qt::darkRed, 3, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); + paint.setPen(QPen(Qt::darkRed, 10, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); paint.drawRect(QRectF(d->paperWidth/2, d->paperHeight/2, d->paperWidth, d->paperHeight)); paint.setPen(QPen(Qt::black, 3, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); From dac95d00fee993ae1a0397205ed0ac504ed237fc Mon Sep 17 00:00:00 2001 From: dismine Date: Tue, 20 Jan 2015 22:58:30 +0200 Subject: [PATCH 048/186] Combine edges not enough for all cases. Was added checking position after rotation around point. --HG-- branch : feature --- src/libs/vlayout/vlayoutdef.h | 6 ++ src/libs/vlayout/vlayoutpaper.cpp | 147 ++++++++++++++++++++---------- src/libs/vlayout/vlayoutpaper.h | 4 +- 3 files changed, 109 insertions(+), 48 deletions(-) diff --git a/src/libs/vlayout/vlayoutdef.h b/src/libs/vlayout/vlayoutdef.h index a69675862..958a35314 100644 --- a/src/libs/vlayout/vlayoutdef.h +++ b/src/libs/vlayout/vlayoutdef.h @@ -40,6 +40,12 @@ enum class LayoutErrors : char EmptyPaperError }; +enum class BestFrom : char +{ + Rotation = 0, + Combine = 1 +}; + //#define LAYOUT_DEBUG // Enable debug mode #ifdef LAYOUT_DEBUG diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index fc3936517..ac34a161c 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -43,7 +43,7 @@ class BestResult public: BestResult(); - void NewResult(qint64 square, int i, int j, const QTransform &matrix, bool mirror); + void NewResult(qint64 square, int i, int j, const QTransform &matrix, bool mirror, BestFrom type); qint64 BestSquare() const; int GContourEdge() const; @@ -51,6 +51,7 @@ public: QTransform Matrix() const; bool ValideResult() const; bool Mirror() const; + BestFrom Type() const; private: // All nedded information about best result @@ -60,18 +61,20 @@ private: qint64 resSquare; // Best square size (least). For begin set max value. bool valideResult; bool resMirror; + BestFrom type; }; //===================================================BestResult======================================================== //--------------------------------------------------------------------------------------------------------------------- BestResult::BestResult() - :resI(0), resJ(0), resMatrix(QMatrix()), resSquare(LLONG_MAX), valideResult(false), resMirror(false) + :resI(0), resJ(0), resMatrix(QMatrix()), resSquare(LLONG_MAX), valideResult(false), resMirror(false), + type (BestFrom::Rotation) {} //--------------------------------------------------------------------------------------------------------------------- -void BestResult::NewResult(qint64 square, int i, int j, const QTransform &matrix, bool mirror) +void BestResult::NewResult(qint64 square, int i, int j, const QTransform &matrix, bool mirror, BestFrom type) { - if (square <= resSquare && square > 0) + if (square <= resSquare && square > 0 && type >= this->type) { resI = i; resJ = j; @@ -79,6 +82,7 @@ void BestResult::NewResult(qint64 square, int i, int j, const QTransform &matrix resSquare = square; valideResult = true; resMirror = mirror; + this->type = type; } } @@ -118,6 +122,12 @@ bool BestResult::Mirror() const return resMirror; } +//--------------------------------------------------------------------------------------------------------------------- +BestFrom BestResult::Type() const +{ + return type; +} + //===================================================VLayoutPaper====================================================== //--------------------------------------------------------------------------------------------------------------------- VLayoutPaper::VLayoutPaper() @@ -269,7 +279,7 @@ bool VLayoutPaper::AddToBlankSheet(const VLayoutDetail &detail, bool &stop) const QRectF rec = workDetail.BoundingRect(); bestResult.NewResult(static_cast(rec.width()*rec.height()), j, dEdge, - workDetail.GetMatrix(), workDetail.IsMirror()); + workDetail.GetMatrix(), workDetail.IsMirror(), BestFrom::Combine); } d->frame = d->frame + 3; @@ -296,7 +306,7 @@ bool VLayoutPaper::AddToBlankSheet(const VLayoutDetail &detail, bool &stop) const QRectF rec = workDetail.BoundingRect(); bestResult.NewResult(static_cast(rec.width()*rec.height()), j, i, - workDetail.GetMatrix(), workDetail.IsMirror()); + workDetail.GetMatrix(), workDetail.IsMirror(), BestFrom::Rotation); } ++d->frame; } @@ -313,10 +323,7 @@ bool VLayoutPaper::AddToSheet(const VLayoutDetail &detail, bool &stop) for (int j=1; j <= EdgesCount(); ++j) { - // We should use copy of the detail. - VLayoutDetail workDetail = detail; - - for (int i=1; i<= workDetail.EdgesCount(); i++) + for (int i=1; i<= detail.EdgesCount(); i++) { QCoreApplication::processEvents(); @@ -325,6 +332,9 @@ bool VLayoutPaper::AddToSheet(const VLayoutDetail &detail, bool &stop) return false; } + // We should use copy of the detail. + VLayoutDetail workDetail = detail; + int dEdge = i;// For mirror detail edge will be different if (CheckCombineEdges(workDetail, j, dEdge)) { @@ -334,13 +344,43 @@ bool VLayoutPaper::AddToSheet(const VLayoutDetail &detail, bool &stop) # endif #endif - QVector newGContour = UniteWithContour(workDetail, j, dEdge); + QVector newGContour = UniteWithContour(workDetail, j, dEdge, BestFrom::Combine); newGContour.append(newGContour.first()); const QRectF rec = QPolygonF(newGContour).boundingRect(); bestResult.NewResult(static_cast(rec.width()*rec.height()), j, dEdge, - workDetail.GetMatrix(), workDetail.IsMirror()); + workDetail.GetMatrix(), workDetail.IsMirror(), BestFrom::Combine); } d->frame = d->frame + 3; + + for (int angle = 0; angle <= 360; angle = angle+20) + { + QCoreApplication::processEvents(); + + if (stop) + { + return false; + } + + // We should use copy of the detail. + VLayoutDetail workDetail = detail; + + if (CheckRotationEdges(workDetail, j, i, angle)) + { + #ifdef LAYOUT_DEBUG + # ifdef SHOW_CANDIDATE_BEST + ++d->frame; + DrawDebug(workDetail, d->frame); + # endif + #endif + + QVector newGContour = UniteWithContour(workDetail, j, i, BestFrom::Rotation); + newGContour.append(newGContour.first()); + const QRectF rec = QPolygonF(newGContour).boundingRect(); + bestResult.NewResult(static_cast(rec.width()*rec.height()), j, i, + workDetail.GetMatrix(), workDetail.IsMirror(), BestFrom::Rotation); + } + ++d->frame; + } } } @@ -694,28 +734,12 @@ void VLayoutPaper::RotateEdges(VLayoutDetail &detail, const QLineF &globalEdge, } //--------------------------------------------------------------------------------------------------------------------- -QVector VLayoutPaper::UniteWithContour(const VLayoutDetail &detail, int globalI, int detJ) const +QVector VLayoutPaper::UniteWithContour(const VLayoutDetail &detail, int globalI, int detJ, BestFrom type) const { QVector newContour; if (d->globalContour.isEmpty()) { - int processedEdges = 0; - const int nD = detail.EdgesCount(); - int j = detJ+1; - do - { - if (j > nD) - { - j=1; - } - const QVector points = CutEdge(detail.Edge(j)); - for (int i = 0; i < points.size()-1; ++i) - { - newContour.append(points.at(i)); - } - ++processedEdges; - ++j; - }while (processedEdges < nD); + AppendWhole(newContour, detail, detJ); } else { @@ -744,26 +768,33 @@ QVector VLayoutPaper::UniteWithContour(const VLayoutDetail &detail, int { if (i == i2) { - int processedEdges = 0; - const int nD = detail.EdgesCount(); - int j = detJ+1; - do + if (type == BestFrom::Rotation) { - if (j > nD) + AppendWhole(newContour, detail, detJ); + } + else + { + int processedEdges = 0; + const int nD = detail.EdgesCount(); + int j = detJ+1; + do { - j=1; - } - if (j != detJ) - { - const QVector points = CutEdge(detail.Edge(j)); - for (int i = 0; i < points.size()-1; ++i) + if (j > nD) { - newContour.append(points.at(i)); + j=1; } - } - ++processedEdges; - ++j; - }while (processedEdges < nD); + if (j != detJ) + { + const QVector points = CutEdge(detail.Edge(j)); + for (int i = 0; i < points.size()-1; ++i) + { + newContour.append(points.at(i)); + } + } + ++processedEdges; + ++j; + }while (processedEdges < nD); + } } if (newContour.isEmpty() == false) @@ -783,6 +814,28 @@ QVector VLayoutPaper::UniteWithContour(const VLayoutDetail &detail, int return newContour; } +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutPaper::AppendWhole(QVector &contour, const VLayoutDetail &detail, int detJ) const +{ + int processedEdges = 0; + const int nD = detail.EdgesCount(); + int j = detJ+1; + do + { + if (j > nD) + { + j=1; + } + const QVector points = CutEdge(detail.Edge(j)); + for (int i = 0; i < points.size()-1; ++i) + { + contour.append(points.at(i)); + } + ++processedEdges; + ++j; + }while (processedEdges < nD); +} + //--------------------------------------------------------------------------------------------------------------------- QLineF VLayoutPaper::GlobalEdge(int i) const { @@ -905,7 +958,7 @@ bool VLayoutPaper::SaveResult(const BestResult &bestResult, const VLayoutDetail workDetail.SetMatrix(bestResult.Matrix());// Don't forget set matrix workDetail.SetMirror(bestResult.Mirror()); const QVector newGContour = UniteWithContour(workDetail, bestResult.GContourEdge(), - bestResult.DetailEdge()); + bestResult.DetailEdge(), bestResult.Type()); if (newGContour.isEmpty()) { return false; diff --git a/src/libs/vlayout/vlayoutpaper.h b/src/libs/vlayout/vlayoutpaper.h index 62d477af9..8401515a5 100644 --- a/src/libs/vlayout/vlayoutpaper.h +++ b/src/libs/vlayout/vlayoutpaper.h @@ -30,6 +30,7 @@ #define VLAYOUTPAPER_H #include +#include "vlayoutdef.h" class VLayoutPaperData; class VLayoutDetail; @@ -98,7 +99,8 @@ private: void CombineEdges(VLayoutDetail &detail, const QLineF &globalEdge, const int &dEdge) const; void RotateEdges(VLayoutDetail &detail, const QLineF &globalEdge, int dEdge, int angle) const; - QVector UniteWithContour(const VLayoutDetail &detail, int globalI, int detJ) const; + QVector UniteWithContour(const VLayoutDetail &detail, int globalI, int detJ, BestFrom type) const; + void AppendWhole(QVector &contour, const VLayoutDetail &detail, int detJ) const; QLineF GlobalEdge(int i) const; int EdgesCount() const; From 8655460d6e2663e51e978fea3fec610efa8c5571 Mon Sep 17 00:00:00 2001 From: dismine Date: Wed, 21 Jan 2015 16:33:06 +0200 Subject: [PATCH 049/186] Refactoring. --HG-- branch : feature --- src/libs/vlayout/vlayoutpaper.cpp | 77 +------------------------------ src/libs/vlayout/vlayoutpaper.h | 1 - 2 files changed, 1 insertion(+), 77 deletions(-) diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index ac34a161c..987e001d4 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -232,14 +232,7 @@ bool VLayoutPaper::ArrangeDetail(const VLayoutDetail &detail, bool &stop) d->frame = 0; - if (Count() == 0) - { - return AddToBlankSheet(detail, stop); - } - else - { - return AddToSheet(detail, stop); - } + return AddToSheet(detail, stop); } //--------------------------------------------------------------------------------------------------------------------- @@ -248,74 +241,6 @@ int VLayoutPaper::Count() const return d->details.count(); } -//--------------------------------------------------------------------------------------------------------------------- -bool VLayoutPaper::AddToBlankSheet(const VLayoutDetail &detail, bool &stop) -{ - BestResult bestResult; - - for (int j=1; j <= EdgesCount(); ++j) - { - for (int i=1; i<= detail.EdgesCount(); i++) - { - QCoreApplication::processEvents(); - - if (stop) - { - return false; - } - - // We should use copy of the detail. - VLayoutDetail workDetail = detail; - - int dEdge = i;// For mirrored detail edge will be different - if (CheckCombineEdges(workDetail, j, dEdge)) - { - #ifdef LAYOUT_DEBUG - # ifdef SHOW_CANDIDATE_BEST - DrawDebug(workDetail, d->frame+2); - - # endif - #endif - - const QRectF rec = workDetail.BoundingRect(); - bestResult.NewResult(static_cast(rec.width()*rec.height()), j, dEdge, - workDetail.GetMatrix(), workDetail.IsMirror(), BestFrom::Combine); - } - d->frame = d->frame + 3; - - for (int angle = 0; angle <= 360; angle = angle+20) - { - QCoreApplication::processEvents(); - - if (stop) - { - return false; - } - - // We should use copy of the detail. - VLayoutDetail workDetail = detail; - - if (CheckRotationEdges(workDetail, j, i, angle)) - { - #ifdef LAYOUT_DEBUG - # ifdef SHOW_CANDIDATE_BEST - ++d->frame; - DrawDebug(workDetail, d->frame); - # endif - #endif - - const QRectF rec = workDetail.BoundingRect(); - bestResult.NewResult(static_cast(rec.width()*rec.height()), j, i, - workDetail.GetMatrix(), workDetail.IsMirror(), BestFrom::Rotation); - } - ++d->frame; - } - } - } - - return SaveResult(bestResult, detail); -} - //--------------------------------------------------------------------------------------------------------------------- bool VLayoutPaper::AddToSheet(const VLayoutDetail &detail, bool &stop) { diff --git a/src/libs/vlayout/vlayoutpaper.h b/src/libs/vlayout/vlayoutpaper.h index 8401515a5..734363b64 100644 --- a/src/libs/vlayout/vlayoutpaper.h +++ b/src/libs/vlayout/vlayoutpaper.h @@ -85,7 +85,6 @@ private: EdgeError = 2 }; - bool AddToBlankSheet(const VLayoutDetail &detail, bool &stop); bool AddToSheet(const VLayoutDetail &detail, bool &stop); bool CheckCombineEdges(VLayoutDetail &detail, int j, int &dEdge) const; From 62aa898742f4ec9a00aca7b251b12e5de41547b5 Mon Sep 17 00:00:00 2001 From: dismine Date: Wed, 21 Jan 2015 20:56:59 +0200 Subject: [PATCH 050/186] Refactoring. Prepare for support multithreading. --HG-- branch : feature --- src/libs/vlayout/vbestsquare.cpp | 101 +++++++ src/libs/vlayout/vbestsquare.h | 63 +++++ src/libs/vlayout/vcontour.cpp | 326 ++++++++++++++++++++++ src/libs/vlayout/vcontour.h | 77 ++++++ src/libs/vlayout/vcontour_p.h | 74 +++++ src/libs/vlayout/vlayout.pri | 9 +- src/libs/vlayout/vlayoutdef.h | 2 +- src/libs/vlayout/vlayoutpaper.cpp | 441 +++++------------------------- src/libs/vlayout/vlayoutpaper.h | 26 +- src/libs/vlayout/vlayoutpaper_p.h | 22 +- 10 files changed, 732 insertions(+), 409 deletions(-) create mode 100644 src/libs/vlayout/vbestsquare.cpp create mode 100644 src/libs/vlayout/vbestsquare.h create mode 100644 src/libs/vlayout/vcontour.cpp create mode 100644 src/libs/vlayout/vcontour.h create mode 100644 src/libs/vlayout/vcontour_p.h diff --git a/src/libs/vlayout/vbestsquare.cpp b/src/libs/vlayout/vbestsquare.cpp new file mode 100644 index 000000000..e72fa7105 --- /dev/null +++ b/src/libs/vlayout/vbestsquare.cpp @@ -0,0 +1,101 @@ +/************************************************************************ + ** + ** @file vbestsquare.cpp + ** @author Roman Telezhynskyi + ** @date 21 1, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#include "vbestsquare.h" + +//--------------------------------------------------------------------------------------------------------------------- +VBestSquare::VBestSquare() + :resI(0), resJ(0), resMatrix(QMatrix()), resSquare(LLONG_MAX), valideResult(false), resMirror(false), + type (BestFrom::Rotation) +{} + +//--------------------------------------------------------------------------------------------------------------------- +void VBestSquare::NewResult(qint64 square, int i, int j, const QTransform &matrix, bool mirror, BestFrom type) +{ + if (square <= resSquare && square > 0 && type >= this->type) + { + resI = i; + resJ = j; + resMatrix = matrix; + resSquare = square; + valideResult = true; + resMirror = mirror; + this->type = type; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void VBestSquare::NewResult(const VBestSquare &best) +{ + if (best.ValideResult()) + { + NewResult(best.BestSquare(), best.GContourEdge(), best.DetailEdge(), best.Matrix(), best.Mirror(), best.Type()); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +qint64 VBestSquare::BestSquare() const +{ + return resSquare; +} + +//--------------------------------------------------------------------------------------------------------------------- +int VBestSquare::GContourEdge() const +{ + return resI; +} + +//--------------------------------------------------------------------------------------------------------------------- +int VBestSquare::DetailEdge() const +{ + return resJ; +} + +//--------------------------------------------------------------------------------------------------------------------- +QTransform VBestSquare::Matrix() const +{ + return resMatrix; +} + +//--------------------------------------------------------------------------------------------------------------------- +bool VBestSquare::ValideResult() const +{ + return valideResult; +} + +//--------------------------------------------------------------------------------------------------------------------- +bool VBestSquare::Mirror() const +{ + return resMirror; +} + +//--------------------------------------------------------------------------------------------------------------------- +BestFrom VBestSquare::Type() const +{ + return type; +} diff --git a/src/libs/vlayout/vbestsquare.h b/src/libs/vlayout/vbestsquare.h new file mode 100644 index 000000000..25f12bc82 --- /dev/null +++ b/src/libs/vlayout/vbestsquare.h @@ -0,0 +1,63 @@ +/************************************************************************ + ** + ** @file vbestsquare.h + ** @author Roman Telezhynskyi + ** @date 21 1, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef VBESTSQUARE_H +#define VBESTSQUARE_H + +#include "vlayoutdef.h" + +#include + +class VBestSquare +{ +public: + VBestSquare(); + + void NewResult(qint64 square, int i, int j, const QTransform &matrix, bool mirror, BestFrom type); + void NewResult(const VBestSquare &best); + + qint64 BestSquare() const; + int GContourEdge() const; + int DetailEdge() const; + QTransform Matrix() const; + bool ValideResult() const; + bool Mirror() const; + BestFrom Type() const; + +private: + // All nedded information about best result + int resI; // Edge of global contour + int resJ; // Edge of detail + QTransform resMatrix; // Matrix for rotation and translation detail + qint64 resSquare; // Best square size (least). For begin set max value. + bool valideResult; + bool resMirror; + BestFrom type; +}; + +#endif // VBESTSQUARE_H diff --git a/src/libs/vlayout/vcontour.cpp b/src/libs/vlayout/vcontour.cpp new file mode 100644 index 000000000..f28d9a9e8 --- /dev/null +++ b/src/libs/vlayout/vcontour.cpp @@ -0,0 +1,326 @@ +/************************************************************************ + ** + ** @file vcontour.cpp + ** @author Roman Telezhynskyi + ** @date 21 1, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#include "vcontour.h" +#include "vcontour_p.h" +#include "vlayoutdetail.h" + +#include +#include + +//--------------------------------------------------------------------------------------------------------------------- +VContour::VContour() + :d(new VContourData()) +{} + +//--------------------------------------------------------------------------------------------------------------------- +VContour::VContour(int height, int width) + :d(new VContourData(height, width)) +{} + +//--------------------------------------------------------------------------------------------------------------------- +VContour::VContour(const VContour &contour) + :d (contour.d) +{} + +//--------------------------------------------------------------------------------------------------------------------- +VContour &VContour::operator=(const VContour &contour) +{ + if ( &contour == this ) + { + return *this; + } + d = contour.d; + return *this; +} + +//--------------------------------------------------------------------------------------------------------------------- +VContour::~VContour() +{} + +//--------------------------------------------------------------------------------------------------------------------- +void VContour::SetContour(const QVector &contour) +{ + d->globalContour = contour; +} + +//--------------------------------------------------------------------------------------------------------------------- +QVector VContour::GetContour() const +{ + return d->globalContour; +} + +//--------------------------------------------------------------------------------------------------------------------- +unsigned int VContour::GetShift() const +{ + return d->shift; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VContour::SetShift(unsigned int shift) +{ + d->shift = shift; +} + +//--------------------------------------------------------------------------------------------------------------------- +int VContour::GetHeight() const +{ + return d->paperHeight; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VContour::SetHeight(int height) +{ + d->paperHeight = height; +} + +//--------------------------------------------------------------------------------------------------------------------- +int VContour::GetWidth() const +{ + return d->paperWidth; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VContour::SetWidth(int width) +{ + d->paperWidth = width; +} + +//--------------------------------------------------------------------------------------------------------------------- +QVector VContour::UniteWithContour(const VLayoutDetail &detail, int globalI, int detJ, BestFrom type) const +{ + QVector newContour; + if (d->globalContour.isEmpty()) + { + AppendWhole(newContour, detail, detJ); + } + else + { + if (globalI <= 0 || globalI > EdgesCount()) + { + return QVector(); + } + + if (detJ <= 0 || detJ > detail.EdgesCount()) + { + return QVector(); + } + + int i2 = 0; + if (globalI == d->globalContour.count()) + { + i2 = 0; + } + else + { + i2 = globalI; + } + + int i=0; + while(i < d->globalContour.count()) + { + if (i == i2) + { + if (type == BestFrom::Rotation) + { + AppendWhole(newContour, detail, detJ); + } + else + { + int processedEdges = 0; + const int nD = detail.EdgesCount(); + int j = detJ+1; + do + { + if (j > nD) + { + j=1; + } + if (j != detJ) + { + const QVector points = CutEdge(detail.Edge(j)); + for (int i = 0; i < points.size()-1; ++i) + { + newContour.append(points.at(i)); + } + } + ++processedEdges; + ++j; + }while (processedEdges < nD); + } + } + + if (newContour.isEmpty() == false) + { + if (newContour.last() != d->globalContour.at(i)) + { + newContour.append(d->globalContour.at(i)); + } + } + else + { + newContour.append(d->globalContour.at(i)); + } + ++i; + } + } + return newContour; +} + +//--------------------------------------------------------------------------------------------------------------------- +int VContour::EdgesCount() const +{ + if (d->globalContour.isEmpty()) + { + if (d->shift == 0) + { + return 1; + } + + const QLineF axis = QLineF(0, 0, d->paperWidth, 0); + const int n = qFloor(axis.length()/d->shift); + if (n <= 0) + { + return 1; + } + else + { + return n; + } + } + else + { + return d->globalContour.count(); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +QLineF VContour::GlobalEdge(int i) const +{ + if (d->globalContour.isEmpty()) + { + // Because sheet is blank we have one global edge for all cases - Ox axis. + const QLineF axis = QLineF(0, 0, d->paperWidth - 5, 0); + if (d->shift == 0) + { + return axis; + } + + const int n = qFloor(axis.length()/d->shift); + + if (i < 1 || i > n) + { // Doesn't exist such edge + return QLineF(); + } + + if (n <= 0) + { + return axis; + } + else + { + const qreal nShift = axis.length()/n; + return QLineF(nShift*(i-1), 0, nShift*i, 0); + } + } + else + { + if (i < 1 || i > EdgesCount()) + { // Doesn't exist such edge + return QLineF(); + } + QLineF edge; + if (i < EdgesCount()) + { + edge = QLineF(d->globalContour.at(i-1), d->globalContour.at(i)); + } + else + { // Closed countour + edge = QLineF(d->globalContour.at(EdgesCount()-1), d->globalContour.at(0)); + } + return edge; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +QVector VContour::CutEdge(const QLineF &edge) const +{ + QVector points; + if (d->shift == 0) + { + points.append(edge.p1()); + points.append(edge.p2()); + } + + const int n = qFloor(edge.length()/d->shift); + + if (n <= 0) + { + points.append(edge.p1()); + points.append(edge.p2()); + } + else + { + const qreal nShift = edge.length()/n; + for (int i = 1; i <= n+1; ++i) + { + QLineF l1 = edge; + l1.setLength(nShift*(i-1)); + points.append(l1.p2()); + } + } + return points; +} + +//--------------------------------------------------------------------------------------------------------------------- +const QPointF &VContour::at(int i) const +{ + return d->globalContour.at(i); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VContour::AppendWhole(QVector &contour, const VLayoutDetail &detail, int detJ) const +{ + int processedEdges = 0; + const int nD = detail.EdgesCount(); + int j = detJ+1; + do + { + if (j > nD) + { + j=1; + } + const QVector points = CutEdge(detail.Edge(j)); + for (int i = 0; i < points.size()-1; ++i) + { + contour.append(points.at(i)); + } + ++processedEdges; + ++j; + }while (processedEdges < nD); +} diff --git a/src/libs/vlayout/vcontour.h b/src/libs/vlayout/vcontour.h new file mode 100644 index 000000000..67b383573 --- /dev/null +++ b/src/libs/vlayout/vcontour.h @@ -0,0 +1,77 @@ +/************************************************************************ + ** + ** @file vcontour.h + ** @author Roman Telezhynskyi + ** @date 21 1, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef VCONTOUR_H +#define VCONTOUR_H + +#include "vlayoutdef.h" + +#include +#include + +class VContourData; +class QPointF; +class VLayoutDetail; +class QLineF; + +class VContour +{ +public: + VContour(); + VContour(int height, int width); + VContour(const VContour &contour); + VContour &operator=(const VContour &contour); + virtual ~VContour(); + + void SetContour(const QVector &contour); + QVector GetContour() const; + + unsigned int GetShift() const; + void SetShift(unsigned int shift); + + int GetHeight() const; + void SetHeight(int height); + + int GetWidth() const; + void SetWidth(int width); + + QVector UniteWithContour(const VLayoutDetail &detail, int globalI, int detJ, BestFrom type) const; + + int EdgesCount() const; + QLineF GlobalEdge(int i) const; + QVector CutEdge(const QLineF &edge) const; + + const QPointF & at(int i) const; + +private: + QSharedDataPointer d; + + void AppendWhole(QVector &contour, const VLayoutDetail &detail, int detJ) const; +}; + +#endif // VCONTOUR_H diff --git a/src/libs/vlayout/vcontour_p.h b/src/libs/vlayout/vcontour_p.h new file mode 100644 index 000000000..0c7fdc8f6 --- /dev/null +++ b/src/libs/vlayout/vcontour_p.h @@ -0,0 +1,74 @@ +/************************************************************************ + ** + ** @file vcontour_p.h + ** @author Roman Telezhynskyi + ** @date 21 1, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef VCONTOUR_P_H +#define VCONTOUR_P_H + +#include +#include + +#ifdef Q_CC_GNU + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Weffc++" +#endif + +class VContourData : public QSharedData +{ +public: + VContourData() + :globalContour(QVector()), paperHeight(0), paperWidth(0), shift(0) + {} + + VContourData(int height, int width) + :globalContour(QVector()), paperHeight(height), paperWidth(width), shift(0) + {} + + VContourData(const VContourData &contour) + :QSharedData(contour), globalContour(contour.globalContour), paperHeight(contour.paperHeight), + paperWidth(contour.paperWidth), shift(contour.shift) + {} + + ~VContourData() {} + + /** @brief globalContour list of global points contour. */ + QVector globalContour; + + /** @brief paperHeight height of paper in pixels*/ + int paperHeight; + + /** @brief paperWidth width of paper in pixels*/ + int paperWidth; + + unsigned int shift; +}; + +#ifdef Q_CC_GNU + #pragma GCC diagnostic pop +#endif + +#endif // VCONTOUR_P_H diff --git a/src/libs/vlayout/vlayout.pri b/src/libs/vlayout/vlayout.pri index 25e9eb556..116b75f0e 100644 --- a/src/libs/vlayout/vlayout.pri +++ b/src/libs/vlayout/vlayout.pri @@ -11,7 +11,10 @@ HEADERS += \ $$PWD/vlayoutdef.h \ $$PWD/vlayoutpaper.h \ $$PWD/vlayoutpaper_p.h \ - $$PWD/vbank.h + $$PWD/vbank.h \ + $$PWD/vcontour.h \ + $$PWD/vcontour_p.h \ + $$PWD/vbestsquare.h SOURCES += \ $$PWD/stable.cpp \ @@ -19,4 +22,6 @@ SOURCES += \ $$PWD/vlayoutdetail.cpp \ $$PWD/vabstractdetail.cpp \ $$PWD/vlayoutpaper.cpp \ - $$PWD/vbank.cpp + $$PWD/vbank.cpp \ + $$PWD/vcontour.cpp \ + $$PWD/vbestsquare.cpp diff --git a/src/libs/vlayout/vlayoutdef.h b/src/libs/vlayout/vlayoutdef.h index 958a35314..2626258ea 100644 --- a/src/libs/vlayout/vlayoutdef.h +++ b/src/libs/vlayout/vlayoutdef.h @@ -46,7 +46,7 @@ enum class BestFrom : char Combine = 1 }; -//#define LAYOUT_DEBUG // Enable debug mode +#define LAYOUT_DEBUG // Enable debug mode #ifdef LAYOUT_DEBUG # define SHOW_VERTICES // Show contour vertices diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index 987e001d4..5498b0f88 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -28,6 +28,7 @@ #include "vlayoutpaper.h" #include "vlayoutpaper_p.h" +#include "vbestsquare.h" #include #include @@ -38,97 +39,6 @@ #include #include -class BestResult -{ -public: - BestResult(); - - void NewResult(qint64 square, int i, int j, const QTransform &matrix, bool mirror, BestFrom type); - - qint64 BestSquare() const; - int GContourEdge() const; - int DetailEdge() const; - QTransform Matrix() const; - bool ValideResult() const; - bool Mirror() const; - BestFrom Type() const; - -private: - // All nedded information about best result - int resI; // Edge of global contour - int resJ; // Edge of detail - QTransform resMatrix; // Matrix for rotation and translation detail - qint64 resSquare; // Best square size (least). For begin set max value. - bool valideResult; - bool resMirror; - BestFrom type; -}; - -//===================================================BestResult======================================================== -//--------------------------------------------------------------------------------------------------------------------- -BestResult::BestResult() - :resI(0), resJ(0), resMatrix(QMatrix()), resSquare(LLONG_MAX), valideResult(false), resMirror(false), - type (BestFrom::Rotation) -{} - -//--------------------------------------------------------------------------------------------------------------------- -void BestResult::NewResult(qint64 square, int i, int j, const QTransform &matrix, bool mirror, BestFrom type) -{ - if (square <= resSquare && square > 0 && type >= this->type) - { - resI = i; - resJ = j; - resMatrix = matrix; - resSquare = square; - valideResult = true; - resMirror = mirror; - this->type = type; - } -} - -//--------------------------------------------------------------------------------------------------------------------- -qint64 BestResult::BestSquare() const -{ - return resSquare; -} - -//--------------------------------------------------------------------------------------------------------------------- -int BestResult::GContourEdge() const -{ - return resI; -} - -//--------------------------------------------------------------------------------------------------------------------- -int BestResult::DetailEdge() const -{ - return resJ; -} - -//--------------------------------------------------------------------------------------------------------------------- -QTransform BestResult::Matrix() const -{ - return resMatrix; -} - -//--------------------------------------------------------------------------------------------------------------------- -bool BestResult::ValideResult() const -{ - return valideResult; -} - -//--------------------------------------------------------------------------------------------------------------------- -bool BestResult::Mirror() const -{ - return resMirror; -} - -//--------------------------------------------------------------------------------------------------------------------- -BestFrom BestResult::Type() const -{ - return type; -} - -//===================================================VLayoutPaper====================================================== //--------------------------------------------------------------------------------------------------------------------- VLayoutPaper::VLayoutPaper() :d(new VLayoutPaperData) @@ -162,25 +72,25 @@ VLayoutPaper::~VLayoutPaper() //--------------------------------------------------------------------------------------------------------------------- int VLayoutPaper::GetHeight() const { - return d->paperHeight; + return d->globalContour.GetHeight(); } //--------------------------------------------------------------------------------------------------------------------- void VLayoutPaper::SetHeight(int height) { - d->paperHeight = height; + d->globalContour.SetHeight(height); } //--------------------------------------------------------------------------------------------------------------------- int VLayoutPaper::GetWidth() const { - return d->paperWidth; + return d->globalContour.GetWidth(); } //--------------------------------------------------------------------------------------------------------------------- void VLayoutPaper::SetWidth(int width) { - d->paperWidth = width; + d->globalContour.SetWidth(width); } //--------------------------------------------------------------------------------------------------------------------- @@ -201,13 +111,13 @@ void VLayoutPaper::SetLayoutWidth(qreal width) //--------------------------------------------------------------------------------------------------------------------- unsigned int VLayoutPaper::GetShift() const { - return d->shift; + return d->globalContour.GetShift(); } //--------------------------------------------------------------------------------------------------------------------- void VLayoutPaper::SetShift(unsigned int shift) { - d->shift = shift; + d->globalContour.SetShift(shift); } //--------------------------------------------------------------------------------------------------------------------- @@ -220,7 +130,7 @@ void VLayoutPaper::SetPaperIndex(quint32 index) bool VLayoutPaper::ArrangeDetail(const VLayoutDetail &detail, bool &stop) { // First need set size of paper - if (d->paperHeight <= 0 || d->paperWidth <= 0) + if (d->globalContour.GetHeight() <= 0 || d->globalContour.GetWidth() <= 0) { return false; } @@ -244,9 +154,9 @@ int VLayoutPaper::Count() const //--------------------------------------------------------------------------------------------------------------------- bool VLayoutPaper::AddToSheet(const VLayoutDetail &detail, bool &stop) { - BestResult bestResult; + VBestSquare bestResult; - for (int j=1; j <= EdgesCount(); ++j) + for (int j=1; j <= d->globalContour.EdgesCount(); ++j) { for (int i=1; i<= detail.EdgesCount(); i++) { @@ -265,15 +175,12 @@ bool VLayoutPaper::AddToSheet(const VLayoutDetail &detail, bool &stop) { #ifdef LAYOUT_DEBUG # ifdef SHOW_CANDIDATE_BEST - DrawDebug(workDetail, d->frame+2); + DrawDebug(d->globalContour, workDetail, d->frame+2, d->paperIndex, d->details.count(), + d->details); # endif #endif - QVector newGContour = UniteWithContour(workDetail, j, dEdge, BestFrom::Combine); - newGContour.append(newGContour.first()); - const QRectF rec = QPolygonF(newGContour).boundingRect(); - bestResult.NewResult(static_cast(rec.width()*rec.height()), j, dEdge, - workDetail.GetMatrix(), workDetail.IsMirror(), BestFrom::Combine); + SaveCandidate(bestResult, workDetail, j, dEdge, BestFrom::Combine); } d->frame = d->frame + 3; @@ -294,15 +201,12 @@ bool VLayoutPaper::AddToSheet(const VLayoutDetail &detail, bool &stop) #ifdef LAYOUT_DEBUG # ifdef SHOW_CANDIDATE_BEST ++d->frame; - DrawDebug(workDetail, d->frame); + DrawDebug(d->globalContour, workDetail, d->frame, d->paperIndex, d->details.count(), + d->details); # endif #endif - QVector newGContour = UniteWithContour(workDetail, j, i, BestFrom::Rotation); - newGContour.append(newGContour.first()); - const QRectF rec = QPolygonF(newGContour).boundingRect(); - bestResult.NewResult(static_cast(rec.width()*rec.height()), j, i, - workDetail.GetMatrix(), workDetail.IsMirror(), BestFrom::Rotation); + SaveCandidate(bestResult, workDetail, j, i, BestFrom::Rotation); } ++d->frame; } @@ -315,7 +219,7 @@ bool VLayoutPaper::AddToSheet(const VLayoutDetail &detail, bool &stop) //--------------------------------------------------------------------------------------------------------------------- bool VLayoutPaper::CheckCombineEdges(VLayoutDetail &detail, int j, int &dEdge) const { - const QLineF globalEdge = GlobalEdge(j); + const QLineF globalEdge = d->globalContour.GlobalEdge(j); bool flagMirror = false; bool flagSquare = false; @@ -323,7 +227,7 @@ bool VLayoutPaper::CheckCombineEdges(VLayoutDetail &detail, int j, int &dEdge) c #ifdef LAYOUT_DEBUG # ifdef SHOW_COMBINE - DrawDebug(detail, d->frame); + DrawDebug(d->globalContour, detail, d->frame, d->paperIndex, d->details.count(), d->details); # endif #endif @@ -366,7 +270,7 @@ bool VLayoutPaper::CheckCombineEdges(VLayoutDetail &detail, int j, int &dEdge) c { #ifdef LAYOUT_DEBUG #ifdef SHOW_MIRROR - DrawDebug(detail, d->frame+1); + DrawDebug(d->globalContour, detail, d->frame+1, d->paperIndex, d->details.count(), d->details); #endif #endif @@ -415,14 +319,14 @@ bool VLayoutPaper::CheckCombineEdges(VLayoutDetail &detail, int j, int &dEdge) c //--------------------------------------------------------------------------------------------------------------------- bool VLayoutPaper::CheckRotationEdges(VLayoutDetail &detail, int j, int dEdge, int angle) const { - const QLineF globalEdge = GlobalEdge(j); + const QLineF globalEdge = d->globalContour.GlobalEdge(j); bool flagSquare = false; RotateEdges(detail, globalEdge, dEdge, angle); #ifdef LAYOUT_DEBUG #ifdef SHOW_ROTATION - DrawDebug(detail, d->frame); + DrawDebug(d->globalContour, detail, d->frame, d->paperIndex, d->details.count(), d->details); #endif #endif @@ -465,7 +369,7 @@ bool VLayoutPaper::CheckRotationEdges(VLayoutDetail &detail, int j, int dEdge, i VLayoutPaper::CrossingType VLayoutPaper::Crossing(const VLayoutDetail &detail, const int &globalI, const int &detailI) const { - int globalEdgesCount = EdgesCount(); + int globalEdgesCount = d->globalContour.EdgesCount(); if (globalEdgesCount == 0) { globalEdgesCount = 1;// For blank sheet @@ -479,7 +383,7 @@ VLayoutPaper::CrossingType VLayoutPaper::Crossing(const VLayoutDetail &detail, c for(int i = 1; i <= globalEdgesCount; i++) { - const QLineF globalEdge = GlobalEdge(i); + const QLineF globalEdge = d->globalContour.GlobalEdge(i); if (globalEdge.isNull()) // Got null edge { return CrossingType::EdgeError; @@ -503,7 +407,7 @@ VLayoutPaper::CrossingType VLayoutPaper::Crossing(const VLayoutDetail &detail, c if (type == QLineF::BoundedIntersection) { - if (TrueIntersection(GlobalEdge(globalI), detail.Edge(detailI), xPoint)) + if (TrueIntersection(d->globalContour.GlobalEdge(globalI), detail.Edge(detailI), xPoint)) { return CrossingType::Intersection; } @@ -532,7 +436,7 @@ VLayoutPaper::InsideType VLayoutPaper::InsideContour(const VLayoutDetail &detail if (d->details.isEmpty()) { - const QLineF globalEdge = GlobalEdge(1); + const QLineF globalEdge = d->globalContour.GlobalEdge(1); for(int i = 0; i < lPoints.count(); i++) { if (CheckSide(globalEdge, lPoints.at(i)) < 0) @@ -543,7 +447,7 @@ VLayoutPaper::InsideType VLayoutPaper::InsideContour(const VLayoutDetail &detail } else { - const int polyCorners = EdgesCount(); + const int polyCorners = d->globalContour.EdgesCount(); int j = polyCorners-1; QVector constant; @@ -620,7 +524,7 @@ qreal VLayoutPaper::CheckSide(const QLineF &edge, const QPointF &p) const //--------------------------------------------------------------------------------------------------------------------- bool VLayoutPaper::SheetContains(const QRectF &rect) const { - const QRectF bRect(0, 0, d->paperWidth, d->paperHeight); + const QRectF bRect(0, 0, d->globalContour.GetWidth(), d->globalContour.GetHeight()); return bRect.contains(rect); } @@ -659,241 +563,26 @@ void VLayoutPaper::RotateEdges(VLayoutDetail &detail, const QLineF &globalEdge, } //--------------------------------------------------------------------------------------------------------------------- -QVector VLayoutPaper::UniteWithContour(const VLayoutDetail &detail, int globalI, int detJ, BestFrom type) const -{ - QVector newContour; - if (d->globalContour.isEmpty()) - { - AppendWhole(newContour, detail, detJ); - } - else - { - if (globalI <= 0 || globalI > EdgesCount()) - { - return QVector(); - } - - if (detJ <= 0 || detJ > detail.EdgesCount()) - { - return QVector(); - } - - int i2 = 0; - if (globalI == d->globalContour.count()) - { - i2 = 0; - } - else - { - i2 = globalI; - } - - int i=0; - while(i < d->globalContour.count()) - { - if (i == i2) - { - if (type == BestFrom::Rotation) - { - AppendWhole(newContour, detail, detJ); - } - else - { - int processedEdges = 0; - const int nD = detail.EdgesCount(); - int j = detJ+1; - do - { - if (j > nD) - { - j=1; - } - if (j != detJ) - { - const QVector points = CutEdge(detail.Edge(j)); - for (int i = 0; i < points.size()-1; ++i) - { - newContour.append(points.at(i)); - } - } - ++processedEdges; - ++j; - }while (processedEdges < nD); - } - } - - if (newContour.isEmpty() == false) - { - if (newContour.last() != d->globalContour.at(i)) - { - newContour.append(d->globalContour.at(i)); - } - } - else - { - newContour.append(d->globalContour.at(i)); - } - ++i; - } - } - return newContour; -} - -//--------------------------------------------------------------------------------------------------------------------- -void VLayoutPaper::AppendWhole(QVector &contour, const VLayoutDetail &detail, int detJ) const -{ - int processedEdges = 0; - const int nD = detail.EdgesCount(); - int j = detJ+1; - do - { - if (j > nD) - { - j=1; - } - const QVector points = CutEdge(detail.Edge(j)); - for (int i = 0; i < points.size()-1; ++i) - { - contour.append(points.at(i)); - } - ++processedEdges; - ++j; - }while (processedEdges < nD); -} - -//--------------------------------------------------------------------------------------------------------------------- -QLineF VLayoutPaper::GlobalEdge(int i) const -{ - if (d->details.isEmpty()) - { - // Because sheet is blank we have one global edge for all cases - Ox axis. - const QLineF axis = QLineF(0, 0, d->paperWidth - d->layoutWidth/2, 0); - if (d->shift == 0) - { - return axis; - } - - const int n = qFloor(axis.length()/d->shift); - - if (i < 1 || i > n) - { // Doesn't exist such edge - return QLineF(); - } - - if (n <= 0) - { - return axis; - } - else - { - const qreal nShift = axis.length()/n; - return QLineF(nShift*(i-1), 0, nShift*i, 0); - } - } - else - { - if (i < 1 || i > EdgesCount()) - { // Doesn't exist such edge - return QLineF(); - } - QLineF edge; - if (i < EdgesCount()) - { - edge = QLineF(d->globalContour.at(i-1), d->globalContour.at(i)); - } - else - { // Closed countour - edge = QLineF(d->globalContour.at(EdgesCount()-1), d->globalContour.at(0)); - } - return edge; - } -} - -//--------------------------------------------------------------------------------------------------------------------- -int VLayoutPaper::EdgesCount() const -{ - if (d->details.isEmpty()) - { - if (d->shift == 0) - { - return 1; - } - - const QLineF axis = QLineF(0, 0, d->paperWidth, 0); - const int n = qFloor(axis.length()/d->shift); - if (n <= 0) - { - return 1; - } - else - { - return n; - } - } - else - { - return d->globalContour.count(); - } -} - -//--------------------------------------------------------------------------------------------------------------------- -QPolygonF VLayoutPaper::GlobalPolygon() const -{ - QVector points = d->globalContour; - points.append(points.first()); - return QPolygonF(points); -} - -//--------------------------------------------------------------------------------------------------------------------- -QVector VLayoutPaper::CutEdge(const QLineF &edge) const -{ - QVector points; - if (d->shift == 0) - { - points.append(edge.p1()); - points.append(edge.p2()); - } - - const int n = qFloor(edge.length()/d->shift); - - if (n <= 0) - { - points.append(edge.p1()); - points.append(edge.p2()); - } - else - { - const qreal nShift = edge.length()/n; - for (int i = 1; i <= n+1; ++i) - { - QLineF l1 = edge; - l1.setLength(nShift*(i-1)); - points.append(l1.p2()); - } - } - return points; -} - -//--------------------------------------------------------------------------------------------------------------------- -bool VLayoutPaper::SaveResult(const BestResult &bestResult, const VLayoutDetail &detail) +bool VLayoutPaper::SaveResult(const VBestSquare &bestResult, const VLayoutDetail &detail) { if (bestResult.ValideResult()) { VLayoutDetail workDetail = detail; workDetail.SetMatrix(bestResult.Matrix());// Don't forget set matrix workDetail.SetMirror(bestResult.Mirror()); - const QVector newGContour = UniteWithContour(workDetail, bestResult.GContourEdge(), - bestResult.DetailEdge(), bestResult.Type()); + const QVector newGContour = d->globalContour.UniteWithContour(workDetail, bestResult.GContourEdge(), + bestResult.DetailEdge(), + bestResult.Type()); if (newGContour.isEmpty()) { return false; } d->details.append(workDetail); - d->globalContour = newGContour; + d->globalContour.SetContour(newGContour); #ifdef LAYOUT_DEBUG # ifdef SHOW_BEST - DrawDebug(workDetail, UINT_MAX); + DrawDebug(d->globalContour, workDetail, UINT_MAX, d->paperIndex, d->details.count(), d->details); # endif #endif } @@ -902,55 +591,67 @@ bool VLayoutPaper::SaveResult(const BestResult &bestResult, const VLayoutDetail } //--------------------------------------------------------------------------------------------------------------------- -void VLayoutPaper::DrawDebug(const VLayoutDetail &detail, int frame) const +void VLayoutPaper::SaveCandidate(VBestSquare &bestResult, const VLayoutDetail &detail, int globalI, int detJ, + BestFrom type) { - QImage frameImage(d->paperWidth*2, d->paperHeight*2, QImage::Format_RGB32); + QVector newGContour = d->globalContour.UniteWithContour(detail, globalI, detJ, type); + newGContour.append(newGContour.first()); + const QRectF rec = QPolygonF(newGContour).boundingRect(); + bestResult.NewResult(static_cast(rec.width()*rec.height()), globalI, detJ, + detail.GetMatrix(), detail.IsMirror(), type); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutPaper::DrawDebug(const VContour &contour, const VLayoutDetail &detail, int frame, quint32 paperIndex, + int detailsCount, const QVector &details) +{ + QImage frameImage(contour.GetWidth()*2, contour.GetHeight()*2, QImage::Format_RGB32); frameImage.fill(Qt::white); QPainter paint; paint.begin(&frameImage); paint.setPen(QPen(Qt::darkRed, 10, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); - paint.drawRect(QRectF(d->paperWidth/2, d->paperHeight/2, d->paperWidth, d->paperHeight)); + paint.drawRect(QRectF(contour.GetWidth()/2, contour.GetHeight()/2, contour.GetWidth(), contour.GetHeight())); paint.setPen(QPen(Qt::black, 3, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); QPainterPath p; - if (d->globalContour.isEmpty()) + if (contour.GetContour().isEmpty()) { - p = DrawContour(CutEdge(QLineF(0, 0, d->paperWidth, 0))); - p.translate(d->paperWidth/2, d->paperHeight/2); + p = DrawContour(contour.CutEdge(QLineF(0, 0, contour.GetWidth(), 0))); + p.translate(contour.GetWidth()/2, contour.GetHeight()/2); paint.drawPath(p); } else { - p = DrawContour(d->globalContour); - p.translate(d->paperWidth/2, d->paperHeight/2); + p = DrawContour(contour.GetContour()); + p.translate(contour.GetWidth()/2, contour.GetHeight()/2); paint.drawPath(p); } #ifdef SHOW_CANDIDATE paint.setPen(QPen(Qt::darkGreen, 3, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); p = DrawContour(detail.GetLayoutAllowencePoints()); - p.translate(d->paperWidth/2, d->paperHeight/2); + p.translate(contour.GetWidth()/2, contour.GetHeight()/2); paint.drawPath(p); #endif #ifdef ARRANGED_DETAILS paint.setPen(QPen(Qt::blue, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); - p = DrawDetails(); - p.translate(d->paperWidth/2, d->paperHeight/2); + p = DrawDetails(details); + p.translate(contour.GetWidth()/2, contour.GetHeight()/2); paint.drawPath(p); #else Q_UNUSED(detail) #endif paint.end(); - const QString path = QDir::homePath()+QStringLiteral("/LayoutDebug/")+QString("%1_%2_%3.png").arg(d->paperIndex) - .arg(d->details.count()).arg(frame); + const QString path = QDir::homePath()+QStringLiteral("/LayoutDebug/")+QString("%1_%2_%3.png").arg(paperIndex) + .arg(detailsCount).arg(frame); frameImage.save (path); } //--------------------------------------------------------------------------------------------------------------------- -QPainterPath VLayoutPaper::ShowDirection(const QLineF &edge) const +QPainterPath VLayoutPaper::ShowDirection(const QLineF &edge) { QLineF arrow = edge; arrow.setLength(edge.length()/2.0); @@ -972,7 +673,7 @@ QPainterPath VLayoutPaper::ShowDirection(const QLineF &edge) const } //--------------------------------------------------------------------------------------------------------------------- -QPainterPath VLayoutPaper::DrawContour(const QVector &points) const +QPainterPath VLayoutPaper::DrawContour(const QVector &points) { QPainterPath path; path.setFillRule(Qt::WindingFill); @@ -1003,26 +704,15 @@ QPainterPath VLayoutPaper::DrawContour(const QVector &points) const } //--------------------------------------------------------------------------------------------------------------------- -QVector VLayoutPaper::TranslateContour(const QVector &points, qreal dx, qreal dy) const -{ - QVector p; - for (qint32 i = 0; i < points.count(); ++i) - { - p.append(QPointF(points.at(i).x()+dx, points.at(i).y()+dy)); - } - return p; -} - -//--------------------------------------------------------------------------------------------------------------------- -QPainterPath VLayoutPaper::DrawDetails() const +QPainterPath VLayoutPaper::DrawDetails(const QVector &details) { QPainterPath path; path.setFillRule(Qt::WindingFill); - if (Count() > 0) + if (details.count() > 0) { - for (int i = 0; i < d->details.size(); ++i) + for (int i = 0; i < details.size(); ++i) { - path.addPath(d->details.at(i).ContourPath()); + path.addPath(details.at(i).ContourPath()); } } return path; @@ -1061,7 +751,8 @@ QVector VLayoutPaper::Triplet(const QLineF &edge) const //--------------------------------------------------------------------------------------------------------------------- QGraphicsItem *VLayoutPaper::GetItem() const { - QGraphicsRectItem *paper = new QGraphicsRectItem(QRectF(0, 0, d->paperWidth, d->paperHeight)); + QGraphicsRectItem *paper = new QGraphicsRectItem(QRectF(0, 0, d->globalContour.GetWidth(), + d->globalContour.GetHeight())); paper->setPen(QPen(Qt::black, 1)); paper->setBrush(QBrush(Qt::white)); for (int i=0; i < d->details.count(); ++i) diff --git a/src/libs/vlayout/vlayoutpaper.h b/src/libs/vlayout/vlayoutpaper.h index 734363b64..496f6a0bb 100644 --- a/src/libs/vlayout/vlayoutpaper.h +++ b/src/libs/vlayout/vlayoutpaper.h @@ -37,9 +37,11 @@ class VLayoutDetail; class QPointF; class QLineF; class QPolygonF; -class BestResult; class QPainterPath; class QGraphicsItem; +class VBestSquare; +class VContour; +class QRectF; class VLayoutPaper { @@ -98,22 +100,14 @@ private: void CombineEdges(VLayoutDetail &detail, const QLineF &globalEdge, const int &dEdge) const; void RotateEdges(VLayoutDetail &detail, const QLineF &globalEdge, int dEdge, int angle) const; - QVector UniteWithContour(const VLayoutDetail &detail, int globalI, int detJ, BestFrom type) const; - void AppendWhole(QVector &contour, const VLayoutDetail &detail, int detJ) const; + bool SaveResult(const VBestSquare &bestResult, const VLayoutDetail &detail); + void SaveCandidate(VBestSquare &bestResult, const VLayoutDetail &detail, int globalI, int detJ, BestFrom type); - QLineF GlobalEdge(int i) const; - int EdgesCount() const; - - QPolygonF GlobalPolygon() const; - QVector CutEdge(const QLineF &edge) const; - - bool SaveResult(const BestResult &bestResult, const VLayoutDetail &detail); - - void DrawDebug(const VLayoutDetail &detail, int frame) const; - QPainterPath ShowDirection(const QLineF &edge) const; - QPainterPath DrawContour(const QVector &points) const; - QVector TranslateContour(const QVector &points, qreal dx, qreal dy) const; - QPainterPath DrawDetails() const; + static void DrawDebug(const VContour &contour, const VLayoutDetail &detail, int frame, quint32 paperIndex, + int detailsCount, const QVector &details = QVector()); + static QPainterPath ShowDirection(const QLineF &edge); + static QPainterPath DrawContour(const QVector &points); + static QPainterPath DrawDetails(const QVector &details); bool TrueIntersection(const QLineF &gEdge, const QLineF &dEdge, const QPointF &p) const; QPointF RoundedPoint(const QPointF &p) const; diff --git a/src/libs/vlayout/vlayoutpaper_p.h b/src/libs/vlayout/vlayoutpaper_p.h index 6acb7bef4..0834895b9 100644 --- a/src/libs/vlayout/vlayoutpaper_p.h +++ b/src/libs/vlayout/vlayoutpaper_p.h @@ -34,6 +34,7 @@ #include #include "vlayoutdetail.h" +#include "vcontour.h" #ifdef Q_CC_GNU #pragma GCC diagnostic push @@ -44,19 +45,17 @@ class VLayoutPaperData : public QSharedData { public: VLayoutPaperData() - :details(QVector()), globalContour(QVector()), paperHeight(0), paperWidth(0), shift(0), - paperIndex(0), frame(0), layoutWidth(0) + :details(QVector()), globalContour(VContour()), paperIndex(0), frame(0), layoutWidth(0) {} VLayoutPaperData(int height, int width) - :details(QVector()), globalContour(QVector()), paperHeight(height), paperWidth(width), - shift(0), paperIndex(0), frame(0), layoutWidth(0) + :details(QVector()), globalContour(VContour(height, width)), paperIndex(0), frame(0), + layoutWidth(0) {} VLayoutPaperData(const VLayoutPaperData &paper) - :QSharedData(paper), details(paper.details), globalContour(paper.globalContour), paperHeight(paper.paperHeight), - paperWidth(paper.paperWidth), shift(paper.shift), paperIndex(paper.paperIndex), frame(paper.frame), - layoutWidth(paper.layoutWidth) + :QSharedData(paper), details(paper.details), globalContour(paper.globalContour), paperIndex(paper.paperIndex), + frame(paper.frame), layoutWidth(paper.layoutWidth) {} ~VLayoutPaperData() {} @@ -65,15 +64,8 @@ public: QVector details; /** @brief globalContour list of global points contour. */ - QVector globalContour; + VContour globalContour; - /** @brief paperHeight height of paper in pixels*/ - int paperHeight; - - /** @brief paperWidth width of paper in pixels*/ - int paperWidth; - - unsigned int shift; quint32 paperIndex; quint32 frame; qreal layoutWidth; From 9210d31c2561aef492cdb2ba1cbfc4197b5a7486 Mon Sep 17 00:00:00 2001 From: dismine Date: Wed, 21 Jan 2015 23:49:38 +0200 Subject: [PATCH 051/186] First realization multithreading. --HG-- branch : feature --- src/libs/vlayout/vlayout.pri | 6 +- src/libs/vlayout/vlayoutdef.h | 4 +- src/libs/vlayout/vlayoutpaper.cpp | 578 ++----------------------- src/libs/vlayout/vlayoutpaper.h | 34 -- src/libs/vlayout/vposition.cpp | 691 ++++++++++++++++++++++++++++++ src/libs/vlayout/vposition.h | 123 ++++++ 6 files changed, 856 insertions(+), 580 deletions(-) create mode 100644 src/libs/vlayout/vposition.cpp create mode 100644 src/libs/vlayout/vposition.h diff --git a/src/libs/vlayout/vlayout.pri b/src/libs/vlayout/vlayout.pri index 116b75f0e..65bebdf49 100644 --- a/src/libs/vlayout/vlayout.pri +++ b/src/libs/vlayout/vlayout.pri @@ -14,7 +14,8 @@ HEADERS += \ $$PWD/vbank.h \ $$PWD/vcontour.h \ $$PWD/vcontour_p.h \ - $$PWD/vbestsquare.h + $$PWD/vbestsquare.h \ + $$PWD/vposition.h SOURCES += \ $$PWD/stable.cpp \ @@ -24,4 +25,5 @@ SOURCES += \ $$PWD/vlayoutpaper.cpp \ $$PWD/vbank.cpp \ $$PWD/vcontour.cpp \ - $$PWD/vbestsquare.cpp + $$PWD/vbestsquare.cpp \ + $$PWD/vposition.cpp diff --git a/src/libs/vlayout/vlayoutdef.h b/src/libs/vlayout/vlayoutdef.h index 2626258ea..5df8aa00d 100644 --- a/src/libs/vlayout/vlayoutdef.h +++ b/src/libs/vlayout/vlayoutdef.h @@ -46,7 +46,7 @@ enum class BestFrom : char Combine = 1 }; -#define LAYOUT_DEBUG // Enable debug mode +//#define LAYOUT_DEBUG // Enable debug mode #ifdef LAYOUT_DEBUG # define SHOW_VERTICES // Show contour vertices @@ -57,7 +57,7 @@ enum class BestFrom : char //# define SHOW_COMBINE //# define SHOW_MIRROR //# define SHOW_CANDIDATE_BEST -# define SHOW_BEST +//# define SHOW_BEST #endif//LAYOUT_DEBUG #endif // VLAYOUTDEF_H diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index 5498b0f88..4d1651ee5 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -29,6 +29,7 @@ #include "vlayoutpaper.h" #include "vlayoutpaper_p.h" #include "vbestsquare.h" +#include "vposition.h" #include #include @@ -38,6 +39,7 @@ #include #include #include +#include //--------------------------------------------------------------------------------------------------------------------- VLayoutPaper::VLayoutPaper() @@ -155,413 +157,52 @@ int VLayoutPaper::Count() const bool VLayoutPaper::AddToSheet(const VLayoutDetail &detail, bool &stop) { VBestSquare bestResult; + QThreadPool *thread_pool = QThreadPool::globalInstance(); + thread_pool->setMaxThreadCount(4); + QVector threads; for (int j=1; j <= d->globalContour.EdgesCount(); ++j) { for (int i=1; i<= detail.EdgesCount(); i++) { - QCoreApplication::processEvents(); + VPosition *thread = new VPosition(d->globalContour, j, detail, i); + //Info for debug + thread->setPaperIndex(d->paperIndex); + thread->setFrame(d->frame); + thread->setDetailsCount(d->details.count()); + thread->setDetails(d->details); - if (stop) - { - return false; - } + thread->setAutoDelete(false); + threads.append(thread); + thread_pool->start(thread); - // We should use copy of the detail. - VLayoutDetail workDetail = detail; - - int dEdge = i;// For mirror detail edge will be different - if (CheckCombineEdges(workDetail, j, dEdge)) - { - #ifdef LAYOUT_DEBUG - # ifdef SHOW_CANDIDATE_BEST - DrawDebug(d->globalContour, workDetail, d->frame+2, d->paperIndex, d->details.count(), - d->details); - # endif - #endif - - SaveCandidate(bestResult, workDetail, j, dEdge, BestFrom::Combine); - } - d->frame = d->frame + 3; - - for (int angle = 0; angle <= 360; angle = angle+20) - { - QCoreApplication::processEvents(); - - if (stop) - { - return false; - } - - // We should use copy of the detail. - VLayoutDetail workDetail = detail; - - if (CheckRotationEdges(workDetail, j, i, angle)) - { - #ifdef LAYOUT_DEBUG - # ifdef SHOW_CANDIDATE_BEST - ++d->frame; - DrawDebug(d->globalContour, workDetail, d->frame, d->paperIndex, d->details.count(), - d->details); - # endif - #endif - - SaveCandidate(bestResult, workDetail, j, i, BestFrom::Rotation); - } - ++d->frame; - } + d->frame = d->frame + 3 + 360/20*2; } } + if (thread_pool->waitForDone() == false) + { + return false; + } + + QCoreApplication::processEvents(); + + if (stop) + { + return false; + } + + for (int i=0; i < threads.size(); ++i) + { + bestResult.NewResult(threads.at(i)->getBestResult()); + } + + qDeleteAll(threads.begin(), threads.end()); + threads.clear(); + return SaveResult(bestResult, detail); } -//--------------------------------------------------------------------------------------------------------------------- -bool VLayoutPaper::CheckCombineEdges(VLayoutDetail &detail, int j, int &dEdge) const -{ - const QLineF globalEdge = d->globalContour.GlobalEdge(j); - bool flagMirror = false; - bool flagSquare = false; - - CombineEdges(detail, globalEdge, dEdge); - -#ifdef LAYOUT_DEBUG -# ifdef SHOW_COMBINE - DrawDebug(d->globalContour, detail, d->frame, d->paperIndex, d->details.count(), d->details); -# endif -#endif - - CrossingType type = CrossingType::Intersection; - if (SheetContains(detail.BoundingRect())) - { - type = Crossing(detail, j, dEdge); - } - - switch (type) - { - case CrossingType::EdgeError: - return false; - case CrossingType::Intersection: - detail.Mirror(globalEdge); - flagMirror = true; - break; - case CrossingType::NoIntersection: - { - switch (InsideContour(detail, dEdge)) - { - case InsideType::EdgeError: - return false; - case InsideType::Inside: - detail.Mirror(globalEdge); - flagMirror = true; - break; - case InsideType::Outside: - flagSquare = true; - break; - default: - break; - } - } - default: - break; - } - - if (flagMirror) - { - #ifdef LAYOUT_DEBUG - #ifdef SHOW_MIRROR - DrawDebug(d->globalContour, detail, d->frame+1, d->paperIndex, d->details.count(), d->details); - #endif - #endif - - dEdge = detail.EdgeByPoint(globalEdge.p2()); - if (dEdge <= 0) - { - return false; - } - - CrossingType type = CrossingType::Intersection; - if (SheetContains(detail.BoundingRect())) - { - type = Crossing(detail, j, dEdge); - } - - switch (type) - { - case CrossingType::EdgeError: - return false; - case CrossingType::Intersection: - flagSquare = false; - break; - case CrossingType::NoIntersection: - { - switch (InsideContour(detail, dEdge)) - { - case InsideType::EdgeError: - return false; - case InsideType::Inside: - flagSquare = false; - break; - case InsideType::Outside: - flagSquare = true; - break; - default: - break; - } - } - default: - break; - } - } - return flagSquare; -} - -//--------------------------------------------------------------------------------------------------------------------- -bool VLayoutPaper::CheckRotationEdges(VLayoutDetail &detail, int j, int dEdge, int angle) const -{ - const QLineF globalEdge = d->globalContour.GlobalEdge(j); - bool flagSquare = false; - - RotateEdges(detail, globalEdge, dEdge, angle); - -#ifdef LAYOUT_DEBUG - #ifdef SHOW_ROTATION - DrawDebug(d->globalContour, detail, d->frame, d->paperIndex, d->details.count(), d->details); - #endif -#endif - - CrossingType type = CrossingType::Intersection; - if (SheetContains(detail.BoundingRect())) - { - type = Crossing(detail, j, dEdge); - } - - switch (type) - { - case CrossingType::EdgeError: - return false; - case CrossingType::Intersection: - flagSquare = false; - break; - case CrossingType::NoIntersection: - { - switch (InsideContour(detail, dEdge)) - { - case InsideType::EdgeError: - return false; - case InsideType::Inside: - flagSquare = false; - break; - case InsideType::Outside: - flagSquare = true; - break; - default: - break; - } - } - default: - break; - } - return flagSquare; -} - -//--------------------------------------------------------------------------------------------------------------------- -VLayoutPaper::CrossingType VLayoutPaper::Crossing(const VLayoutDetail &detail, const int &globalI, - const int &detailI) const -{ - int globalEdgesCount = d->globalContour.EdgesCount(); - if (globalEdgesCount == 0) - { - globalEdgesCount = 1;// For blank sheet - } - - const int detailEdgesCount = detail.EdgesCount(); - if (detailEdgesCount < 3) - { - return CrossingType::EdgeError; - } - - for(int i = 1; i <= globalEdgesCount; i++) - { - const QLineF globalEdge = d->globalContour.GlobalEdge(i); - if (globalEdge.isNull()) // Got null edge - { - return CrossingType::EdgeError; - } - - for(int j = 1; j <= detailEdgesCount; j++) - { - if (i == globalI && j == detailI) - { - continue; - } - - const QLineF detailEdge = detail.Edge(j); - if (detailEdge.isNull()) // Got null edge - { - return CrossingType::EdgeError; - } - - QPointF xPoint; - QLineF::IntersectType type = globalEdge.intersect(detailEdge, &xPoint); - - if (type == QLineF::BoundedIntersection) - { - if (TrueIntersection(d->globalContour.GlobalEdge(globalI), detail.Edge(detailI), xPoint)) - { - return CrossingType::Intersection; - } - } - } - } - - return CrossingType::NoIntersection; -} - -//--------------------------------------------------------------------------------------------------------------------- -VLayoutPaper::InsideType VLayoutPaper::InsideContour(const VLayoutDetail &detail, const int &detailI) const -{ - if (detail.EdgesCount() < 3) - { - return InsideType::EdgeError; - } - - const QVector lPoints = detail.GetLayoutAllowencePoints(); - - const QLineF detailEdge = detail.Edge(detailI); - if (detailEdge.isNull()) // Got null edge - { - return InsideType::EdgeError; - } - - if (d->details.isEmpty()) - { - const QLineF globalEdge = d->globalContour.GlobalEdge(1); - for(int i = 0; i < lPoints.count(); i++) - { - if (CheckSide(globalEdge, lPoints.at(i)) < 0) - { - return InsideType::Inside; - } - } - } - else - { - const int polyCorners = d->globalContour.EdgesCount(); - int j = polyCorners-1; - - QVector constant; - QVector multiple; - - for(int i=0; iglobalContour.at(i).x(); - const qreal xj = d->globalContour.at(j).x(); - const qreal yi = d->globalContour.at(i).y(); - const qreal yj = d->globalContour.at(j).y(); - if(qFuzzyCompare(yj, yi)) - { - constant.insert(i, xi); - multiple.insert(i, 0); - } - else - { - constant.insert(i, xi - (yi*xj)/(yj-yi) + (yi*xi)/(yj-yi)); - multiple.insert(i, (xj-xi)/(yj-yi)); - } - - j=i; - } - - for(int m = 1; m <= detail.EdgesCount(); ++m) - { - if (m == detailI) - { - continue; - } - - const QLineF detailEdge = detail.Edge(m); - if (detailEdge.isNull()) // Got null edge - { - return InsideType::EdgeError; - } - - const QVector p = Triplet(detailEdge); - for (int n=0; nglobalContour.at(i).y(); - const qreal yj = d->globalContour.at(j).y(); - - if (((yi < p.at(n).y() && yj >= p.at(n).y()) || (yj < p.at(n).y() && yi >= p.at(n).y()))) - { - oddNodes ^= (p.at(n).y() * multiple.at(i) + constant.at(i) < p.at(n).x()); - } - - j=i; - } - - if (oddNodes) - { - return InsideType::Inside; - } - } - } - } - return InsideType::Outside; -} - -//--------------------------------------------------------------------------------------------------------------------- -qreal VLayoutPaper::CheckSide(const QLineF &edge, const QPointF &p) const -{ - return (edge.x2() - edge.x1()) * (p.y() - edge.y1()) - (edge.y2() - edge.y1()) * (p.x() - edge.x1()); -} - -//--------------------------------------------------------------------------------------------------------------------- -bool VLayoutPaper::SheetContains(const QRectF &rect) const -{ - const QRectF bRect(0, 0, d->globalContour.GetWidth(), d->globalContour.GetHeight()); - return bRect.contains(rect); -} - -//--------------------------------------------------------------------------------------------------------------------- -void VLayoutPaper::CombineEdges(VLayoutDetail &detail, const QLineF &globalEdge, const int &dEdge) const -{ - QLineF detailEdge = detail.Edge(dEdge); - - // Find distance between two edges for two begin vertex. - const qreal dx = globalEdge.x2() - detailEdge.x2(); - const qreal dy = globalEdge.y2() - detailEdge.y2(); - - detailEdge.translate(dx, dy); // Use values for translate detail edge. - - const qreal angle_between = globalEdge.angleTo(detailEdge); // Seek angle between two edges. - - // Now we move detail to position near to global contour edge. - detail.Translate(dx, dy); - detail.Rotate(detailEdge.p2(), -angle_between); -} - -//--------------------------------------------------------------------------------------------------------------------- -void VLayoutPaper::RotateEdges(VLayoutDetail &detail, const QLineF &globalEdge, int dEdge, int angle) const -{ - QLineF detailEdge = detail.Edge(dEdge); - - // Find distance between two edges for two begin vertex. - const qreal dx = globalEdge.x2() - detailEdge.x2(); - const qreal dy = globalEdge.y2() - detailEdge.y2(); - - detailEdge.translate(dx, dy); // Use values for translate detail edge. - - // Now we move detail to position near to global contour edge. - detail.Translate(dx, dy); - detail.Rotate(globalEdge.p2(), angle); -} - //--------------------------------------------------------------------------------------------------------------------- bool VLayoutPaper::SaveResult(const VBestSquare &bestResult, const VLayoutDetail &detail) { @@ -582,7 +223,7 @@ bool VLayoutPaper::SaveResult(const VBestSquare &bestResult, const VLayoutDetail #ifdef LAYOUT_DEBUG # ifdef SHOW_BEST - DrawDebug(d->globalContour, workDetail, UINT_MAX, d->paperIndex, d->details.count(), d->details); + VPosition::DrawDebug(d->globalContour, workDetail, UINT_MAX, d->paperIndex, d->details.count(), d->details); # endif #endif } @@ -601,153 +242,6 @@ void VLayoutPaper::SaveCandidate(VBestSquare &bestResult, const VLayoutDetail &d detail.GetMatrix(), detail.IsMirror(), type); } -//--------------------------------------------------------------------------------------------------------------------- -void VLayoutPaper::DrawDebug(const VContour &contour, const VLayoutDetail &detail, int frame, quint32 paperIndex, - int detailsCount, const QVector &details) -{ - QImage frameImage(contour.GetWidth()*2, contour.GetHeight()*2, QImage::Format_RGB32); - frameImage.fill(Qt::white); - QPainter paint; - paint.begin(&frameImage); - - paint.setPen(QPen(Qt::darkRed, 10, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); - paint.drawRect(QRectF(contour.GetWidth()/2, contour.GetHeight()/2, contour.GetWidth(), contour.GetHeight())); - - paint.setPen(QPen(Qt::black, 3, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); - QPainterPath p; - if (contour.GetContour().isEmpty()) - { - p = DrawContour(contour.CutEdge(QLineF(0, 0, contour.GetWidth(), 0))); - p.translate(contour.GetWidth()/2, contour.GetHeight()/2); - paint.drawPath(p); - } - else - { - p = DrawContour(contour.GetContour()); - p.translate(contour.GetWidth()/2, contour.GetHeight()/2); - paint.drawPath(p); - } - -#ifdef SHOW_CANDIDATE - paint.setPen(QPen(Qt::darkGreen, 3, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); - p = DrawContour(detail.GetLayoutAllowencePoints()); - p.translate(contour.GetWidth()/2, contour.GetHeight()/2); - paint.drawPath(p); -#endif - -#ifdef ARRANGED_DETAILS - paint.setPen(QPen(Qt::blue, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); - p = DrawDetails(details); - p.translate(contour.GetWidth()/2, contour.GetHeight()/2); - paint.drawPath(p); -#else - Q_UNUSED(detail) -#endif - - paint.end(); - const QString path = QDir::homePath()+QStringLiteral("/LayoutDebug/")+QString("%1_%2_%3.png").arg(paperIndex) - .arg(detailsCount).arg(frame); - frameImage.save (path); -} - -//--------------------------------------------------------------------------------------------------------------------- -QPainterPath VLayoutPaper::ShowDirection(const QLineF &edge) -{ - QLineF arrow = edge; - arrow.setLength(edge.length()/2.0); - - //Reverse line because we want start arrow from this point - arrow = QLineF(arrow.p2(), arrow.p1()); - const qreal angle = arrow.angle();//we each time change line angle, better save original angle value - arrow.setLength(14);//arrow length in pixels - - QPainterPath path; - arrow.setAngle(angle-35); - path.moveTo(arrow.p1()); - path.lineTo(arrow.p2()); - - arrow.setAngle(angle+35); - path.moveTo(arrow.p1()); - path.lineTo(arrow.p2()); - return path; -} - -//--------------------------------------------------------------------------------------------------------------------- -QPainterPath VLayoutPaper::DrawContour(const QVector &points) -{ - QPainterPath path; - path.setFillRule(Qt::WindingFill); - if (points.count() >= 2) - { - for (qint32 i = 0; i < points.count()-1; ++i) - { - path.moveTo(points.at(i)); - path.lineTo(points.at(i+1)); - } - path.lineTo(points.at(0)); - -#ifdef SHOW_DIRECTION - for (qint32 i = 0; i < points.count()-1; ++i) - { - path.addPath(ShowDirection(QLineF(points.at(i), points.at(i+1)))); - } -#endif - -#ifdef SHOW_VERTICES - for (qint32 i = 0; i < points.count(); ++i) - { - path.addRect(points.at(i).x()-3, points.at(i).y()-3, 6, 6); - } -#endif - } - return path; -} - -//--------------------------------------------------------------------------------------------------------------------- -QPainterPath VLayoutPaper::DrawDetails(const QVector &details) -{ - QPainterPath path; - path.setFillRule(Qt::WindingFill); - if (details.count() > 0) - { - for (int i = 0; i < details.size(); ++i) - { - path.addPath(details.at(i).ContourPath()); - } - } - return path; -} - -//--------------------------------------------------------------------------------------------------------------------- -bool VLayoutPaper::TrueIntersection(const QLineF &gEdge, const QLineF &dEdge, const QPointF &p) const -{ - const QPointF pX = RoundedPoint(p); - const QPointF gP1 = RoundedPoint(gEdge.p1()); - const QPointF gP2 = RoundedPoint(gEdge.p2()); - const QPointF dP1 = RoundedPoint(dEdge.p1()); - const QPointF dP2 = RoundedPoint(dEdge.p2()); - return !(pX == gP1 || pX == gP2 || pX == dP1 || pX == dP2); -} - -//--------------------------------------------------------------------------------------------------------------------- -QPointF VLayoutPaper::RoundedPoint(const QPointF &p) const -{ - return QPointF(qRound(p.x()), qRound(p.y())); -} - -//--------------------------------------------------------------------------------------------------------------------- -QVector VLayoutPaper::Triplet(const QLineF &edge) const -{ - QVector p; - QLineF line = edge; - line.setLength(edge.length()/2); - - p.append(edge.p1()); - p.append(line.p2()); - p.append(edge.p2()); - return p; -} - //--------------------------------------------------------------------------------------------------------------------- QGraphicsItem *VLayoutPaper::GetItem() const { diff --git a/src/libs/vlayout/vlayoutpaper.h b/src/libs/vlayout/vlayoutpaper.h index 496f6a0bb..2bc3c45f6 100644 --- a/src/libs/vlayout/vlayoutpaper.h +++ b/src/libs/vlayout/vlayoutpaper.h @@ -73,45 +73,11 @@ public: private: QSharedDataPointer d; - enum class CrossingType : char - { - NoIntersection = 0, - Intersection = 1, - EdgeError = 2 - }; - - enum class InsideType : char - { - Outside = 0, - Inside = 1, - EdgeError = 2 - }; - bool AddToSheet(const VLayoutDetail &detail, bool &stop); - bool CheckCombineEdges(VLayoutDetail &detail, int j, int &dEdge) const; - bool CheckRotationEdges(VLayoutDetail &detail, int j, int dEdge, int angle) const; - - CrossingType Crossing(const VLayoutDetail &detail, const int &globalI, const int &detailI) const; - InsideType InsideContour(const VLayoutDetail &detail, const int &detailI) const; - qreal CheckSide(const QLineF &edge, const QPointF &p) const; - bool SheetContains(const QRectF &rect) const; - - void CombineEdges(VLayoutDetail &detail, const QLineF &globalEdge, const int &dEdge) const; - void RotateEdges(VLayoutDetail &detail, const QLineF &globalEdge, int dEdge, int angle) const; - bool SaveResult(const VBestSquare &bestResult, const VLayoutDetail &detail); void SaveCandidate(VBestSquare &bestResult, const VLayoutDetail &detail, int globalI, int detJ, BestFrom type); - static void DrawDebug(const VContour &contour, const VLayoutDetail &detail, int frame, quint32 paperIndex, - int detailsCount, const QVector &details = QVector()); - static QPainterPath ShowDirection(const QLineF &edge); - static QPainterPath DrawContour(const QVector &points); - static QPainterPath DrawDetails(const QVector &details); - - bool TrueIntersection(const QLineF &gEdge, const QLineF &dEdge, const QPointF &p) const; - QPointF RoundedPoint(const QPointF &p) const; - QVector Triplet(const QLineF &edge) const; }; #endif // VLAYOUTPAPER_H diff --git a/src/libs/vlayout/vposition.cpp b/src/libs/vlayout/vposition.cpp new file mode 100644 index 000000000..8e0f309ec --- /dev/null +++ b/src/libs/vlayout/vposition.cpp @@ -0,0 +1,691 @@ +/************************************************************************ + ** + ** @file vposition.cpp + ** @author Roman Telezhynskyi + ** @date 20 1, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#include "vposition.h" + +#include +#include +#include +#include +#include +#include +#include + +//--------------------------------------------------------------------------------------------------------------------- +VPosition::VPosition(const VContour &gContour, int j, const VLayoutDetail &detail, int i) + :QRunnable(), bestResult(VBestSquare()), gContour(gContour), detail(detail), i(i), j(j), paperIndex(0), frame(0), + detailsCount(0), details(QVector()) +{} + +//--------------------------------------------------------------------------------------------------------------------- +void VPosition::run() +{ + // We should use copy of the detail. + VLayoutDetail workDetail = detail; + + int dEdge = i;// For mirror detail edge will be different + if (CheckCombineEdges(workDetail, j, dEdge)) + { + #ifdef LAYOUT_DEBUG + # ifdef SHOW_CANDIDATE_BEST + DrawDebug(gContour, workDetail, frame+2, paperIndex, detailsCount, details); + # endif + #endif + + SaveCandidate(bestResult, workDetail, j, dEdge, BestFrom::Combine); + } + frame = frame + 3; + + for (int angle = 0; angle <= 360; angle = angle+20) + { + // We should use copy of the detail. + VLayoutDetail workDetail = detail; + + if (CheckRotationEdges(workDetail, j, i, angle)) + { + #ifdef LAYOUT_DEBUG + # ifdef SHOW_CANDIDATE_BEST + ++frame; + DrawDebug(gContour, workDetail, frame, paperIndex, detailsCount, details); + # endif + #endif + + SaveCandidate(bestResult, workDetail, j, i, BestFrom::Rotation); + } + ++frame; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +quint32 VPosition::getPaperIndex() const +{ + return paperIndex; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VPosition::setPaperIndex(const quint32 &value) +{ + paperIndex = value; +} + +//--------------------------------------------------------------------------------------------------------------------- +quint32 VPosition::getFrame() const +{ + return frame; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VPosition::setFrame(const quint32 &value) +{ + frame = value; +} + +//--------------------------------------------------------------------------------------------------------------------- +quint32 VPosition::getDetailsCount() const +{ + return detailsCount; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VPosition::setDetailsCount(const quint32 &value) +{ + detailsCount = value; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VPosition::setDetails(const QVector &details) +{ + this->details = details; +} + +//--------------------------------------------------------------------------------------------------------------------- +VBestSquare VPosition::getBestResult() const +{ + return bestResult; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VPosition::DrawDebug(const VContour &contour, const VLayoutDetail &detail, int frame, quint32 paperIndex, + int detailsCount, const QVector &details) +{ + QImage frameImage(contour.GetWidth()*2, contour.GetHeight()*2, QImage::Format_RGB32); + frameImage.fill(Qt::white); + QPainter paint; + paint.begin(&frameImage); + + paint.setPen(QPen(Qt::darkRed, 10, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); + paint.drawRect(QRectF(contour.GetWidth()/2, contour.GetHeight()/2, contour.GetWidth(), contour.GetHeight())); + + paint.setPen(QPen(Qt::black, 3, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); + QPainterPath p; + if (contour.GetContour().isEmpty()) + { + p = DrawContour(contour.CutEdge(QLineF(0, 0, contour.GetWidth(), 0))); + p.translate(contour.GetWidth()/2, contour.GetHeight()/2); + paint.drawPath(p); + } + else + { + p = DrawContour(contour.GetContour()); + p.translate(contour.GetWidth()/2, contour.GetHeight()/2); + paint.drawPath(p); + } + +#ifdef SHOW_CANDIDATE + paint.setPen(QPen(Qt::darkGreen, 3, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); + p = DrawContour(detail.GetLayoutAllowencePoints()); + p.translate(contour.GetWidth()/2, contour.GetHeight()/2); + paint.drawPath(p); +#endif + +#ifdef ARRANGED_DETAILS + paint.setPen(QPen(Qt::blue, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); + p = DrawDetails(details); + p.translate(contour.GetWidth()/2, contour.GetHeight()/2); + paint.drawPath(p); +#endif + + paint.end(); + const QString path = QDir::homePath()+QStringLiteral("/LayoutDebug/")+QString("%1_%2_%3.png").arg(paperIndex) + .arg(detailsCount).arg(frame); + frameImage.save (path); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VPosition::SaveCandidate(VBestSquare &bestResult, const VLayoutDetail &detail, int globalI, int detJ, + BestFrom type) +{ + QVector newGContour = gContour.UniteWithContour(detail, globalI, detJ, type); + newGContour.append(newGContour.first()); + const QRectF rec = QPolygonF(newGContour).boundingRect(); + bestResult.NewResult(static_cast(rec.width()*rec.height()), globalI, detJ, detail.GetMatrix(), + detail.IsMirror(), type); +} + +//--------------------------------------------------------------------------------------------------------------------- +bool VPosition::CheckCombineEdges(VLayoutDetail &detail, int j, int &dEdge) const +{ + const QLineF globalEdge = gContour.GlobalEdge(j); + bool flagMirror = false; + bool flagSquare = false; + + CombineEdges(detail, globalEdge, dEdge); + +#ifdef LAYOUT_DEBUG +# ifdef SHOW_COMBINE + DrawDebug(gContour, detail, frame, paperIndex, detailsCount, details); +# endif +#endif + + CrossingType type = CrossingType::Intersection; + if (SheetContains(detail.BoundingRect())) + { + type = Crossing(detail, j, dEdge); + } + + switch (type) + { + case CrossingType::EdgeError: + return false; + case CrossingType::Intersection: + detail.Mirror(globalEdge); + flagMirror = true; + break; + case CrossingType::NoIntersection: + { + switch (InsideContour(detail, dEdge)) + { + case InsideType::EdgeError: + return false; + case InsideType::Inside: + detail.Mirror(globalEdge); + flagMirror = true; + break; + case InsideType::Outside: + flagSquare = true; + break; + default: + break; + } + } + default: + break; + } + + if (flagMirror) + { + #ifdef LAYOUT_DEBUG + #ifdef SHOW_MIRROR + DrawDebug(gContour, detail, frame+1, paperIndex, detailsCount, details); + #endif + #endif + + dEdge = detail.EdgeByPoint(globalEdge.p2()); + if (dEdge <= 0) + { + return false; + } + + CrossingType type = CrossingType::Intersection; + if (SheetContains(detail.BoundingRect())) + { + type = Crossing(detail, j, dEdge); + } + + switch (type) + { + case CrossingType::EdgeError: + return false; + case CrossingType::Intersection: + flagSquare = false; + break; + case CrossingType::NoIntersection: + { + switch (InsideContour(detail, dEdge)) + { + case InsideType::EdgeError: + return false; + case InsideType::Inside: + flagSquare = false; + break; + case InsideType::Outside: + flagSquare = true; + break; + default: + break; + } + } + default: + break; + } + } + return flagSquare; +} + +//--------------------------------------------------------------------------------------------------------------------- +bool VPosition::CheckRotationEdges(VLayoutDetail &detail, int j, int dEdge, int angle) const +{ + const QLineF globalEdge = gContour.GlobalEdge(j); + bool flagSquare = false; + + RotateEdges(detail, globalEdge, dEdge, angle); + +#ifdef LAYOUT_DEBUG + #ifdef SHOW_ROTATION + DrawDebug(gContour, detail, frame, paperIndex, detailsCount, details); + #endif +#endif + + CrossingType type = CrossingType::Intersection; + if (SheetContains(detail.BoundingRect())) + { + type = Crossing(detail, j, dEdge); + } + + switch (type) + { + case CrossingType::EdgeError: + return false; + case CrossingType::Intersection: + flagSquare = false; + break; + case CrossingType::NoIntersection: + { + switch (InsideContour(detail, dEdge)) + { + case InsideType::EdgeError: + return false; + case InsideType::Inside: + flagSquare = false; + break; + case InsideType::Outside: + flagSquare = true; + break; + default: + break; + } + } + default: + break; + } + return flagSquare; +} + +//--------------------------------------------------------------------------------------------------------------------- +VPosition::CrossingType VPosition::Crossing(const VLayoutDetail &detail, const int &globalI, const int &detailI) const +{ + int globalEdgesCount = gContour.EdgesCount(); + if (globalEdgesCount == 0) + { + globalEdgesCount = 1;// For blank sheet + } + + const int detailEdgesCount = detail.EdgesCount(); + if (detailEdgesCount < 3) + { + return CrossingType::EdgeError; + } + + for(int i = 1; i <= globalEdgesCount; i++) + { + const QLineF globalEdge = gContour.GlobalEdge(i); + if (globalEdge.isNull()) // Got null edge + { + return CrossingType::EdgeError; + } + + for(int j = 1; j <= detailEdgesCount; j++) + { + if (i == globalI && j == detailI) + { + continue; + } + + const QLineF detailEdge = detail.Edge(j); + if (detailEdge.isNull()) // Got null edge + { + return CrossingType::EdgeError; + } + + QPointF xPoint; + QLineF::IntersectType type = globalEdge.intersect(detailEdge, &xPoint); + + if (type == QLineF::BoundedIntersection) + { + if (TrueIntersection(gContour.GlobalEdge(globalI), detail.Edge(detailI), xPoint)) + { + return CrossingType::Intersection; + } + } + } + } + + return CrossingType::NoIntersection; +} + +//--------------------------------------------------------------------------------------------------------------------- +VPosition::InsideType VPosition::InsideContour(const VLayoutDetail &detail, const int &detailI) const +{ + if (detail.EdgesCount() < 3) + { + return InsideType::EdgeError; + } + + const QVector lPoints = detail.GetLayoutAllowencePoints(); + + const QLineF detailEdge = detail.Edge(detailI); + if (detailEdge.isNull()) // Got null edge + { + return InsideType::EdgeError; + } + + if (details.isEmpty()) + { + const QLineF globalEdge = gContour.GlobalEdge(1); + for(int i = 0; i < lPoints.count(); i++) + { + if (CheckSide(globalEdge, lPoints.at(i)) < 0) + { + return InsideType::Inside; + } + } + } + else + { + const int polyCorners = gContour.EdgesCount(); + int j = polyCorners-1; + + QVector constant; + QVector multiple; + + for(int i=0; i p = Triplet(detailEdge); + for (int n=0; n= p.at(n).y()) || (yj < p.at(n).y() && yi >= p.at(n).y()))) + { + oddNodes ^= (p.at(n).y() * multiple.at(i) + constant.at(i) < p.at(n).x()); + } + + j=i; + } + + if (oddNodes) + { + return InsideType::Inside; + } + } + } + } + return InsideType::Outside; +} + +//--------------------------------------------------------------------------------------------------------------------- +qreal VPosition::CheckSide(const QLineF &edge, const QPointF &p) const +{ + return (edge.x2() - edge.x1()) * (p.y() - edge.y1()) - (edge.y2() - edge.y1()) * (p.x() - edge.x1()); +} + +//--------------------------------------------------------------------------------------------------------------------- +bool VPosition::SheetContains(const QRectF &rect) const +{ + const QRectF bRect(0, 0, gContour.GetWidth(), gContour.GetHeight()); + return bRect.contains(rect); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VPosition::CombineEdges(VLayoutDetail &detail, const QLineF &globalEdge, const int &dEdge) const +{ + QLineF detailEdge = detail.Edge(dEdge); + + // Find distance between two edges for two begin vertex. + const qreal dx = globalEdge.x2() - detailEdge.x2(); + const qreal dy = globalEdge.y2() - detailEdge.y2(); + + detailEdge.translate(dx, dy); // Use values for translate detail edge. + + const qreal angle_between = globalEdge.angleTo(detailEdge); // Seek angle between two edges. + + // Now we move detail to position near to global contour edge. + detail.Translate(dx, dy); + detail.Rotate(detailEdge.p2(), -angle_between); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VPosition::RotateEdges(VLayoutDetail &detail, const QLineF &globalEdge, int dEdge, int angle) const +{ + QLineF detailEdge = detail.Edge(dEdge); + + // Find distance between two edges for two begin vertex. + const qreal dx = globalEdge.x2() - detailEdge.x2(); + const qreal dy = globalEdge.y2() - detailEdge.y2(); + + detailEdge.translate(dx, dy); // Use values for translate detail edge. + + // Now we move detail to position near to global contour edge. + detail.Translate(dx, dy); + detail.Rotate(globalEdge.p2(), angle); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VPosition::AppendWhole(QVector &contour, const VLayoutDetail &detail, int detJ, unsigned int shift) +{ + int processedEdges = 0; + const int nD = detail.EdgesCount(); + int j = detJ+1; + do + { + if (j > nD) + { + j=1; + } + const QVector points = CutEdge(detail.Edge(j), shift); + for (int i = 0; i < points.size()-1; ++i) + { + contour.append(points.at(i)); + } + ++processedEdges; + ++j; + }while (processedEdges < nD); +} + +//--------------------------------------------------------------------------------------------------------------------- +QPolygonF VPosition::GlobalPolygon() const +{ + QVector points = gContour.GetContour(); + points.append(points.first()); + return QPolygonF(points); +} + +//--------------------------------------------------------------------------------------------------------------------- +QVector VPosition::CutEdge(const QLineF &edge, unsigned int shift) +{ + QVector points; + if (shift == 0) + { + points.append(edge.p1()); + points.append(edge.p2()); + } + + const int n = qFloor(edge.length()/shift); + + if (n <= 0) + { + points.append(edge.p1()); + points.append(edge.p2()); + } + else + { + const qreal nShift = edge.length()/n; + for (int i = 1; i <= n+1; ++i) + { + QLineF l1 = edge; + l1.setLength(nShift*(i-1)); + points.append(l1.p2()); + } + } + return points; +} + +//--------------------------------------------------------------------------------------------------------------------- +bool VPosition::TrueIntersection(const QLineF &gEdge, const QLineF &dEdge, const QPointF &p) const +{ + const QPointF pX = RoundedPoint(p); + const QPointF gP1 = RoundedPoint(gEdge.p1()); + const QPointF gP2 = RoundedPoint(gEdge.p2()); + const QPointF dP1 = RoundedPoint(dEdge.p1()); + const QPointF dP2 = RoundedPoint(dEdge.p2()); + return !(pX == gP1 || pX == gP2 || pX == dP1 || pX == dP2); +} + +//--------------------------------------------------------------------------------------------------------------------- +QPointF VPosition::RoundedPoint(const QPointF &p) const +{ + return QPointF(qRound(p.x()), qRound(p.y())); +} + +//--------------------------------------------------------------------------------------------------------------------- +QVector VPosition::Triplet(const QLineF &edge) const +{ + QVector p; + QLineF line = edge; + line.setLength(edge.length()/2); + + p.append(edge.p1()); + p.append(line.p2()); + p.append(edge.p2()); + return p; +} + +//--------------------------------------------------------------------------------------------------------------------- +QPainterPath VPosition::ShowDirection(const QLineF &edge) +{ + QLineF arrow = edge; + arrow.setLength(edge.length()/2.0); + + //Reverse line because we want start arrow from this point + arrow = QLineF(arrow.p2(), arrow.p1()); + const qreal angle = arrow.angle();//we each time change line angle, better save original angle value + arrow.setLength(14);//arrow length in pixels + + QPainterPath path; + arrow.setAngle(angle-35); + path.moveTo(arrow.p1()); + path.lineTo(arrow.p2()); + + arrow.setAngle(angle+35); + path.moveTo(arrow.p1()); + path.lineTo(arrow.p2()); + return path; +} + +//--------------------------------------------------------------------------------------------------------------------- +QPainterPath VPosition::DrawContour(const QVector &points) +{ + QPainterPath path; + path.setFillRule(Qt::WindingFill); + if (points.count() >= 2) + { + for (qint32 i = 0; i < points.count()-1; ++i) + { + path.moveTo(points.at(i)); + path.lineTo(points.at(i+1)); + } + path.lineTo(points.at(0)); + +#ifdef SHOW_DIRECTION + for (qint32 i = 0; i < points.count()-1; ++i) + { + path.addPath(ShowDirection(QLineF(points.at(i), points.at(i+1)))); + } +#endif + +#ifdef SHOW_VERTICES + for (qint32 i = 0; i < points.count(); ++i) + { + path.addRect(points.at(i).x()-3, points.at(i).y()-3, 6, 6); + } +#endif + } + return path; +} + +//--------------------------------------------------------------------------------------------------------------------- +QPainterPath VPosition::DrawDetails(const QVector &details) +{ + QPainterPath path; + path.setFillRule(Qt::WindingFill); + if (details.count() > 0) + { + for (int i = 0; i < details.size(); ++i) + { + path.addPath(details.at(i).ContourPath()); + } + } + return path; +} diff --git a/src/libs/vlayout/vposition.h b/src/libs/vlayout/vposition.h new file mode 100644 index 000000000..d8b2edbe4 --- /dev/null +++ b/src/libs/vlayout/vposition.h @@ -0,0 +1,123 @@ +/************************************************************************ + ** + ** @file vposition.h + ** @author Roman Telezhynskyi + ** @date 20 1, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef VPOSITION_H +#define VPOSITION_H + +#include +#include + +#include "vlayoutdef.h" +#include "vbestsquare.h" +#include "vcontour.h" +#include "vlayoutdetail.h" + +class QPointF; +class QRectF; +class QLineF; +class QPolygonF; +class QPainterPath; + +class VPosition : public QRunnable +{ +public: + VPosition(const VContour &gContour, int j, const VLayoutDetail &detail, int i); + virtual ~VPosition(){} + + virtual void run(); + + quint32 getPaperIndex() const; + void setPaperIndex(const quint32 &value); + + quint32 getFrame() const; + void setFrame(const quint32 &value); + + quint32 getDetailsCount() const; + void setDetailsCount(const quint32 &value); + + void setDetails(const QVector &details); + + VBestSquare getBestResult() const; + + static void DrawDebug(const VContour &contour, const VLayoutDetail &detail, int frame, quint32 paperIndex, + int detailsCount, const QVector &details = QVector()); + +private: + Q_DISABLE_COPY(VPosition) + VBestSquare bestResult; + const VContour gContour; + const VLayoutDetail detail; + int i; + int j; + quint32 paperIndex; + quint32 frame; + quint32 detailsCount; + QVector details; + + enum class CrossingType : char + { + NoIntersection = 0, + Intersection = 1, + EdgeError = 2 + }; + + enum class InsideType : char + { + Outside = 0, + Inside = 1, + EdgeError = 2 + }; + + void SaveCandidate(VBestSquare &bestResult, const VLayoutDetail &detail, int globalI, int detJ, BestFrom type); + + bool CheckCombineEdges(VLayoutDetail &detail, int j, int &dEdge) const; + bool CheckRotationEdges(VLayoutDetail &detail, int j, int dEdge, int angle) const; + + CrossingType Crossing(const VLayoutDetail &detail, const int &globalI, const int &detailI) const; + InsideType InsideContour(const VLayoutDetail &detail, const int &detailI) const; + qreal CheckSide(const QLineF &edge, const QPointF &p) const; + bool SheetContains(const QRectF &rect) const; + + void CombineEdges(VLayoutDetail &detail, const QLineF &globalEdge, const int &dEdge) const; + void RotateEdges(VLayoutDetail &detail, const QLineF &globalEdge, int dEdge, int angle) const; + + QPolygonF GlobalPolygon() const; + + bool TrueIntersection(const QLineF &gEdge, const QLineF &dEdge, const QPointF &p) const; + QPointF RoundedPoint(const QPointF &p) const; + QVector Triplet(const QLineF &edge) const; + + static QPainterPath ShowDirection(const QLineF &edge); + static QPainterPath DrawContour(const QVector &points); + static QPainterPath DrawDetails(const QVector &details); + + static void AppendWhole(QVector &contour, const VLayoutDetail &detail, int detJ, unsigned int shift); + static QVector CutEdge(const QLineF &edge, unsigned int shift); +}; + +#endif // VPOSITION_H From 2aa9de5f9486cd0116dce695366bb44f81c279b5 Mon Sep 17 00:00:00 2001 From: dismine Date: Thu, 22 Jan 2015 13:26:09 +0200 Subject: [PATCH 052/186] For rotation check only two positions 180 and 0 degree. --HG-- branch : feature --- src/libs/vlayout/vlayoutpaper.cpp | 3 +-- src/libs/vlayout/vposition.cpp | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index 4d1651ee5..f4cc329ba 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -158,7 +158,6 @@ bool VLayoutPaper::AddToSheet(const VLayoutDetail &detail, bool &stop) { VBestSquare bestResult; QThreadPool *thread_pool = QThreadPool::globalInstance(); - thread_pool->setMaxThreadCount(4); QVector threads; for (int j=1; j <= d->globalContour.EdgesCount(); ++j) @@ -176,7 +175,7 @@ bool VLayoutPaper::AddToSheet(const VLayoutDetail &detail, bool &stop) threads.append(thread); thread_pool->start(thread); - d->frame = d->frame + 3 + 360/20*2; + d->frame = d->frame + 3 + 360/180*2; } } diff --git a/src/libs/vlayout/vposition.cpp b/src/libs/vlayout/vposition.cpp index 8e0f309ec..b194640fc 100644 --- a/src/libs/vlayout/vposition.cpp +++ b/src/libs/vlayout/vposition.cpp @@ -61,7 +61,7 @@ void VPosition::run() } frame = frame + 3; - for (int angle = 0; angle <= 360; angle = angle+20) + for (int angle = 0; angle <= 360; angle = angle+180) { // We should use copy of the detail. VLayoutDetail workDetail = detail; @@ -404,7 +404,7 @@ VPosition::InsideType VPosition::InsideContour(const VLayoutDetail &detail, cons return InsideType::EdgeError; } - if (details.isEmpty()) + if (gContour.GetContour().isEmpty()) { const QLineF globalEdge = gContour.GlobalEdge(1); for(int i = 0; i < lPoints.count(); i++) From 7a9447f7af051ba1a0e5e216fd9eeee1671e160f Mon Sep 17 00:00:00 2001 From: dismine Date: Thu, 22 Jan 2015 13:29:40 +0200 Subject: [PATCH 053/186] Don't set information for debug if no need. --HG-- branch : feature --- src/libs/vlayout/vlayoutpaper.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index f4cc329ba..da473714e 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -166,10 +166,12 @@ bool VLayoutPaper::AddToSheet(const VLayoutDetail &detail, bool &stop) { VPosition *thread = new VPosition(d->globalContour, j, detail, i); //Info for debug - thread->setPaperIndex(d->paperIndex); - thread->setFrame(d->frame); - thread->setDetailsCount(d->details.count()); - thread->setDetails(d->details); + #ifdef LAYOUT_DEBUG + thread->setPaperIndex(d->paperIndex); + thread->setFrame(d->frame); + thread->setDetailsCount(d->details.count()); + thread->setDetails(d->details); + #endif thread->setAutoDelete(false); threads.append(thread); From d538f2af73b2503db70c16c9e127930091f3b303 Mon Sep 17 00:00:00 2001 From: dismine Date: Thu, 22 Jan 2015 13:35:12 +0200 Subject: [PATCH 054/186] Give program time update GUI. --HG-- branch : feature --- src/libs/vlayout/vposition.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libs/vlayout/vposition.cpp b/src/libs/vlayout/vposition.cpp index b194640fc..20eca8269 100644 --- a/src/libs/vlayout/vposition.cpp +++ b/src/libs/vlayout/vposition.cpp @@ -35,6 +35,7 @@ #include #include #include +#include //--------------------------------------------------------------------------------------------------------------------- VPosition::VPosition(const VContour &gContour, int j, const VLayoutDetail &detail, int i) @@ -45,6 +46,8 @@ VPosition::VPosition(const VContour &gContour, int j, const VLayoutDetail &detai //--------------------------------------------------------------------------------------------------------------------- void VPosition::run() { + QCoreApplication::processEvents(); + // We should use copy of the detail. VLayoutDetail workDetail = detail; @@ -63,6 +66,8 @@ void VPosition::run() for (int angle = 0; angle <= 360; angle = angle+180) { + QCoreApplication::processEvents(); + // We should use copy of the detail. VLayoutDetail workDetail = detail; From 0d1725fc11f57dccc3b16c12ffb0a3c7e35194b5 Mon Sep 17 00:00:00 2001 From: dismine Date: Thu, 22 Jan 2015 13:39:04 +0200 Subject: [PATCH 055/186] Allow user more quick stop generation. --HG-- branch : feature --- src/libs/vlayout/vlayoutpaper.cpp | 2 +- src/libs/vlayout/vposition.cpp | 14 ++++++++++++-- src/libs/vlayout/vposition.h | 3 ++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index da473714e..1574ee7b6 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -164,7 +164,7 @@ bool VLayoutPaper::AddToSheet(const VLayoutDetail &detail, bool &stop) { for (int i=1; i<= detail.EdgesCount(); i++) { - VPosition *thread = new VPosition(d->globalContour, j, detail, i); + VPosition *thread = new VPosition(d->globalContour, j, detail, i, &stop); //Info for debug #ifdef LAYOUT_DEBUG thread->setPaperIndex(d->paperIndex); diff --git a/src/libs/vlayout/vposition.cpp b/src/libs/vlayout/vposition.cpp index 20eca8269..5d2dfda2a 100644 --- a/src/libs/vlayout/vposition.cpp +++ b/src/libs/vlayout/vposition.cpp @@ -38,9 +38,9 @@ #include //--------------------------------------------------------------------------------------------------------------------- -VPosition::VPosition(const VContour &gContour, int j, const VLayoutDetail &detail, int i) +VPosition::VPosition(const VContour &gContour, int j, const VLayoutDetail &detail, int i, bool *stop) :QRunnable(), bestResult(VBestSquare()), gContour(gContour), detail(detail), i(i), j(j), paperIndex(0), frame(0), - detailsCount(0), details(QVector()) + detailsCount(0), details(QVector()), stop(stop) {} //--------------------------------------------------------------------------------------------------------------------- @@ -48,6 +48,11 @@ void VPosition::run() { QCoreApplication::processEvents(); + if (*stop) + { + return; + } + // We should use copy of the detail. VLayoutDetail workDetail = detail; @@ -66,6 +71,11 @@ void VPosition::run() for (int angle = 0; angle <= 360; angle = angle+180) { + if (*stop) + { + return; + } + QCoreApplication::processEvents(); // We should use copy of the detail. diff --git a/src/libs/vlayout/vposition.h b/src/libs/vlayout/vposition.h index d8b2edbe4..4c18167bb 100644 --- a/src/libs/vlayout/vposition.h +++ b/src/libs/vlayout/vposition.h @@ -46,7 +46,7 @@ class QPainterPath; class VPosition : public QRunnable { public: - VPosition(const VContour &gContour, int j, const VLayoutDetail &detail, int i); + VPosition(const VContour &gContour, int j, const VLayoutDetail &detail, int i, bool *stop); virtual ~VPosition(){} virtual void run(); @@ -78,6 +78,7 @@ private: quint32 frame; quint32 detailsCount; QVector details; + bool *stop; enum class CrossingType : char { From dd098506dd68b3821577e3d7fb147325eddc179f Mon Sep 17 00:00:00 2001 From: dismine Date: Thu, 22 Jan 2015 13:47:20 +0200 Subject: [PATCH 056/186] Move rotation to separate method. Preparetion for working with new setting. --HG-- branch : feature --- src/libs/vlayout/vposition.cpp | 56 +++++++++++++++++++--------------- src/libs/vlayout/vposition.h | 2 ++ 2 files changed, 33 insertions(+), 25 deletions(-) diff --git a/src/libs/vlayout/vposition.cpp b/src/libs/vlayout/vposition.cpp index 5d2dfda2a..cf8a2e685 100644 --- a/src/libs/vlayout/vposition.cpp +++ b/src/libs/vlayout/vposition.cpp @@ -69,31 +69,7 @@ void VPosition::run() } frame = frame + 3; - for (int angle = 0; angle <= 360; angle = angle+180) - { - if (*stop) - { - return; - } - - QCoreApplication::processEvents(); - - // We should use copy of the detail. - VLayoutDetail workDetail = detail; - - if (CheckRotationEdges(workDetail, j, i, angle)) - { - #ifdef LAYOUT_DEBUG - # ifdef SHOW_CANDIDATE_BEST - ++frame; - DrawDebug(gContour, workDetail, frame, paperIndex, detailsCount, details); - # endif - #endif - - SaveCandidate(bestResult, workDetail, j, i, BestFrom::Rotation); - } - ++frame; - } + Rotate(180); } //--------------------------------------------------------------------------------------------------------------------- @@ -607,6 +583,36 @@ QVector VPosition::CutEdge(const QLineF &edge, unsigned int shift) return points; } +//--------------------------------------------------------------------------------------------------------------------- +void VPosition::Rotate(int increase) +{ + for (int angle = 0; angle <= 360; angle = angle+increase) + { + if (*stop) + { + return; + } + + QCoreApplication::processEvents(); + + // We should use copy of the detail. + VLayoutDetail workDetail = detail; + + if (CheckRotationEdges(workDetail, j, i, angle)) + { + #ifdef LAYOUT_DEBUG + # ifdef SHOW_CANDIDATE_BEST + ++frame; + DrawDebug(gContour, workDetail, frame, paperIndex, detailsCount, details); + # endif + #endif + + SaveCandidate(bestResult, workDetail, j, i, BestFrom::Rotation); + } + ++frame; + } +} + //--------------------------------------------------------------------------------------------------------------------- bool VPosition::TrueIntersection(const QLineF &gEdge, const QLineF &dEdge, const QPointF &p) const { diff --git a/src/libs/vlayout/vposition.h b/src/libs/vlayout/vposition.h index 4c18167bb..833fdccc0 100644 --- a/src/libs/vlayout/vposition.h +++ b/src/libs/vlayout/vposition.h @@ -119,6 +119,8 @@ private: static void AppendWhole(QVector &contour, const VLayoutDetail &detail, int detJ, unsigned int shift); static QVector CutEdge(const QLineF &edge, unsigned int shift); + + void Rotate(int increase); }; #endif // VPOSITION_H From ef73b351edeea29cfe3b9bca029f58c78a80c595 Mon Sep 17 00:00:00 2001 From: dismine Date: Thu, 22 Jan 2015 16:11:50 +0200 Subject: [PATCH 057/186] New options: rotatate and rotation increase. --HG-- branch : feature --- src/app/dialogs/app/dialoglayoutsettings.cpp | 31 ++ src/app/dialogs/app/dialoglayoutsettings.h | 6 + src/app/dialogs/app/dialoglayoutsettings.ui | 472 +++++++++++++------ src/app/tablewindow.cpp | 2 + src/libs/vlayout/vlayoutgenerator.cpp | 33 +- src/libs/vlayout/vlayoutgenerator.h | 8 + src/libs/vlayout/vlayoutpaper.cpp | 33 +- src/libs/vlayout/vlayoutpaper.h | 6 + src/libs/vlayout/vlayoutpaper_p.h | 10 +- src/libs/vlayout/vposition.cpp | 24 +- src/libs/vlayout/vposition.h | 5 +- 11 files changed, 464 insertions(+), 166 deletions(-) diff --git a/src/app/dialogs/app/dialoglayoutsettings.cpp b/src/app/dialogs/app/dialoglayoutsettings.cpp index e5cea7856..9b4dc7a86 100644 --- a/src/app/dialogs/app/dialoglayoutsettings.cpp +++ b/src/app/dialogs/app/dialoglayoutsettings.cpp @@ -153,6 +153,37 @@ void DialogLayoutSettings::SetGroup(const Cases &value) } } +//--------------------------------------------------------------------------------------------------------------------- +bool DialogLayoutSettings::GetRotate() const +{ + return ui->groupBoxRotate->isChecked(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::SetRotate(bool state) +{ + ui->groupBoxRotate->setChecked(state); +} + +//--------------------------------------------------------------------------------------------------------------------- +int DialogLayoutSettings::GetIncrease() const +{ + return ui->comboBoxIncrease->currentText().toInt(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::SetIncrease(int increase) +{ + int index = ui->comboBoxIncrease->findText(QString::number(increase)); + + if (index == -1) + { + index = 21; + } + + ui->comboBoxIncrease->setCurrentIndex(index); +} + //--------------------------------------------------------------------------------------------------------------------- void DialogLayoutSettings::TemplateSelected() { diff --git a/src/app/dialogs/app/dialoglayoutsettings.h b/src/app/dialogs/app/dialoglayoutsettings.h index 1739d468d..4936c9997 100644 --- a/src/app/dialogs/app/dialoglayoutsettings.h +++ b/src/app/dialogs/app/dialoglayoutsettings.h @@ -61,6 +61,12 @@ public: Cases GetGroup() const; void SetGroup(const Cases &value); + bool GetRotate() const; + void SetRotate(bool state); + + int GetIncrease() const; + void SetIncrease(int increase); + public slots: void ConvertPaperSize(); void ConvertLayoutSize(); diff --git a/src/app/dialogs/app/dialoglayoutsettings.ui b/src/app/dialogs/app/dialoglayoutsettings.ui index f50ad9533..2fae9b45c 100644 --- a/src/app/dialogs/app/dialoglayoutsettings.ui +++ b/src/app/dialogs/app/dialoglayoutsettings.ui @@ -6,182 +6,344 @@ 0 0 - 659 - 273 + 661 + 289 Creation a layout - + - + - - - Paper size - - - - - - 6 - + + + + + Paper size + + + false + + + false + + + false + + - - - - 0 - 0 - + + + 6 - - Templates: - - - - - - - - - - - - - - - 0 - 0 - - - - - 124 - 0 - - - - - - - - - 0 - 0 - - - - Width: - - - - - - - - 0 - 0 - - - - Height: - - - - - - - - 94 - 0 - - - - 2 - - - 99999.000000000000000 - - - - - - - - 94 - 0 - - - - 2 - - - 99999.990000000005239 - - - - - - - TextLabel - - - - - - + + + + 0 + 0 + + - ... + Templates: - - - :/icon/16x16/portrait.png:/icon/16x16/portrait.png - - - true - - - true - - - true - - - buttonGroup - - - - ... + + + + + + + + + + + 0 + 0 + - - - :/icon/16x16/landscape.png:/icon/16x16/landscape.png + + + 124 + 0 + - - true - - - false - - - true - - - buttonGroup - + + + + + 0 + 0 + + + + Width: + + + + + + + + 0 + 0 + + + + Height: + + + + + + + + 94 + 0 + + + + 2 + + + 99999.000000000000000 + + + + + + + + 94 + 0 + + + + 2 + + + 99999.990000000005239 + + + + + + + TextLabel + + + + + + + + + ... + + + + :/icon/16x16/portrait.png:/icon/16x16/portrait.png + + + true + + + true + + + true + + + buttonGroup + + + + + + + ... + + + + :/icon/16x16/landscape.png:/icon/16x16/landscape.png + + + true + + + false + + + true + + + buttonGroup + + + + + - - - + + + + + + Rotate workpiece + + + true + + + + + + + 0 + 0 + + + + Rotate by + + + + + + + 21 + + + + 1 + + + + + 2 + + + + + 3 + + + + + 4 + + + + + 5 + + + + + 6 + + + + + 8 + + + + + 9 + + + + + 10 + + + + + 12 + + + + + 15 + + + + + 18 + + + + + 20 + + + + + 24 + + + + + 30 + + + + + 36 + + + + + 40 + + + + + 45 + + + + + 60 + + + + + 72 + + + + + 90 + + + + + 180 + + + + + + + + degree + + + + + + + @@ -349,7 +511,7 @@ - + diff --git a/src/app/tablewindow.cpp b/src/app/tablewindow.cpp index bd47d5691..f348bc020 100644 --- a/src/app/tablewindow.cpp +++ b/src/app/tablewindow.cpp @@ -285,6 +285,8 @@ void TableWindow::Layout() lGenerator.SetPaperHeight(layout.GetPaperHeight()); lGenerator.SetPaperWidth(layout.GetPaperWidth()); lGenerator.SetShift(layout.GetShift()); + lGenerator.SetRotate(layout.GetRotate()); + lGenerator.SetRotationIncrease(layout.GetIncrease()); DialogLayoutProgress progress(listDetails.count(), this); diff --git a/src/libs/vlayout/vlayoutgenerator.cpp b/src/libs/vlayout/vlayoutgenerator.cpp index 0501440da..d7ccad3c8 100644 --- a/src/libs/vlayout/vlayoutgenerator.cpp +++ b/src/libs/vlayout/vlayoutgenerator.cpp @@ -38,7 +38,7 @@ //--------------------------------------------------------------------------------------------------------------------- VLayoutGenerator::VLayoutGenerator(QObject *parent) :QObject(parent), papers(QVector()), bank(new VBank()), paperHeight(0), paperWidth(0), - stopGeneration(false), state(LayoutErrors::NoError), shift(0) + stopGeneration(false), state(LayoutErrors::NoError), shift(0), rotate(true), rotationIncrease(180) {} //--------------------------------------------------------------------------------------------------------------------- @@ -101,6 +101,8 @@ void VLayoutGenerator::Generate() paper.SetShift(shift); paper.SetLayoutWidth(bank->GetLayoutWidth()); paper.SetPaperIndex(papers.count()); + paper.SetRotate(rotate); + paper.SetRotationIncrease(rotationIncrease); do { const int index = bank->GetTiket(); @@ -170,6 +172,35 @@ void VLayoutGenerator::Abort() state = LayoutErrors::ProcessStoped; } +//--------------------------------------------------------------------------------------------------------------------- +int VLayoutGenerator::GetRotationIncrease() const +{ + return rotationIncrease; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutGenerator::SetRotationIncrease(int value) +{ + rotationIncrease = value; + + if ((rotationIncrease >= 1 && rotationIncrease <= 180 && 360 % rotationIncrease == 0) == false) + { + rotationIncrease = 180; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +bool VLayoutGenerator::GetRotate() const +{ + return rotate; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutGenerator::SetRotate(bool value) +{ + rotate = value; +} + //--------------------------------------------------------------------------------------------------------------------- void VLayoutGenerator::CheckDetailsSize() { diff --git a/src/libs/vlayout/vlayoutgenerator.h b/src/libs/vlayout/vlayoutgenerator.h index 5146a19ff..2e8f30d0e 100644 --- a/src/libs/vlayout/vlayoutgenerator.h +++ b/src/libs/vlayout/vlayoutgenerator.h @@ -66,6 +66,12 @@ public: QList GetItems() const; + bool GetRotate() const; + void SetRotate(bool value); + + int GetRotationIncrease() const; + void SetRotationIncrease(int value); + signals: void Start(); void Arranged(int count); @@ -84,6 +90,8 @@ private: bool stopGeneration; LayoutErrors state; unsigned int shift; + bool rotate; + int rotationIncrease; void CheckDetailsSize(); }; diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index 1574ee7b6..247af5e98 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -122,6 +122,35 @@ void VLayoutPaper::SetShift(unsigned int shift) d->globalContour.SetShift(shift); } +//--------------------------------------------------------------------------------------------------------------------- +bool VLayoutPaper::GetRotate() const +{ + return d->rotate; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutPaper::SetRotate(bool value) +{ + d->rotate = value; +} + +//--------------------------------------------------------------------------------------------------------------------- +int VLayoutPaper::GetRotationIncrease() const +{ + return d->rotationIncrease; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutPaper::SetRotationIncrease(int value) +{ + d->rotationIncrease = value; + + if ((d->rotationIncrease >= 1 && d->rotationIncrease <= 180 && 360 % d->rotationIncrease == 0) == false) + { + d->rotationIncrease = 180; + } +} + //--------------------------------------------------------------------------------------------------------------------- void VLayoutPaper::SetPaperIndex(quint32 index) { @@ -164,7 +193,7 @@ bool VLayoutPaper::AddToSheet(const VLayoutDetail &detail, bool &stop) { for (int i=1; i<= detail.EdgesCount(); i++) { - VPosition *thread = new VPosition(d->globalContour, j, detail, i, &stop); + VPosition *thread = new VPosition(d->globalContour, j, detail, i, &stop, d->rotate, d->rotationIncrease); //Info for debug #ifdef LAYOUT_DEBUG thread->setPaperIndex(d->paperIndex); @@ -177,7 +206,7 @@ bool VLayoutPaper::AddToSheet(const VLayoutDetail &detail, bool &stop) threads.append(thread); thread_pool->start(thread); - d->frame = d->frame + 3 + 360/180*2; + d->frame = d->frame + 3 + 360/d->rotationIncrease*2; } } diff --git a/src/libs/vlayout/vlayoutpaper.h b/src/libs/vlayout/vlayoutpaper.h index 2bc3c45f6..fe0310ad3 100644 --- a/src/libs/vlayout/vlayoutpaper.h +++ b/src/libs/vlayout/vlayoutpaper.h @@ -64,6 +64,12 @@ public: unsigned int GetShift() const; void SetShift(unsigned int shift); + bool GetRotate() const; + void SetRotate(bool value); + + int GetRotationIncrease() const; + void SetRotationIncrease(int value); + void SetPaperIndex(quint32 index); bool ArrangeDetail(const VLayoutDetail &detail, bool &stop); diff --git a/src/libs/vlayout/vlayoutpaper_p.h b/src/libs/vlayout/vlayoutpaper_p.h index 0834895b9..09acd09e1 100644 --- a/src/libs/vlayout/vlayoutpaper_p.h +++ b/src/libs/vlayout/vlayoutpaper_p.h @@ -45,17 +45,19 @@ class VLayoutPaperData : public QSharedData { public: VLayoutPaperData() - :details(QVector()), globalContour(VContour()), paperIndex(0), frame(0), layoutWidth(0) + :details(QVector()), globalContour(VContour()), paperIndex(0), frame(0), layoutWidth(0), + rotate(true), rotationIncrease(180) {} VLayoutPaperData(int height, int width) :details(QVector()), globalContour(VContour(height, width)), paperIndex(0), frame(0), - layoutWidth(0) + layoutWidth(0), rotate(true), rotationIncrease(180) {} VLayoutPaperData(const VLayoutPaperData &paper) :QSharedData(paper), details(paper.details), globalContour(paper.globalContour), paperIndex(paper.paperIndex), - frame(paper.frame), layoutWidth(paper.layoutWidth) + frame(paper.frame), layoutWidth(paper.layoutWidth), rotate(paper.rotate), + rotationIncrease(paper.rotationIncrease) {} ~VLayoutPaperData() {} @@ -69,6 +71,8 @@ public: quint32 paperIndex; quint32 frame; qreal layoutWidth; + bool rotate; + int rotationIncrease; }; #ifdef Q_CC_GNU diff --git a/src/libs/vlayout/vposition.cpp b/src/libs/vlayout/vposition.cpp index cf8a2e685..e99b5a0c9 100644 --- a/src/libs/vlayout/vposition.cpp +++ b/src/libs/vlayout/vposition.cpp @@ -38,10 +38,16 @@ #include //--------------------------------------------------------------------------------------------------------------------- -VPosition::VPosition(const VContour &gContour, int j, const VLayoutDetail &detail, int i, bool *stop) +VPosition::VPosition(const VContour &gContour, int j, const VLayoutDetail &detail, int i, bool *stop, bool rotate, + int rotationIncrease) :QRunnable(), bestResult(VBestSquare()), gContour(gContour), detail(detail), i(i), j(j), paperIndex(0), frame(0), - detailsCount(0), details(QVector()), stop(stop) -{} + detailsCount(0), details(QVector()), stop(stop), rotate(rotate), rotationIncrease(rotationIncrease) +{ + if ((rotationIncrease >= 1 && rotationIncrease <= 180 && 360 % rotationIncrease == 0) == false) + { + rotationIncrease = 180; + } +} //--------------------------------------------------------------------------------------------------------------------- void VPosition::run() @@ -69,7 +75,17 @@ void VPosition::run() } frame = frame + 3; - Rotate(180); + if (rotate) + { + Rotate(rotationIncrease); + } + else + { + if (gContour.GetContour().isEmpty()) + { + Rotate(rotationIncrease); + } + } } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vlayout/vposition.h b/src/libs/vlayout/vposition.h index 833fdccc0..2ec01169c 100644 --- a/src/libs/vlayout/vposition.h +++ b/src/libs/vlayout/vposition.h @@ -46,7 +46,8 @@ class QPainterPath; class VPosition : public QRunnable { public: - VPosition(const VContour &gContour, int j, const VLayoutDetail &detail, int i, bool *stop); + VPosition(const VContour &gContour, int j, const VLayoutDetail &detail, int i, bool *stop, bool rotate, + int rotationIncrease); virtual ~VPosition(){} virtual void run(); @@ -79,6 +80,8 @@ private: quint32 detailsCount; QVector details; bool *stop; + bool rotate; + int rotationIncrease; enum class CrossingType : char { From 2388d8ef2933baa1343839b956a07613dedf40ce Mon Sep 17 00:00:00 2001 From: dismine Date: Thu, 22 Jan 2015 16:13:25 +0200 Subject: [PATCH 058/186] Avoid window freaze. --HG-- branch : feature --- src/libs/vlayout/vlayoutpaper.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index 247af5e98..31d83c9f5 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -193,6 +193,8 @@ bool VLayoutPaper::AddToSheet(const VLayoutDetail &detail, bool &stop) { for (int i=1; i<= detail.EdgesCount(); i++) { + QCoreApplication::processEvents(); + VPosition *thread = new VPosition(d->globalContour, j, detail, i, &stop, d->rotate, d->rotationIncrease); //Info for debug #ifdef LAYOUT_DEBUG From c84caa349df6de283fe701d9bd78b20c0c2f5db4 Mon Sep 17 00:00:00 2001 From: dismine Date: Thu, 22 Jan 2015 16:23:23 +0200 Subject: [PATCH 059/186] Clear layout paper. --HG-- branch : feature --- src/libs/vlayout/vlayoutpaper.cpp | 7 +------ src/libs/vlayout/vlayoutpaper.h | 6 ------ 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index 31d83c9f5..56e5ed9d8 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -31,15 +31,10 @@ #include "vbestsquare.h" #include "vposition.h" -#include -#include -#include -#include -#include -#include #include #include #include +#include //--------------------------------------------------------------------------------------------------------------------- VLayoutPaper::VLayoutPaper() diff --git a/src/libs/vlayout/vlayoutpaper.h b/src/libs/vlayout/vlayoutpaper.h index fe0310ad3..015a73d4c 100644 --- a/src/libs/vlayout/vlayoutpaper.h +++ b/src/libs/vlayout/vlayoutpaper.h @@ -34,14 +34,8 @@ class VLayoutPaperData; class VLayoutDetail; -class QPointF; -class QLineF; -class QPolygonF; -class QPainterPath; class QGraphicsItem; class VBestSquare; -class VContour; -class QRectF; class VLayoutPaper { From 0b85380f20f132de766282fdd1fc8ba01181a1ef Mon Sep 17 00:00:00 2001 From: dismine Date: Thu, 22 Jan 2015 18:22:37 +0200 Subject: [PATCH 060/186] Show paper preview in list. --HG-- branch : feature --- src/app/dialogs/app/dialoglayoutprogress.cpp | 2 + src/app/dialogs/app/dialoglayoutprogress.ui | 12 ++ src/app/tablewindow.cpp | 33 ++++- src/app/tablewindow.h | 1 + src/app/tablewindow.ui | 130 +++++++------------ 5 files changed, 94 insertions(+), 84 deletions(-) diff --git a/src/app/dialogs/app/dialoglayoutprogress.cpp b/src/app/dialogs/app/dialoglayoutprogress.cpp index 670cd90fd..a32c83a6e 100644 --- a/src/app/dialogs/app/dialoglayoutprogress.cpp +++ b/src/app/dialogs/app/dialoglayoutprogress.cpp @@ -44,6 +44,8 @@ DialogLayoutProgress::DialogLayoutProgress(int count, QWidget *parent) SCASSERT(bCancel != nullptr); connect(bCancel, &QPushButton::clicked, this, &DialogLayoutProgress::StopWorking); setModal(true); + + this->setWindowFlags(Qt::Dialog | Qt::WindowTitleHint | Qt::CustomizeWindowHint); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/app/dialoglayoutprogress.ui b/src/app/dialogs/app/dialoglayoutprogress.ui index f2e02ea51..edd14dddb 100644 --- a/src/app/dialogs/app/dialoglayoutprogress.ui +++ b/src/app/dialogs/app/dialoglayoutprogress.ui @@ -13,6 +13,18 @@ 119 + + + 566 + 119 + + + + + 566 + 119 + + Creation a layout diff --git a/src/app/tablewindow.cpp b/src/app/tablewindow.cpp index f348bc020..e08bc599c 100644 --- a/src/app/tablewindow.cpp +++ b/src/app/tablewindow.cpp @@ -260,6 +260,7 @@ void TableWindow::ShowPaper(int index) if (index < 0 || index > scenes.size()) { ui->view->setScene(tempScene); + ui->actionSave->setEnabled(false); } else { @@ -518,15 +519,43 @@ void TableWindow::CreateScenes() //--------------------------------------------------------------------------------------------------------------------- void TableWindow::PrepareSceneList() { - const QIcon ico("://icon/64x64/icon64x64.png"); for (int i=1; i<=scenes.size(); ++i) { - QListWidgetItem *item = new QListWidgetItem(ico, QString::number(i)); + QListWidgetItem *item = new QListWidgetItem(ScenePreview(i-1), QString::number(i)); ui->listWidget->addItem(item); } if (scenes.isEmpty() == false) { ui->listWidget->setCurrentRow(0); + ui->actionSave->setEnabled(true); } } + +//--------------------------------------------------------------------------------------------------------------------- +QIcon TableWindow::ScenePreview(int i) const +{ + QImage image; + QGraphicsRectItem *paper = qgraphicsitem_cast(papers.at(i)); + if (paper) + { + const QRectF r = paper->rect(); + // Create the image with the exact size of the shrunk scene + image = QImage(QSize(static_cast(r.width()), static_cast(r.height())), QImage::Format_RGB32); + image.fill(Qt::white); + QPainter painter(&image); + painter.setFont( QFont( "Arial", 8, QFont::Normal ) ); + painter.setRenderHint(QPainter::Antialiasing, true); + painter.setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()), Qt::SolidLine, Qt::RoundCap, + Qt::RoundJoin)); + painter.setBrush ( QBrush ( Qt::NoBrush ) ); + scenes.at(i)->render(&painter); + image.scaled(101, 146, Qt::KeepAspectRatio); + } + else + { + image = QImage(QSize(101, 146), QImage::Format_RGB32); + image.fill(Qt::white); + } + return QIcon(QBitmap::fromImage(image)); +} diff --git a/src/app/tablewindow.h b/src/app/tablewindow.h index d038308d5..22d83be71 100644 --- a/src/app/tablewindow.h +++ b/src/app/tablewindow.h @@ -101,6 +101,7 @@ private: void CreateShadows(); void CreateScenes(); void PrepareSceneList(); + QIcon ScenePreview(int i) const; }; #endif // TABLEWINDOW_H diff --git a/src/app/tablewindow.ui b/src/app/tablewindow.ui index 03c642d21..11bcf6891 100644 --- a/src/app/tablewindow.ui +++ b/src/app/tablewindow.ui @@ -23,7 +23,17 @@ - + + + + 20 + 0 + + + + QGraphicsView::AnchorUnderMouse + + @@ -33,8 +43,8 @@ - 16 - 16 + 24 + 24 @@ -47,11 +57,6 @@ false - - - - - @@ -59,6 +64,24 @@ + + + 0 + 0 + + + + + 187 + 121 + + + + + 187 + 524287 + + QDockWidget::DockWidgetMovable @@ -66,7 +89,7 @@ Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea - Pages + Layout pages 1 @@ -75,6 +98,18 @@ + + + 0 + 0 + + + + + 0 + 0 + + 200 @@ -114,35 +149,6 @@ Save layout - - - - - - - - Next - - - Next detail - - - - - false - - - - - - - - Turn - - - Turn the detail 90 degrees - - @@ -156,50 +162,6 @@ Stop laying - - - - - - - - Enlarge letter - - - Enlarge the length of the sheet - - - - - false - - - - - - - - Reduce sheet - - - Reduce the length of the sheet - - - - - false - - - - :/icon/16x16/mirror.png:/icon/16x16/mirror.png - - - Mirroring - - - Mirroring - - @@ -227,6 +189,10 @@ + + + :/icon/32x32/layout.png:/icon/32x32/layout.png + Layout From 4a9e69d32f477c04e5a2652711d6aec4ef0a1c8e Mon Sep 17 00:00:00 2001 From: dismine Date: Fri, 23 Jan 2015 12:07:58 +0200 Subject: [PATCH 061/186] Saving the layout paper sheets. --HG-- branch : feature --- src/app/dialogs/app/dialogsavelayout.cpp | 151 +++++++++ src/app/dialogs/app/dialogsavelayout.h | 63 ++++ src/app/dialogs/app/dialogsavelayout.ui | 140 +++++++++ src/app/dialogs/dialogs.pri | 9 +- src/app/tablewindow.cpp | 385 ++++++++++++----------- src/app/tablewindow.h | 15 +- src/libs/vlayout/vlayoutgenerator.cpp | 15 +- src/libs/vlayout/vlayoutgenerator.h | 3 +- src/libs/vlayout/vlayoutpaper.cpp | 18 +- src/libs/vlayout/vlayoutpaper.h | 4 +- 10 files changed, 601 insertions(+), 202 deletions(-) create mode 100644 src/app/dialogs/app/dialogsavelayout.cpp create mode 100644 src/app/dialogs/app/dialogsavelayout.h create mode 100644 src/app/dialogs/app/dialogsavelayout.ui diff --git a/src/app/dialogs/app/dialogsavelayout.cpp b/src/app/dialogs/app/dialogsavelayout.cpp new file mode 100644 index 000000000..bf7705278 --- /dev/null +++ b/src/app/dialogs/app/dialogsavelayout.cpp @@ -0,0 +1,151 @@ +/************************************************************************ + ** + ** @file dialogsavelayout.cpp + ** @author Roman Telezhynskyi + ** @date 22 1, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#include "dialogsavelayout.h" +#include "ui_dialogsavelayout.h" +#include "../options.h" + +#include +#include +#include + +//--------------------------------------------------------------------------------------------------------------------- +DialogSaveLayout::DialogSaveLayout(const QMap &formates, int count, QWidget *parent) + :QDialog(parent), ui(new Ui::DialogSaveLAyout), count(count) +{ + ui->setupUi(this); + + QPushButton *bOk = ui->buttonBox->button(QDialogButtonBox::Ok); + SCASSERT(bOk != nullptr); + bOk->setEnabled(false); + + QRegExpValidator *validator = new QRegExpValidator(QRegExp("^[\\w\\-. ]+$"), this); + ui->lineEditMask->setValidator(validator); + + QMap::const_iterator i = formates.constBegin(); + while (i != formates.constEnd()) + { + ui->comboBoxFormat->addItem(i.key(), QVariant(i.value())); + ++i; + } + + connect(bOk, &QPushButton::clicked, this, &DialogSaveLayout::Save); + connect(ui->lineEditMask, &QLineEdit::textChanged, this, &DialogSaveLayout::ShowExample); + connect(ui->comboBoxFormat, static_cast(&QComboBox::currentIndexChanged), this, + &DialogSaveLayout::ShowExample); + connect(ui->pushButtonBrowse, &QPushButton::clicked, this, &DialogSaveLayout::Browse); + connect(ui->lineEditPath, &QLineEdit::textChanged, this, &DialogSaveLayout::PathChanged); + + ui->comboBoxFormat->setCurrentIndex(4);//svg +} + +//--------------------------------------------------------------------------------------------------------------------- +DialogSaveLayout::~DialogSaveLayout() +{ + delete ui; +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogSaveLayout::Path() const +{ + return ui->lineEditPath->text(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogSaveLayout::Mask() const +{ + return ui->lineEditMask->text(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogSaveLayout::Formate() const +{ + return ui->comboBoxFormat->currentData().toString(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogSaveLayout::Save() +{ + for (int i=0; i < count; ++i) + { + const QString name = Path()+"/"+Mask()+QString::number(i+1)+Formate(); + if (QFile::exists(name)) + { + QMessageBox::StandardButton res = QMessageBox::question(this, tr("Name conflict"), + tr("Folder already contain file with name %1. Rewrite all conflict file names?") + .arg(name), QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes); + if (res == QMessageBox::No) + { + return; + } + else + { + break; + } + } + } + accept(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogSaveLayout::ShowExample() +{ + ui->labelExample->setText(tr("Example:") + Mask() + "1" + Formate()); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogSaveLayout::Browse() +{ + const QString dir = QFileDialog::getExistingDirectory(this, tr("Select folder"), QDir::homePath(), + QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); + ui->lineEditPath->setText(dir); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogSaveLayout::PathChanged(const QString &text) +{ + QPushButton *bOk = ui->buttonBox->button(QDialogButtonBox::Ok); + SCASSERT(bOk != nullptr); + + QPalette palette = ui->lineEditPath->palette(); + + QDir dir(text); + dir.setPath(text); + if (dir.exists(text)) + { + bOk->setEnabled(true); + palette.setColor(ui->lineEditPath->foregroundRole(), Qt::black); + } + else + { + bOk->setEnabled(false); + palette.setColor(ui->lineEditPath->foregroundRole(), Qt::red); + } + + ui->lineEditPath->setPalette(palette); +} diff --git a/src/app/dialogs/app/dialogsavelayout.h b/src/app/dialogs/app/dialogsavelayout.h new file mode 100644 index 000000000..74425a632 --- /dev/null +++ b/src/app/dialogs/app/dialogsavelayout.h @@ -0,0 +1,63 @@ +/************************************************************************ + ** + ** @file dialogsavelayout.h + ** @author Roman Telezhynskyi + ** @date 22 1, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef DIALOGSAVELAYOUT_H +#define DIALOGSAVELAYOUT_H + +#include + +namespace Ui +{ + class DialogSaveLAyout; +} + +class DialogSaveLayout : public QDialog +{ + Q_OBJECT + +public: + DialogSaveLayout(const QMap &formates, int count, QWidget *parent = 0); + ~DialogSaveLayout(); + + QString Path() const; + QString Mask() const; + QString Formate() const; + +public slots: + void Save(); + void ShowExample(); + void Browse(); + void PathChanged(const QString &text); + +private: + Q_DISABLE_COPY(DialogSaveLayout) + Ui::DialogSaveLAyout *ui; + int count; +}; + +#endif // DIALOGSAVELAYOUT_H diff --git a/src/app/dialogs/app/dialogsavelayout.ui b/src/app/dialogs/app/dialogsavelayout.ui new file mode 100644 index 000000000..cc1ecd863 --- /dev/null +++ b/src/app/dialogs/app/dialogsavelayout.ui @@ -0,0 +1,140 @@ + + + DialogSaveLAyout + + + + 0 + 0 + 692 + 179 + + + + + 692 + 179 + + + + Dialog + + + + + + 0 + + + + + Mask: + + + + + + + Path: + + + + + + + File format: + + + + + + + + + + + 0 + 0 + + + + Browse... + + + + + + + + 0 + 0 + + + + + + + + + + + + 130 + 0 + + + + TextLabel + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + DialogSaveLAyout + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + DialogSaveLAyout + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/src/app/dialogs/dialogs.pri b/src/app/dialogs/dialogs.pri index ce99dd510..0e684e367 100644 --- a/src/app/dialogs/dialogs.pri +++ b/src/app/dialogs/dialogs.pri @@ -43,7 +43,8 @@ HEADERS += \ $$PWD/app/dialogundo.h \ $$PWD/tools/dialogcurveintersectaxis.h \ $$PWD/app/dialoglayoutsettings.h \ - $$PWD/app/dialoglayoutprogress.h + $$PWD/app/dialoglayoutprogress.h \ + dialogs/app/dialogsavelayout.h SOURCES += \ $$PWD/tools/dialogtriangle.cpp \ @@ -85,7 +86,8 @@ SOURCES += \ $$PWD/app/dialogundo.cpp \ $$PWD/tools/dialogcurveintersectaxis.cpp \ $$PWD/app/dialoglayoutsettings.cpp \ - $$PWD/app/dialoglayoutprogress.cpp + $$PWD/app/dialoglayoutprogress.cpp \ + dialogs/app/dialogsavelayout.cpp FORMS += \ $$PWD/tools/dialogtriangle.ui \ @@ -121,4 +123,5 @@ FORMS += \ $$PWD/app/dialogundo.ui \ $$PWD/tools/dialogcurveintersectaxis.ui \ $$PWD/app/dialoglayoutsettings.ui \ - $$PWD/app/dialoglayoutprogress.ui + $$PWD/app/dialoglayoutprogress.ui \ + dialogs/app/dialogsavelayout.ui diff --git a/src/app/tablewindow.cpp b/src/app/tablewindow.cpp index e08bc599c..dd706cc84 100644 --- a/src/app/tablewindow.cpp +++ b/src/app/tablewindow.cpp @@ -34,6 +34,7 @@ #include "../dialogs/app/dialoglayoutsettings.h" #include "../../libs/vlayout/vlayoutgenerator.h" #include "../dialogs/app/dialoglayoutprogress.h" +#include "../dialogs/app/dialogsavelayout.h" #include #include @@ -54,7 +55,8 @@ TableWindow::TableWindow(QWidget *parent) :QMainWindow(parent), ui(new Ui::TableWindow), listDetails(QVector()), papers(QList()), shadows(QList()), - scenes(QList()), fileName(QString()), description(QString()), tempScene(nullptr) + scenes(QList()), details(QList >()),fileName(QString()), + description(QString()), tempScene(nullptr) { ui->setupUi(this); tempScene = new QGraphicsScene(QRectF(0, 0, qApp->toPixel(823, Unit::Mm), qApp->toPixel(1171, Unit::Mm))); @@ -69,7 +71,7 @@ TableWindow::TableWindow(QWidget *parent) connect(ui->actionZoomIn, &QAction::triggered, ui->view, &VTableGraphicsView::ZoomIn); connect(ui->actionZoomOut, &QAction::triggered, ui->view, &VTableGraphicsView::ZoomOut); connect(ui->actionStop, &QAction::triggered, this, &TableWindow::StopTable); - //connect(ui->actionSave, &QAction::triggered, this, &TableWindow::saveScene); + connect(ui->actionSave, &QAction::triggered, this, &TableWindow::saveScene); connect(ui->actionLayout, &QAction::triggered, this, &TableWindow::Layout); connect(ui->listWidget, &QListWidget::currentRowChanged, this, &TableWindow::ShowPaper); } @@ -161,97 +163,68 @@ void TableWindow::StopTable() */ void TableWindow::saveScene() { -// QMap extByMessage; -// extByMessage[ tr("Svg files (*.svg)") ] = ".svg"; -// extByMessage[ tr("PDF files (*.pdf)") ] = ".pdf"; -// extByMessage[ tr("Images (*.png)") ] = ".png"; -// extByMessage[ tr("Wavefront OBJ (*.obj)") ] = ".obj"; + QMap extByMessage = InitFormates(); + DialogSaveLayout dialog(extByMessage, scenes.size(), this); -// QProcess proc; -// proc.start(PDFTOPS); -// if (proc.waitForFinished(15000)) -// { -// extByMessage[ tr("PS files (*.ps)") ] = ".ps"; -// extByMessage[ tr("EPS files (*.eps)") ] = ".eps"; -// } -// else -// { -// qWarning()< i(extByMessage); -// while (i.hasNext()) -// { -// i.next(); -// saveMessage += i.key(); -// if (i.hasNext()) -// { -// saveMessage += ";;"; -// } -// } + QString suf = dialog.Formate(); + suf.replace(".", ""); -// QString sf; -// // the save function -// QString dir = QDir::homePath()+"/"+fileName; -// QString name = QFileDialog::getSaveFileName(this, tr("Save layout"), dir, saveMessage, &sf); + QString path = dialog.Path(); + QString mask = dialog.Mask(); -// if (name.isEmpty()) -// { -// return; -// } - -// // what if the user did not specify a suffix...? -// QString suf = extByMessage.value(sf); -// suf.replace(".", ""); -// QFileInfo f( name ); -// if (f.suffix().isEmpty() || f.suffix() != suf) -// { -// name += extByMessage.value(sf); -// } - -// QBrush *brush = new QBrush(); -// brush->setColor( QColor( Qt::white ) ); -// tableScene->setBackgroundBrush( *brush ); -// tableScene->clearSelection(); // Selections would also render to the file, so need delete them -// shadowPaper->setVisible(false); -// paper->setPen(QPen(Qt::white, 0.1, Qt::NoPen)); -// QFileInfo fi( name ); -// QStringList suffix = QStringList() << "svg" << "png" << "pdf" << "eps" << "ps" << "obj"; -// switch (suffix.indexOf(fi.suffix())) -// { -// case 0: //svg -// paper->setVisible(false); -// SvgFile(name); -// paper->setVisible(true); -// break; -// case 1: //png -// PngFile(name); -// break; -// case 2: //pdf -// PdfFile(name); -// break; -// case 3: //eps -// EpsFile(name); -// break; -// case 4: //ps -// PsFile(name); -// break; -// case 5: //obj -// paper->setVisible(false); -// ObjFile(name); -// paper->setVisible(true); -// break; -// default: -// qDebug() << "Can't recognize file suffix. File file "<setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()))); -// brush->setColor( QColor( Qt::gray ) ); -// brush->setStyle( Qt::SolidPattern ); -// tableScene->setBackgroundBrush( *brush ); -// shadowPaper->setVisible(true); -// delete brush; + for (int i=0; i < scenes.size(); ++i) + { + QGraphicsRectItem *paper = qgraphicsitem_cast(papers.at(i)); + if (paper) + { + const QString name = path + "/" + mask+QString::number(i+1) + dialog.Formate(); + QBrush *brush = new QBrush(); + brush->setColor( QColor( Qt::white ) ); + scenes[i]->setBackgroundBrush( *brush ); + shadows[i]->setVisible(false); + paper->setPen(QPen(Qt::white, 0.1, Qt::NoPen)); + QStringList suffix = QStringList() << "svg" << "png" << "pdf" << "eps" << "ps" << "obj"; + switch (suffix.indexOf(suf)) + { + case 0: //svg + paper->setVisible(false); + SvgFile(name, i); + paper->setVisible(true); + break; + case 1: //png + PngFile(name, i); + break; + case 2: //pdf + PdfFile(name, i); + break; + case 3: //eps + EpsFile(name, i); + break; + case 4: //ps + PsFile(name, i); + break; + case 5: //obj + paper->setVisible(false); + ObjFile(name, i); + paper->setVisible(true); + break; + default: + qDebug() << "Can't recognize file suffix." << Q_FUNC_INFO; + break; + } + paper->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()))); + brush->setColor( QColor( Qt::gray ) ); + brush->setStyle( Qt::SolidPattern ); + scenes[i]->setBackgroundBrush( *brush ); + shadows[i]->setVisible(true); + delete brush; + } + } } //--------------------------------------------------------------------------------------------------------------------- @@ -303,10 +276,10 @@ void TableWindow::Layout() { case LayoutErrors::NoError: ClearLayout(); - papers = lGenerator.GetItems(); + papers = lGenerator.GetPapersItems(); + details = lGenerator.GetAllDetails(); CreateShadows(); CreateScenes(); - // Create previews PrepareSceneList(); break; case LayoutErrors::ProcessStoped: @@ -326,23 +299,28 @@ void TableWindow::Layout() * @brief SvgFile save layout to svg file. * @param name name layout file. */ -void TableWindow::SvgFile(const QString &name) const +void TableWindow::SvgFile(const QString &name, int i) const { -// QSvgGenerator generator; -// generator.setFileName(name); -// generator.setSize(paper->rect().size().toSize()); -// generator.setViewBox(paper->rect()); -// generator.setTitle("Valentina pattern"); -// generator.setDescription(description); -// generator.setResolution(static_cast(qApp->PrintDPI)); -// QPainter painter; -// painter.begin(&generator); -// painter.setFont( QFont( "Arial", 8, QFont::Normal ) ); -// painter.setRenderHint(QPainter::Antialiasing, true); -// painter.setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine()), Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); -// painter.setBrush ( QBrush ( Qt::NoBrush ) ); -// tableScene->render(&painter); -// painter.end(); + QGraphicsRectItem *paper = qgraphicsitem_cast(papers.at(i)); + if (paper) + { + QSvgGenerator generator; + generator.setFileName(name); + generator.setSize(paper->rect().size().toSize()); + generator.setViewBox(paper->rect()); + generator.setTitle("Valentina. Pattern layout"); + generator.setDescription(description); + generator.setResolution(static_cast(qApp->PrintDPI)); + QPainter painter; + painter.begin(&generator); + painter.setFont( QFont( "Arial", 8, QFont::Normal ) ); + painter.setRenderHint(QPainter::Antialiasing, true); + painter.setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine()), Qt::SolidLine, Qt::RoundCap, + Qt::RoundJoin)); + painter.setBrush ( QBrush ( Qt::NoBrush ) ); + scenes.at(i)->render(&painter); + painter.end(); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -350,21 +328,24 @@ void TableWindow::SvgFile(const QString &name) const * @brief PngFile save layout to png file. * @param name name layout file. */ -void TableWindow::PngFile(const QString &name) const +void TableWindow::PngFile(const QString &name, int i) const { -// QRectF r = paper->rect(); -// qreal x=0, y=0, w=0, h=0; -// r.getRect(&x, &y, &w, &h);// Re-shrink the scene to it's bounding contents -// // Create the image with the exact size of the shrunk scene -// QImage image(QSize(static_cast(w), static_cast(h)), QImage::Format_ARGB32); -// image.fill(Qt::transparent); // Start all pixels transparent -// QPainter painter(&image); -// painter.setFont( QFont( "Arial", 8, QFont::Normal ) ); -// painter.setRenderHint(QPainter::Antialiasing, true); -// painter.setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()), Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); -// painter.setBrush ( QBrush ( Qt::NoBrush ) ); -// tableScene->render(&painter); -// image.save(name); + QGraphicsRectItem *paper = qgraphicsitem_cast(papers.at(i)); + if (paper) + { + const QRectF r = paper->rect(); + // Create the image with the exact size of the shrunk scene + QImage image(QSize(static_cast(r.width()), static_cast(r.height())), QImage::Format_ARGB32); + image.fill(Qt::transparent); // Start all pixels transparent + QPainter painter(&image); + painter.setFont( QFont( "Arial", 8, QFont::Normal ) ); + painter.setRenderHint(QPainter::Antialiasing, true); + painter.setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()), Qt::SolidLine, Qt::RoundCap, + Qt::RoundJoin)); + painter.setBrush ( QBrush ( Qt::NoBrush ) ); + scenes.at(i)->render(&painter); + image.save(name); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -372,28 +353,32 @@ void TableWindow::PngFile(const QString &name) const * @brief PdfFile save layout to pdf file. * @param name name layout file. */ -void TableWindow::PdfFile(const QString &name) const +void TableWindow::PdfFile(const QString &name, int i) const { -// QPrinter printer; -// printer.setOutputFormat(QPrinter::PdfFormat); -// printer.setOutputFileName(name); -// QRectF r = paper->rect(); -// qreal x=0, y=0, w=0, h=0; -// r.getRect(&x, &y, &w, &h);// Re-shrink the scene to it's bounding contents -// printer.setResolution(static_cast(qApp->PrintDPI)); -// printer.setPaperSize ( QSizeF(qApp->fromPixel(w, Unit::Mm), qApp->fromPixel(h, Unit::Mm)), QPrinter::Millimeter ); -// QPainter painter; -// if (painter.begin( &printer ) == false) -// { // failed to open file -// qCritical("Can't open printer %s", qPrintable(name)); -// return; -// } -// painter.setFont( QFont( "Arial", 8, QFont::Normal ) ); -// painter.setRenderHint(QPainter::Antialiasing, true); -// painter.setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()), Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); -// painter.setBrush ( QBrush ( Qt::NoBrush ) ); -// tableScene->render(&painter); -// painter.end(); + QGraphicsRectItem *paper = qgraphicsitem_cast(papers.at(i)); + if (paper) + { + QPrinter printer; + printer.setOutputFormat(QPrinter::PdfFormat); + printer.setOutputFileName(name); + const QRectF r = paper->rect(); + printer.setResolution(static_cast(qApp->PrintDPI)); + printer.setPaperSize ( QSizeF(qApp->fromPixel(r.width(), Unit::Mm), qApp->fromPixel(r.height(), Unit::Mm)), + QPrinter::Millimeter ); + QPainter painter; + if (painter.begin( &printer ) == false) + { // failed to open file + qCritical("Can't open printer %s", qPrintable(name)); + return; + } + painter.setFont( QFont( "Arial", 8, QFont::Normal ) ); + painter.setRenderHint(QPainter::Antialiasing, true); + painter.setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()), Qt::SolidLine, Qt::RoundCap, + Qt::RoundJoin)); + painter.setBrush ( QBrush ( Qt::NoBrush ) ); + scenes.at(i)->render(&painter); + painter.end(); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -401,15 +386,15 @@ void TableWindow::PdfFile(const QString &name) const * @brief EpsFile save layout to eps file. * @param name name layout file. */ -void TableWindow::EpsFile(const QString &name) const +void TableWindow::EpsFile(const QString &name, int i) const { -// QTemporaryFile tmp; -// if (tmp.open()) -// { -// PdfFile(tmp.fileName()); -// QStringList params = QStringList() << "-eps" << tmp.fileName() << name; -// PdfToPs(params); -// } + QTemporaryFile tmp; + if (tmp.open()) + { + PdfFile(tmp.fileName(), i); + QStringList params = QStringList() << "-eps" << tmp.fileName() << name; + PdfToPs(params); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -417,15 +402,15 @@ void TableWindow::EpsFile(const QString &name) const * @brief PsFile save layout to ps file. * @param name name layout file. */ -void TableWindow::PsFile(const QString &name) const +void TableWindow::PsFile(const QString &name, int i) const { -// QTemporaryFile tmp; -// if (tmp.open()) -// { -// PdfFile(tmp.fileName()); -// QStringList params = QStringList() << tmp.fileName() << name; -// PdfToPs(params); -// } + QTemporaryFile tmp; + if (tmp.open()) + { + PdfFile(tmp.fileName(), i); + QStringList params = QStringList() << tmp.fileName() << name; + PdfToPs(params); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -436,36 +421,40 @@ void TableWindow::PsFile(const QString &name) const */ void TableWindow::PdfToPs(const QStringList ¶ms) const { -//#ifndef QT_NO_CURSOR -// QApplication::setOverrideCursor(Qt::WaitCursor); -//#endif -// QProcess proc; -// proc.start(PDFTOPS, params); -// proc.waitForFinished(15000); -//#ifndef QT_NO_CURSOR -// QApplication::restoreOverrideCursor(); -//#endif +#ifndef QT_NO_CURSOR + QApplication::setOverrideCursor(Qt::WaitCursor); +#endif + QProcess proc; + proc.start(PDFTOPS, params); + proc.waitForFinished(15000); +#ifndef QT_NO_CURSOR + QApplication::restoreOverrideCursor(); +#endif -// QFile f(params.last()); -// if (f.exists() == false) -// { -// QString msg = QString(tr("Creating file '%1' failed! %2")).arg(params.last()).arg(proc.errorString()); -// QMessageBox msgBox(QMessageBox::Critical, tr("Critical error!"), msg, QMessageBox::Ok | QMessageBox::Default); -// msgBox.exec(); -// } + QFile f(params.last()); + if (f.exists() == false) + { + QString msg = QString(tr("Creating file '%1' failed! %2")).arg(params.last()).arg(proc.errorString()); + QMessageBox msgBox(QMessageBox::Critical, tr("Critical error!"), msg, QMessageBox::Ok | QMessageBox::Default); + msgBox.exec(); + } } //--------------------------------------------------------------------------------------------------------------------- -void TableWindow::ObjFile(const QString &name) const +void TableWindow::ObjFile(const QString &name, int i) const { -// VObjPaintDevice generator; -// generator.setFileName(name); -// generator.setSize(paper->rect().size().toSize()); -// generator.setResolution(static_cast(qApp->PrintDPI)); -// QPainter painter; -// painter.begin(&generator); -// tableScene->render(&painter); -// painter.end(); + QGraphicsRectItem *paper = qgraphicsitem_cast(papers.at(i)); + if (paper) + { + VObjPaintDevice generator; + generator.setFileName(name); + generator.setSize(paper->rect().size().toSize()); + generator.setResolution(static_cast(qApp->PrintDPI)); + QPainter painter; + painter.begin(&generator); + scenes.at(i)->render(&painter); + painter.end(); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -512,6 +501,13 @@ void TableWindow::CreateScenes() scene->setBackgroundBrush(brush); scene->addItem(shadows.at(i)); scene->addItem(papers.at(i)); + + QList paperDetails = details.at(i); + for (int i=0; i < paperDetails.size(); ++i) + { + scene->addItem(paperDetails.at(i)); + } + scenes.append(scene); } } @@ -559,3 +555,26 @@ QIcon TableWindow::ScenePreview(int i) const } return QIcon(QBitmap::fromImage(image)); } + +//--------------------------------------------------------------------------------------------------------------------- +QMap TableWindow::InitFormates() const +{ + QMap extByMessage; + extByMessage[ tr("Svg files (*.svg)") ] = ".svg"; + extByMessage[ tr("PDF files (*.pdf)") ] = ".pdf"; + extByMessage[ tr("Images (*.png)") ] = ".png"; + extByMessage[ tr("Wavefront OBJ (*.obj)") ] = ".obj"; + + QProcess proc; + proc.start(PDFTOPS); + if (proc.waitForFinished(15000)) + { + extByMessage[ tr("PS files (*.ps)") ] = ".ps"; + extByMessage[ tr("EPS files (*.eps)") ] = ".eps"; + } + else + { + qWarning()< papers; QList shadows; QList scenes; + QList > details; /** @brief fileName keep name of pattern file. */ QString fileName; @@ -89,19 +91,20 @@ private: QGraphicsScene* tempScene; - void SvgFile(const QString &name)const; - void PngFile(const QString &name)const; - void PdfFile(const QString &name)const; - void EpsFile(const QString &name)const; - void PsFile(const QString &name)const; + void SvgFile(const QString &name, int i)const; + void PngFile(const QString &name, int i)const; + void PdfFile(const QString &name, int i)const; + void EpsFile(const QString &name, int i)const; + void PsFile(const QString &name, int i)const; void PdfToPs(const QStringList ¶ms)const; - void ObjFile(const QString &name)const; + void ObjFile(const QString &name, int i)const; void ClearLayout(); void CreateShadows(); void CreateScenes(); void PrepareSceneList(); QIcon ScenePreview(int i) const; + QMap InitFormates() const; }; #endif // TABLEWINDOW_H diff --git a/src/libs/vlayout/vlayoutgenerator.cpp b/src/libs/vlayout/vlayoutgenerator.cpp index d7ccad3c8..1a7697862 100644 --- a/src/libs/vlayout/vlayoutgenerator.cpp +++ b/src/libs/vlayout/vlayoutgenerator.cpp @@ -155,12 +155,23 @@ LayoutErrors VLayoutGenerator::State() const } //--------------------------------------------------------------------------------------------------------------------- -QList VLayoutGenerator::GetItems() const +QList VLayoutGenerator::GetPapersItems() const { QList list; for (int i=0; i < papers.count(); ++i) { - list.append(papers.at(i).GetItem()); + list.append(papers.at(i).GetPaperItem()); + } + return list; +} + +//--------------------------------------------------------------------------------------------------------------------- +QList > VLayoutGenerator::GetAllDetails() const +{ + QList > list; + for (int i=0; i < papers.count(); ++i) + { + list.append(papers.at(i).GetDetails()); } return list; } diff --git a/src/libs/vlayout/vlayoutgenerator.h b/src/libs/vlayout/vlayoutgenerator.h index 2e8f30d0e..4405df468 100644 --- a/src/libs/vlayout/vlayoutgenerator.h +++ b/src/libs/vlayout/vlayoutgenerator.h @@ -64,7 +64,8 @@ public: LayoutErrors State() const; - QList GetItems() const; + QList GetPapersItems() const; + QList> GetAllDetails() const; bool GetRotate() const; void SetRotate(bool value); diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index 56e5ed9d8..08542cfda 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -270,16 +270,22 @@ void VLayoutPaper::SaveCandidate(VBestSquare &bestResult, const VLayoutDetail &d } //--------------------------------------------------------------------------------------------------------------------- -QGraphicsItem *VLayoutPaper::GetItem() const +QGraphicsRectItem *VLayoutPaper::GetPaperItem() const { QGraphicsRectItem *paper = new QGraphicsRectItem(QRectF(0, 0, d->globalContour.GetWidth(), d->globalContour.GetHeight())); paper->setPen(QPen(Qt::black, 1)); paper->setBrush(QBrush(Qt::white)); - for (int i=0; i < d->details.count(); ++i) - { - QGraphicsItem *item = d->details.at(i).GetItem(); - item->setParentItem(paper); - } return paper; } + +//--------------------------------------------------------------------------------------------------------------------- +QList VLayoutPaper::GetDetails() const +{ + QList list; + for (int i=0; i < d->details.count(); ++i) + { + list.append(d->details.at(i).GetItem()); + } + return list; +} diff --git a/src/libs/vlayout/vlayoutpaper.h b/src/libs/vlayout/vlayoutpaper.h index 015a73d4c..4574adeec 100644 --- a/src/libs/vlayout/vlayoutpaper.h +++ b/src/libs/vlayout/vlayoutpaper.h @@ -36,6 +36,7 @@ class VLayoutPaperData; class VLayoutDetail; class QGraphicsItem; class VBestSquare; +class QGraphicsRectItem; class VLayoutPaper { @@ -68,7 +69,8 @@ public: bool ArrangeDetail(const VLayoutDetail &detail, bool &stop); int Count() const; - QGraphicsItem *GetItem() const; + QGraphicsRectItem *GetPaperItem() const; + QList GetDetails() const; private: QSharedDataPointer d; From bc2df2b1b3c53d0b552f0fc0429c6597aa0a702e Mon Sep 17 00:00:00 2001 From: dismine Date: Fri, 23 Jan 2015 12:59:40 +0200 Subject: [PATCH 062/186] Changed layout allowence value. --HG-- branch : develop --- src/app/dialogs/app/dialoglayoutsettings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/dialogs/app/dialoglayoutsettings.cpp b/src/app/dialogs/app/dialoglayoutsettings.cpp index 9b4dc7a86..a96b4a30f 100644 --- a/src/app/dialogs/app/dialoglayoutsettings.cpp +++ b/src/app/dialogs/app/dialoglayoutsettings.cpp @@ -292,7 +292,7 @@ void DialogLayoutSettings::InitLayoutUnits() ui->comboBoxLayoutUnit->setCurrentIndex(indexUnit); } - ui->doubleSpinBoxLayoutWidth->setValue(VAbstractMeasurements::UnitConvertor(1, Unit::Mm, oldLayoutUnit)); + ui->doubleSpinBoxLayoutWidth->setValue(VAbstractMeasurements::UnitConvertor(2.5, Unit::Mm, oldLayoutUnit)); ui->doubleSpinBoxShift->setValue(VAbstractMeasurements::UnitConvertor(50, Unit::Mm, oldLayoutUnit)); } From 878cc2d573800a268fb655d788c1007accc804a8 Mon Sep 17 00:00:00 2001 From: dismine Date: Fri, 23 Jan 2015 13:40:17 +0200 Subject: [PATCH 063/186] Use pattern file name in mask. --HG-- branch : develop --- src/app/dialogs/app/dialogsavelayout.cpp | 4 +++- src/app/dialogs/app/dialogsavelayout.h | 3 ++- src/app/tablewindow.cpp | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/app/dialogs/app/dialogsavelayout.cpp b/src/app/dialogs/app/dialogsavelayout.cpp index bf7705278..fc04d1f22 100644 --- a/src/app/dialogs/app/dialogsavelayout.cpp +++ b/src/app/dialogs/app/dialogsavelayout.cpp @@ -35,7 +35,8 @@ #include //--------------------------------------------------------------------------------------------------------------------- -DialogSaveLayout::DialogSaveLayout(const QMap &formates, int count, QWidget *parent) +DialogSaveLayout::DialogSaveLayout(const QMap &formates, int count, const QString &mask, + QWidget *parent) :QDialog(parent), ui(new Ui::DialogSaveLAyout), count(count) { ui->setupUi(this); @@ -46,6 +47,7 @@ DialogSaveLayout::DialogSaveLayout(const QMap &formates, int c QRegExpValidator *validator = new QRegExpValidator(QRegExp("^[\\w\\-. ]+$"), this); ui->lineEditMask->setValidator(validator); + ui->lineEditMask->setText(mask); QMap::const_iterator i = formates.constBegin(); while (i != formates.constEnd()) diff --git a/src/app/dialogs/app/dialogsavelayout.h b/src/app/dialogs/app/dialogsavelayout.h index 74425a632..d1e083ed2 100644 --- a/src/app/dialogs/app/dialogsavelayout.h +++ b/src/app/dialogs/app/dialogsavelayout.h @@ -41,7 +41,8 @@ class DialogSaveLayout : public QDialog Q_OBJECT public: - DialogSaveLayout(const QMap &formates, int count, QWidget *parent = 0); + DialogSaveLayout(const QMap &formates, int count, const QString &mask = QString(), + QWidget *parent = 0); ~DialogSaveLayout(); QString Path() const; diff --git a/src/app/tablewindow.cpp b/src/app/tablewindow.cpp index dd706cc84..e92268020 100644 --- a/src/app/tablewindow.cpp +++ b/src/app/tablewindow.cpp @@ -164,7 +164,7 @@ void TableWindow::StopTable() void TableWindow::saveScene() { QMap extByMessage = InitFormates(); - DialogSaveLayout dialog(extByMessage, scenes.size(), this); + DialogSaveLayout dialog(extByMessage, scenes.size(), fileName, this); if (dialog.exec() == QDialog::Rejected) { From 245c6f522b136cf5d35eb95efb02163da55c6b4b Mon Sep 17 00:00:00 2001 From: dismine Date: Fri, 23 Jan 2015 17:05:23 +0200 Subject: [PATCH 064/186] Don't show arrow if edge too short. --HG-- branch : develop --- src/libs/vlayout/vposition.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/libs/vlayout/vposition.cpp b/src/libs/vlayout/vposition.cpp index e99b5a0c9..23c977cf3 100644 --- a/src/libs/vlayout/vposition.cpp +++ b/src/libs/vlayout/vposition.cpp @@ -662,15 +662,21 @@ QVector VPosition::Triplet(const QLineF &edge) const //--------------------------------------------------------------------------------------------------------------------- QPainterPath VPosition::ShowDirection(const QLineF &edge) { + const int arrowLength = 14; + QPainterPath path; + if (edge.length()/arrowLength < 5) + { + return path; + } + QLineF arrow = edge; arrow.setLength(edge.length()/2.0); //Reverse line because we want start arrow from this point arrow = QLineF(arrow.p2(), arrow.p1()); const qreal angle = arrow.angle();//we each time change line angle, better save original angle value - arrow.setLength(14);//arrow length in pixels + arrow.setLength(arrowLength);//arrow length in pixels - QPainterPath path; arrow.setAngle(angle-35); path.moveTo(arrow.p1()); path.lineTo(arrow.p2()); From 57c481325505072effe2b4dc134db4e9b32df91b Mon Sep 17 00:00:00 2001 From: dismine Date: Mon, 26 Jan 2015 15:38:51 +0200 Subject: [PATCH 065/186] Refactoring changed word 'Mask' to 'File Name' when saving the layout. --HG-- branch : develop --- src/app/dialogs/app/dialogsavelayout.cpp | 16 ++++++++-------- src/app/dialogs/app/dialogsavelayout.h | 4 ++-- src/app/dialogs/app/dialogsavelayout.ui | 4 ++-- src/app/tablewindow.cpp | 6 +++--- src/app/tablewindow.h | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/app/dialogs/app/dialogsavelayout.cpp b/src/app/dialogs/app/dialogsavelayout.cpp index fc04d1f22..dec9d2d02 100644 --- a/src/app/dialogs/app/dialogsavelayout.cpp +++ b/src/app/dialogs/app/dialogsavelayout.cpp @@ -35,7 +35,7 @@ #include //--------------------------------------------------------------------------------------------------------------------- -DialogSaveLayout::DialogSaveLayout(const QMap &formates, int count, const QString &mask, +DialogSaveLayout::DialogSaveLayout(const QMap &formates, int count, const QString &fileName, QWidget *parent) :QDialog(parent), ui(new Ui::DialogSaveLAyout), count(count) { @@ -46,8 +46,8 @@ DialogSaveLayout::DialogSaveLayout(const QMap &formates, int c bOk->setEnabled(false); QRegExpValidator *validator = new QRegExpValidator(QRegExp("^[\\w\\-. ]+$"), this); - ui->lineEditMask->setValidator(validator); - ui->lineEditMask->setText(mask); + ui->lineEditFileName->setValidator(validator); + ui->lineEditFileName->setText(fileName); QMap::const_iterator i = formates.constBegin(); while (i != formates.constEnd()) @@ -57,7 +57,7 @@ DialogSaveLayout::DialogSaveLayout(const QMap &formates, int c } connect(bOk, &QPushButton::clicked, this, &DialogSaveLayout::Save); - connect(ui->lineEditMask, &QLineEdit::textChanged, this, &DialogSaveLayout::ShowExample); + connect(ui->lineEditFileName, &QLineEdit::textChanged, this, &DialogSaveLayout::ShowExample); connect(ui->comboBoxFormat, static_cast(&QComboBox::currentIndexChanged), this, &DialogSaveLayout::ShowExample); connect(ui->pushButtonBrowse, &QPushButton::clicked, this, &DialogSaveLayout::Browse); @@ -79,9 +79,9 @@ QString DialogSaveLayout::Path() const } //--------------------------------------------------------------------------------------------------------------------- -QString DialogSaveLayout::Mask() const +QString DialogSaveLayout::FileName() const { - return ui->lineEditMask->text(); + return ui->lineEditFileName->text(); } //--------------------------------------------------------------------------------------------------------------------- @@ -95,7 +95,7 @@ void DialogSaveLayout::Save() { for (int i=0; i < count; ++i) { - const QString name = Path()+"/"+Mask()+QString::number(i+1)+Formate(); + const QString name = Path()+"/"+FileName()+QString::number(i+1)+Formate(); if (QFile::exists(name)) { QMessageBox::StandardButton res = QMessageBox::question(this, tr("Name conflict"), @@ -117,7 +117,7 @@ void DialogSaveLayout::Save() //--------------------------------------------------------------------------------------------------------------------- void DialogSaveLayout::ShowExample() { - ui->labelExample->setText(tr("Example:") + Mask() + "1" + Formate()); + ui->labelExample->setText(tr("Example:") + FileName() + "1" + Formate()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/app/dialogsavelayout.h b/src/app/dialogs/app/dialogsavelayout.h index d1e083ed2..1dbdb02f8 100644 --- a/src/app/dialogs/app/dialogsavelayout.h +++ b/src/app/dialogs/app/dialogsavelayout.h @@ -41,12 +41,12 @@ class DialogSaveLayout : public QDialog Q_OBJECT public: - DialogSaveLayout(const QMap &formates, int count, const QString &mask = QString(), + DialogSaveLayout(const QMap &formates, int count, const QString &fileName = QString(), QWidget *parent = 0); ~DialogSaveLayout(); QString Path() const; - QString Mask() const; + QString FileName() const; QString Formate() const; public slots: diff --git a/src/app/dialogs/app/dialogsavelayout.ui b/src/app/dialogs/app/dialogsavelayout.ui index cc1ecd863..ea4082c46 100644 --- a/src/app/dialogs/app/dialogsavelayout.ui +++ b/src/app/dialogs/app/dialogsavelayout.ui @@ -28,7 +28,7 @@ - Mask: + File name: @@ -73,7 +73,7 @@ - + diff --git a/src/app/tablewindow.cpp b/src/app/tablewindow.cpp index e92268020..fe3974934 100644 --- a/src/app/tablewindow.cpp +++ b/src/app/tablewindow.cpp @@ -71,7 +71,7 @@ TableWindow::TableWindow(QWidget *parent) connect(ui->actionZoomIn, &QAction::triggered, ui->view, &VTableGraphicsView::ZoomIn); connect(ui->actionZoomOut, &QAction::triggered, ui->view, &VTableGraphicsView::ZoomOut); connect(ui->actionStop, &QAction::triggered, this, &TableWindow::StopTable); - connect(ui->actionSave, &QAction::triggered, this, &TableWindow::saveScene); + connect(ui->actionSave, &QAction::triggered, this, &TableWindow::SaveLayout); connect(ui->actionLayout, &QAction::triggered, this, &TableWindow::Layout); connect(ui->listWidget, &QListWidget::currentRowChanged, this, &TableWindow::ShowPaper); } @@ -161,7 +161,7 @@ void TableWindow::StopTable() /** * @brief saveScene save created layout. */ -void TableWindow::saveScene() +void TableWindow::SaveLayout() { QMap extByMessage = InitFormates(); DialogSaveLayout dialog(extByMessage, scenes.size(), fileName, this); @@ -175,7 +175,7 @@ void TableWindow::saveScene() suf.replace(".", ""); QString path = dialog.Path(); - QString mask = dialog.Mask(); + QString mask = dialog.FileName(); for (int i=0; i < scenes.size(); ++i) { diff --git a/src/app/tablewindow.h b/src/app/tablewindow.h index 4687256f1..f704c5e1d 100644 --- a/src/app/tablewindow.h +++ b/src/app/tablewindow.h @@ -58,7 +58,7 @@ public slots: const QString &description); void Layout(); void StopTable(); - void saveScene(); + void SaveLayout(); void ShowPaper(int index); signals: From 886f347ba648e707b52cbcc00acd88bfb906c825 Mon Sep 17 00:00:00 2001 From: dismine Date: Mon, 26 Jan 2015 16:08:09 +0200 Subject: [PATCH 066/186] To File/Preferences/Paths added path to export a layout. --HG-- branch : develop --- src/app/core/vsettings.cpp | 13 +++++++++++++ src/app/core/vsettings.h | 4 ++++ src/app/dialogs/app/configpages/pathpage.cpp | 7 ++++++- src/app/dialogs/app/dialogsavelayout.cpp | 4 ++++ src/app/tablewindow.cpp | 6 ++++-- 5 files changed, 31 insertions(+), 3 deletions(-) diff --git a/src/app/core/vsettings.cpp b/src/app/core/vsettings.cpp index 7f507a9e9..0dd1fa4ec 100644 --- a/src/app/core/vsettings.cpp +++ b/src/app/core/vsettings.cpp @@ -42,6 +42,7 @@ const QString VSettings::SettingConfigurationLabelLanguage = QStringLiteral(" const QString VSettings::SettingPathsIndividualMeasurements = QStringLiteral("paths/individual_measurements"); const QString VSettings::SettingPathsPattern = QStringLiteral("paths/pattern"); +const QString VSettings::SettingPathsLayout = QStringLiteral("paths/layout"); const QString VSettings::SettingPatternUser = QStringLiteral("pattern/user"); const QString VSettings::SettingPatternGraphicalOutput = QStringLiteral("pattern/graphicalOutput"); @@ -185,6 +186,18 @@ void VSettings::SetPathPattern(const QString &value) setValue(SettingPathsPattern, value); } +//--------------------------------------------------------------------------------------------------------------------- +QString VSettings::GetPathLayout() const +{ + return value(SettingPathsLayout, QDir::homePath()).toString(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VSettings::SetPathLayout(const QString &value) +{ + setValue(SettingPathsLayout, value); +} + //--------------------------------------------------------------------------------------------------------------------- QString VSettings::GetUser() const { diff --git a/src/app/core/vsettings.h b/src/app/core/vsettings.h index 7a21b56c6..cb240b73c 100644 --- a/src/app/core/vsettings.h +++ b/src/app/core/vsettings.h @@ -65,6 +65,9 @@ public: QString GetPathPattern() const; void SetPathPattern(const QString &value); + QString GetPathLayout() const; + void SetPathLayout(const QString &value); + QString GetUser() const; void SetUser(const QString &value); @@ -128,6 +131,7 @@ private: static const QString SettingPathsIndividualMeasurements; static const QString SettingPathsPattern; + static const QString SettingPathsLayout; static const QString SettingPatternUser; static const QString SettingPatternGraphicalOutput; diff --git a/src/app/dialogs/app/configpages/pathpage.cpp b/src/app/dialogs/app/configpages/pathpage.cpp index bf2a8e686..fd55446a7 100644 --- a/src/app/dialogs/app/configpages/pathpage.cpp +++ b/src/app/dialogs/app/configpages/pathpage.cpp @@ -64,6 +64,7 @@ void PathPage::Apply() { qApp->getSettings()->SetPathIndividualMeasurements(pathTable->item(0, 1)->text()); qApp->getSettings()->SetPathPattern(pathTable->item(1, 1)->text()); + qApp->getSettings()->SetPathLayout(pathTable->item(2, 1)->text()); } //--------------------------------------------------------------------------------------------------------------------- @@ -125,10 +126,11 @@ QGroupBox *PathPage::PathGroup() return pathGroup; } +//--------------------------------------------------------------------------------------------------------------------- void PathPage::InitTable() { pathTable = new QTableWidget(); - pathTable->setRowCount(2); + pathTable->setRowCount(3); pathTable->setColumnCount(2); pathTable->verticalHeader()->setVisible(false); pathTable->setEditTriggers(QAbstractItemView::NoEditTriggers); @@ -145,6 +147,9 @@ void PathPage::InitTable() pathTable->setItem(1, 0, new QTableWidgetItem(tr("Patterns"))); pathTable->setItem(1, 1, new QTableWidgetItem(qApp->getSettings()->GetPathPattern())); + pathTable->setItem(2, 0, new QTableWidgetItem(tr("Layout"))); + pathTable->setItem(2, 1, new QTableWidgetItem(qApp->getSettings()->GetPathLayout())); + pathTable->verticalHeader()->setDefaultSectionSize(20); pathTable->resizeColumnsToContents(); pathTable->resizeRowsToContents(); diff --git a/src/app/dialogs/app/dialogsavelayout.cpp b/src/app/dialogs/app/dialogsavelayout.cpp index dec9d2d02..3a427a76b 100644 --- a/src/app/dialogs/app/dialogsavelayout.cpp +++ b/src/app/dialogs/app/dialogsavelayout.cpp @@ -29,6 +29,8 @@ #include "dialogsavelayout.h" #include "ui_dialogsavelayout.h" #include "../options.h" +#include "../../core/vapplication.h" +#include "../../core/vsettings.h" #include #include @@ -49,6 +51,8 @@ DialogSaveLayout::DialogSaveLayout(const QMap &formates, int c ui->lineEditFileName->setValidator(validator); ui->lineEditFileName->setText(fileName); + ui->lineEditPath->setText(qApp->getSettings()->GetPathLayout()); + QMap::const_iterator i = formates.constBegin(); while (i != formates.constEnd()) { diff --git a/src/app/tablewindow.cpp b/src/app/tablewindow.cpp index fe3974934..30649add5 100644 --- a/src/app/tablewindow.cpp +++ b/src/app/tablewindow.cpp @@ -30,6 +30,7 @@ #include "ui_tablewindow.h" #include "widgets/vtablegraphicsview.h" #include "core/vapplication.h" +#include "core/vsettings.h" #include "../../libs/vobj/vobjpaintdevice.h" #include "../dialogs/app/dialoglayoutsettings.h" #include "../../libs/vlayout/vlayoutgenerator.h" @@ -174,8 +175,9 @@ void TableWindow::SaveLayout() QString suf = dialog.Formate(); suf.replace(".", ""); - QString path = dialog.Path(); - QString mask = dialog.FileName(); + const QString path = dialog.Path(); + qApp->getSettings()->SetPathLayout(path); + const QString mask = dialog.FileName(); for (int i=0; i < scenes.size(); ++i) { From aac096d897c01896519cb21d8ce1c9ad9627d9c2 Mon Sep 17 00:00:00 2001 From: dismine Date: Mon, 26 Jan 2015 17:02:57 +0200 Subject: [PATCH 067/186] Fixed issue #223. Attempt to remove stale lock file. --HG-- branch : develop --- src/app/core/vapplication.cpp | 43 ++++++++++++++++++++++++++++++++--- src/app/core/vapplication.h | 2 ++ src/app/mainwindow.cpp | 4 ++-- 3 files changed, 44 insertions(+), 5 deletions(-) diff --git a/src/app/core/vapplication.cpp b/src/app/core/vapplication.cpp index 57a6feb96..b6b3bc84b 100644 --- a/src/app/core/vapplication.cpp +++ b/src/app/core/vapplication.cpp @@ -339,6 +339,43 @@ double VApplication::fromPixel(double pix) const return fromPixel(pix, _patternUnit); } +//--------------------------------------------------------------------------------------------------------------------- +bool VApplication::TryLock(QLockFile *lock) +{ + if (lock == nullptr) + { + return false; + } + + if (lock->tryLock()) + { + return true; + } + else + { + if (lock->error() == QLockFile::LockFailedError) + { + // This happens if a stale lock file exists and another process uses that PID. + // Try removing the stale file, which will fail if a real process is holding a + // file-level lock. A false error is more problematic than not locking properly + // on corner-case systems. + if (lock->removeStaleLockFile() == false || lock->tryLock() == false) + { + return false; + } + else + { + return true; + } + } + else + { + return false; + } + return false; + } +} + //--------------------------------------------------------------------------------------------------------------------- QString VApplication::pathToTables() const { @@ -461,7 +498,7 @@ void VApplication::BeginLogging() qInstallMessageHandler(noisyFailureMsgHandler); logLock = new QLockFile(LogPath()+".lock"); logLock->setStaleLockTime(0); - if (logLock->tryLock()) + if (TryLock(logLock)) { qCDebug(vApp) << "Log file"<tryLock()) + if (TryLock(lock)) { qCDebug(vApp) << "Locked file"<setStaleLockTime(0); - if (logLock->tryLock()) + if (TryLock(logLock)) { *out <<"--------------------------" << endl; QFile logFile(info.absoluteFilePath()); diff --git a/src/app/core/vapplication.h b/src/app/core/vapplication.h index 7122d424d..93a864d50 100644 --- a/src/app/core/vapplication.h +++ b/src/app/core/vapplication.h @@ -70,6 +70,8 @@ public: double fromPixel(double pix, const Unit &unit) const; double fromPixel(double pix) const; + static bool TryLock(QLockFile *lock); + static const qreal PrintDPI; QString translationsPath() const; QString pathToTables() const; diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index 01097d8de..f76099bd1 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -2365,7 +2365,7 @@ void MainWindow::LoadPattern(const QString &fileName) qCDebug(vMainWindow)<<"Loking file"; lock = new QLockFile(fileName+".lock"); lock->setStaleLockTime(0); - if (lock->tryLock()) + if (VApplication::TryLock(lock)) { qCDebug(vMainWindow) << "Pattern file"<setStaleLockTime(0); - if (lock->tryLock()) + if (VApplication::TryLock(lock)) { restoreFiles.append(files.at(i)); } From 9875558e49fb25ee248104ecc4af21819d0269af Mon Sep 17 00:00:00 2001 From: dismine Date: Mon, 26 Jan 2015 17:13:46 +0200 Subject: [PATCH 068/186] Fixed issue #222. Move Layout icon on top toolbar so it is next to Detail mode. --HG-- branch : develop --- src/app/mainwindow.cpp | 1 - src/app/mainwindow.ui | 23 ++++++++++++++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index f76099bd1..f6fc6b4c8 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -942,7 +942,6 @@ void MainWindow::ToolBarDraws() ui->actionHistory->setEnabled(false); connect(ui->actionHistory, &QAction::triggered, this, &MainWindow::ActionHistory); - ui->toolBarDraws->addAction(ui->actionLayout); connect(ui->actionLayout, &QAction::triggered, this, &MainWindow::ActionLayout); ui->actionLayout->setEnabled(false); } diff --git a/src/app/mainwindow.ui b/src/app/mainwindow.ui index 688b6463f..176d9e371 100644 --- a/src/app/mainwindow.ui +++ b/src/app/mainwindow.ui @@ -832,7 +832,7 @@ - + true @@ -847,7 +847,7 @@ - + @@ -906,6 +906,18 @@ + + + toolBar + + + TopToolBarArea + + + false + + + @@ -1106,6 +1118,9 @@ + + false + :/icon/32x32/layout.png:/icon/32x32/layout.png @@ -1264,7 +1279,9 @@ - + + + Online help From acadc898dc61e806d3c319b9058f4a8323553d6f Mon Sep 17 00:00:00 2001 From: Felix Ulber Date: Mon, 26 Jan 2015 21:05:59 +0100 Subject: [PATCH 069/186] Fixed Issue #204. Point from X and Y tool needs X & Y labels in options box. --HG-- branch : develop --- src/app/dialogs/tools/dialogpointofintersection.ui | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/dialogs/tools/dialogpointofintersection.ui b/src/app/dialogs/tools/dialogpointofintersection.ui index d79a9035a..a63c1a653 100644 --- a/src/app/dialogs/tools/dialogpointofintersection.ui +++ b/src/app/dialogs/tools/dialogpointofintersection.ui @@ -58,7 +58,7 @@ - vertical point + X: vertical point @@ -78,7 +78,7 @@ - horizontal point + Y: horizontal point From 70ffdcc1c6f7652bf8987ed6dff4ce446f6a8496 Mon Sep 17 00:00:00 2001 From: Felix Ulber Date: Mon, 26 Jan 2015 22:28:54 +0100 Subject: [PATCH 070/186] Fixed Issue #207: Point from intersection of line and arc has incorrect options dialog title. --HG-- branch : develop --- src/app/dialogs/tools/dialogpointofcontact.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/dialogs/tools/dialogpointofcontact.ui b/src/app/dialogs/tools/dialogpointofcontact.ui index e74fd80ca..5d9d5101d 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.ui +++ b/src/app/dialogs/tools/dialogpointofcontact.ui @@ -11,7 +11,7 @@ - Point of contact + Point from intersection of line and arc From 665d276e9652ddf77756a0eb9b8dffd77887cb18 Mon Sep 17 00:00:00 2001 From: Felix Ulber Date: Mon, 26 Jan 2015 23:13:57 +0100 Subject: [PATCH 071/186] Fixed Issue #205: Point from X and Y needs improved tooltip and user prompts. --HG-- branch : develop --- src/app/dialogs/tools/dialogpointofintersection.cpp | 2 +- src/app/mainwindow.cpp | 2 +- src/app/mainwindow.ui | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/dialogs/tools/dialogpointofintersection.cpp b/src/app/dialogs/tools/dialogpointofintersection.cpp index 4474e067e..c3b4dc425 100644 --- a/src/app/dialogs/tools/dialogpointofintersection.cpp +++ b/src/app/dialogs/tools/dialogpointofintersection.cpp @@ -100,7 +100,7 @@ void DialogPointOfIntersection::ChosenObject(quint32 id, const SceneObject &type switch (number) { case 0: - if (SetObject(id, ui->comboBoxFirstPoint, tr("Select point horizontally"))) + if (SetObject(id, ui->comboBoxFirstPoint, tr("Select point for Y value (horizontal)"))) { number++; line->VisualMode(id); diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index f6fc6b4c8..973045e3c 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -658,7 +658,7 @@ void MainWindow::ToolPointOfIntersection(bool checked) { SetToolButtonWithApply(checked, Tool::PointOfIntersection, ":/cursor/pointofintersect_cursor.png", - tr("Select point vertically"), + tr("Select point for X value (vertical)"), &MainWindow::ClosedDialogWithApply, &MainWindow::ApplyDialog); } diff --git a/src/app/mainwindow.ui b/src/app/mainwindow.ui index 176d9e371..2850c4796 100644 --- a/src/app/mainwindow.ui +++ b/src/app/mainwindow.ui @@ -229,7 +229,7 @@ false - Tool to make point from x & y of two other points. + 'Point from X and Y of two other points. ... From f9f6ae884fef921000068b0632854b2c31d76619 Mon Sep 17 00:00:00 2001 From: Felix Ulber Date: Tue, 27 Jan 2015 11:20:30 +0100 Subject: [PATCH 072/186] Fixed Issue #212: Tooltip for Tool triangle is unclear. Rename. --HG-- branch : develop --- src/app/mainwindow.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/mainwindow.ui b/src/app/mainwindow.ui index 2850c4796..9f65e49c2 100644 --- a/src/app/mainwindow.ui +++ b/src/app/mainwindow.ui @@ -125,7 +125,7 @@ false - Tool triangle. + Triangle tool. ... From 2a27ebfe1f041d679eef88b7f67c641ddba5b8b4 Mon Sep 17 00:00:00 2001 From: dismine Date: Tue, 27 Jan 2015 15:56:44 +0200 Subject: [PATCH 073/186] Fixed issue #230. Program hangs when I try to open saved file. --HG-- branch : develop --- src/app/dialogs/tools/dialogsplinepath.cpp | 5 +++ src/app/geometry/vspline.cpp | 11 ++++++ src/app/geometry/vsplinepath.cpp | 5 +++ src/app/tools/drawTools/vtoolsplinepath.cpp | 29 +++++++------- src/app/tools/drawTools/vtoolsplinepath.h | 2 +- src/app/xml/vpattern.cpp | 43 +++++++++++++++++++-- 6 files changed, 75 insertions(+), 20 deletions(-) diff --git a/src/app/dialogs/tools/dialogsplinepath.cpp b/src/app/dialogs/tools/dialogsplinepath.cpp index 39daac404..e68650792 100644 --- a/src/app/dialogs/tools/dialogsplinepath.cpp +++ b/src/app/dialogs/tools/dialogsplinepath.cpp @@ -103,6 +103,11 @@ void DialogSplinePath::ChosenObject(quint32 id, const SceneObject &type) { if (type == SceneObject::Point) { + if (path.CountPoint() >= 2 && path.at(path.CountPoint()-1).P().id() == id) + { + return; + } + NewItem(id, 1, 0, 1, 180); emit ToolTip(tr("Select point of curve path")); diff --git a/src/app/geometry/vspline.cpp b/src/app/geometry/vspline.cpp index e6d48a9d9..00e7ca219 100644 --- a/src/app/geometry/vspline.cpp +++ b/src/app/geometry/vspline.cpp @@ -294,6 +294,17 @@ void VSpline::PointBezier_r ( qreal x1, qreal y1, qreal x2, qreal y2, qreal x3, qreal y3, qreal x4, qreal y4, qint16 level, QVector &px, QVector &py) { + if (px.size() >= 2) + { + for (int i=1; i < px.size(); ++i) + { + if (QPointF(px.at(i-1), py.at(i-1)) == QPointF(px.at(i), py.at(i))) + { + qCritical("All neighbors points in path must be unique."); + } + } + } + const double curve_collinearity_epsilon = 1e-30; const double curve_angle_tolerance_epsilon = 0.01; const double m_angle_tolerance = 0.0; diff --git a/src/app/geometry/vsplinepath.cpp b/src/app/geometry/vsplinepath.cpp index d2c49976b..832b313d2 100644 --- a/src/app/geometry/vsplinepath.cpp +++ b/src/app/geometry/vsplinepath.cpp @@ -47,6 +47,11 @@ VSplinePath::~VSplinePath() //--------------------------------------------------------------------------------------------------------------------- void VSplinePath::append(const VSplinePoint &point) { + if (d->path.size() > 0 && d->path.last().P().toQPointF() == point.P().toQPointF()) + { + return; + } + d->path.append(point); QString name = splPath; name.append(QString("_%1").arg(d->path.first().P().name())); diff --git a/src/app/tools/drawTools/vtoolsplinepath.cpp b/src/app/tools/drawTools/vtoolsplinepath.cpp index 3a53d0193..c77576e96 100644 --- a/src/app/tools/drawTools/vtoolsplinepath.cpp +++ b/src/app/tools/drawTools/vtoolsplinepath.cpp @@ -251,20 +251,18 @@ void VToolSplinePath::RefreshSplinePath(VSplinePath &splPath) */ void VToolSplinePath::UpdatePathPoint(VPattern *doc, QDomNode& node, const VSplinePath &path) { - SCASSERT(doc != nullptr) - QDomNodeList nodeList = node.childNodes(); - qint32 num = nodeList.size(); - for (qint32 i = 0; i < num; ++i) + SCASSERT(doc != nullptr); + QDomElement element = node.toElement(); + if (element.isElement() == false) { - QDomElement domElement = nodeList.at(i).toElement(); - if (domElement.isNull() == false) - { - VSplinePoint p = path.at(i); - doc->SetAttribute(domElement, AttrPSpline, p.P().id()); - doc->SetAttribute(domElement, AttrKAsm1, p.KAsm1()); - doc->SetAttribute(domElement, AttrKAsm2, p.KAsm2()); - doc->SetAttribute(domElement, AttrAngle, p.Angle2()); - } + qDebug()<<"Couldn't convert parent to element."; + return; + } + + doc->removeAllChilds(element); + for (qint32 i = 0; i < path.CountPoint(); ++i) + { + AddPathPoint(doc, element, path.at(i)); } } @@ -352,8 +350,9 @@ void VToolSplinePath::RefreshDataInFile() * @param domElement dom element. * @param splPoint spline path point. */ -void VToolSplinePath::AddPathPoint(QDomElement &domElement, const VSplinePoint &splPoint) +void VToolSplinePath::AddPathPoint(VPattern *doc, QDomElement &domElement, const VSplinePoint &splPoint) { + SCASSERT(doc != nullptr); QDomElement pathPoint = doc->createElement(AttrPathPoint); doc->SetAttribute(pathPoint, AttrPSpline, splPoint.P().id()); @@ -406,7 +405,7 @@ void VToolSplinePath::SaveOptions(QDomElement &tag, QSharedPointer &ob doc->RemoveAllChild(tag); for (qint32 i = 0; i < splPath->CountPoint(); ++i) { - AddPathPoint(tag, splPath->at(i)); + AddPathPoint(doc, tag, splPath->at(i)); } } diff --git a/src/app/tools/drawTools/vtoolsplinepath.h b/src/app/tools/drawTools/vtoolsplinepath.h index 3943a4626..75ffbf8ef 100644 --- a/src/app/tools/drawTools/vtoolsplinepath.h +++ b/src/app/tools/drawTools/vtoolsplinepath.h @@ -80,7 +80,7 @@ protected: virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); private: void RefreshGeometry(); - void AddPathPoint(QDomElement &domElement, const VSplinePoint &splPoint); + static void AddPathPoint(VPattern *doc, QDomElement &domElement, const VSplinePoint &splPoint); void UpdateControlPoints(const VSpline &spl, VSplinePath &splPath, const qint32 &indexSpline) const; void RefreshSplinePath(VSplinePath &splPath); }; diff --git a/src/app/xml/vpattern.cpp b/src/app/xml/vpattern.cpp index 4e567f6c3..02b401175 100644 --- a/src/app/xml/vpattern.cpp +++ b/src/app/xml/vpattern.cpp @@ -301,6 +301,21 @@ bool VPattern::ChangeNamePP(const QString& oldName, const QString &newName) void VPattern::Parse(const Document &parse) { qCDebug(vXML)<<"Parsing pattern."; + switch (parse) + { + case Document::FullParse: + qCDebug(vXML)<<"Full parse."; + break; + case Document::LiteParse: + qCDebug(vXML)<<"Lite parse."; + break; + case Document::LitePPParse: + qCDebug(vXML)<<"Lite pattern piece parse."; + break; + default: + break; + } + SCASSERT(sceneDraw != nullptr); SCASSERT(sceneDetail != nullptr); QStringList tags = QStringList() << TagDraw << TagIncrements << TagAuthor << TagDescription << TagNotes @@ -317,6 +332,7 @@ void VPattern::Parse(const Document &parse) switch (tags.indexOf(domElement.tagName())) { case 0: // TagDraw + qCDebug(vXML)<<"Tag draw."; if (parse == Document::FullParse) { if (nameActivPP.isEmpty()) @@ -336,22 +352,29 @@ void VPattern::Parse(const Document &parse) ParseDrawElement(domElement, parse); break; case 1: // TagIncrements + qCDebug(vXML)<<"Tag increments."; ParseIncrementsElement(domElement); break; case 2: // TagAuthor + qCDebug(vXML)<<"Tag author."; break; case 3: // TagDescription + qCDebug(vXML)<<"Tag description."; break; case 4: // TagNotes + qCDebug(vXML)<<"Tag notes."; break; case 5: // TagMeasurements + qCDebug(vXML)<<"Tag measurements."; break; case 6: // TagVersion + qCDebug(vXML)<<"Tag version."; break; case 7: // TagGradation + qCDebug(vXML)<<"Tag gradation."; break; default: - qDebug()<<"Wrong tag name"<ClearCalculationGObjects(); ParseDrawMode(domElement, parse, Draw::Calculation); break; case 1: // TagModeling + qCDebug(vXML)<<"Tag modeling."; ParseDrawMode(domElement, parse, Draw::Modeling); break; case 2: // TagDetails + qCDebug(vXML)<<"Tag details."; ParseDetails(domElement, parse); break; default: - qDebug()<<"Wrong tag name"< Date: Tue, 27 Jan 2015 16:14:54 +0200 Subject: [PATCH 074/186] Fixed issue #218. Pattern disappears when Detail icon on icon bar is selected. --HG-- branch : develop --- src/app/mainwindow.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index 973045e3c..22fa7668c 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -1468,7 +1468,6 @@ void MainWindow::Clear() qCDebug(vMainWindow)<<"Unlocked pattern file."; ui->actionDetails->setChecked(false); - ui->actionDetails->setEnabled(false); ui->actionDraw->setChecked(true); ui->actionDraw->setEnabled(false); qCDebug(vMainWindow)<<"Returned to Draw mode."; @@ -1678,11 +1677,20 @@ void MainWindow::SetEnabledGUI(bool enabled) ui->actionHistory->setEnabled(enabled); ui->actionNewDraw->setEnabled(enabled); ui->actionDraw->setEnabled(enabled); - ui->actionDetails->setEnabled(enabled); ui->actionTable->setEnabled(enabled); - ui->actionLayout->setEnabled(enabled); ui->actionZoomFitBest->setEnabled(enabled); ui->actionZoomOriginal->setEnabled(enabled); + + if (enabled) + { + Layout(); + } + else + { + ui->actionDetails->setEnabled(enabled); + ui->actionLayout->setEnabled(enabled); + } + guiEnabled = enabled; sceneDraw->SetDisable(!enabled); @@ -1708,10 +1716,12 @@ void MainWindow::Layout() const QHash *details = pattern->DataDetails(); if (details->size() > 0) { + ui->actionDetails->setEnabled(true); ui->actionLayout->setEnabled(true); } else { + ui->actionDetails->setEnabled(false); ui->actionLayout->setEnabled(false); } } @@ -1826,12 +1836,12 @@ void MainWindow::SetEnableWidgets(bool enable) { ui->actionSaveAs->setEnabled(enable); ui->actionDraw->setEnabled(enable); - ui->actionDetails->setEnabled(enable); ui->actionOptionDraw->setEnabled(enable); if (enable == true && curFile.isEmpty() == false) { ui->actionSave->setEnabled(enable); } + Layout(); ui->actionTable->setEnabled(enable); ui->actionHistory->setEnabled(enable); ui->actionPattern_properties->setEnabled(enable); From c15c0ac67bd752e0bdbe81414e4bcdbdedbb9202 Mon Sep 17 00:00:00 2001 From: dismine Date: Tue, 27 Jan 2015 18:32:50 +0200 Subject: [PATCH 075/186] Fixed issue #196. Detail Editor crashes on Delete. --HG-- branch : develop --- src/app/dialogs/tools/dialogdetail.cpp | 103 ++++++++++++++++++------- src/app/dialogs/tools/dialogdetail.h | 15 ++-- src/app/tools/vtooldetail.cpp | 6 +- 3 files changed, 89 insertions(+), 35 deletions(-) diff --git a/src/app/dialogs/tools/dialogdetail.cpp b/src/app/dialogs/tools/dialogdetail.cpp index d8ca3604f..cbbe47047 100644 --- a/src/app/dialogs/tools/dialogdetail.cpp +++ b/src/app/dialogs/tools/dialogdetail.cpp @@ -44,7 +44,7 @@ * @param parent parent widget */ DialogDetail::DialogDetail(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(), details(VDetail()), supplement(true), closed(true) + :DialogTool(data, toolId, parent), ui(), detail(VDetail()), supplement(true), closed(true) { ui.setupUi(this); labelEditNamePoint = ui.labelEditNameDetail; @@ -110,7 +110,22 @@ void DialogDetail::ChosenObject(quint32 id, const SceneObject &type) qDebug()<setEnabled(true); + + if (ui.listWidget->count() > 0) + { + EnableObjectGUI(true); + } + + if (CreateDetail().ContourPoints(data).size() < 3) + { + ValidObjects(false); + } + else + { + ValidObjects(true); + + } + this->show(); } } @@ -118,16 +133,8 @@ void DialogDetail::ChosenObject(quint32 id, const SceneObject &type) //--------------------------------------------------------------------------------------------------------------------- void DialogDetail::SaveData() { - details.Clear(); - for (qint32 i = 0; i < ui.listWidget->count(); ++i) - { - QListWidgetItem *item = ui.listWidget->item(i); - details.append( qvariant_cast(item->data(Qt::UserRole))); - } - details.setWidth(ui.doubleSpinBoxSeams->value()); - details.setName(ui.lineEditNameDetail->text()); - details.setSeamAllowance(supplement); - details.setClosed(closed); + detail.Clear(); + detail = CreateDetail(); } //--------------------------------------------------------------------------------------------------------------------- @@ -202,26 +209,62 @@ void DialogDetail::NewItem(quint32 id, const Tool &typeTool, const NodeDetail &t ui.doubleSpinBoxBiasY->blockSignals(false); } +//--------------------------------------------------------------------------------------------------------------------- +VDetail DialogDetail::CreateDetail() const +{ + VDetail detail; + for (qint32 i = 0; i < ui.listWidget->count(); ++i) + { + QListWidgetItem *item = ui.listWidget->item(i); + detail.append( qvariant_cast(item->data(Qt::UserRole))); + } + detail.setWidth(ui.doubleSpinBoxSeams->value()); + detail.setName(ui.lineEditNameDetail->text()); + detail.setSeamAllowance(supplement); + detail.setClosed(closed); + return detail; +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogDetail::ValidObjects(bool value) +{ + flagError = value; + CheckState(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogDetail::EnableObjectGUI(bool value) +{ + ui.toolButtonDelete->setEnabled(value); + ui.doubleSpinBoxBiasX->setEnabled(value); + ui.doubleSpinBoxBiasY->setEnabled(value); + + if (value == false) + { + ui.checkBoxReverse->setEnabled(value); + } +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief setDetails set detail * @param value detail */ -void DialogDetail::setDetails(const VDetail &value) +void DialogDetail::setDetail(const VDetail &value) { - details = value; + detail = value; ui.listWidget->clear(); - for (int i = 0; i < details.CountNode(); ++i) + for (int i = 0; i < detail.CountNode(); ++i) { - NewItem(details.at(i).getId(), details.at(i).getTypeTool(), details.at(i).getTypeNode(), details.at(i).getMx(), - details.at(i).getMy(), details.at(i).getReverse()); + NewItem(detail.at(i).getId(), detail.at(i).getTypeTool(), detail.at(i).getTypeNode(), detail.at(i).getMx(), + detail.at(i).getMy(), detail.at(i).getReverse()); } - ui.lineEditNameDetail->setText(details.getName()); - ui.checkBoxSeams->setChecked(details.getSeamAllowance()); - ui.checkBoxClosed->setChecked(details.getClosed()); - ClickedClosed(details.getClosed()); - ClickedSeams(details.getSeamAllowance()); - ui.doubleSpinBoxSeams->setValue(details.getWidth()); + ui.lineEditNameDetail->setText(detail.getName()); + ui.checkBoxSeams->setChecked(detail.getSeamAllowance()); + ui.checkBoxClosed->setChecked(detail.getClosed()); + ClickedClosed(detail.getClosed()); + ClickedSeams(detail.getSeamAllowance()); + ui.doubleSpinBoxSeams->setValue(detail.getWidth()); ui.listWidget->setCurrentRow(0); ui.listWidget->setFocus(Qt::OtherFocusReason); ui.toolButtonDelete->setEnabled(true); @@ -297,7 +340,7 @@ void DialogDetail::ClickedReverse(bool checked) */ void DialogDetail::ObjectChanged(int row) { - if (ui.listWidget->count() == 0) + if (ui.listWidget->count() == 0 || row == -1) { return; } @@ -323,8 +366,16 @@ void DialogDetail::ObjectChanged(int row) */ void DialogDetail::DeleteItem() { - qint32 row = ui.listWidget->currentRow(); - delete ui.listWidget->item( row ); + if (ui.listWidget->count() == 1) + { + EnableObjectGUI(false); + } + + delete ui.listWidget->item( ui.listWidget->currentRow() ); + if (CreateDetail().ContourPoints(data).size() < 3 ) + { + ValidObjects(false); + } } diff --git a/src/app/dialogs/tools/dialogdetail.h b/src/app/dialogs/tools/dialogdetail.h index 8f8efe965..ab3535dc8 100644 --- a/src/app/dialogs/tools/dialogdetail.h +++ b/src/app/dialogs/tools/dialogdetail.h @@ -42,8 +42,8 @@ class DialogDetail : public DialogTool public: DialogDetail(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); - VDetail getDetails() const; - void setDetails(const VDetail &value); + VDetail getDetail() const; + void setDetail(const VDetail &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); void BiasXChanged(qreal d); @@ -64,8 +64,8 @@ private: /** @brief ui keeps information about user interface */ Ui::DialogDetail ui; - /** @brief details detail */ - VDetail details; + /** @brief detail detail */ + VDetail detail; /** @brief supplement keep option supplement of seams */ bool supplement; @@ -75,6 +75,9 @@ private: void NewItem(quint32 id, const Tool &typeTool, const NodeDetail &typeNode, qreal mx = 0, qreal my = 0, bool reverse = false); + VDetail CreateDetail() const; + void ValidObjects(bool value); + void EnableObjectGUI(bool value); }; //--------------------------------------------------------------------------------------------------------------------- @@ -82,9 +85,9 @@ private: * @brief getDetails return detail * @return detail */ -inline VDetail DialogDetail::getDetails() const +inline VDetail DialogDetail::getDetail() const { - return details; + return detail; } #endif // DIALOGDETAIL_H diff --git a/src/app/tools/vtooldetail.cpp b/src/app/tools/vtooldetail.cpp index 38af795f4..744f8a8a1 100644 --- a/src/app/tools/vtooldetail.cpp +++ b/src/app/tools/vtooldetail.cpp @@ -129,7 +129,7 @@ void VToolDetail::setDialog() DialogDetail *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); VDetail detail = VAbstractTool::data.GetDetail(id); - dialogTool->setDetails(detail); + dialogTool->setDetail(detail); } //--------------------------------------------------------------------------------------------------------------------- @@ -145,7 +145,7 @@ void VToolDetail::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern SCASSERT(dialog != nullptr); DialogDetail *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); - VDetail detail = dialogTool->getDetails(); + VDetail detail = dialogTool->getDetail(); VDetail det; qApp->getUndoStack()->beginMacro("add detail"); for (int i = 0; i< detail.CountNode(); ++i) @@ -260,7 +260,7 @@ void VToolDetail::FullUpdateFromGuiOk(int result) SCASSERT(dialog != nullptr); DialogDetail *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); - VDetail newDet = dialogTool->getDetails(); + VDetail newDet = dialogTool->getDetail(); VDetail oldDet = VAbstractTool::data.GetDetail(id); SaveDetailOptions *saveCommand = new SaveDetailOptions(oldDet, newDet, doc, id, this->scene()); From f8c62b9b25721eaab7cdc4b01d0d6862851f5288 Mon Sep 17 00:00:00 2001 From: dismine Date: Tue, 27 Jan 2015 20:17:28 +0200 Subject: [PATCH 076/186] Fixed issue #208. Point from X and Y needs vertical bar to help select point for X vertical value. --HG-- branch : develop --- src/app/dialogs/tools/dialogpointofintersection.cpp | 5 +++-- src/app/visualization/vistoolpointofintersection.cpp | 10 ++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/app/dialogs/tools/dialogpointofintersection.cpp b/src/app/dialogs/tools/dialogpointofintersection.cpp index c3b4dc425..5f565ddeb 100644 --- a/src/app/dialogs/tools/dialogpointofintersection.cpp +++ b/src/app/dialogs/tools/dialogpointofintersection.cpp @@ -62,6 +62,7 @@ DialogPointOfIntersection::DialogPointOfIntersection(const VContainer *data, con this, &DialogPointOfIntersection::PointNameChanged); line = new VisToolPointOfIntersection(data); + line->VisualMode(NULL_ID); } //--------------------------------------------------------------------------------------------------------------------- @@ -103,7 +104,8 @@ void DialogPointOfIntersection::ChosenObject(quint32 id, const SceneObject &type if (SetObject(id, ui->comboBoxFirstPoint, tr("Select point for Y value (horizontal)"))) { number++; - line->VisualMode(id); + line->setPoint1Id(id); + line->RefreshGeometry(); } break; case 1: @@ -173,7 +175,6 @@ void DialogPointOfIntersection::ShowVisualization() { VMainGraphicsScene *scene = qApp->getCurrentScene(); connect(scene, &VMainGraphicsScene::NewFactor, line, &VisLine::SetFactor); - scene->addItem(line); line->RefreshGeometry(); } } diff --git a/src/app/visualization/vistoolpointofintersection.cpp b/src/app/visualization/vistoolpointofintersection.cpp index 85c84af8a..6427eb3f3 100644 --- a/src/app/visualization/vistoolpointofintersection.cpp +++ b/src/app/visualization/vistoolpointofintersection.cpp @@ -48,12 +48,18 @@ VisToolPointOfIntersection::~VisToolPointOfIntersection() //--------------------------------------------------------------------------------------------------------------------- void VisToolPointOfIntersection::RefreshGeometry() { - if (point1Id > NULL_ID) + QLineF axisL1; + if (point1Id <= NULL_ID) + { + axisL1 = Axis(Visualization::scenePos, 90); + DrawLine(this, axisL1, supportColor, Qt::DashLine); + } + else { const QSharedPointer first = Visualization::data->GeometricObject(point1Id); DrawPoint(axisP1, first->toQPointF(), supportColor); - QLineF axisL1 = Axis(first->toQPointF(), 90); + axisL1 = Axis(first->toQPointF(), 90); DrawLine(this, axisL1, supportColor, Qt::DashLine); QLineF axisL2; From d70879276e27d0cf5b9b0b0cb97c5667efc83e9c Mon Sep 17 00:00:00 2001 From: dismine Date: Wed, 28 Jan 2015 16:46:41 +0200 Subject: [PATCH 077/186] Fixed bug "Can't get Valentina to pick the .vst initial file (OSX)". --HG-- branch : develop --- src/app/core/vapplication.cpp | 30 ------- src/app/core/vapplication.h | 1 - src/app/core/vsettings.cpp | 55 ++++++++++++ src/app/core/vsettings.h | 6 ++ src/app/dialogs/app/configpages/pathpage.cpp | 86 ++++++++++++++++--- src/app/dialogs/app/dialogincrements.cpp | 6 +- .../app/dialogindividualmeasurements.cpp | 5 +- .../app/dialogstandardmeasurements.cpp | 9 +- src/app/mainwindow.cpp | 8 +- 9 files changed, 153 insertions(+), 53 deletions(-) diff --git a/src/app/core/vapplication.cpp b/src/app/core/vapplication.cpp index b6b3bc84b..6d47aa27f 100644 --- a/src/app/core/vapplication.cpp +++ b/src/app/core/vapplication.cpp @@ -376,36 +376,6 @@ bool VApplication::TryLock(QLockFile *lock) } } -//--------------------------------------------------------------------------------------------------------------------- -QString VApplication::pathToTables() const -{ - if (_patternType == MeasurementsType::Individual) - { - return QStringLiteral("://tables/individual/individual.vit"); - } - else - { - const QString stPath = QStringLiteral("/tables/standard"); - #ifdef Q_OS_WIN - return QApplication::applicationDirPath() + stPath; - #else - #ifdef QT_DEBUG - return QApplication::applicationDirPath() + stPath; - #else - QDir dir(QApplication::applicationDirPath() + stPath); - if (dir.exists()) - { - return dir.absolutePath(); - } - else - { - return QStringLiteral("/usr/share/valentina/tables/standard"); - } - #endif - #endif - } -} - //--------------------------------------------------------------------------------------------------------------------- QString VApplication::translationsPath() const { diff --git a/src/app/core/vapplication.h b/src/app/core/vapplication.h index 93a864d50..b3e944d05 100644 --- a/src/app/core/vapplication.h +++ b/src/app/core/vapplication.h @@ -74,7 +74,6 @@ public: static const qreal PrintDPI; QString translationsPath() const; - QString pathToTables() const; qreal widthMainLine() const; qreal widthHairLine() const; QString VarToUser(const QString &var) const; diff --git a/src/app/core/vsettings.cpp b/src/app/core/vsettings.cpp index 0dd1fa4ec..884695fc2 100644 --- a/src/app/core/vsettings.cpp +++ b/src/app/core/vsettings.cpp @@ -31,6 +31,7 @@ #include #include #include +#include const QString VSettings::SettingConfigurationOsSeparator = QStringLiteral("configuration/osSeparator"); const QString VSettings::SettingConfigurationAutosaveState = QStringLiteral("configuration/autosave/state"); @@ -41,6 +42,7 @@ const QString VSettings::SettingConfigurationUnit = QStringLiteral(" const QString VSettings::SettingConfigurationLabelLanguage = QStringLiteral("configuration/label_language"); const QString VSettings::SettingPathsIndividualMeasurements = QStringLiteral("paths/individual_measurements"); +const QString VSettings::SettingPathsStandardMeasurements = QStringLiteral("paths/standard_measurements"); const QString VSettings::SettingPathsPattern = QStringLiteral("paths/pattern"); const QString VSettings::SettingPathsLayout = QStringLiteral("paths/layout"); @@ -174,6 +176,18 @@ void VSettings::SetPathIndividualMeasurements(const QString &value) setValue(SettingPathsIndividualMeasurements, value); } +//--------------------------------------------------------------------------------------------------------------------- +QString VSettings::GetPathStandardMeasurements() const +{ + return value(SettingPathsStandardMeasurements, StandardTablesPath()).toString(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VSettings::SetPathStandardMeasurements(const QString &value) +{ + setValue(SettingPathsStandardMeasurements, value); +} + //--------------------------------------------------------------------------------------------------------------------- QString VSettings::GetPathPattern() const { @@ -415,3 +429,44 @@ void VSettings::SetUserPassword(const QString &value) { setValue(SettingCommunityUserPassword, value); } + +//--------------------------------------------------------------------------------------------------------------------- +QString VSettings::StandardTablesPath() +{ + const QString stPath = QStringLiteral("/tables/standard"); +#ifdef Q_OS_WIN + return QApplication::applicationDirPath() + stPath; +#elif defined(Q_OS_MAC) + QDir dirBundle(QApplication::applicationDirPath() + QStringLiteral("/../Resources") + stPath); + if (dirBundle.exists()) + { + return dirBundle.absolutePath(); + } + else + { + QDir dir(QApplication::applicationDirPath() + stPath); + if (dir.exists()) + { + return dir.absolutePath(); + } + else + { + return QStringLiteral("/usr/share/valentina/tables/standard"); + } + } +#else // Unix + #ifdef QT_DEBUG + return QApplication::applicationDirPath() + stPath; + #else + QDir dir(QApplication::applicationDirPath() + stPath); + if (dir.exists()) + { + return dir.absolutePath(); + } + else + { + return QStringLiteral("/usr/share/valentina/tables/standard"); + } + #endif +#endif +} diff --git a/src/app/core/vsettings.h b/src/app/core/vsettings.h index cb240b73c..c00fe4b6a 100644 --- a/src/app/core/vsettings.h +++ b/src/app/core/vsettings.h @@ -38,6 +38,8 @@ public: VSettings(Format format, Scope scope, const QString &organization, const QString &application = QString(), QObject *parent = 0); + static QString StandardTablesPath(); + bool GetOsSeparator() const; void SetOsSeparator(const bool &value); @@ -62,6 +64,9 @@ public: QString GetPathIndividualMeasurements() const; void SetPathIndividualMeasurements(const QString &value); + QString GetPathStandardMeasurements() const; + void SetPathStandardMeasurements(const QString &value); + QString GetPathPattern() const; void SetPathPattern(const QString &value); @@ -130,6 +135,7 @@ private: static const QString SettingConfigurationLabelLanguage; static const QString SettingPathsIndividualMeasurements; + static const QString SettingPathsStandardMeasurements; static const QString SettingPathsPattern; static const QString SettingPathsLayout; diff --git a/src/app/dialogs/app/configpages/pathpage.cpp b/src/app/dialogs/app/configpages/pathpage.cpp index fd55446a7..72aab21d6 100644 --- a/src/app/dialogs/app/configpages/pathpage.cpp +++ b/src/app/dialogs/app/configpages/pathpage.cpp @@ -63,8 +63,9 @@ PathPage::PathPage(QWidget *parent) void PathPage::Apply() { qApp->getSettings()->SetPathIndividualMeasurements(pathTable->item(0, 1)->text()); - qApp->getSettings()->SetPathPattern(pathTable->item(1, 1)->text()); - qApp->getSettings()->SetPathLayout(pathTable->item(2, 1)->text()); + qApp->getSettings()->SetPathStandardMeasurements(pathTable->item(1, 1)->text()); + qApp->getSettings()->SetPathPattern(pathTable->item(2, 1)->text()); + qApp->getSettings()->SetPathLayout(pathTable->item(3, 1)->text()); } //--------------------------------------------------------------------------------------------------------------------- @@ -80,24 +81,62 @@ void PathPage::TableActivated() //--------------------------------------------------------------------------------------------------------------------- void PathPage::DefaultPath() { - QTableWidgetItem *item = pathTable->item(pathTable->currentRow(), 1); + const int row = pathTable->currentRow(); + QTableWidgetItem *item = pathTable->item(row, 1); SCASSERT(item != nullptr); - item->setText(QDir::homePath()); + + switch(row) + { + case 1: // standard measurements + item->setText(VSettings::StandardTablesPath()); + item->setToolTip(VSettings::StandardTablesPath()); + break; + case 0: // individual measurements + case 2: // pattern path + case 3: // layout path + item->setText(QDir::homePath()); + item->setToolTip(QDir::homePath()); + break; + default: + break; + } } //--------------------------------------------------------------------------------------------------------------------- void PathPage::EditPath() { - QTableWidgetItem *item = pathTable->item(pathTable->currentRow(), 1); + const int row = pathTable->currentRow(); + QTableWidgetItem *item = pathTable->item(row, 1); SCASSERT(item != nullptr); - QString dir = QFileDialog::getExistingDirectory(this, tr("Open Directory"), QDir::homePath(), + + QString path; + switch(row) + { + case 0: // individual measurements + path = qApp->getSettings()->GetPathIndividualMeasurements(); + break; + case 1: // standard measurements + path = qApp->getSettings()->GetPathStandardMeasurements(); + break; + case 2: // pattern path + path = qApp->getSettings()->GetPathPattern(); + break; + case 3: // layout path + path = qApp->getSettings()->GetPathLayout(); + break; + default: + break; + } + QString dir = QFileDialog::getExistingDirectory(this, tr("Open Directory"), path, QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); if (dir.isEmpty()) { - dir = QDir::homePath(); + DefaultPath(); + return; } item->setText(dir); + item->setToolTip(dir); } //--------------------------------------------------------------------------------------------------------------------- @@ -130,7 +169,7 @@ QGroupBox *PathPage::PathGroup() void PathPage::InitTable() { pathTable = new QTableWidget(); - pathTable->setRowCount(3); + pathTable->setRowCount(4); pathTable->setColumnCount(2); pathTable->verticalHeader()->setVisible(false); pathTable->setEditTriggers(QAbstractItemView::NoEditTriggers); @@ -141,14 +180,33 @@ void PathPage::InitTable() QStringList tableHeader = QStringList() << tr("Type") << tr("Path"); pathTable->setHorizontalHeaderLabels(tableHeader); - pathTable->setItem(0, 0, new QTableWidgetItem(tr("Individual measurements"))); - pathTable->setItem(0, 1, new QTableWidgetItem(qApp->getSettings()->GetPathIndividualMeasurements())); + { + pathTable->setItem(0, 0, new QTableWidgetItem(tr("Individual measurements"))); + QTableWidgetItem *item = new QTableWidgetItem(qApp->getSettings()->GetPathIndividualMeasurements()); + item->setToolTip(qApp->getSettings()->GetPathIndividualMeasurements()); + pathTable->setItem(0, 1, item); + } - pathTable->setItem(1, 0, new QTableWidgetItem(tr("Patterns"))); - pathTable->setItem(1, 1, new QTableWidgetItem(qApp->getSettings()->GetPathPattern())); + { + pathTable->setItem(1, 0, new QTableWidgetItem(tr("Standard measurements"))); + QTableWidgetItem *item = new QTableWidgetItem(qApp->getSettings()->GetPathStandardMeasurements()); + item->setToolTip(qApp->getSettings()->GetPathStandardMeasurements()); + pathTable->setItem(1, 1, item); + } - pathTable->setItem(2, 0, new QTableWidgetItem(tr("Layout"))); - pathTable->setItem(2, 1, new QTableWidgetItem(qApp->getSettings()->GetPathLayout())); + { + pathTable->setItem(2, 0, new QTableWidgetItem(tr("Patterns"))); + QTableWidgetItem *item = new QTableWidgetItem(qApp->getSettings()->GetPathPattern()); + item->setToolTip(qApp->getSettings()->GetPathPattern()); + pathTable->setItem(2, 1, item); + } + + { + pathTable->setItem(3, 0, new QTableWidgetItem(tr("Layout"))); + QTableWidgetItem *item = new QTableWidgetItem(qApp->getSettings()->GetPathLayout()); + item->setToolTip(qApp->getSettings()->GetPathLayout()); + pathTable->setItem(3, 1, item); + } pathTable->verticalHeader()->setDefaultSectionSize(20); pathTable->resizeColumnsToContents(); diff --git a/src/app/dialogs/app/dialogincrements.cpp b/src/app/dialogs/app/dialogincrements.cpp index 055979b35..62f5d47fb 100644 --- a/src/app/dialogs/app/dialogincrements.cpp +++ b/src/app/dialogs/app/dialogincrements.cpp @@ -506,7 +506,7 @@ void DialogIncrements::SaveBirthDate(const QDate & date) //--------------------------------------------------------------------------------------------------------------------- void DialogIncrements::OpenTable() { - QString text = tr("Measurements use different units than pattern. This pattern required measurements in %1") + const QString text = tr("Measurements use different units than pattern. This pattern required measurements in %1") .arg(doc->UnitsToStr(qApp->patternUnit())); if (qApp->patternType() == MeasurementsType::Individual) { @@ -555,7 +555,9 @@ void DialogIncrements::OpenTable() else { const QString filter(tr("Standard measurements (*.vst)")); - const QString filePath = QFileDialog::getOpenFileName(this, tr("Open file"), qApp->pathToTables(), filter); + //Use standard path to standard measurements + const QString path = qApp->getSettings()->GetPathStandardMeasurements(); + const QString filePath = QFileDialog::getOpenFileName(this, tr("Open file"), path, filter); if (filePath.isEmpty()) { return; diff --git a/src/app/dialogs/app/dialogindividualmeasurements.cpp b/src/app/dialogs/app/dialogindividualmeasurements.cpp index 8adcc8649..8fedf9f43 100644 --- a/src/app/dialogs/app/dialogindividualmeasurements.cpp +++ b/src/app/dialogs/app/dialogindividualmeasurements.cpp @@ -98,8 +98,9 @@ void DialogIndividualMeasurements::DialogAccepted() } //just in case - VDomDocument::ValidateXML("://schema/individual_measurements.xsd", qApp->pathToTables()); - QFile iMeasur(qApp->pathToTables()); + const QString path = QStringLiteral("://tables/individual/individual.vit"); + VDomDocument::ValidateXML("://schema/individual_measurements.xsd", path); + QFile iMeasur(path); //TODO maybe make copy save? if ( iMeasur.copy(_tablePath) == false ) { diff --git a/src/app/dialogs/app/dialogstandardmeasurements.cpp b/src/app/dialogs/app/dialogstandardmeasurements.cpp index 356074ed7..f3a8fc4f1 100644 --- a/src/app/dialogs/app/dialogstandardmeasurements.cpp +++ b/src/app/dialogs/app/dialogstandardmeasurements.cpp @@ -33,6 +33,7 @@ #include #include "../../xml/vstandardmeasurements.h" #include "../../core/vapplication.h" +#include "../../core/vsettings.h" #include "../../container/vcontainer.h" #include @@ -149,14 +150,16 @@ void DialogStandardMeasurements::LoadStandardTables() { qCDebug(vStMeasur)<<"Loading standard table."; QStringList filters{"*.vst"}; - QDir tablesDir(qApp->pathToTables()); + //Use standard path to standard measurements + const QString path = qApp->getSettings()->GetPathStandardMeasurements(); + QDir tablesDir(path); tablesDir.setNameFilters(filters); - tablesDir.setCurrent(qApp->pathToTables()); + tablesDir.setCurrent(path); const QStringList allFiles = tablesDir.entryList(QDir::NoDotAndDotDot | QDir::Files); if (allFiles.isEmpty() == true) { - qCDebug(vStMeasur)<<"Can't find standard measurements in path"<pathToTables(); + qCDebug(vStMeasur)<<"Can't find standard measurements in path"<comboBoxTables->clear(); CheckState(); return; diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index 22fa7668c..e13907407 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -2574,15 +2574,21 @@ QString MainWindow::CheckPathToMeasurements(const QString &path, const Measureme else { QString filter; + QString mPath; if (patternType == MeasurementsType::Standard) { filter = tr("Standard measurements (*.vst)"); + //Use standard path to standard measurements + const QString path = qApp->getSettings()->GetPathStandardMeasurements(); + mPath = QFileDialog::getOpenFileName(this, tr("Open file"), path, filter); } else { filter = tr("Individual measurements (*.vit)"); + //Use standard path to individual measurements + const QString path = qApp->getSettings()->GetPathIndividualMeasurements(); + mPath = QFileDialog::getOpenFileName(this, tr("Open file"), path, filter); } - QString mPath = QFileDialog::getOpenFileName(this, tr("Open file"), qApp->pathToTables(), filter); if (mPath.isEmpty()) { From 5dcfa8869129e1323438fdf02d2eeb4321029a1c Mon Sep 17 00:00:00 2001 From: dismine Date: Wed, 28 Jan 2015 17:33:01 +0200 Subject: [PATCH 078/186] Fix for Mac OS. Issue Makefile overriding commands for target "bin/valentina.app/Contents/Frameworks/". --HG-- branch : develop --- src/app/app.pro | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/app/app.pro b/src/app/app.pro index d69191a0a..ac7295cd3 100644 --- a/src/app/app.pro +++ b/src/app/app.pro @@ -306,11 +306,11 @@ unix{ QMAKE_BUNDLE_DATA += TRANSLATION_id_ID } - qmuparser.path = $$FRAMEWORKS_DIR - qmuparser.files = $${OUT_PWD}/../libs/qmuparser/$${DESTDIR}/ - qmuparser.files += $${OUT_PWD}/../libs/qmuparser/$${DESTDIR}/libqmuparser.2.dylib - vpropertyexplorer.path = $$FRAMEWORKS_DIR - vpropertyexplorer.files = $${OUT_PWD}/../libs/vpropertyexplorer/$${DESTDIR}/ + # Symlinks also good names for copying. Make will take origin file and copy them with using symlink name. + # For bundle this names more then enough. We don't need care much about libraries versions. + libraries.path = $$FRAMEWORKS_DIR + libraries.files += $${OUT_PWD}/../libs/qmuparser/$${DESTDIR}/libqmuparser.2.dylib + libraries.files = $${OUT_PWD}/../libs/vpropertyexplorer/$${DESTDIR}/libvpropertyexplorer.1.dylib # logo on macx. @@ -322,9 +322,7 @@ unix{ QMAKE_BUNDLE_DATA += \ standard \ - qmuparser \ - vpropertyexplorer - + libraries } } From 1b6408c1449320674c21aad2eaa23b6bbaea8225 Mon Sep 17 00:00:00 2001 From: dismine Date: Thu, 29 Jan 2015 17:47:02 +0200 Subject: [PATCH 079/186] Fixed issue #171. QComboBox to show Qt::PenStyle. --HG-- branch : develop --- src/app/dialogs/tools/dialogalongline.cpp | 6 +- src/app/dialogs/tools/dialogalongline.ui | 18 ++ src/app/dialogs/tools/dialogbisector.cpp | 6 +- src/app/dialogs/tools/dialogbisector.ui | 18 ++ .../tools/dialogcurveintersectaxis.cpp | 6 +- .../dialogs/tools/dialogcurveintersectaxis.ui | 18 ++ src/app/dialogs/tools/dialogendline.cpp | 6 +- src/app/dialogs/tools/dialogendline.ui | 18 ++ src/app/dialogs/tools/dialogheight.cpp | 6 +- src/app/dialogs/tools/dialogheight.ui | 18 ++ src/app/dialogs/tools/dialogline.cpp | 9 +- src/app/dialogs/tools/dialogline.ui | 14 +- .../dialogs/tools/dialoglineintersectaxis.cpp | 6 +- .../dialogs/tools/dialoglineintersectaxis.ui | 18 ++ src/app/dialogs/tools/dialognormal.cpp | 6 +- src/app/dialogs/tools/dialognormal.ui | 18 ++ src/app/dialogs/tools/dialogpointofcontact.ui | 14 +- src/app/dialogs/tools/dialogshoulderpoint.cpp | 6 +- src/app/dialogs/tools/dialogshoulderpoint.ui | 18 ++ src/app/dialogs/tools/dialogtool.cpp | 46 ++--- src/app/dialogs/tools/dialogtool.h | 4 +- src/app/tools/drawTools/vtoolalongline.cpp | 4 +- src/app/tools/drawTools/vtoolbisector.cpp | 4 +- .../drawTools/vtoolcurveintersectaxis.cpp | 4 +- src/app/tools/drawTools/vtoolendline.cpp | 4 +- src/app/tools/drawTools/vtoolheight.cpp | 4 +- src/app/tools/drawTools/vtoolline.cpp | 14 +- .../drawTools/vtoollineintersectaxis.cpp | 4 +- src/app/tools/drawTools/vtoollinepoint.cpp | 6 +- src/app/tools/drawTools/vtoolnormal.cpp | 4 +- .../tools/drawTools/vtoolshoulderpoint.cpp | 4 +- src/app/tools/vabstracttool.cpp | 30 ++- src/app/tools/vabstracttool.h | 8 +- .../widgets/vtooloptionspropertybrowser.cpp | 57 +++--- src/app/widgets/vtooloptionspropertybrowser.h | 2 +- .../vpropertyexplorer/plugins/venumproperty.h | 2 +- .../plugins/vlinetypeproperty.cpp | 171 ++++++++++++++++++ .../plugins/vlinetypeproperty.h | 101 +++++++++++ src/libs/vpropertyexplorer/vproperties.h | 1 + .../vpropertyexplorer/vpropertyexplorer.pri | 6 +- 40 files changed, 582 insertions(+), 127 deletions(-) create mode 100644 src/libs/vpropertyexplorer/plugins/vlinetypeproperty.cpp create mode 100644 src/libs/vpropertyexplorer/plugins/vlinetypeproperty.h diff --git a/src/app/dialogs/tools/dialogalongline.cpp b/src/app/dialogs/tools/dialogalongline.cpp index b818b2744..dbf57e8b6 100644 --- a/src/app/dialogs/tools/dialogalongline.cpp +++ b/src/app/dialogs/tools/dialogalongline.cpp @@ -60,7 +60,7 @@ DialogAlongLine::DialogAlongLine(const VContainer *data, const quint32 &toolId, FillComboBoxPoints(ui->comboBoxFirstPoint); FillComboBoxPoints(ui->comboBoxSecondPoint); - FillComboBoxTypeLine(ui->comboBoxLineType); + FillComboBoxTypeLine(ui->comboBoxLineType, VAbstractTool::LineStylesPics()); ui->comboBoxLineType->setCurrentIndex(0); connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogAlongLine::PutHere); @@ -189,7 +189,7 @@ void DialogAlongLine::SaveData() line->setPoint1Id(firstPointId); line->setPoint2Id(secondPointId); line->setLength(formula); - line->setLineStyle(VAbstractTool::LineStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); line->RefreshGeometry(); } @@ -249,7 +249,7 @@ void DialogAlongLine::setTypeLine(const QString &value) { typeLine = value; SetupTypeLine(ui->comboBoxLineType, value); - line->setLineStyle(VAbstractTool::LineStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogalongline.ui b/src/app/dialogs/tools/dialogalongline.ui index ccefaa068..a2e13e7e6 100644 --- a/src/app/dialogs/tools/dialogalongline.ui +++ b/src/app/dialogs/tools/dialogalongline.ui @@ -276,9 +276,27 @@ 0 + + + 80 + 0 + + + + + 110 + 16777215 + + Show line from first point to this point + + + 80 + 14 + + diff --git a/src/app/dialogs/tools/dialogbisector.cpp b/src/app/dialogs/tools/dialogbisector.cpp index 791ca123c..90c4449ed 100644 --- a/src/app/dialogs/tools/dialogbisector.cpp +++ b/src/app/dialogs/tools/dialogbisector.cpp @@ -60,7 +60,7 @@ DialogBisector::DialogBisector(const VContainer *data, const quint32 &toolId, QW FillComboBoxPoints(ui->comboBoxFirstPoint); FillComboBoxPoints(ui->comboBoxSecondPoint); - FillComboBoxTypeLine(ui->comboBoxLineType); + FillComboBoxTypeLine(ui->comboBoxLineType, VAbstractTool::LineStylesPics()); FillComboBoxPoints(ui->comboBoxThirdPoint); connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogBisector::PutHere); @@ -218,7 +218,7 @@ void DialogBisector::setTypeLine(const QString &value) { typeLine = value; SetupTypeLine(ui->comboBoxLineType, value); - line->setLineStyle(VAbstractTool::LineStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); } //--------------------------------------------------------------------------------------------------------------------- @@ -287,7 +287,7 @@ void DialogBisector::SaveData() line->setPoint2Id(secondPointId); line->setPoint3Id(thirdPointId); line->setLength(formula); - line->setLineStyle(VAbstractTool::LineStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); line->RefreshGeometry(); } diff --git a/src/app/dialogs/tools/dialogbisector.ui b/src/app/dialogs/tools/dialogbisector.ui index 3f81fc51f..c4ad6001a 100644 --- a/src/app/dialogs/tools/dialogbisector.ui +++ b/src/app/dialogs/tools/dialogbisector.ui @@ -302,9 +302,27 @@ + + + 80 + 0 + + + + + 110 + 16777215 + + Show line from second point to this point + + + 80 + 14 + + diff --git a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp b/src/app/dialogs/tools/dialogcurveintersectaxis.cpp index 17c5f87bd..43eefe4a4 100644 --- a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp +++ b/src/app/dialogs/tools/dialogcurveintersectaxis.cpp @@ -56,7 +56,7 @@ DialogCurveIntersectAxis::DialogCurveIntersectAxis(const VContainer *data, const FillComboBoxPoints(ui->comboBoxAxisPoint); FillComboBoxCurves(ui->comboBoxCurve); - FillComboBoxTypeLine(ui->comboBoxLineType); + FillComboBoxTypeLine(ui->comboBoxLineType, VAbstractTool::LineStylesPics()); connect(ui->toolButtonPutHereAngle, &QPushButton::clicked, this, &DialogCurveIntersectAxis::PutAngle); connect(listWidget, &QListWidget::itemDoubleClicked, this, &DialogCurveIntersectAxis::PutVal); @@ -103,7 +103,7 @@ void DialogCurveIntersectAxis::setTypeLine(const QString &value) { typeLine = value; SetupTypeLine(ui->comboBoxLineType, value); - line->setLineStyle(VAbstractTool::LineStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); } //--------------------------------------------------------------------------------------------------------------------- @@ -269,7 +269,7 @@ void DialogCurveIntersectAxis::SaveData() line->setPoint1Id(curveId); line->setAxisPointId(basePointId); line->setAngle(formulaAngle); - line->setLineStyle(VAbstractTool::LineStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); line->RefreshGeometry(); } diff --git a/src/app/dialogs/tools/dialogcurveintersectaxis.ui b/src/app/dialogs/tools/dialogcurveintersectaxis.ui index 4fe305a4f..39a9ccba9 100644 --- a/src/app/dialogs/tools/dialogcurveintersectaxis.ui +++ b/src/app/dialogs/tools/dialogcurveintersectaxis.ui @@ -285,9 +285,27 @@ + + + 80 + 0 + + + + + 110 + 16777215 + + Show line from first point to this point + + + 80 + 14 + + diff --git a/src/app/dialogs/tools/dialogendline.cpp b/src/app/dialogs/tools/dialogendline.cpp index 8da548990..e450a5659 100644 --- a/src/app/dialogs/tools/dialogendline.cpp +++ b/src/app/dialogs/tools/dialogendline.cpp @@ -63,7 +63,7 @@ DialogEndLine::DialogEndLine(const VContainer *data, const quint32 &toolId, QWid CheckState(); FillComboBoxPoints(ui->comboBoxBasePoint); - FillComboBoxTypeLine(ui->comboBoxLineType); + FillComboBoxTypeLine(ui->comboBoxLineType, VAbstractTool::LineStylesPics()); connect(ui->toolButtonPutHereLength, &QPushButton::clicked, this, &DialogEndLine::PutHere); connect(ui->toolButtonPutHereAngle, &QPushButton::clicked, this, &DialogEndLine::PutAngle); @@ -173,7 +173,7 @@ void DialogEndLine::setTypeLine(const QString &value) { typeLine = value; SetupTypeLine(ui->comboBoxLineType, value); - line->setLineStyle(VAbstractTool::LineStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); } //--------------------------------------------------------------------------------------------------------------------- @@ -287,7 +287,7 @@ void DialogEndLine::SaveData() line->setPoint1Id(basePointId); line->setLength(formulaLength); line->setAngle(formulaAngle); - line->setLineStyle(VAbstractTool::LineStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); line->RefreshGeometry(); } diff --git a/src/app/dialogs/tools/dialogendline.ui b/src/app/dialogs/tools/dialogendline.ui index a34de47cc..a5e8259f5 100644 --- a/src/app/dialogs/tools/dialogendline.ui +++ b/src/app/dialogs/tools/dialogendline.ui @@ -454,9 +454,27 @@ + + + 80 + 0 + + + + + 110 + 16777215 + + Show line from first point to this point + + + 80 + 14 + + diff --git a/src/app/dialogs/tools/dialogheight.cpp b/src/app/dialogs/tools/dialogheight.cpp index 573906e79..b4f80756a 100644 --- a/src/app/dialogs/tools/dialogheight.cpp +++ b/src/app/dialogs/tools/dialogheight.cpp @@ -54,7 +54,7 @@ DialogHeight::DialogHeight(const VContainer *data, const quint32 &toolId, QWidge FillComboBoxPoints(ui->comboBoxBasePoint); FillComboBoxPoints(ui->comboBoxP1Line); FillComboBoxPoints(ui->comboBoxP2Line); - FillComboBoxTypeLine(ui->comboBoxLineType); + FillComboBoxTypeLine(ui->comboBoxLineType, VAbstractTool::LineStylesPics()); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogHeight::NamePointChanged); connect(ui->comboBoxBasePoint, static_cast(&QComboBox::currentIndexChanged), this, &DialogHeight::PointNameChanged); @@ -96,7 +96,7 @@ void DialogHeight::setTypeLine(const QString &value) { typeLine = value; SetupTypeLine(ui->comboBoxLineType, value); - line->setLineStyle(VAbstractTool::LineStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); } //--------------------------------------------------------------------------------------------------------------------- @@ -203,7 +203,7 @@ void DialogHeight::SaveData() line->setPoint1Id(basePointId); line->setLineP1Id(p1LineId); line->setLineP2Id(p2LineId); - line->setLineStyle(VAbstractTool::LineStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); line->RefreshGeometry(); } diff --git a/src/app/dialogs/tools/dialogheight.ui b/src/app/dialogs/tools/dialogheight.ui index be8edb8cf..4338c7de7 100644 --- a/src/app/dialogs/tools/dialogheight.ui +++ b/src/app/dialogs/tools/dialogheight.ui @@ -111,9 +111,27 @@ + + + 80 + 0 + + + + + 110 + 16777215 + + Show line from first point to our point + + + 80 + 14 + + diff --git a/src/app/dialogs/tools/dialogline.cpp b/src/app/dialogs/tools/dialogline.cpp index 287055246..1e62d1290 100644 --- a/src/app/dialogs/tools/dialogline.cpp +++ b/src/app/dialogs/tools/dialogline.cpp @@ -51,7 +51,10 @@ DialogLine::DialogLine(const VContainer *data, const quint32 &toolId, QWidget *p FillComboBoxPoints(ui->comboBoxFirstPoint); FillComboBoxPoints(ui->comboBoxSecondPoint); - FillComboBoxTypeLine(ui->comboBoxLineType); + + QMap stylesPics = VAbstractTool::LineStylesPics(); + stylesPics.remove(VAbstractTool::TypeLineNone);// Prevent hiding line + FillComboBoxTypeLine(ui->comboBoxLineType, stylesPics); number = 0; @@ -93,7 +96,7 @@ void DialogLine::setTypeLine(const QString &value) { typeLine = value; SetupTypeLine(ui->comboBoxLineType, value); - line->setLineStyle(VAbstractTool::LineStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); } //--------------------------------------------------------------------------------------------------------------------- @@ -158,7 +161,7 @@ void DialogLine::SaveData() line->setPoint1Id(firstPoint); line->setPoint2Id(secondPoint); - line->setLineStyle(VAbstractTool::LineStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); line->RefreshGeometry(); } diff --git a/src/app/dialogs/tools/dialogline.ui b/src/app/dialogs/tools/dialogline.ui index b02ea2911..50dc4afe7 100644 --- a/src/app/dialogs/tools/dialogline.ui +++ b/src/app/dialogs/tools/dialogline.ui @@ -122,13 +122,25 @@ - 0 + 80 0 + + + 110 + 16777215 + + Show line from first point to this point + + + 80 + 14 + + diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.cpp b/src/app/dialogs/tools/dialoglineintersectaxis.cpp index 7264e2a31..a7b77c1b1 100644 --- a/src/app/dialogs/tools/dialoglineintersectaxis.cpp +++ b/src/app/dialogs/tools/dialoglineintersectaxis.cpp @@ -57,7 +57,7 @@ DialogLineIntersectAxis::DialogLineIntersectAxis(const VContainer *data, const q FillComboBoxPoints(ui->comboBoxAxisPoint); FillComboBoxPoints(ui->comboBoxFirstLinePoint); FillComboBoxPoints(ui->comboBoxSecondLinePoint); - FillComboBoxTypeLine(ui->comboBoxLineType); + FillComboBoxTypeLine(ui->comboBoxLineType, VAbstractTool::LineStylesPics()); connect(ui->toolButtonPutHereAngle, &QPushButton::clicked, this, &DialogLineIntersectAxis::PutAngle); connect(listWidget, &QListWidget::itemDoubleClicked, this, &DialogLineIntersectAxis::PutVal); @@ -112,7 +112,7 @@ void DialogLineIntersectAxis::setTypeLine(const QString &value) { typeLine = value; SetupTypeLine(ui->comboBoxLineType, value); - line->setLineStyle(VAbstractTool::LineStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); } //--------------------------------------------------------------------------------------------------------------------- @@ -336,7 +336,7 @@ void DialogLineIntersectAxis::SaveData() line->setPoint2Id(secondPointId); line->setAxisPointId(basePointId); line->setAngle(formulaAngle); - line->setLineStyle(VAbstractTool::LineStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); line->RefreshGeometry(); } diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.ui b/src/app/dialogs/tools/dialoglineintersectaxis.ui index 31909167f..2ad7bac18 100644 --- a/src/app/dialogs/tools/dialoglineintersectaxis.ui +++ b/src/app/dialogs/tools/dialoglineintersectaxis.ui @@ -302,9 +302,27 @@ + + + 80 + 0 + + + + + 110 + 16777215 + + Show line from first point to this point + + + 80 + 14 + + diff --git a/src/app/dialogs/tools/dialognormal.cpp b/src/app/dialogs/tools/dialognormal.cpp index 2901361aa..1461259cd 100644 --- a/src/app/dialogs/tools/dialognormal.cpp +++ b/src/app/dialogs/tools/dialognormal.cpp @@ -56,7 +56,7 @@ DialogNormal::DialogNormal(const VContainer *data, const quint32 &toolId, QWidge FillComboBoxPoints(ui->comboBoxFirstPoint); FillComboBoxPoints(ui->comboBoxSecondPoint); - FillComboBoxTypeLine(ui->comboBoxLineType); + FillComboBoxTypeLine(ui->comboBoxLineType, VAbstractTool::LineStylesPics()); InitArrow(ui); @@ -183,7 +183,7 @@ void DialogNormal::SaveData() line->setPoint2Id(secondPointId); line->setLength(formula); line->setAngle(angle); - line->setLineStyle(VAbstractTool::LineStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); line->RefreshGeometry(); } @@ -255,7 +255,7 @@ void DialogNormal::setTypeLine(const QString &value) { typeLine = value; SetupTypeLine(ui->comboBoxLineType, value); - line->setLineStyle(VAbstractTool::LineStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialognormal.ui b/src/app/dialogs/tools/dialognormal.ui index 492531abe..959714a6d 100644 --- a/src/app/dialogs/tools/dialognormal.ui +++ b/src/app/dialogs/tools/dialognormal.ui @@ -483,9 +483,27 @@ + + + 80 + 0 + + + + + 110 + 16777215 + + Show line from first point to this point + + + 80 + 14 + + diff --git a/src/app/dialogs/tools/dialogpointofcontact.ui b/src/app/dialogs/tools/dialogpointofcontact.ui index 5d9d5101d..3b5b1c350 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.ui +++ b/src/app/dialogs/tools/dialogpointofcontact.ui @@ -317,10 +317,22 @@ - 145 + 80 0 + + + 110 + 16777215 + + + + + 80 + 14 + + diff --git a/src/app/dialogs/tools/dialogshoulderpoint.cpp b/src/app/dialogs/tools/dialogshoulderpoint.cpp index d2c5d4521..1ef046f91 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.cpp +++ b/src/app/dialogs/tools/dialogshoulderpoint.cpp @@ -58,7 +58,7 @@ DialogShoulderPoint::DialogShoulderPoint(const VContainer *data, const quint32 & flagFormula = false; CheckState(); - FillComboBoxTypeLine(ui->comboBoxLineType); + FillComboBoxTypeLine(ui->comboBoxLineType, VAbstractTool::LineStylesPics()); FillComboBoxPoints(ui->comboBoxP1Line); FillComboBoxPoints(ui->comboBoxP2Line); FillComboBoxPoints(ui->comboBoxP3); @@ -212,7 +212,7 @@ void DialogShoulderPoint::SaveData() line->setLineP1Id(p1Line); line->setLineP2Id(p2Line); line->setLength(formula); - line->setLineStyle(VAbstractTool::LineStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); line->RefreshGeometry(); } @@ -283,7 +283,7 @@ void DialogShoulderPoint::setTypeLine(const QString &value) { typeLine = value; SetupTypeLine(ui->comboBoxLineType, value); - line->setLineStyle(VAbstractTool::LineStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogshoulderpoint.ui b/src/app/dialogs/tools/dialogshoulderpoint.ui index 996d5cbee..8c306b556 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.ui +++ b/src/app/dialogs/tools/dialogshoulderpoint.ui @@ -341,9 +341,27 @@ 0 + + + 80 + 0 + + + + + 110 + 16777215 + + Show line from first point to our point + + + 80 + 14 + + diff --git a/src/app/dialogs/tools/dialogtool.cpp b/src/app/dialogs/tools/dialogtool.cpp index 2a0c7ae72..872a12c20 100644 --- a/src/app/dialogs/tools/dialogtool.cpp +++ b/src/app/dialogs/tools/dialogtool.cpp @@ -66,7 +66,7 @@ DialogTool::DialogTool(const VContainer *data, const quint32 &toolId, QWidget *p labelEditFormula(nullptr), radioButtonSizeGrowth(nullptr), radioButtonStandardTable(nullptr), radioButtonIncrements(nullptr), radioButtonLengthLine(nullptr), radioButtonLengthArc(nullptr), radioButtonLengthCurve(nullptr), radioButtonAngleLine(nullptr), checkBoxHideEmpty(nullptr), - lineStyles(VAbstractTool::Styles()), okColor(QColor(76, 76, 76)), errorColor(Qt::red), associatedTool(nullptr), + okColor(QColor(76, 76, 76)), errorColor(Qt::red), associatedTool(nullptr), toolId(toolId), prepare(false), pointName(QString()) { SCASSERT(data != nullptr); @@ -288,10 +288,16 @@ void DialogTool::FillComboBoxCurves(QComboBox *box) const * @brief FillComboBoxTypeLine fill comboBox list of type lines * @param box comboBox */ -void DialogTool::FillComboBoxTypeLine(QComboBox *box) const +void DialogTool::FillComboBoxTypeLine(QComboBox *box, const QMap &stylesPics) const { SCASSERT(box != nullptr); - box->addItems(lineStyles); + QMap::const_iterator i = stylesPics.constBegin(); + while (i != stylesPics.constEnd()) + { + box->addItem(i.value(), "", QVariant(i.key())); + ++i; + } + box->setCurrentIndex(1); } @@ -303,30 +309,13 @@ void DialogTool::FillComboBoxTypeLine(QComboBox *box) const */ QString DialogTool::GetTypeLine(const QComboBox *box) const { - switch (lineStyles.indexOf(box->currentText())) + SCASSERT(box != nullptr) + QString value = box->currentData().toString(); + if (value.isEmpty()) { - case 0: //No line - return VAbstractTool::TypeLineNone; - break; - case 1: //Line - return VAbstractTool::TypeLineLine; - break; - case 2: //Dash Line - return VAbstractTool::TypeLineDashLine; - break; - case 3: //Dot Line - return VAbstractTool::TypeLineDotLine; - break; - case 4: //Dash Dot Line - return VAbstractTool::TypeLineDashDotLine; - break; - case 5: //Dash Dot Dot Line - return VAbstractTool::TypeLineDashDotDotLine; - break; - default: - return VAbstractTool::TypeLineLine; - break; + value = VAbstractTool::TypeLineLine; } + return value; } //--------------------------------------------------------------------------------------------------------------------- @@ -337,8 +326,8 @@ QString DialogTool::GetTypeLine(const QComboBox *box) const */ void DialogTool::SetupTypeLine(QComboBox *box, const QString &value) { - QStringList styles = VAbstractTool::Styles(); - qint32 index = box->findText(lineStyles.at(styles.indexOf(value))); + SCASSERT(box != nullptr) + const qint32 index = box->findData(value); if (index != -1) { box->setCurrentIndex(index); @@ -353,7 +342,8 @@ void DialogTool::SetupTypeLine(QComboBox *box, const QString &value) */ void DialogTool::ChangeCurrentData(QComboBox *box, const quint32 &value) const { - qint32 index = box->findData(value); + SCASSERT(box != nullptr) + const qint32 index = box->findData(value); if (index != -1) { box->setCurrentIndex(index); diff --git a/src/app/dialogs/tools/dialogtool.h b/src/app/dialogs/tools/dialogtool.h index 7bb48c2e3..7366a862e 100644 --- a/src/app/dialogs/tools/dialogtool.h +++ b/src/app/dialogs/tools/dialogtool.h @@ -193,8 +193,6 @@ protected: QCheckBox *checkBoxHideEmpty; - /** @brief lineStyles list supported line styles. */ - QStringList lineStyles; const QColor okColor; const QColor errorColor; /** @@ -217,7 +215,7 @@ protected: void FillComboBoxSplinesPath(QComboBox *box, ComboBoxCutSpline cut = ComboBoxCutSpline::NoCutSpline)const; void FillComboBoxCurves(QComboBox *box)const; - void FillComboBoxTypeLine(QComboBox *box) const; + void FillComboBoxTypeLine(QComboBox *box, const QMap &stylesPics) const; virtual void CheckState(); QString GetTypeLine(const QComboBox *box)const; template diff --git a/src/app/tools/drawTools/vtoolalongline.cpp b/src/app/tools/drawTools/vtoolalongline.cpp index 597618386..442e8d69a 100644 --- a/src/app/tools/drawTools/vtoolalongline.cpp +++ b/src/app/tools/drawTools/vtoolalongline.cpp @@ -87,7 +87,7 @@ void VToolAlongLine::FullUpdateFromFile() visual->setPoint1Id(basePointId); visual->setPoint2Id(secondPointId); visual->setLength(qApp->FormulaToUser(formulaLength)); - visual->setLineStyle(VAbstractTool::LineStyle(typeLine)); + visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); } } @@ -201,7 +201,7 @@ void VToolAlongLine::ShowVisualization(bool show) visual->setPoint1Id(basePointId); visual->setPoint2Id(secondPointId); visual->setLength(qApp->FormulaToUser(formulaLength)); - visual->setLineStyle(VAbstractTool::LineStyle(typeLine)); + visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); vis = visual; } diff --git a/src/app/tools/drawTools/vtoolbisector.cpp b/src/app/tools/drawTools/vtoolbisector.cpp index 3a4eefa53..96b42eadc 100644 --- a/src/app/tools/drawTools/vtoolbisector.cpp +++ b/src/app/tools/drawTools/vtoolbisector.cpp @@ -239,7 +239,7 @@ void VToolBisector::FullUpdateFromFile() visual->setPoint2Id(basePointId); visual->setPoint3Id(thirdPointId); visual->setLength(qApp->FormulaToUser(formulaLength)); - visual->setLineStyle(VAbstractTool::LineStyle(typeLine)); + visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); } } @@ -356,7 +356,7 @@ void VToolBisector::ShowVisualization(bool show) visual->setPoint2Id(basePointId); visual->setPoint3Id(thirdPointId); visual->setLength(qApp->FormulaToUser(formulaLength)); - visual->setLineStyle(VAbstractTool::LineStyle(typeLine)); + visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); vis = visual; } diff --git a/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp b/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp index ad60c3af9..3aa46c33f 100644 --- a/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp +++ b/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp @@ -227,7 +227,7 @@ void VToolCurveIntersectAxis::ShowVisualization(bool show) visual->setPoint1Id(curveId); visual->setAxisPointId(basePointId); visual->setAngle(qApp->FormulaToUser(formulaAngle)); - visual->setLineStyle(VAbstractTool::LineStyle(typeLine)); + visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); vis = visual; } @@ -266,7 +266,7 @@ void VToolCurveIntersectAxis::FullUpdateFromFile() visual->setPoint1Id(curveId); visual->setAxisPointId(basePointId); visual->setAngle(qApp->FormulaToUser(formulaAngle)); - visual->setLineStyle(VAbstractTool::LineStyle(typeLine)); + visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); } } diff --git a/src/app/tools/drawTools/vtoolendline.cpp b/src/app/tools/drawTools/vtoolendline.cpp index 4a41806f3..3bc0fc2f8 100644 --- a/src/app/tools/drawTools/vtoolendline.cpp +++ b/src/app/tools/drawTools/vtoolendline.cpp @@ -197,7 +197,7 @@ void VToolEndLine::FullUpdateFromFile() visual->setPoint1Id(basePointId); visual->setLength(qApp->FormulaToUser(formulaLength)); visual->setAngle(qApp->FormulaToUser(formulaAngle)); - visual->setLineStyle(VAbstractTool::LineStyle(typeLine)); + visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); } } @@ -293,7 +293,7 @@ void VToolEndLine::ShowVisualization(bool show) visual->setPoint1Id(basePointId); visual->setLength(qApp->FormulaToUser(formulaLength)); visual->setAngle(qApp->FormulaToUser(formulaAngle)); - visual->setLineStyle(VAbstractTool::LineStyle(typeLine)); + visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); vis = visual; } diff --git a/src/app/tools/drawTools/vtoolheight.cpp b/src/app/tools/drawTools/vtoolheight.cpp index 25ea2a864..fd878a4ee 100644 --- a/src/app/tools/drawTools/vtoolheight.cpp +++ b/src/app/tools/drawTools/vtoolheight.cpp @@ -209,7 +209,7 @@ void VToolHeight::FullUpdateFromFile() visual->setPoint1Id(basePointId); visual->setLineP1Id(p1LineId); visual->setLineP2Id(p2LineId); - visual->setLineStyle(VAbstractTool::LineStyle(typeLine)); + visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); } } @@ -301,7 +301,7 @@ void VToolHeight::ShowVisualization(bool show) visual->setPoint1Id(basePointId); visual->setLineP1Id(p1LineId); visual->setLineP2Id(p2LineId); - visual->setLineStyle(VAbstractTool::LineStyle(typeLine)); + visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); vis = visual; } diff --git a/src/app/tools/drawTools/vtoolline.cpp b/src/app/tools/drawTools/vtoolline.cpp index ec85c2b29..a38daf2d5 100644 --- a/src/app/tools/drawTools/vtoolline.cpp +++ b/src/app/tools/drawTools/vtoolline.cpp @@ -61,7 +61,7 @@ VToolLine::VToolLine(VPattern *doc, VContainer *data, quint32 id, quint32 firstP this->setFlag(QGraphicsItem::ItemIsSelectable, true); this->setFlag(QGraphicsItem::ItemIsFocusable, true); this->setAcceptHoverEvents(true); - this->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine())/factor, LineStyle(typeLine))); + this->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine())/factor, LineStyleToPenStyle(typeLine))); if (typeCreation == Source::FromGui) { @@ -196,7 +196,7 @@ void VToolLine::FullUpdateFromFile() VisToolLine *visual = qobject_cast(vis); visual->setPoint1Id(firstPoint); visual->setPoint2Id(secondPoint); - visual->setLineStyle(VAbstractTool::LineStyle(typeLine)); + visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); } } @@ -239,7 +239,7 @@ void VToolLine::ChangedActivDraw(const QString &newName) { VDrawTool::ChangedActivDraw(newName); this->setEnabled(nameActivDraw == newName); - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor, LineStyle(typeLine))); + this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor, LineStyleToPenStyle(typeLine))); } //--------------------------------------------------------------------------------------------------------------------- @@ -290,7 +290,7 @@ void VToolLine::RefreshDataInFile() void VToolLine::hoverEnterEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthMainLine())/factor, LineStyle(typeLine))); + this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthMainLine())/factor, LineStyleToPenStyle(typeLine))); } //--------------------------------------------------------------------------------------------------------------------- @@ -301,7 +301,7 @@ void VToolLine::hoverEnterEvent(QGraphicsSceneHoverEvent *event) void VToolLine::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor, LineStyle(typeLine))); + this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor, LineStyleToPenStyle(typeLine))); } //--------------------------------------------------------------------------------------------------------------------- @@ -414,7 +414,7 @@ void VToolLine::ShowVisualization(bool show) visual->setPoint1Id(firstPoint); visual->setPoint2Id(secondPoint); - visual->setLineStyle(VAbstractTool::LineStyle(typeLine)); + visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); vis = visual; } @@ -477,5 +477,5 @@ void VToolLine::RefreshGeometry() const QSharedPointer first = VAbstractTool::data.GeometricObject(firstPoint); const QSharedPointer second = VAbstractTool::data.GeometricObject(secondPoint); this->setLine(QLineF(first->toQPointF(), second->toQPointF())); - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor, LineStyle(typeLine))); + this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor, LineStyleToPenStyle(typeLine))); } diff --git a/src/app/tools/drawTools/vtoollineintersectaxis.cpp b/src/app/tools/drawTools/vtoollineintersectaxis.cpp index c9f28c18e..53f88fb5a 100644 --- a/src/app/tools/drawTools/vtoollineintersectaxis.cpp +++ b/src/app/tools/drawTools/vtoollineintersectaxis.cpp @@ -243,7 +243,7 @@ void VToolLineIntersectAxis::ShowVisualization(bool show) visual->setPoint2Id(secondPointId); visual->setAxisPointId(basePointId); visual->setAngle(qApp->FormulaToUser(formulaAngle)); - visual->setLineStyle(VAbstractTool::LineStyle(typeLine)); + visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); vis = visual; } @@ -284,7 +284,7 @@ void VToolLineIntersectAxis::FullUpdateFromFile() visual->setPoint2Id(secondPointId); visual->setAxisPointId(basePointId); visual->setAngle(qApp->FormulaToUser(formulaAngle)); - visual->setLineStyle(VAbstractTool::LineStyle(typeLine)); + visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); } } diff --git a/src/app/tools/drawTools/vtoollinepoint.cpp b/src/app/tools/drawTools/vtoollinepoint.cpp index 67983917c..1213c85ca 100644 --- a/src/app/tools/drawTools/vtoollinepoint.cpp +++ b/src/app/tools/drawTools/vtoollinepoint.cpp @@ -52,7 +52,7 @@ VToolLinePoint::VToolLinePoint(VPattern *doc, VContainer *data, const quint32 &i QPointF point1 = data->GeometricObject(basePointId)->toQPointF(); QPointF point2 = data->GeometricObject(id)->toQPointF(); mainLine = new QGraphicsLineItem(QLineF(point1 - point2, QPointF()), this); - mainLine->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine())/factor, LineStyle(typeLine))); + mainLine->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine())/factor, LineStyleToPenStyle(typeLine))); mainLine->setFlag(QGraphicsItem::ItemStacksBehindParent, true); } @@ -71,7 +71,7 @@ void VToolLinePoint::ChangedActivDraw(const QString &newName) { VToolPoint::ChangedActivDraw(newName); this->setEnabled(nameActivDraw == newName); - mainLine->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor, LineStyle(typeLine))); + mainLine->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor, LineStyleToPenStyle(typeLine))); } //--------------------------------------------------------------------------------------------------------------------- @@ -80,7 +80,7 @@ void VToolLinePoint::ChangedActivDraw(const QString &newName) */ void VToolLinePoint::RefreshGeometry() { - mainLine->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor, LineStyle(typeLine))); + mainLine->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor, LineStyleToPenStyle(typeLine))); VToolPoint::RefreshPointGeometry(*VDrawTool::data.GeometricObject(id)); QPointF point = VDrawTool::data.GeometricObject(id)->toQPointF(); QPointF basePoint = VDrawTool::data.GeometricObject(basePointId)->toQPointF(); diff --git a/src/app/tools/drawTools/vtoolnormal.cpp b/src/app/tools/drawTools/vtoolnormal.cpp index abf347a7f..c4d9f9268 100644 --- a/src/app/tools/drawTools/vtoolnormal.cpp +++ b/src/app/tools/drawTools/vtoolnormal.cpp @@ -218,7 +218,7 @@ void VToolNormal::FullUpdateFromFile() visual->setPoint2Id(secondPointId); visual->setLength(qApp->FormulaToUser(formulaLength)); visual->setAngle(angle); - visual->setLineStyle(VAbstractTool::LineStyle(typeLine)); + visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); } } @@ -334,7 +334,7 @@ void VToolNormal::ShowVisualization(bool show) visual->setPoint2Id(secondPointId); visual->setLength(qApp->FormulaToUser(formulaLength)); visual->setAngle(angle); - visual->setLineStyle(VAbstractTool::LineStyle(typeLine)); + visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); vis = visual; } diff --git a/src/app/tools/drawTools/vtoolshoulderpoint.cpp b/src/app/tools/drawTools/vtoolshoulderpoint.cpp index 33d29bae5..312aa5d9d 100644 --- a/src/app/tools/drawTools/vtoolshoulderpoint.cpp +++ b/src/app/tools/drawTools/vtoolshoulderpoint.cpp @@ -243,7 +243,7 @@ void VToolShoulderPoint::FullUpdateFromFile() visual->setLineP1Id(basePointId); visual->setLineP2Id(p2Line); visual->setLength(qApp->FormulaToUser(formulaLength)); - visual->setLineStyle(VAbstractTool::LineStyle(typeLine)); + visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); } } @@ -360,7 +360,7 @@ void VToolShoulderPoint::ShowVisualization(bool show) visual->setLineP1Id(basePointId); visual->setLineP2Id(p2Line); visual->setLength(qApp->FormulaToUser(formulaLength)); - visual->setLineStyle(VAbstractTool::LineStyle(typeLine)); + visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); vis = visual; } diff --git a/src/app/tools/vabstracttool.cpp b/src/app/tools/vabstracttool.cpp index 67037a51a..92fc3de7e 100644 --- a/src/app/tools/vabstracttool.cpp +++ b/src/app/tools/vabstracttool.cpp @@ -161,9 +161,9 @@ void VAbstractTool::DeleteTool(bool ask) * @brief LineStyle return pen style for current line style. * @return pen style. */ -Qt::PenStyle VAbstractTool::LineStyle(const QString &typeLine) +Qt::PenStyle VAbstractTool::LineStyleToPenStyle(const QString &typeLine) { - QStringList styles = Styles(); + const QStringList styles = StylesList(); switch (styles.indexOf(typeLine)) { case 0: // TypeLineNone @@ -190,6 +190,30 @@ Qt::PenStyle VAbstractTool::LineStyle(const QString &typeLine) } } +//--------------------------------------------------------------------------------------------------------------------- +QMap VAbstractTool::LineStylesPics() +{ + QMap map; + const QStringList styles = StylesList(); + + for (int i=0; i < styles.size(); ++i) + { + const Qt::PenStyle style = LineStyleToPenStyle(styles.at(i)); + QPixmap pix(80, 14); + pix.fill(Qt::white); + + QBrush brush(Qt::black); + QPen pen(brush, 2.5, style); + + QPainter painter(&pix); + painter.setPen(pen); + painter.drawLine(2, 7, 78, 7); + + map.insert(styles.at(i), QIcon(pix)); + } + return map; +} + //--------------------------------------------------------------------------------------------------------------------- QString VAbstractTool::getLineType() const { @@ -264,7 +288,7 @@ void VAbstractTool::SaveOption(QSharedPointer &obj) * @brief Styles return list of all line styles. * @return list of all line styles. */ -const QStringList VAbstractTool::Styles() +const QStringList VAbstractTool::StylesList() { QStringList styles = QStringList() << TypeLineNone << TypeLineLine << TypeLineDashLine << TypeLineDotLine << TypeLineDashDotLine << TypeLineDashDotDotLine; diff --git a/src/app/tools/vabstracttool.h b/src/app/tools/vabstracttool.h index f69a1339b..3667f9377 100644 --- a/src/app/tools/vabstracttool.h +++ b/src/app/tools/vabstracttool.h @@ -92,9 +92,13 @@ public: static const QString TypeLineDotLine; static const QString TypeLineDashDotLine; static const QString TypeLineDashDotDotLine; - static const QStringList Styles(); + + static const QStringList StylesList(); + static Qt::PenStyle LineStyleToPenStyle(const QString &typeLine); + static QMap LineStylesPics(); + static void AddRecord(const quint32 id, const Tool &toolType, VPattern *doc); - static Qt::PenStyle LineStyle(const QString &typeLine); + const VContainer *getData() const; QString getLineType() const; diff --git a/src/app/widgets/vtooloptionspropertybrowser.cpp b/src/app/widgets/vtooloptionspropertybrowser.cpp index b3cae144e..178d6c6f3 100644 --- a/src/app/widgets/vtooloptionspropertybrowser.cpp +++ b/src/app/widgets/vtooloptionspropertybrowser.cpp @@ -382,12 +382,12 @@ void VToolOptionsPropertyBrowser::AddPropertyPointName(Tool *i, const QString &p //--------------------------------------------------------------------------------------------------------------------- template -void VToolOptionsPropertyBrowser::AddPropertyLineType(Tool *i, const QString &propertyName) +void VToolOptionsPropertyBrowser::AddPropertyLineType(Tool *i, const QString &propertyName, + const QMap &styles) { - VEnumProperty *lineTypeProperty = new VEnumProperty(propertyName); - QStringList styles = VAbstractTool::Styles(); - lineTypeProperty->setLiterals(styles); - qint32 index = styles.indexOf(i->getLineType()); + VLineTypeProperty *lineTypeProperty = new VLineTypeProperty(propertyName); + lineTypeProperty->setStyles(styles); + const qint32 index = VLineTypeProperty::IndexOfStyle(styles, i->getLineType()); if (index == -1) { qWarning()<<"Can't find line style" << i->getLineType()<<"in list"; @@ -945,7 +945,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolEndLine(QGraphicsItem *item) formView->setTitle(tr("Point at distance and angle")); AddPropertyPointName(i, tr("Point label")); - AddPropertyLineType(i, tr("Line type")); + AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); AddPropertyFormula(tr("Length"), i->getFormulaLength(), VAbstractTool::AttrLength); AddPropertyFormula(tr("Angle"), i->getFormulaAngle(), VAbstractTool::AttrAngle); } @@ -958,7 +958,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolAlongLine(QGraphicsItem *item) formView->setTitle(tr("Point at distance along line")); AddPropertyPointName(i, tr("Point label")); - AddPropertyLineType(i, tr("Line type")); + AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); AddPropertyFormula(tr("Length"), i->getFormulaLength(), VAbstractTool::AttrLength); } @@ -982,7 +982,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolBisector(QGraphicsItem *item) formView->setTitle(tr("Point along bisector")); AddPropertyPointName(i, tr("Point label")); - AddPropertyLineType(i, tr("Line type")); + AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); AddPropertyFormula(tr("Length"), i->getFormulaLength(), VAbstractTool::AttrLength); } @@ -1027,7 +1027,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolHeight(QGraphicsItem *item) formView->setTitle(tr("Perpendicular point along line")); AddPropertyPointName(i, tr("Point label")); - AddPropertyLineType(i, tr("Line type")); + AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); } //--------------------------------------------------------------------------------------------------------------------- @@ -1037,7 +1037,9 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolLine(QGraphicsItem *item) i->ShowVisualization(true); formView->setTitle(tr("Line between points")); - AddPropertyLineType(i, tr("Line type")); + QMap styles = VAbstractTool::LineStylesPics(); + styles.remove(VAbstractTool::TypeLineNone); + AddPropertyLineType(i, tr("Line type"), styles); } //--------------------------------------------------------------------------------------------------------------------- @@ -1059,7 +1061,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolNormal(QGraphicsItem *item) AddPropertyFormula(tr("Length"), i->getFormulaLength(), VAbstractTool::AttrLength); AddPropertyPointName(i, tr("Point label")); - AddPropertyLineType(i, tr("Line type")); + AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); VDoubleProperty* itemAngle = new VDoubleProperty(tr("Additional angle degrees")); itemAngle->setValue(i->getAngle()); @@ -1098,7 +1100,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolShoulderPoint(QGraphicsItem *it formView->setTitle(tr("Special point on shoulder")); AddPropertyPointName(i, tr("Point label")); - AddPropertyLineType(i, tr("Line type")); + AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); AddPropertyFormula(tr("Length"), i->getFormulaLength(), VAbstractTool::AttrLength); } @@ -1154,7 +1156,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolLineIntersectAxis(QGraphicsItem formView->setTitle(tr("Point intersection line and axis")); AddPropertyPointName(i, tr("Point label")); - AddPropertyLineType(i, tr("Line type")); + AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); AddPropertyFormula(tr("Angle"), i->getFormulaAngle(), VAbstractTool::AttrAngle); } @@ -1166,7 +1168,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolCurveIntersectAxis(QGraphicsIte formView->setTitle(tr("Point intersection line and axis")); AddPropertyPointName(i, tr("Point label")); - AddPropertyLineType(i, tr("Line type")); + AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); AddPropertyFormula(tr("Angle"), i->getFormulaAngle(), VAbstractTool::AttrAngle); } @@ -1184,8 +1186,7 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolEndLine() VToolEndLine *i = qgraphicsitem_cast(currentItem); idToProperty[VAbstractTool::AttrName]->setValue(i->name()); - QStringList styles = VAbstractTool::Styles(); - qint32 index = styles.indexOf(i->getLineType()); + const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); QVariant valueFormula; @@ -1203,8 +1204,7 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolAlongLine() VToolAlongLine *i = qgraphicsitem_cast(currentItem); idToProperty[VAbstractTool::AttrName]->setValue(i->name()); - QStringList styles = VAbstractTool::Styles(); - qint32 index = styles.indexOf(i->getLineType()); + const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); QVariant valueFormula; @@ -1242,8 +1242,7 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolBisector() valueFormula.setValue(i->getFormulaLength()); idToProperty[VAbstractTool::AttrLength]->setValue(valueFormula); - QStringList styles = VAbstractTool::Styles(); - qint32 index = styles.indexOf(i->getLineType()); + const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); } @@ -1290,8 +1289,7 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolHeight() idToProperty[VAbstractTool::AttrName]->setValue(i->name()); - QStringList styles = VAbstractTool::Styles(); - qint32 index = styles.indexOf(i->getLineType()); + const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); } @@ -1300,8 +1298,7 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolLine() { VToolLine *i = qgraphicsitem_cast(currentItem); - QStringList styles = VAbstractTool::Styles(); - qint32 index = styles.indexOf(i->getLineType()); + const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); } @@ -1326,8 +1323,7 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolNormal() idToProperty[VAbstractTool::AttrAngle]->setValue( i->getAngle()); - QStringList styles = VAbstractTool::Styles(); - qint32 index = styles.indexOf(i->getLineType()); + const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); } @@ -1362,8 +1358,7 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolShoulderPoint() idToProperty[VAbstractTool::AttrName]->setValue(i->name()); - QStringList styles = VAbstractTool::Styles(); - qint32 index = styles.indexOf(i->getLineType()); + const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); } @@ -1399,8 +1394,7 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolLineIntersectAxis() VToolLineIntersectAxis *i = qgraphicsitem_cast(currentItem); idToProperty[VAbstractTool::AttrName]->setValue(i->name()); - QStringList styles = VAbstractTool::Styles(); - qint32 index = styles.indexOf(i->getLineType()); + const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); QVariant valueAngle; @@ -1414,8 +1408,7 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolCurveIntersectAxis() VToolCurveIntersectAxis *i = qgraphicsitem_cast(currentItem); idToProperty[VAbstractTool::AttrName]->setValue(i->name()); - QStringList styles = VAbstractTool::Styles(); - qint32 index = styles.indexOf(i->getLineType()); + const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); QVariant valueAngle; diff --git a/src/app/widgets/vtooloptionspropertybrowser.h b/src/app/widgets/vtooloptionspropertybrowser.h index 1c4c65fa1..b2b918e99 100644 --- a/src/app/widgets/vtooloptionspropertybrowser.h +++ b/src/app/widgets/vtooloptionspropertybrowser.h @@ -71,7 +71,7 @@ private: void AddPropertyPointName(Tool *i, const QString &propertyName); template - void AddPropertyLineType(Tool *i, const QString &propertyName); + void AddPropertyLineType(Tool *i, const QString &propertyName, const QMap &styles); void AddPropertyFormula(const QString &propertyName, const VFormula &formula, const QString &attrName); diff --git a/src/libs/vpropertyexplorer/plugins/venumproperty.h b/src/libs/vpropertyexplorer/plugins/venumproperty.h index b15a04cd5..1fae1a975 100644 --- a/src/libs/vpropertyexplorer/plugins/venumproperty.h +++ b/src/libs/vpropertyexplorer/plugins/venumproperty.h @@ -86,7 +86,7 @@ public slots: void currentIndexChanged(int index); protected: - //! The list of possible options to choose frome + //! The list of possible options to choose from QStringList EnumerationLiterals; // No use of d-pointer in this case, because it is unlikely this will change. If it does, we can still add other //members by reimplementing the VPropertyPrivate class without touching this header file. diff --git a/src/libs/vpropertyexplorer/plugins/vlinetypeproperty.cpp b/src/libs/vpropertyexplorer/plugins/vlinetypeproperty.cpp new file mode 100644 index 000000000..a5305dbee --- /dev/null +++ b/src/libs/vpropertyexplorer/plugins/vlinetypeproperty.cpp @@ -0,0 +1,171 @@ +/************************************************************************ + ** + ** @file vlinetypeproperty.cpp + ** @author Roman Telezhynskyi + ** @date 29 1, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#include "vlinetypeproperty.h" +#include "../vproperty_p.h" + +#include +#include + +using namespace VPE; + +VLineTypeProperty::VLineTypeProperty(const QString &name) + : VProperty(name, QVariant::Int), styles(), indexList() +{ + VProperty::d_ptr->VariantValue = 0; + VProperty::d_ptr->VariantValue.convert(QVariant::Int); +} + +QVariant VLineTypeProperty::data(int column, int role) const +{ + if (styles.empty()) + { + return QVariant(); + } + + int tmpIndex = VProperty::d_ptr->VariantValue.toInt(); + + if (tmpIndex < 0 || tmpIndex >= indexList.count()) + { + tmpIndex = 0; + } + + if (column == DPC_Data && Qt::DisplayRole == role) + { + return indexList.at(tmpIndex); + } + else if (column == DPC_Data && Qt::EditRole == role) + { + return tmpIndex; + } + else + { + return VProperty::data(column, role); + } +} + +QWidget *VLineTypeProperty::createEditor(QWidget *parent, const QStyleOptionViewItem &options, + const QAbstractItemDelegate *delegate) +{ + Q_UNUSED(options); + Q_UNUSED(delegate); + QComboBox* tmpEditor = new QComboBox(parent); + tmpEditor->clear(); + tmpEditor->setIconSize(QSize(80, 14)); + tmpEditor->setMinimumWidth(80); + tmpEditor->setMaximumWidth(110); + + QMap::const_iterator i = styles.constBegin(); + while (i != styles.constEnd()) + { + tmpEditor->addItem(i.value(), "", QVariant(i.key())); + ++i; + } + + tmpEditor->setCurrentIndex(VProperty::d_ptr->VariantValue.toInt()); + connect(tmpEditor, static_cast(&QComboBox::currentIndexChanged), this, + &VLineTypeProperty::currentIndexChanged); + + VProperty::d_ptr->editor = tmpEditor; + return VProperty::d_ptr->editor; +} + +QVariant VLineTypeProperty::getEditorData(const QWidget *editor) const +{ + const QComboBox* tmpEditor = qobject_cast(editor); + if (tmpEditor) + { + return tmpEditor->currentIndex(); + } + + return QVariant(0); +} + +void VLineTypeProperty::setStyles(const QMap &styles) +{ + this->styles = styles; + indexList.clear(); + QMap::const_iterator i = styles.constBegin(); + while (i != styles.constEnd()) + { + indexList.append(i.key()); + ++i; + } +} + +QMap VLineTypeProperty::getStyles() const +{ + return styles; +} + +void VLineTypeProperty::setValue(const QVariant &value) +{ + int tmpIndex = value.toInt(); + + if (tmpIndex < 0 || tmpIndex >= indexList.count()) + { + tmpIndex = 0; + } + + VProperty::d_ptr->VariantValue = tmpIndex; + VProperty::d_ptr->VariantValue.convert(QVariant::Int); + + if (VProperty::d_ptr->editor != nullptr) + { + setEditorData(VProperty::d_ptr->editor); + } +} + +QString VLineTypeProperty::type() const +{ + return QStringLiteral("lineType"); +} + +VProperty *VLineTypeProperty::clone(bool include_children, VProperty *container) const +{ + return VProperty::clone(include_children, container ? container : new VLineTypeProperty(getName())); +} + +int VLineTypeProperty::IndexOfStyle(const QMap &styles, const QString &style) +{ + QVector indexList; + QMap::const_iterator i = styles.constBegin(); + while (i != styles.constEnd()) + { + indexList.append(i.key()); + ++i; + } + return indexList.indexOf(style); +} + +void VLineTypeProperty::currentIndexChanged(int index) +{ + Q_UNUSED(index) + UserChangeEvent *event = new UserChangeEvent(); + QCoreApplication::postEvent ( VProperty::d_ptr->editor, event ); +} diff --git a/src/libs/vpropertyexplorer/plugins/vlinetypeproperty.h b/src/libs/vpropertyexplorer/plugins/vlinetypeproperty.h new file mode 100644 index 000000000..335ac481d --- /dev/null +++ b/src/libs/vpropertyexplorer/plugins/vlinetypeproperty.h @@ -0,0 +1,101 @@ +/************************************************************************ + ** + ** @file vlinetypeproperty.h + ** @author Roman Telezhynskyi + ** @date 29 1, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef VLINETYPEPROPERTY_H +#define VLINETYPEPROPERTY_H + +#include "../vproperty.h" + +#include +#include +#include + +namespace VPE +{ + +class VPROPERTYEXPLORERSHARED_EXPORT VLineTypeProperty : public VProperty +{ + Q_OBJECT +public: + //! Constructor + VLineTypeProperty(const QString& name); + + //! Destructor + ~VLineTypeProperty() {} + + //! Get the data how it should be displayed + virtual QVariant data (int column = DPC_Name, int role = Qt::DisplayRole) const; + + //! Returns an editor widget, or NULL if it doesn't supply one + //! \param parent The widget to which the editor will be added as a child + //! \options Render options + //! \delegate A pointer to the QAbstractItemDelegate requesting the editor. This can be used to connect signals and + //! slots. + virtual QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& options, + const QAbstractItemDelegate* delegate); + + //! Gets the data from the widget + virtual QVariant getEditorData(const QWidget* editor) const; + + //! Sets the line styles + virtual void setStyles(const QMap &styles); + + //! Get the settings. This function has to be implemented in a subclass in order to have an effect + virtual QMap getStyles() const; + + //! Sets the value of the property + virtual void setValue(const QVariant& value); + + //! Returns a string containing the type of the property + virtual QString type() const; + + //! Clones this property + //! \param include_children Indicates whether to also clone the children + //! \param container If a property is being passed here, no new VProperty is being created but instead it is tried + //! to fill all the data into container. This can also be used when subclassing this function. + //! \return Returns the newly created property (or container, if it was not NULL) + virtual VProperty* clone(bool include_children = true, VProperty* container = nullptr) const; + + static int IndexOfStyle(const QMap &styles, const QString &style); + +public slots: + void currentIndexChanged(int index); + +protected: + //! The list of possible options to choose from + QMap styles; + QVector indexList; + // No use of d-pointer in this case, because it is unlikely this will change. If it does, we can still add other + //members by reimplementing the VPropertyPrivate class without touching this header file. +private: + Q_DISABLE_COPY(VLineTypeProperty) +}; + +} + +#endif // VLINETYPEPROPERTY_H diff --git a/src/libs/vpropertyexplorer/vproperties.h b/src/libs/vpropertyexplorer/vproperties.h index f1c531f27..0c8467d4d 100644 --- a/src/libs/vpropertyexplorer/vproperties.h +++ b/src/libs/vpropertyexplorer/vproperties.h @@ -26,6 +26,7 @@ #include "plugins/vcolorproperty.h" #include "plugins/Vector3d/vvector3dproperty.h" #include "plugins/vemptyproperty.h" +#include "plugins/vlinetypeproperty.h" #include "plugins/venumproperty.h" #include "plugins/vfileproperty.h" #include "plugins/vnumberproperty.h" diff --git a/src/libs/vpropertyexplorer/vpropertyexplorer.pri b/src/libs/vpropertyexplorer/vpropertyexplorer.pri index d5ab89175..871cff6d3 100644 --- a/src/libs/vpropertyexplorer/vpropertyexplorer.pri +++ b/src/libs/vpropertyexplorer/vpropertyexplorer.pri @@ -27,7 +27,8 @@ SOURCES += \ $$PWD/plugins/vstringproperty.cpp \ $$PWD/plugins/vpointfproperty.cpp \ $$PWD/plugins/vobjectproperty.cpp \ - $$PWD/stable.cpp + $$PWD/stable.cpp \ + $$PWD/plugins/vlinetypeproperty.cpp HEADERS +=\ $$PWD/vpropertyexplorer_global.h \ @@ -67,4 +68,5 @@ HEADERS +=\ $$PWD/plugins/vpointfproperty.h \ $$PWD/plugins/vobjectproperty.h \ $$PWD/vproperties.h \ - $$PWD/stable.h + $$PWD/stable.h \ + $$PWD/plugins/vlinetypeproperty.h From de1c9d8a779a0ed5c3cfb8bf6e8f2e4db6ae4e60 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 2 Feb 2015 11:29:50 +0200 Subject: [PATCH 080/186] List of colors. --HG-- branch : feature --- src/app/tools/vabstracttool.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/app/tools/vabstracttool.cpp b/src/app/tools/vabstracttool.cpp index 92fc3de7e..9737f9777 100644 --- a/src/app/tools/vabstracttool.cpp +++ b/src/app/tools/vabstracttool.cpp @@ -70,6 +70,8 @@ const QString VAbstractTool::AttrPSpline = QStringLiteral("pSpline"); const QString VAbstractTool::AttrAxisP1 = QStringLiteral("axisP1"); const QString VAbstractTool::AttrAxisP2 = QStringLiteral("axisP2"); const QString VAbstractTool::AttrCurve = QStringLiteral("curve"); +const QString VAbstractTool::AttrLineColor = QStringLiteral("lineColor"); +const QString VAbstractTool::AttrColor = QStringLiteral("color"); const QString VAbstractTool::TypeLineNone = QStringLiteral("none"); const QString VAbstractTool::TypeLineLine = QStringLiteral("hair"); @@ -78,6 +80,14 @@ const QString VAbstractTool::TypeLineDotLine = QStringLiteral("dotLine"); const QString VAbstractTool::TypeLineDashDotLine = QStringLiteral("dashDotLine"); const QString VAbstractTool::TypeLineDashDotDotLine = QStringLiteral("dashDotDotLine"); +const QString VAbstractTool::ColorBlack = QStringLiteral("black"); +const QString VAbstractTool::ColorGreen = QStringLiteral("green"); +const QString VAbstractTool::ColorBlue = QStringLiteral("blue"); +const QString VAbstractTool::ColorDarkRed = QStringLiteral("darkRed"); +const QString VAbstractTool::ColorDarkGreen = QStringLiteral("darkGreen"); +const QString VAbstractTool::ColorDarkBlue = QStringLiteral("DarkBlue"); +const QString VAbstractTool::ColorYellow = QStringLiteral("Yellow"); + //--------------------------------------------------------------------------------------------------------------------- /** * @brief VAbstractTool container. @@ -214,6 +224,14 @@ QMap VAbstractTool::LineStylesPics() return map; } +//--------------------------------------------------------------------------------------------------------------------- +const QStringList VAbstractTool::Colors() +{ + const QStringList colors = QStringList() << ColorBlack << ColorGreen << ColorBlue << ColorDarkRed << ColorDarkGreen + << ColorDarkBlue << ColorYellow; + return colors; +} + //--------------------------------------------------------------------------------------------------------------------- QString VAbstractTool::getLineType() const { @@ -290,8 +308,8 @@ void VAbstractTool::SaveOption(QSharedPointer &obj) */ const QStringList VAbstractTool::StylesList() { - QStringList styles = QStringList() << TypeLineNone << TypeLineLine << TypeLineDashLine << TypeLineDotLine << - TypeLineDashDotLine << TypeLineDashDotDotLine; + const QStringList styles = QStringList() << TypeLineNone << TypeLineLine << TypeLineDashLine << TypeLineDotLine + << TypeLineDashDotLine << TypeLineDashDotDotLine; return styles; } From e2fab3345a1989976c896e902e7ff2676af2d072 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 2 Feb 2015 12:28:09 +0200 Subject: [PATCH 081/186] Test combobox that show colors. --HG-- branch : feature --- src/app/dialogs/tools/dialogendline.cpp | 1 + src/app/dialogs/tools/dialogendline.ui | 13 ++++++ src/app/dialogs/tools/dialogtool.cpp | 56 +++++++++++++++++++++++++ src/app/dialogs/tools/dialogtool.h | 1 + src/app/tools/vabstracttool.cpp | 4 +- src/app/tools/vabstracttool.h | 13 ++++++ 6 files changed, 86 insertions(+), 2 deletions(-) diff --git a/src/app/dialogs/tools/dialogendline.cpp b/src/app/dialogs/tools/dialogendline.cpp index e450a5659..8c25748a5 100644 --- a/src/app/dialogs/tools/dialogendline.cpp +++ b/src/app/dialogs/tools/dialogendline.cpp @@ -64,6 +64,7 @@ DialogEndLine::DialogEndLine(const VContainer *data, const quint32 &toolId, QWid FillComboBoxPoints(ui->comboBoxBasePoint); FillComboBoxTypeLine(ui->comboBoxLineType, VAbstractTool::LineStylesPics()); + FillComboBoxLineColors(ui->comboBoxLineColor); connect(ui->toolButtonPutHereLength, &QPushButton::clicked, this, &DialogEndLine::PutHere); connect(ui->toolButtonPutHereAngle, &QPushButton::clicked, this, &DialogEndLine::PutAngle); diff --git a/src/app/dialogs/tools/dialogendline.ui b/src/app/dialogs/tools/dialogendline.ui index a5e8259f5..93dbd3f8f 100644 --- a/src/app/dialogs/tools/dialogendline.ui +++ b/src/app/dialogs/tools/dialogendline.ui @@ -409,6 +409,9 @@ + + QFormLayout::AllNonFixedFieldsGrow + @@ -477,6 +480,16 @@ + + + + Line color + + + + + + diff --git a/src/app/dialogs/tools/dialogtool.cpp b/src/app/dialogs/tools/dialogtool.cpp index 872a12c20..bcd73eab9 100644 --- a/src/app/dialogs/tools/dialogtool.cpp +++ b/src/app/dialogs/tools/dialogtool.cpp @@ -301,6 +301,50 @@ void DialogTool::FillComboBoxTypeLine(QComboBox *box, const QMap box->setCurrentIndex(1); } +//--------------------------------------------------------------------------------------------------------------------- +void DialogTool::FillComboBoxLineColors(QComboBox *box) const +{ + SCASSERT(box != nullptr); + + const QStringList colorNames = VAbstractTool::Colors(); + + for (int i = 0; i < colorNames.size(); ++i) + { + QString name; + switch (i) + { + case 0: // ColorBlack + name = tr("black"); + break; + case 1: // ColorGreen + name = tr("green"); + break; + case 2: // ColorBlue + name = tr("blue"); + break; + case 3: // ColorDarkRed + name = tr("dark red"); + break; + case 4: // ColorDarkGreen + name = tr("dark green"); + break; + case 5: // ColorDarkBlue + name = tr("dark blue"); + break; + case 6: // ColorYellow + name = tr("yellow"); + break; + default: + name = tr("black"); + break; + } + + QPixmap pix(16, 16); + pix.fill(QColor(colorNames.at(i))); + box->insertItem(i, QIcon(pix), name, QVariant(colorNames.at(i))); + } +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief getTypeLine return type of line @@ -318,6 +362,18 @@ QString DialogTool::GetTypeLine(const QComboBox *box) const return value; } +//--------------------------------------------------------------------------------------------------------------------- +QString DialogTool::GetLineColor(const QComboBox *box) const +{ + SCASSERT(box != nullptr) + QString value = box->currentData().toString(); + if (value.isEmpty()) + { + value = VAbstractTool::ColorBlack; + } + return value; +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief SetupTypeLine setupe type of line diff --git a/src/app/dialogs/tools/dialogtool.h b/src/app/dialogs/tools/dialogtool.h index 7366a862e..b5041d7a2 100644 --- a/src/app/dialogs/tools/dialogtool.h +++ b/src/app/dialogs/tools/dialogtool.h @@ -216,6 +216,7 @@ protected: ComboBoxCutSpline cut = ComboBoxCutSpline::NoCutSpline)const; void FillComboBoxCurves(QComboBox *box)const; void FillComboBoxTypeLine(QComboBox *box, const QMap &stylesPics) const; + void FillComboBoxLineColors(QComboBox *box)const; virtual void CheckState(); QString GetTypeLine(const QComboBox *box)const; template diff --git a/src/app/tools/vabstracttool.cpp b/src/app/tools/vabstracttool.cpp index 9737f9777..7b5034667 100644 --- a/src/app/tools/vabstracttool.cpp +++ b/src/app/tools/vabstracttool.cpp @@ -85,8 +85,8 @@ const QString VAbstractTool::ColorGreen = QStringLiteral("green"); const QString VAbstractTool::ColorBlue = QStringLiteral("blue"); const QString VAbstractTool::ColorDarkRed = QStringLiteral("darkRed"); const QString VAbstractTool::ColorDarkGreen = QStringLiteral("darkGreen"); -const QString VAbstractTool::ColorDarkBlue = QStringLiteral("DarkBlue"); -const QString VAbstractTool::ColorYellow = QStringLiteral("Yellow"); +const QString VAbstractTool::ColorDarkBlue = QStringLiteral("darkBlue"); +const QString VAbstractTool::ColorYellow = QStringLiteral("yellow"); //--------------------------------------------------------------------------------------------------------------------- /** diff --git a/src/app/tools/vabstracttool.h b/src/app/tools/vabstracttool.h index 3667f9377..dca1083a1 100644 --- a/src/app/tools/vabstracttool.h +++ b/src/app/tools/vabstracttool.h @@ -86,6 +86,9 @@ public: static const QString AttrAxisP1; static const QString AttrAxisP2; static const QString AttrCurve; + static const QString AttrLineColor; + static const QString AttrColor; + static const QString TypeLineNone; static const QString TypeLineLine; static const QString TypeLineDashLine; @@ -93,10 +96,20 @@ public: static const QString TypeLineDashDotLine; static const QString TypeLineDashDotDotLine; + static const QString ColorBlack; + static const QString ColorGreen; + static const QString ColorBlue; + static const QString ColorDarkRed; + static const QString ColorDarkGreen; + static const QString ColorDarkBlue; + static const QString ColorYellow; + static const QStringList StylesList(); static Qt::PenStyle LineStyleToPenStyle(const QString &typeLine); static QMap LineStylesPics(); + static const QStringList Colors(); + static void AddRecord(const quint32 id, const Tool &toolType, VPattern *doc); const VContainer *getData() const; From c06938272fc2b6c5ebcb095acaee33486320f8b4 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 2 Feb 2015 13:06:58 +0200 Subject: [PATCH 082/186] Color comboboxs in dialogs. --HG-- branch : feature --- src/app/dialogs/tools/dialogalongline.ui | 21 ++++- src/app/dialogs/tools/dialogarc.ui | 63 ++++++++------ src/app/dialogs/tools/dialogbisector.ui | 12 ++- .../dialogs/tools/dialogcurveintersectaxis.ui | 12 ++- src/app/dialogs/tools/dialogheight.ui | 12 ++- src/app/dialogs/tools/dialogline.ui | 16 +++- .../dialogs/tools/dialoglineintersectaxis.ui | 12 ++- src/app/dialogs/tools/dialognormal.ui | 85 ++++++++++--------- src/app/dialogs/tools/dialogshoulderpoint.ui | 12 ++- src/app/dialogs/tools/dialogspline.ui | 24 ++++-- src/app/dialogs/tools/dialogsplinepath.ui | 24 ++++-- src/app/dialogs/tools/dialogtool.h | 3 + 12 files changed, 207 insertions(+), 89 deletions(-) diff --git a/src/app/dialogs/tools/dialogalongline.ui b/src/app/dialogs/tools/dialogalongline.ui index a2e13e7e6..3dec6c83a 100644 --- a/src/app/dialogs/tools/dialogalongline.ui +++ b/src/app/dialogs/tools/dialogalongline.ui @@ -7,7 +7,7 @@ 0 0 428 - 499 + 532 @@ -223,6 +223,9 @@ + + QFormLayout::AllNonFixedFieldsGrow + @@ -230,9 +233,6 @@ - - - @@ -299,6 +299,19 @@ + + + + Line color + + + + + + + + + diff --git a/src/app/dialogs/tools/dialogarc.ui b/src/app/dialogs/tools/dialogarc.ui index 4bf89a0cc..84ccc7856 100644 --- a/src/app/dialogs/tools/dialogarc.ui +++ b/src/app/dialogs/tools/dialogarc.ui @@ -6,8 +6,8 @@ 0 0 - 423 - 544 + 425 + 577 @@ -583,32 +583,42 @@ - - - - - - - 0 - 0 - - - - Center point - - - - - - - Select point of center of arc - - - - - + + + + + + + 0 + 0 + + + + Center point + + + + + + + Select point of center of arc + + + + + + + + + + Color + + + + + @@ -782,7 +792,6 @@ pushButtonGrowLengthF1 toolButtonPutHereF2 toolButtonEqualF2 - comboBoxBasePoint radioButtonSizeGrowth radioButtonStandardTable radioButtonIncrements diff --git a/src/app/dialogs/tools/dialogbisector.ui b/src/app/dialogs/tools/dialogbisector.ui index c4ad6001a..40d359b8b 100644 --- a/src/app/dialogs/tools/dialogbisector.ui +++ b/src/app/dialogs/tools/dialogbisector.ui @@ -7,7 +7,7 @@ 0 0 428 - 532 + 565 @@ -325,6 +325,16 @@ + + + + Line color + + + + + + diff --git a/src/app/dialogs/tools/dialogcurveintersectaxis.ui b/src/app/dialogs/tools/dialogcurveintersectaxis.ui index 39a9ccba9..514b73d75 100644 --- a/src/app/dialogs/tools/dialogcurveintersectaxis.ui +++ b/src/app/dialogs/tools/dialogcurveintersectaxis.ui @@ -7,7 +7,7 @@ 0 0 419 - 499 + 532 @@ -308,6 +308,16 @@ + + + + Line color + + + + + + diff --git a/src/app/dialogs/tools/dialogheight.ui b/src/app/dialogs/tools/dialogheight.ui index 4338c7de7..e500e407f 100644 --- a/src/app/dialogs/tools/dialogheight.ui +++ b/src/app/dialogs/tools/dialogheight.ui @@ -7,7 +7,7 @@ 0 0 285 - 212 + 245 @@ -134,6 +134,16 @@ + + + + Line color + + + + + + diff --git a/src/app/dialogs/tools/dialogline.ui b/src/app/dialogs/tools/dialogline.ui index 50dc4afe7..e57621c42 100644 --- a/src/app/dialogs/tools/dialogline.ui +++ b/src/app/dialogs/tools/dialogline.ui @@ -10,19 +10,19 @@ 0 0 286 - 151 + 179 286 - 151 + 179 286 - 151 + 179 @@ -143,6 +143,16 @@ + + + + Line color + + + + + + diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.ui b/src/app/dialogs/tools/dialoglineintersectaxis.ui index 2ad7bac18..a31e877d1 100644 --- a/src/app/dialogs/tools/dialoglineintersectaxis.ui +++ b/src/app/dialogs/tools/dialoglineintersectaxis.ui @@ -7,7 +7,7 @@ 0 0 457 - 532 + 565 @@ -325,6 +325,16 @@ + + + + Line color + + + + + + diff --git a/src/app/dialogs/tools/dialognormal.ui b/src/app/dialogs/tools/dialognormal.ui index 959714a6d..cf79e9586 100644 --- a/src/app/dialogs/tools/dialognormal.ui +++ b/src/app/dialogs/tools/dialognormal.ui @@ -7,7 +7,7 @@ 0 0 517 - 645 + 678 @@ -472,44 +472,54 @@ - - - - - - Type of line - - - - - - - - 80 - 0 - - - - - 110 - 16777215 - - - - Show line from first point to this point - - - - 80 - 14 - - - - - - + + + + + + Type of line + + + + + + + + 80 + 0 + + + + + 110 + 16777215 + + + + Show line from first point to this point + + + + 80 + 14 + + + + + + + + + + + Line color + + + + + @@ -689,7 +699,6 @@ toolButtonArrowLeftDown toolButtonArrowLeft toolButtonArrowLeftUp - comboBoxLineType radioButtonSizeGrowth radioButtonStandardTable radioButtonIncrements diff --git a/src/app/dialogs/tools/dialogshoulderpoint.ui b/src/app/dialogs/tools/dialogshoulderpoint.ui index 8c306b556..c63a6d001 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.ui +++ b/src/app/dialogs/tools/dialogshoulderpoint.ui @@ -7,7 +7,7 @@ 0 0 488 - 532 + 565 @@ -364,6 +364,16 @@ + + + + Line color + + + + + + diff --git a/src/app/dialogs/tools/dialogspline.ui b/src/app/dialogs/tools/dialogspline.ui index 580268256..10238a584 100644 --- a/src/app/dialogs/tools/dialogspline.ui +++ b/src/app/dialogs/tools/dialogspline.ui @@ -6,8 +6,8 @@ 0 0 - 524 - 254 + 540 + 233 @@ -152,8 +152,11 @@ - - + + + QFormLayout::AllNonFixedFieldsGrow + + @@ -172,7 +175,7 @@ - + @@ -194,6 +197,16 @@ + + + + Color + + + + + + @@ -215,7 +228,6 @@ comboBoxP4 doubleSpinBoxKasm2 spinBoxAngle2 - doubleSpinBoxKcurve buttonBox diff --git a/src/app/dialogs/tools/dialogsplinepath.ui b/src/app/dialogs/tools/dialogsplinepath.ui index 44c1b3459..7c00882f6 100644 --- a/src/app/dialogs/tools/dialogsplinepath.ui +++ b/src/app/dialogs/tools/dialogsplinepath.ui @@ -6,8 +6,8 @@ 0 0 - 524 - 321 + 528 + 322 @@ -141,8 +141,11 @@ - - + + + QFormLayout::AllNonFixedFieldsGrow + + @@ -161,7 +164,7 @@ - + @@ -183,6 +186,16 @@ + + + + Color + + + + + + @@ -204,7 +217,6 @@ doubleSpinBoxKasm2 doubleSpinBoxAngle2 listWidget - doubleSpinBoxKcurve buttonBox diff --git a/src/app/dialogs/tools/dialogtool.h b/src/app/dialogs/tools/dialogtool.h index b5041d7a2..aad677211 100644 --- a/src/app/dialogs/tools/dialogtool.h +++ b/src/app/dialogs/tools/dialogtool.h @@ -209,6 +209,7 @@ protected: virtual void closeEvent ( QCloseEvent * event ); virtual void showEvent( QShowEvent *event ); + void FillComboBoxPoints(QComboBox *box)const; void FillComboBoxArcs(QComboBox *box, ComboBoxCutArc cut = ComboBoxCutArc::NoCutArc)const; void FillComboBoxSplines(QComboBox *box, ComboBoxCutSpline cut = ComboBoxCutSpline::NoCutSpline)const; @@ -217,8 +218,10 @@ protected: void FillComboBoxCurves(QComboBox *box)const; void FillComboBoxTypeLine(QComboBox *box, const QMap &stylesPics) const; void FillComboBoxLineColors(QComboBox *box)const; + virtual void CheckState(); QString GetTypeLine(const QComboBox *box)const; + QString GetLineColor(const QComboBox *box)const; template void ShowVariable(const QMap var); void SetupTypeLine(QComboBox *box, const QString &value); From 9381cc78a690789ab0beac61ac6fa989bbd4d38f Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 2 Feb 2015 13:10:02 +0200 Subject: [PATCH 083/186] Initialization color conmbobox. --HG-- branch : feature --- src/app/dialogs/tools/dialogalongline.cpp | 1 + src/app/dialogs/tools/dialogarc.cpp | 1 + src/app/dialogs/tools/dialogbisector.cpp | 1 + src/app/dialogs/tools/dialogcurveintersectaxis.cpp | 1 + src/app/dialogs/tools/dialogheight.cpp | 2 ++ src/app/dialogs/tools/dialogline.cpp | 1 + src/app/dialogs/tools/dialoglineintersectaxis.cpp | 1 + src/app/dialogs/tools/dialognormal.cpp | 1 + src/app/dialogs/tools/dialogshoulderpoint.cpp | 1 + src/app/dialogs/tools/dialogspline.cpp | 2 ++ src/app/dialogs/tools/dialogsplinepath.cpp | 1 + 11 files changed, 13 insertions(+) diff --git a/src/app/dialogs/tools/dialogalongline.cpp b/src/app/dialogs/tools/dialogalongline.cpp index dbf57e8b6..b041e9819 100644 --- a/src/app/dialogs/tools/dialogalongline.cpp +++ b/src/app/dialogs/tools/dialogalongline.cpp @@ -62,6 +62,7 @@ DialogAlongLine::DialogAlongLine(const VContainer *data, const quint32 &toolId, FillComboBoxPoints(ui->comboBoxSecondPoint); FillComboBoxTypeLine(ui->comboBoxLineType, VAbstractTool::LineStylesPics()); ui->comboBoxLineType->setCurrentIndex(0); + FillComboBoxLineColors(ui->comboBoxLineColor); connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogAlongLine::PutHere); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogAlongLine::NamePointChanged); diff --git a/src/app/dialogs/tools/dialogarc.cpp b/src/app/dialogs/tools/dialogarc.cpp index 045f0c2be..3aa039f17 100644 --- a/src/app/dialogs/tools/dialogarc.cpp +++ b/src/app/dialogs/tools/dialogarc.cpp @@ -74,6 +74,7 @@ DialogArc::DialogArc(const VContainer *data, const quint32 &toolId, QWidget *par InitOkCancelApply(ui); FillComboBoxPoints(ui->comboBoxBasePoint); + FillComboBoxLineColors(ui->comboBoxColor); CheckState(); diff --git a/src/app/dialogs/tools/dialogbisector.cpp b/src/app/dialogs/tools/dialogbisector.cpp index 90c4449ed..9329de8a3 100644 --- a/src/app/dialogs/tools/dialogbisector.cpp +++ b/src/app/dialogs/tools/dialogbisector.cpp @@ -62,6 +62,7 @@ DialogBisector::DialogBisector(const VContainer *data, const quint32 &toolId, QW FillComboBoxPoints(ui->comboBoxSecondPoint); FillComboBoxTypeLine(ui->comboBoxLineType, VAbstractTool::LineStylesPics()); FillComboBoxPoints(ui->comboBoxThirdPoint); + FillComboBoxLineColors(ui->comboBoxLineColor); connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogBisector::PutHere); connect(listWidget, &QListWidget::itemDoubleClicked, this, &DialogBisector::PutVal); diff --git a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp b/src/app/dialogs/tools/dialogcurveintersectaxis.cpp index 43eefe4a4..feeb9ef55 100644 --- a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp +++ b/src/app/dialogs/tools/dialogcurveintersectaxis.cpp @@ -57,6 +57,7 @@ DialogCurveIntersectAxis::DialogCurveIntersectAxis(const VContainer *data, const FillComboBoxPoints(ui->comboBoxAxisPoint); FillComboBoxCurves(ui->comboBoxCurve); FillComboBoxTypeLine(ui->comboBoxLineType, VAbstractTool::LineStylesPics()); + FillComboBoxLineColors(ui->comboBoxLineColor); connect(ui->toolButtonPutHereAngle, &QPushButton::clicked, this, &DialogCurveIntersectAxis::PutAngle); connect(listWidget, &QListWidget::itemDoubleClicked, this, &DialogCurveIntersectAxis::PutVal); diff --git a/src/app/dialogs/tools/dialogheight.cpp b/src/app/dialogs/tools/dialogheight.cpp index b4f80756a..2a6d17084 100644 --- a/src/app/dialogs/tools/dialogheight.cpp +++ b/src/app/dialogs/tools/dialogheight.cpp @@ -55,6 +55,8 @@ DialogHeight::DialogHeight(const VContainer *data, const quint32 &toolId, QWidge FillComboBoxPoints(ui->comboBoxP1Line); FillComboBoxPoints(ui->comboBoxP2Line); FillComboBoxTypeLine(ui->comboBoxLineType, VAbstractTool::LineStylesPics()); + FillComboBoxLineColors(ui->comboBoxLineColor); + connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogHeight::NamePointChanged); connect(ui->comboBoxBasePoint, static_cast(&QComboBox::currentIndexChanged), this, &DialogHeight::PointNameChanged); diff --git a/src/app/dialogs/tools/dialogline.cpp b/src/app/dialogs/tools/dialogline.cpp index 1e62d1290..3f635a774 100644 --- a/src/app/dialogs/tools/dialogline.cpp +++ b/src/app/dialogs/tools/dialogline.cpp @@ -51,6 +51,7 @@ DialogLine::DialogLine(const VContainer *data, const quint32 &toolId, QWidget *p FillComboBoxPoints(ui->comboBoxFirstPoint); FillComboBoxPoints(ui->comboBoxSecondPoint); + FillComboBoxLineColors(ui->comboBoxLineColor); QMap stylesPics = VAbstractTool::LineStylesPics(); stylesPics.remove(VAbstractTool::TypeLineNone);// Prevent hiding line diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.cpp b/src/app/dialogs/tools/dialoglineintersectaxis.cpp index a7b77c1b1..09cbb04e5 100644 --- a/src/app/dialogs/tools/dialoglineintersectaxis.cpp +++ b/src/app/dialogs/tools/dialoglineintersectaxis.cpp @@ -58,6 +58,7 @@ DialogLineIntersectAxis::DialogLineIntersectAxis(const VContainer *data, const q FillComboBoxPoints(ui->comboBoxFirstLinePoint); FillComboBoxPoints(ui->comboBoxSecondLinePoint); FillComboBoxTypeLine(ui->comboBoxLineType, VAbstractTool::LineStylesPics()); + FillComboBoxLineColors(ui->comboBoxLineColor); connect(ui->toolButtonPutHereAngle, &QPushButton::clicked, this, &DialogLineIntersectAxis::PutAngle); connect(listWidget, &QListWidget::itemDoubleClicked, this, &DialogLineIntersectAxis::PutVal); diff --git a/src/app/dialogs/tools/dialognormal.cpp b/src/app/dialogs/tools/dialognormal.cpp index 1461259cd..58947b0e4 100644 --- a/src/app/dialogs/tools/dialognormal.cpp +++ b/src/app/dialogs/tools/dialognormal.cpp @@ -57,6 +57,7 @@ DialogNormal::DialogNormal(const VContainer *data, const quint32 &toolId, QWidge FillComboBoxPoints(ui->comboBoxFirstPoint); FillComboBoxPoints(ui->comboBoxSecondPoint); FillComboBoxTypeLine(ui->comboBoxLineType, VAbstractTool::LineStylesPics()); + FillComboBoxLineColors(ui->comboBoxLineColor); InitArrow(ui); diff --git a/src/app/dialogs/tools/dialogshoulderpoint.cpp b/src/app/dialogs/tools/dialogshoulderpoint.cpp index 1ef046f91..14ee285bb 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.cpp +++ b/src/app/dialogs/tools/dialogshoulderpoint.cpp @@ -62,6 +62,7 @@ DialogShoulderPoint::DialogShoulderPoint(const VContainer *data, const quint32 & FillComboBoxPoints(ui->comboBoxP1Line); FillComboBoxPoints(ui->comboBoxP2Line); FillComboBoxPoints(ui->comboBoxP3); + FillComboBoxLineColors(ui->comboBoxLineColor); connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogShoulderPoint::PutHere); connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogShoulderPoint::PutVal); diff --git a/src/app/dialogs/tools/dialogspline.cpp b/src/app/dialogs/tools/dialogspline.cpp index d60ae5b9c..3590fdde4 100644 --- a/src/app/dialogs/tools/dialogspline.cpp +++ b/src/app/dialogs/tools/dialogspline.cpp @@ -49,6 +49,8 @@ DialogSpline::DialogSpline(const VContainer *data, const quint32 &toolId, QWidge FillComboBoxPoints(ui->comboBoxP1); FillComboBoxPoints(ui->comboBoxP4); + FillComboBoxLineColors(ui->comboBoxColor); + connect(ui->comboBoxP1, static_cast(&QComboBox::currentIndexChanged), this, &DialogSpline::PointNameChanged); connect(ui->comboBoxP4, static_cast(&QComboBox::currentIndexChanged), diff --git a/src/app/dialogs/tools/dialogsplinepath.cpp b/src/app/dialogs/tools/dialogsplinepath.cpp index e68650792..8fef7320f 100644 --- a/src/app/dialogs/tools/dialogsplinepath.cpp +++ b/src/app/dialogs/tools/dialogsplinepath.cpp @@ -46,6 +46,7 @@ DialogSplinePath::DialogSplinePath(const VContainer *data, const quint32 &toolId bOk->setEnabled(false); FillComboBoxPoints(ui->comboBoxPoint); + FillComboBoxLineColors(ui->comboBoxColor); connect(ui->listWidget, &QListWidget::currentRowChanged, this, &DialogSplinePath::PointChanged); connect(ui->comboBoxPoint, static_cast(&QComboBox::currentIndexChanged), From d41308e1f4f5cff5d68387a2e3454439acfc3d55 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 2 Feb 2015 13:55:42 +0200 Subject: [PATCH 084/186] Set line color for dialog tool " point along line". --HG-- branch : feature --- src/app/dialogs/tools/dialogalongline.cpp | 17 +++++++++++++++-- src/app/dialogs/tools/dialogalongline.h | 5 +++++ src/app/dialogs/tools/dialogbisector.cpp | 2 +- .../dialogs/tools/dialogcurveintersectaxis.cpp | 2 +- src/app/dialogs/tools/dialogendline.cpp | 2 +- src/app/dialogs/tools/dialogheight.cpp | 2 +- src/app/dialogs/tools/dialogline.cpp | 2 +- .../dialogs/tools/dialoglineintersectaxis.cpp | 2 +- src/app/dialogs/tools/dialognormal.cpp | 2 +- src/app/dialogs/tools/dialogshoulderpoint.cpp | 2 +- src/app/dialogs/tools/dialogtool.cpp | 18 +----------------- src/app/dialogs/tools/dialogtool.h | 3 +-- 12 files changed, 30 insertions(+), 29 deletions(-) diff --git a/src/app/dialogs/tools/dialogalongline.cpp b/src/app/dialogs/tools/dialogalongline.cpp index b041e9819..10b640c93 100644 --- a/src/app/dialogs/tools/dialogalongline.cpp +++ b/src/app/dialogs/tools/dialogalongline.cpp @@ -43,7 +43,7 @@ DialogAlongLine::DialogAlongLine(const VContainer *data, const quint32 &toolId, QWidget *parent) :DialogTool(data, toolId, parent), ui(new Ui::DialogAlongLine), number(0), typeLine(QString()), formula(QString()), firstPointId(NULL_ID), secondPointId(NULL_ID), formulaBaseHeight(0), - line(nullptr) + line(nullptr), lineColor(VAbstractTool::ColorBlack) { ui->setupUi(this); InitVariables(ui); @@ -249,10 +249,23 @@ void DialogAlongLine::setFormula(const QString &value) void DialogAlongLine::setTypeLine(const QString &value) { typeLine = value; - SetupTypeLine(ui->comboBoxLineType, value); + ChangeCurrentData(ui->comboBoxLineType, value); line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); } +//--------------------------------------------------------------------------------------------------------------------- +QString DialogAlongLine::getLineColor() const +{ + return lineColor; +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogAlongLine::setLineColor(const QString &value) +{ + lineColor = value; + ChangeCurrentData(ui->comboBoxLineColor, value); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief setPointName set name of point diff --git a/src/app/dialogs/tools/dialogalongline.h b/src/app/dialogs/tools/dialogalongline.h index 01dd498a5..667c42aea 100644 --- a/src/app/dialogs/tools/dialogalongline.h +++ b/src/app/dialogs/tools/dialogalongline.h @@ -53,6 +53,9 @@ public: QString getTypeLine() const; void setTypeLine(const QString &value); + QString getLineColor() const; + void setLineColor(const QString &value); + QString getFormula() const; void setFormula(const QString &value); @@ -103,6 +106,8 @@ private: /** @brief formulaBaseHeight base height defined by dialogui */ int formulaBaseHeight; VisToolAlongLine *line; + + QString lineColor; }; //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogbisector.cpp b/src/app/dialogs/tools/dialogbisector.cpp index 9329de8a3..015818202 100644 --- a/src/app/dialogs/tools/dialogbisector.cpp +++ b/src/app/dialogs/tools/dialogbisector.cpp @@ -218,7 +218,7 @@ void DialogBisector::setPointName(const QString &value) void DialogBisector::setTypeLine(const QString &value) { typeLine = value; - SetupTypeLine(ui->comboBoxLineType, value); + ChangeCurrentData(ui->comboBoxLineType, value); line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); } diff --git a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp b/src/app/dialogs/tools/dialogcurveintersectaxis.cpp index feeb9ef55..85728e8a1 100644 --- a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp +++ b/src/app/dialogs/tools/dialogcurveintersectaxis.cpp @@ -103,7 +103,7 @@ QString DialogCurveIntersectAxis::getTypeLine() const void DialogCurveIntersectAxis::setTypeLine(const QString &value) { typeLine = value; - SetupTypeLine(ui->comboBoxLineType, value); + ChangeCurrentData(ui->comboBoxLineType, value); line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); } diff --git a/src/app/dialogs/tools/dialogendline.cpp b/src/app/dialogs/tools/dialogendline.cpp index 8c25748a5..af11b8778 100644 --- a/src/app/dialogs/tools/dialogendline.cpp +++ b/src/app/dialogs/tools/dialogendline.cpp @@ -173,7 +173,7 @@ void DialogEndLine::setPointName(const QString &value) void DialogEndLine::setTypeLine(const QString &value) { typeLine = value; - SetupTypeLine(ui->comboBoxLineType, value); + ChangeCurrentData(ui->comboBoxLineType, value); line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); } diff --git a/src/app/dialogs/tools/dialogheight.cpp b/src/app/dialogs/tools/dialogheight.cpp index 2a6d17084..898ebcfe9 100644 --- a/src/app/dialogs/tools/dialogheight.cpp +++ b/src/app/dialogs/tools/dialogheight.cpp @@ -97,7 +97,7 @@ void DialogHeight::setPointName(const QString &value) void DialogHeight::setTypeLine(const QString &value) { typeLine = value; - SetupTypeLine(ui->comboBoxLineType, value); + ChangeCurrentData(ui->comboBoxLineType, value); line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); } diff --git a/src/app/dialogs/tools/dialogline.cpp b/src/app/dialogs/tools/dialogline.cpp index 3f635a774..0c3cafc9c 100644 --- a/src/app/dialogs/tools/dialogline.cpp +++ b/src/app/dialogs/tools/dialogline.cpp @@ -96,7 +96,7 @@ void DialogLine::setSecondPoint(const quint32 &value) void DialogLine::setTypeLine(const QString &value) { typeLine = value; - SetupTypeLine(ui->comboBoxLineType, value); + ChangeCurrentData(ui->comboBoxLineType, value); line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); } diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.cpp b/src/app/dialogs/tools/dialoglineintersectaxis.cpp index 09cbb04e5..9e62e943b 100644 --- a/src/app/dialogs/tools/dialoglineintersectaxis.cpp +++ b/src/app/dialogs/tools/dialoglineintersectaxis.cpp @@ -112,7 +112,7 @@ QString DialogLineIntersectAxis::getTypeLine() const void DialogLineIntersectAxis::setTypeLine(const QString &value) { typeLine = value; - SetupTypeLine(ui->comboBoxLineType, value); + ChangeCurrentData(ui->comboBoxLineType, value); line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); } diff --git a/src/app/dialogs/tools/dialognormal.cpp b/src/app/dialogs/tools/dialognormal.cpp index 58947b0e4..53c934b03 100644 --- a/src/app/dialogs/tools/dialognormal.cpp +++ b/src/app/dialogs/tools/dialognormal.cpp @@ -255,7 +255,7 @@ void DialogNormal::setFormula(const QString &value) void DialogNormal::setTypeLine(const QString &value) { typeLine = value; - SetupTypeLine(ui->comboBoxLineType, value); + ChangeCurrentData(ui->comboBoxLineType, value); line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); } diff --git a/src/app/dialogs/tools/dialogshoulderpoint.cpp b/src/app/dialogs/tools/dialogshoulderpoint.cpp index 14ee285bb..cee6737cb 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.cpp +++ b/src/app/dialogs/tools/dialogshoulderpoint.cpp @@ -283,7 +283,7 @@ void DialogShoulderPoint::setFormula(const QString &value) void DialogShoulderPoint::setTypeLine(const QString &value) { typeLine = value; - SetupTypeLine(ui->comboBoxLineType, value); + ChangeCurrentData(ui->comboBoxLineType, value); line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); } diff --git a/src/app/dialogs/tools/dialogtool.cpp b/src/app/dialogs/tools/dialogtool.cpp index bcd73eab9..ba346bc1a 100644 --- a/src/app/dialogs/tools/dialogtool.cpp +++ b/src/app/dialogs/tools/dialogtool.cpp @@ -374,29 +374,13 @@ QString DialogTool::GetLineColor(const QComboBox *box) const return value; } -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief SetupTypeLine setupe type of line - * @param box combobox - * @param value string from pattern file - */ -void DialogTool::SetupTypeLine(QComboBox *box, const QString &value) -{ - SCASSERT(box != nullptr) - const qint32 index = box->findData(value); - if (index != -1) - { - box->setCurrentIndex(index); - } -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief ChangeCurrentData select item in combobox by id * @param box combobox * @param value id of item */ -void DialogTool::ChangeCurrentData(QComboBox *box, const quint32 &value) const +void DialogTool::ChangeCurrentData(QComboBox *box, const QVariant &value) const { SCASSERT(box != nullptr) const qint32 index = box->findData(value); diff --git a/src/app/dialogs/tools/dialogtool.h b/src/app/dialogs/tools/dialogtool.h index aad677211..a488b3db2 100644 --- a/src/app/dialogs/tools/dialogtool.h +++ b/src/app/dialogs/tools/dialogtool.h @@ -224,8 +224,7 @@ protected: QString GetLineColor(const QComboBox *box)const; template void ShowVariable(const QMap var); - void SetupTypeLine(QComboBox *box, const QString &value); - void ChangeCurrentData(QComboBox *box, const quint32 &value) const; + void ChangeCurrentData(QComboBox *box, const QVariant &value) const; void PutValHere(QLineEdit *lineEdit, QListWidget *listWidget); void PutValHere(QPlainTextEdit *plainTextEdit, QListWidget *listWidget); void ValFormulaChanged(bool &flag, QLineEdit *edit, QTimer * timer); From e3b54789f30c38d1a27e71e512bae64175e46ebe Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 2 Feb 2015 17:11:48 +0200 Subject: [PATCH 085/186] Refactoring. Move inline methods in cpp file. --HG-- branch : feature --- src/app/dialogs/tools/dialogalongline.cpp | 50 ++++++++++++++++ src/app/dialogs/tools/dialogalongline.h | 51 +--------------- src/app/dialogs/tools/dialogarc.cpp | 40 +++++++++++++ src/app/dialogs/tools/dialogarc.h | 40 ------------- src/app/dialogs/tools/dialogbisector.cpp | 60 +++++++++++++++++++ src/app/dialogs/tools/dialogbisector.h | 60 ------------------- src/app/dialogs/tools/dialogcutarc.cpp | 20 +++++++ src/app/dialogs/tools/dialogcutarc.h | 20 ------- src/app/dialogs/tools/dialogcutspline.cpp | 30 ++++++++++ src/app/dialogs/tools/dialogcutspline.h | 30 ---------- src/app/dialogs/tools/dialogcutsplinepath.cpp | 30 ++++++++++ src/app/dialogs/tools/dialogcutsplinepath.h | 30 ---------- src/app/dialogs/tools/dialogendline.cpp | 50 ++++++++++++++++ src/app/dialogs/tools/dialogendline.h | 52 ---------------- src/app/dialogs/tools/dialogheight.cpp | 50 ++++++++++++++++ src/app/dialogs/tools/dialogheight.h | 50 ---------------- src/app/dialogs/tools/dialogline.cpp | 30 ++++++++++ src/app/dialogs/tools/dialogline.h | 30 ---------- src/app/dialogs/tools/dialoglineintersect.cpp | 50 ++++++++++++++++ src/app/dialogs/tools/dialoglineintersect.h | 50 ---------------- src/app/dialogs/tools/dialognormal.cpp | 60 +++++++++++++++++++ src/app/dialogs/tools/dialognormal.h | 60 ------------------- .../dialogs/tools/dialogpointofcontact.cpp | 50 ++++++++++++++++ src/app/dialogs/tools/dialogpointofcontact.h | 50 ---------------- .../tools/dialogpointofintersection.cpp | 30 ++++++++++ .../dialogs/tools/dialogpointofintersection.h | 30 ---------- src/app/dialogs/tools/dialogshoulderpoint.cpp | 60 +++++++++++++++++++ src/app/dialogs/tools/dialogshoulderpoint.h | 60 ------------------- src/app/dialogs/tools/dialogsinglepoint.cpp | 20 +++++++ src/app/dialogs/tools/dialogsinglepoint.h | 20 ------- src/app/dialogs/tools/dialogspline.cpp | 50 ++++++++++++++++ src/app/dialogs/tools/dialogspline.h | 50 ---------------- src/app/dialogs/tools/dialogtriangle.cpp | 50 ++++++++++++++++ src/app/dialogs/tools/dialogtriangle.h | 50 ---------------- 34 files changed, 731 insertions(+), 732 deletions(-) diff --git a/src/app/dialogs/tools/dialogalongline.cpp b/src/app/dialogs/tools/dialogalongline.cpp index 10b640c93..27133a1c4 100644 --- a/src/app/dialogs/tools/dialogalongline.cpp +++ b/src/app/dialogs/tools/dialogalongline.cpp @@ -276,3 +276,53 @@ void DialogAlongLine::setPointName(const QString &value) pointName = value; ui->lineEditNamePoint->setText(pointName); } + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getPointName return name of point + * @return name + */ +QString DialogAlongLine::getPointName() const +{ + return pointName; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getTypeLine return type of line + * @return type + */ +QString DialogAlongLine::getTypeLine() const +{ + return typeLine; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getFormula return string of formula + * @return formula + */ +QString DialogAlongLine::getFormula() const +{ + return qApp->FormulaFromUser(formula); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getFirstPointId return id first point of line + * @return id + */ +quint32 DialogAlongLine::getFirstPointId() const +{ + return firstPointId; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getSecondPointId return id second point of line + * @return id + */ +quint32 DialogAlongLine::getSecondPointId() const +{ + return secondPointId; +} diff --git a/src/app/dialogs/tools/dialogalongline.h b/src/app/dialogs/tools/dialogalongline.h index 667c42aea..591603fa0 100644 --- a/src/app/dialogs/tools/dialogalongline.h +++ b/src/app/dialogs/tools/dialogalongline.h @@ -47,6 +47,7 @@ class DialogAlongLine : public DialogTool public: DialogAlongLine(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogAlongLine(); + QString getPointName() const; void setPointName(const QString &value); @@ -110,54 +111,4 @@ private: QString lineColor; }; -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name of point - * @return name - */ -inline QString DialogAlongLine::getPointName() const -{ - return pointName; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getTypeLine return type of line - * @return type - */ -inline QString DialogAlongLine::getTypeLine() const -{ - return typeLine; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getFormula return string of formula - * @return formula - */ -inline QString DialogAlongLine::getFormula() const -{ - return qApp->FormulaFromUser(formula); -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getFirstPointId return id first point of line - * @return id - */ -inline quint32 DialogAlongLine::getFirstPointId() const -{ - return firstPointId; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getSecondPointId return id second point of line - * @return id - */ -inline quint32 DialogAlongLine::getSecondPointId() const -{ - return secondPointId; -} - #endif // DIALOGALONGLINE_H diff --git a/src/app/dialogs/tools/dialogarc.cpp b/src/app/dialogs/tools/dialogarc.cpp index 3aa039f17..ccf6e0f2d 100644 --- a/src/app/dialogs/tools/dialogarc.cpp +++ b/src/app/dialogs/tools/dialogarc.cpp @@ -437,3 +437,43 @@ void DialogArc::CheckAngles() DialogArc::CheckState(); } + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetCenter return id of center point + * @return id id + */ +quint32 DialogArc::GetCenter() const +{ + return center; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetRadius return formula of radius + * @return formula + */ +QString DialogArc::GetRadius() const +{ + return radius; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetF1 return formula first angle of arc + * @return formula + */ +QString DialogArc::GetF1() const +{ + return f1; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetF2 return formula second angle of arc + * @return formula + */ +QString DialogArc::GetF2() const +{ + return f2; +} diff --git a/src/app/dialogs/tools/dialogarc.h b/src/app/dialogs/tools/dialogarc.h index 189e86abe..004d3fcf8 100644 --- a/src/app/dialogs/tools/dialogarc.h +++ b/src/app/dialogs/tools/dialogarc.h @@ -136,44 +136,4 @@ private: void CheckAngles(); }; -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief GetCenter return id of center point - * @return id id - */ -inline quint32 DialogArc::GetCenter() const -{ - return center; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief GetRadius return formula of radius - * @return formula - */ -inline QString DialogArc::GetRadius() const -{ - return radius; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief GetF1 return formula first angle of arc - * @return formula - */ -inline QString DialogArc::GetF1() const -{ - return f1; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief GetF2 return formula second angle of arc - * @return formula - */ -inline QString DialogArc::GetF2() const -{ - return f2; -} - #endif // DIALOGARC_H diff --git a/src/app/dialogs/tools/dialogbisector.cpp b/src/app/dialogs/tools/dialogbisector.cpp index 015818202..2952d0c48 100644 --- a/src/app/dialogs/tools/dialogbisector.cpp +++ b/src/app/dialogs/tools/dialogbisector.cpp @@ -298,3 +298,63 @@ void DialogBisector::closeEvent(QCloseEvent *event) ui->plainTextEditFormula->blockSignals(true); DialogTool::closeEvent(event); } + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getPointName return name of point + * @return name + */ +QString DialogBisector::getPointName() const +{ + return pointName; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getTypeLine return type of line + * @return type + */ +QString DialogBisector::getTypeLine() const +{ + return typeLine; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getFormula return string of formula + * @return formula + */ +QString DialogBisector::getFormula() const +{ + return qApp->FormulaFromUser(formula); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getFirstPointId return id of first point + * @return id + */ +quint32 DialogBisector::getFirstPointId() const +{ + return firstPointId; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getSecondPointId return id of second point + * @return id + */ +quint32 DialogBisector::getSecondPointId() const +{ + return secondPointId; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getThirdPointId return id of third point + * @return id + */ +quint32 DialogBisector::getThirdPointId() const +{ + return thirdPointId; +} diff --git a/src/app/dialogs/tools/dialogbisector.h b/src/app/dialogs/tools/dialogbisector.h index 2cc69c2ca..36f09da07 100644 --- a/src/app/dialogs/tools/dialogbisector.h +++ b/src/app/dialogs/tools/dialogbisector.h @@ -114,64 +114,4 @@ private: }; -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name of point - * @return name - */ -inline QString DialogBisector::getPointName() const -{ - return pointName; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getTypeLine return type of line - * @return type - */ -inline QString DialogBisector::getTypeLine() const -{ - return typeLine; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getFormula return string of formula - * @return formula - */ -inline QString DialogBisector::getFormula() const -{ - return qApp->FormulaFromUser(formula); -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getFirstPointId return id of first point - * @return id - */ -inline quint32 DialogBisector::getFirstPointId() const -{ - return firstPointId; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getSecondPointId return id of second point - * @return id - */ -inline quint32 DialogBisector::getSecondPointId() const -{ - return secondPointId; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getThirdPointId return id of third point - * @return id - */ -inline quint32 DialogBisector::getThirdPointId() const -{ - return thirdPointId; -} - #endif // DIALOGBISECTOR_H diff --git a/src/app/dialogs/tools/dialogcutarc.cpp b/src/app/dialogs/tools/dialogcutarc.cpp index 247e02dd2..ed12ca626 100644 --- a/src/app/dialogs/tools/dialogcutarc.cpp +++ b/src/app/dialogs/tools/dialogcutarc.cpp @@ -196,3 +196,23 @@ QString DialogCutArc::getFormula() const { return qApp->FormulaFromUser(formula); } + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getPointName return name point on arc + * @return name + */ +QString DialogCutArc::getPointName() const +{ + return pointName; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getArcId return id of arc + * @return id + */ +quint32 DialogCutArc::getArcId() const +{ + return arcId; +} diff --git a/src/app/dialogs/tools/dialogcutarc.h b/src/app/dialogs/tools/dialogcutarc.h index d2cf2f288..375642524 100644 --- a/src/app/dialogs/tools/dialogcutarc.h +++ b/src/app/dialogs/tools/dialogcutarc.h @@ -91,24 +91,4 @@ private: VisToolCutArc *path; }; -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name point on arc - * @return name - */ -inline QString DialogCutArc::getPointName() const -{ - return pointName; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getArcId return id of arc - * @return id - */ -inline quint32 DialogCutArc::getArcId() const -{ - return arcId; -} - #endif // DIALOGCUTARC_H diff --git a/src/app/dialogs/tools/dialogcutspline.cpp b/src/app/dialogs/tools/dialogcutspline.cpp index 7ed289dcc..5894681b3 100644 --- a/src/app/dialogs/tools/dialogcutspline.cpp +++ b/src/app/dialogs/tools/dialogcutspline.cpp @@ -179,3 +179,33 @@ void DialogCutSpline::ShowVisualization() path->RefreshGeometry(); } } + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getPointName return name of point + * @return name + */ +QString DialogCutSpline::getPointName() const +{ + return pointName; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getFormula return string of formula + * @return formula + */ +QString DialogCutSpline::getFormula() const +{ + return qApp->FormulaFromUser(formula); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getSplineId return id base point of line + * @return id + */ +quint32 DialogCutSpline::getSplineId() const +{ + return splineId; +} diff --git a/src/app/dialogs/tools/dialogcutspline.h b/src/app/dialogs/tools/dialogcutspline.h index 163d703c0..4eb871fa9 100644 --- a/src/app/dialogs/tools/dialogcutspline.h +++ b/src/app/dialogs/tools/dialogcutspline.h @@ -87,34 +87,4 @@ private: VisToolCutSpline *path; }; -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name of point - * @return name - */ -inline QString DialogCutSpline::getPointName() const -{ - return pointName; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getFormula return string of formula - * @return formula - */ -inline QString DialogCutSpline::getFormula() const -{ - return qApp->FormulaFromUser(formula); -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getSplineId return id base point of line - * @return id - */ -inline quint32 DialogCutSpline::getSplineId() const -{ - return splineId; -} - #endif // DIALOGCUTSPLINE_H diff --git a/src/app/dialogs/tools/dialogcutsplinepath.cpp b/src/app/dialogs/tools/dialogcutsplinepath.cpp index 6367feae9..5eb72b3f9 100644 --- a/src/app/dialogs/tools/dialogcutsplinepath.cpp +++ b/src/app/dialogs/tools/dialogcutsplinepath.cpp @@ -179,3 +179,33 @@ void DialogCutSplinePath::ShowVisualization() path->RefreshGeometry(); } } + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getPointName return name of point + * @return name + */ +QString DialogCutSplinePath::getPointName() const +{ + return pointName; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getFormula return string of formula + * @return formula + */ +QString DialogCutSplinePath::getFormula() const +{ + return qApp->FormulaFromUser(formula); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getSplineId return id base point of line + * @return id + */ +quint32 DialogCutSplinePath::getSplinePathId() const +{ + return splinePathId; +} diff --git a/src/app/dialogs/tools/dialogcutsplinepath.h b/src/app/dialogs/tools/dialogcutsplinepath.h index 063cd316b..c9cb2fca9 100644 --- a/src/app/dialogs/tools/dialogcutsplinepath.h +++ b/src/app/dialogs/tools/dialogcutsplinepath.h @@ -87,34 +87,4 @@ private: VisToolCutSplinePath *path; }; -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name of point - * @return name - */ -inline QString DialogCutSplinePath::getPointName() const -{ - return pointName; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getFormula return string of formula - * @return formula - */ -inline QString DialogCutSplinePath::getFormula() const -{ - return qApp->FormulaFromUser(formula); -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getSplineId return id base point of line - * @return id - */ -inline quint32 DialogCutSplinePath::getSplinePathId() const -{ - return splinePathId; -} - #endif // DIALOGCUTSPLINEPATH_H diff --git a/src/app/dialogs/tools/dialogendline.cpp b/src/app/dialogs/tools/dialogendline.cpp index af11b8778..62770a73f 100644 --- a/src/app/dialogs/tools/dialogendline.cpp +++ b/src/app/dialogs/tools/dialogendline.cpp @@ -309,3 +309,53 @@ DialogEndLine::~DialogEndLine() } delete ui; } + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getPointName return name of point + * @return name + */ +QString DialogEndLine::getPointName() const +{ + return pointName; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getTypeLine return type of line + * @return type + */ +QString DialogEndLine::getTypeLine() const +{ + return typeLine; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getFormula return string of formula + * @return formula + */ +QString DialogEndLine::getFormula() const +{ + return qApp->FormulaFromUser(formulaLength); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getAngle return formula angle of line + * @return angle formula + */ +QString DialogEndLine::getAngle() const +{ + return qApp->FormulaFromUser(formulaAngle); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getBasePointId return id base point of line + * @return id + */ +quint32 DialogEndLine::getBasePointId() const +{ + return basePointId; +} diff --git a/src/app/dialogs/tools/dialogendline.h b/src/app/dialogs/tools/dialogendline.h index 0747f4b65..5ef3cd6ca 100644 --- a/src/app/dialogs/tools/dialogendline.h +++ b/src/app/dialogs/tools/dialogendline.h @@ -107,58 +107,6 @@ private: int formulaBaseHeightAngle; VisToolEndLine *line; - - }; -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name of point - * @return name - */ -inline QString DialogEndLine::getPointName() const -{ - return pointName; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getTypeLine return type of line - * @return type - */ -inline QString DialogEndLine::getTypeLine() const -{ - return typeLine; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getFormula return string of formula - * @return formula - */ -inline QString DialogEndLine::getFormula() const -{ - return qApp->FormulaFromUser(formulaLength); -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getAngle return formula angle of line - * @return angle formula - */ -inline QString DialogEndLine::getAngle() const -{ - return qApp->FormulaFromUser(formulaAngle); -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getBasePointId return id base point of line - * @return id - */ -inline quint32 DialogEndLine::getBasePointId() const -{ - return basePointId; -} - #endif // DIALOGENDLINE_H diff --git a/src/app/dialogs/tools/dialogheight.cpp b/src/app/dialogs/tools/dialogheight.cpp index 898ebcfe9..95acb0c79 100644 --- a/src/app/dialogs/tools/dialogheight.cpp +++ b/src/app/dialogs/tools/dialogheight.cpp @@ -263,3 +263,53 @@ void DialogHeight::ShowVisualization() line->RefreshGeometry(); } } + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getPointName return name of point + * @return name + */ +QString DialogHeight::getPointName() const +{ + return pointName; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getTypeLine return type of line + * @return type + */ +QString DialogHeight::getTypeLine() const +{ + return typeLine; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getBasePointId return id base point of height + * @return id + */ +quint32 DialogHeight::getBasePointId() const +{ + return basePointId; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getP1LineId return id first point of line + * @return id id + */ +quint32 DialogHeight::getP1LineId() const +{ + return p1LineId; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getP2LineId return id second point of line + * @return id + */ +quint32 DialogHeight::getP2LineId() const +{ + return p2LineId; +} diff --git a/src/app/dialogs/tools/dialogheight.h b/src/app/dialogs/tools/dialogheight.h index 8c384b145..03950da35 100644 --- a/src/app/dialogs/tools/dialogheight.h +++ b/src/app/dialogs/tools/dialogheight.h @@ -95,54 +95,4 @@ private: VisToolHeight *line; }; -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name of point - * @return name - */ -inline QString DialogHeight::getPointName() const -{ - return pointName; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getTypeLine return type of line - * @return type - */ -inline QString DialogHeight::getTypeLine() const -{ - return typeLine; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getBasePointId return id base point of height - * @return id - */ -inline quint32 DialogHeight::getBasePointId() const -{ - return basePointId; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getP1LineId return id first point of line - * @return id id - */ -inline quint32 DialogHeight::getP1LineId() const -{ - return p1LineId; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getP2LineId return id second point of line - * @return id - */ -inline quint32 DialogHeight::getP2LineId() const -{ - return p2LineId; -} - #endif // DIALOGHEIGHT_H diff --git a/src/app/dialogs/tools/dialogline.cpp b/src/app/dialogs/tools/dialogline.cpp index 0c3cafc9c..11e4bd175 100644 --- a/src/app/dialogs/tools/dialogline.cpp +++ b/src/app/dialogs/tools/dialogline.cpp @@ -204,3 +204,33 @@ void DialogLine::ChosenObject(quint32 id, const SceneObject &type) } } } + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getFirstPoint return id first point + * @return id + */ +quint32 DialogLine::getFirstPoint() const +{ + return firstPoint; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getSecondPoint return id second point + * @return id + */ +quint32 DialogLine::getSecondPoint() const +{ + return secondPoint; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getTypeLine return type of line + * @return type + */ +QString DialogLine::getTypeLine() const +{ + return typeLine; +} diff --git a/src/app/dialogs/tools/dialogline.h b/src/app/dialogs/tools/dialogline.h index c08d061b0..b48bbe2a4 100644 --- a/src/app/dialogs/tools/dialogline.h +++ b/src/app/dialogs/tools/dialogline.h @@ -87,34 +87,4 @@ private: }; -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getFirstPoint return id first point - * @return id - */ -inline quint32 DialogLine::getFirstPoint() const -{ - return firstPoint; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getSecondPoint return id second point - * @return id - */ -inline quint32 DialogLine::getSecondPoint() const -{ - return secondPoint; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getTypeLine return type of line - * @return type - */ -inline QString DialogLine::getTypeLine() const -{ - return typeLine; -} - #endif // DIALOGLINE_H diff --git a/src/app/dialogs/tools/dialoglineintersect.cpp b/src/app/dialogs/tools/dialoglineintersect.cpp index ae45b1589..25cf95713 100644 --- a/src/app/dialogs/tools/dialoglineintersect.cpp +++ b/src/app/dialogs/tools/dialoglineintersect.cpp @@ -390,3 +390,53 @@ void DialogLineIntersect::setPointName(const QString &value) pointName = value; ui->lineEditNamePoint->setText(pointName); } + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getP1Line1 return id first point of first line + * @return id + */ +quint32 DialogLineIntersect::getP1Line1() const +{ + return p1Line1; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getP2Line1 return id second point of first line + * @return id + */ +quint32 DialogLineIntersect::getP2Line1() const +{ + return p2Line1; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getP1Line2 return id first point of second line + * @return id + */ +quint32 DialogLineIntersect::getP1Line2() const +{ + return p1Line2; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getP2Line2 return id second point of second line + * @return id + */ +quint32 DialogLineIntersect::getP2Line2() const +{ + return p2Line2; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getPointName return name of point + * @return name of point + */ +QString DialogLineIntersect::getPointName() const +{ + return pointName; +} diff --git a/src/app/dialogs/tools/dialoglineintersect.h b/src/app/dialogs/tools/dialoglineintersect.h index 93f686f73..2f470c120 100644 --- a/src/app/dialogs/tools/dialoglineintersect.h +++ b/src/app/dialogs/tools/dialoglineintersect.h @@ -106,54 +106,4 @@ private: bool CheckIntersecion(); }; -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getP1Line1 return id first point of first line - * @return id - */ -inline quint32 DialogLineIntersect::getP1Line1() const -{ - return p1Line1; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getP2Line1 return id second point of first line - * @return id - */ -inline quint32 DialogLineIntersect::getP2Line1() const -{ - return p2Line1; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getP1Line2 return id first point of second line - * @return id - */ -inline quint32 DialogLineIntersect::getP1Line2() const -{ - return p1Line2; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getP2Line2 return id second point of second line - * @return id - */ -inline quint32 DialogLineIntersect::getP2Line2() const -{ - return p2Line2; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name of point - * @return name of point - */ -inline QString DialogLineIntersect::getPointName() const -{ - return pointName; -} - #endif // DIALOGLINEINTERSECT_H diff --git a/src/app/dialogs/tools/dialognormal.cpp b/src/app/dialogs/tools/dialognormal.cpp index 53c934b03..109c38d37 100644 --- a/src/app/dialogs/tools/dialognormal.cpp +++ b/src/app/dialogs/tools/dialognormal.cpp @@ -269,3 +269,63 @@ void DialogNormal::setPointName(const QString &value) pointName = value; ui->lineEditNamePoint->setText(pointName); } + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getPointName return name of point + * @return name + */ +QString DialogNormal::getPointName() const +{ + return pointName; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getTypeLine return type of line + * @return type + */ +QString DialogNormal::getTypeLine() const +{ + return typeLine; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getFormula return string of formula + * @return formula + */ +QString DialogNormal::getFormula() const +{ + return qApp->FormulaFromUser(formula); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getAngle return aditional angle of normal + * @return angle in degree + */ +qreal DialogNormal::getAngle() const +{ + return angle; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getFirstPointId return id of first point + * @return id + */ +quint32 DialogNormal::getFirstPointId() const +{ + return firstPointId; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getSecondPointId return id of second point + * @return id + */ +quint32 DialogNormal::getSecondPointId() const +{ + return secondPointId; +} diff --git a/src/app/dialogs/tools/dialognormal.h b/src/app/dialogs/tools/dialognormal.h index 0b346d473..cdeb8d5b2 100644 --- a/src/app/dialogs/tools/dialognormal.h +++ b/src/app/dialogs/tools/dialognormal.h @@ -113,64 +113,4 @@ private: VisToolNormal *line; }; -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name of point - * @return name - */ -inline QString DialogNormal::getPointName() const -{ - return pointName; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getTypeLine return type of line - * @return type - */ -inline QString DialogNormal::getTypeLine() const -{ - return typeLine; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getFormula return string of formula - * @return formula - */ -inline QString DialogNormal::getFormula() const -{ - return qApp->FormulaFromUser(formula); -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getAngle return aditional angle of normal - * @return angle in degree - */ -inline qreal DialogNormal::getAngle() const -{ - return angle; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getFirstPointId return id of first point - * @return id - */ -inline quint32 DialogNormal::getFirstPointId() const -{ - return firstPointId; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getSecondPointId return id of second point - * @return id - */ -inline quint32 DialogNormal::getSecondPointId() const -{ - return secondPointId; -} - #endif // DIALOGNORMAL_H diff --git a/src/app/dialogs/tools/dialogpointofcontact.cpp b/src/app/dialogs/tools/dialogpointofcontact.cpp index 27e6e3ae3..862989aa2 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.cpp +++ b/src/app/dialogs/tools/dialogpointofcontact.cpp @@ -296,3 +296,53 @@ void DialogPointOfContact::setPointName(const QString &value) pointName = value; ui->lineEditNamePoint->setText(pointName); } + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getPointName return name of point + * @return name + */ +QString DialogPointOfContact::getPointName() const +{ + return pointName; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getRadius return formula radius of arc + * @return formula + */ +QString DialogPointOfContact::getRadius() const +{ + return radius; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetCenter return id of center point + * @return id + */ +quint32 DialogPointOfContact::getCenter() const +{ + return center; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getFirstPoint return id first point + * @return id + */ +quint32 DialogPointOfContact::getFirstPoint() const +{ + return firstPoint; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getSecondPoint return id second point + * @return id + */ +quint32 DialogPointOfContact::getSecondPoint() const +{ + return secondPoint; +} diff --git a/src/app/dialogs/tools/dialogpointofcontact.h b/src/app/dialogs/tools/dialogpointofcontact.h index 2b7126f3e..2fef8c4fc 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.h +++ b/src/app/dialogs/tools/dialogpointofcontact.h @@ -108,54 +108,4 @@ private: VisToolPointOfContact *line; }; -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name of point - * @return name - */ -inline QString DialogPointOfContact::getPointName() const -{ - return pointName; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getRadius return formula radius of arc - * @return formula - */ -inline QString DialogPointOfContact::getRadius() const -{ - return radius; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief GetCenter return id of center point - * @return id - */ -inline quint32 DialogPointOfContact::getCenter() const -{ - return center; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getFirstPoint return id first point - * @return id - */ -inline quint32 DialogPointOfContact::getFirstPoint() const -{ - return firstPoint; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getSecondPoint return id second point - * @return id - */ -inline quint32 DialogPointOfContact::getSecondPoint() const -{ - return secondPoint; -} - #endif // DIALOGPOINTOFCONTACT_H diff --git a/src/app/dialogs/tools/dialogpointofintersection.cpp b/src/app/dialogs/tools/dialogpointofintersection.cpp index 5f565ddeb..11420fa44 100644 --- a/src/app/dialogs/tools/dialogpointofintersection.cpp +++ b/src/app/dialogs/tools/dialogpointofintersection.cpp @@ -200,3 +200,33 @@ void DialogPointOfIntersection::setPointName(const QString &value) pointName = value; ui->lineEditNamePoint->setText(pointName); } + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getPointName return name of point + * @return name + */ +QString DialogPointOfIntersection::getPointName() const +{ + return pointName; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getFirstPointId return id of first point + * @return id + */ +quint32 DialogPointOfIntersection::getFirstPointId() const +{ + return firstPointId; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getSecondPointId return id of second point + * @return id + */ +quint32 DialogPointOfIntersection::getSecondPointId() const +{ + return secondPointId; +} diff --git a/src/app/dialogs/tools/dialogpointofintersection.h b/src/app/dialogs/tools/dialogpointofintersection.h index 00fb7648b..3ca3b4f8f 100644 --- a/src/app/dialogs/tools/dialogpointofintersection.h +++ b/src/app/dialogs/tools/dialogpointofintersection.h @@ -83,34 +83,4 @@ private: VisToolPointOfIntersection *line; }; -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name of point - * @return name - */ -inline QString DialogPointOfIntersection::getPointName() const -{ - return pointName; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getFirstPointId return id of first point - * @return id - */ -inline quint32 DialogPointOfIntersection::getFirstPointId() const -{ - return firstPointId; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getSecondPointId return id of second point - * @return id - */ -inline quint32 DialogPointOfIntersection::getSecondPointId() const -{ - return secondPointId; -} - #endif // DIALOGPOINTOFINTERSECTION_H diff --git a/src/app/dialogs/tools/dialogshoulderpoint.cpp b/src/app/dialogs/tools/dialogshoulderpoint.cpp index cee6737cb..359ddd072 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.cpp +++ b/src/app/dialogs/tools/dialogshoulderpoint.cpp @@ -297,3 +297,63 @@ void DialogShoulderPoint::setPointName(const QString &value) pointName = value; ui->lineEditNamePoint->setText(pointName); } + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getPointName return name of point + * @return name + */ +QString DialogShoulderPoint::getPointName() const +{ + return pointName; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getTypeLine return type of line + * @return type + */ +QString DialogShoulderPoint::getTypeLine() const +{ + return typeLine; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getFormula return string of formula + * @return formula + */ +QString DialogShoulderPoint::getFormula() const +{ + return qApp->FormulaFromUser(formula); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getP1Line return id first point of line + * @return id + */ +quint32 DialogShoulderPoint::getP1Line() const +{ + return p1Line; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getP2Line return id second point of line + * @return id + */ +quint32 DialogShoulderPoint::getP2Line() const +{ + return p2Line; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getPShoulder return id shoulder point + * @return id + */ +quint32 DialogShoulderPoint::getP3() const +{ + return pShoulder; +} diff --git a/src/app/dialogs/tools/dialogshoulderpoint.h b/src/app/dialogs/tools/dialogshoulderpoint.h index 47c1d489c..66dd2f0d4 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.h +++ b/src/app/dialogs/tools/dialogshoulderpoint.h @@ -112,64 +112,4 @@ private: VisToolShoulderPoint *line; }; -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name of point - * @return name - */ -inline QString DialogShoulderPoint::getPointName() const -{ - return pointName; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getTypeLine return type of line - * @return type - */ -inline QString DialogShoulderPoint::getTypeLine() const -{ - return typeLine; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getFormula return string of formula - * @return formula - */ -inline QString DialogShoulderPoint::getFormula() const -{ - return qApp->FormulaFromUser(formula); -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getP1Line return id first point of line - * @return id - */ -inline quint32 DialogShoulderPoint::getP1Line() const -{ - return p1Line; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getP2Line return id second point of line - * @return id - */ -inline quint32 DialogShoulderPoint::getP2Line() const -{ - return p2Line; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPShoulder return id shoulder point - * @return id - */ -inline quint32 DialogShoulderPoint::getP3() const -{ - return pShoulder; -} - #endif // DIALOGSHOULDERPOINT_H diff --git a/src/app/dialogs/tools/dialogsinglepoint.cpp b/src/app/dialogs/tools/dialogsinglepoint.cpp index 3c95d069c..23a0f4ba4 100644 --- a/src/app/dialogs/tools/dialogsinglepoint.cpp +++ b/src/app/dialogs/tools/dialogsinglepoint.cpp @@ -107,3 +107,23 @@ DialogSinglePoint::~DialogSinglePoint() { delete ui; } + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getName return name + * @return name + */ +QString DialogSinglePoint::getName() const +{ + return pointName; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getPoint return point + * @return point + */ +QPointF DialogSinglePoint::getPoint() const +{ + return point; +} diff --git a/src/app/dialogs/tools/dialogsinglepoint.h b/src/app/dialogs/tools/dialogsinglepoint.h index 86e489ab9..80b6ee226 100644 --- a/src/app/dialogs/tools/dialogsinglepoint.h +++ b/src/app/dialogs/tools/dialogsinglepoint.h @@ -66,24 +66,4 @@ private: QPointF point; }; -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getName return name - * @return name - */ -inline QString DialogSinglePoint::getName() const -{ - return pointName; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPoint return point - * @return point - */ -inline QPointF DialogSinglePoint::getPoint() const -{ - return point; -} - #endif // DIALOGSINGLEPOINT_H diff --git a/src/app/dialogs/tools/dialogspline.cpp b/src/app/dialogs/tools/dialogspline.cpp index 3590fdde4..26c753773 100644 --- a/src/app/dialogs/tools/dialogspline.cpp +++ b/src/app/dialogs/tools/dialogspline.cpp @@ -294,3 +294,53 @@ quint32 DialogSpline::getP4() const { return p4; } + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getAngle1 return first angle of spline + * @return angle in degree + */ +qreal DialogSpline::getAngle1() const +{ + return angle1; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getAngle2 return second angle of spline + * @return angle in degree + */ +qreal DialogSpline::getAngle2() const +{ + return angle2; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getKAsm1 return first coefficient asymmetry + * @return value. Can be >= 0. + */ +qreal DialogSpline::getKAsm1() const +{ + return kAsm1; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getKAsm2 return second coefficient asymmetry + * @return value. Can be >= 0. + */ +qreal DialogSpline::getKAsm2() const +{ + return kAsm2; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getKCurve return coefficient curve + * @return value. Can be >= 0. + */ +qreal DialogSpline::getKCurve() const +{ + return kCurve; +} diff --git a/src/app/dialogs/tools/dialogspline.h b/src/app/dialogs/tools/dialogspline.h index 20d97f396..540c034e5 100644 --- a/src/app/dialogs/tools/dialogspline.h +++ b/src/app/dialogs/tools/dialogspline.h @@ -111,54 +111,4 @@ private: VisToolSpline *path; }; -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getAngle1 return first angle of spline - * @return angle in degree - */ -inline qreal DialogSpline::getAngle1() const -{ - return angle1; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getAngle2 return second angle of spline - * @return angle in degree - */ -inline qreal DialogSpline::getAngle2() const -{ - return angle2; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getKAsm1 return first coefficient asymmetry - * @return value. Can be >= 0. - */ -inline qreal DialogSpline::getKAsm1() const -{ - return kAsm1; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getKAsm2 return second coefficient asymmetry - * @return value. Can be >= 0. - */ -inline qreal DialogSpline::getKAsm2() const -{ - return kAsm2; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getKCurve return coefficient curve - * @return value. Can be >= 0. - */ -inline qreal DialogSpline::getKCurve() const -{ - return kCurve; -} - #endif // DIALOGSPLINE_H diff --git a/src/app/dialogs/tools/dialogtriangle.cpp b/src/app/dialogs/tools/dialogtriangle.cpp index a0a21e7a3..e61fced17 100644 --- a/src/app/dialogs/tools/dialogtriangle.cpp +++ b/src/app/dialogs/tools/dialogtriangle.cpp @@ -275,3 +275,53 @@ void DialogTriangle::setAxisP1Id(const quint32 &value) setPointId(ui->comboBoxAxisP1, axisP1Id, value); line->setPoint1Id(axisP1Id); } + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getAxisP1Id return id first point of axis + * @return id + */ +quint32 DialogTriangle::getAxisP1Id() const +{ + return axisP1Id; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getAxisP2Id return id second point of axis + * @return id + */ +quint32 DialogTriangle::getAxisP2Id() const +{ + return axisP2Id; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getFirstPointId return id of first point + * @return id + */ +quint32 DialogTriangle::getFirstPointId() const +{ + return firstPointId; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getSecondPointId return id of second point + * @return id + */ +quint32 DialogTriangle::getSecondPointId() const +{ + return secondPointId; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getPointName return name of point + * @return name + */ +QString DialogTriangle::getPointName() const +{ + return pointName; +} diff --git a/src/app/dialogs/tools/dialogtriangle.h b/src/app/dialogs/tools/dialogtriangle.h index 9ca29765c..8b1577b37 100644 --- a/src/app/dialogs/tools/dialogtriangle.h +++ b/src/app/dialogs/tools/dialogtriangle.h @@ -96,54 +96,4 @@ private: VisToolTriangle *line; }; -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getAxisP1Id return id first point of axis - * @return id - */ -inline quint32 DialogTriangle::getAxisP1Id() const -{ - return axisP1Id; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getAxisP2Id return id second point of axis - * @return id - */ -inline quint32 DialogTriangle::getAxisP2Id() const -{ - return axisP2Id; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getFirstPointId return id of first point - * @return id - */ -inline quint32 DialogTriangle::getFirstPointId() const -{ - return firstPointId; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getSecondPointId return id of second point - * @return id - */ -inline quint32 DialogTriangle::getSecondPointId() const -{ - return secondPointId; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name of point - * @return name - */ -inline QString DialogTriangle::getPointName() const -{ - return pointName; -} - #endif // DIALOGTRIANGLE_H From d5836e2fb31132e8f65e7b248009f97bb08dd143 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 2 Feb 2015 18:35:40 +0200 Subject: [PATCH 086/186] Refactoring. Left method getPointName only in parent class. --HG-- branch : feature --- src/app/dialogs/tools/dialogalongline.cpp | 10 ---------- src/app/dialogs/tools/dialogalongline.h | 1 - src/app/dialogs/tools/dialogbisector.cpp | 10 ---------- src/app/dialogs/tools/dialogbisector.h | 1 - src/app/dialogs/tools/dialogcurveintersectaxis.cpp | 6 ------ src/app/dialogs/tools/dialogcurveintersectaxis.h | 1 - src/app/dialogs/tools/dialogcutarc.cpp | 10 ---------- src/app/dialogs/tools/dialogcutarc.h | 1 - src/app/dialogs/tools/dialogcutspline.cpp | 10 ---------- src/app/dialogs/tools/dialogcutspline.h | 1 - src/app/dialogs/tools/dialogcutsplinepath.cpp | 10 ---------- src/app/dialogs/tools/dialogcutsplinepath.h | 1 - src/app/dialogs/tools/dialogendline.cpp | 10 ---------- src/app/dialogs/tools/dialogendline.h | 1 - src/app/dialogs/tools/dialogheight.cpp | 10 ---------- src/app/dialogs/tools/dialogheight.h | 1 - src/app/dialogs/tools/dialoglineintersect.cpp | 10 ---------- src/app/dialogs/tools/dialoglineintersect.h | 1 - src/app/dialogs/tools/dialoglineintersectaxis.cpp | 6 ------ src/app/dialogs/tools/dialoglineintersectaxis.h | 1 - src/app/dialogs/tools/dialognormal.cpp | 10 ---------- src/app/dialogs/tools/dialognormal.h | 1 - src/app/dialogs/tools/dialogpointofcontact.cpp | 10 ---------- src/app/dialogs/tools/dialogpointofcontact.h | 1 - src/app/dialogs/tools/dialogpointofintersection.cpp | 10 ---------- src/app/dialogs/tools/dialogpointofintersection.h | 1 - src/app/dialogs/tools/dialogshoulderpoint.cpp | 10 ---------- src/app/dialogs/tools/dialogshoulderpoint.h | 1 - src/app/dialogs/tools/dialogsinglepoint.cpp | 10 ---------- src/app/dialogs/tools/dialogsinglepoint.h | 1 - src/app/dialogs/tools/dialogtool.cpp | 6 ++++++ src/app/dialogs/tools/dialogtool.h | 2 ++ src/app/dialogs/tools/dialogtriangle.cpp | 10 ---------- src/app/dialogs/tools/dialogtriangle.h | 1 - src/app/tools/drawTools/vtoolsinglepoint.cpp | 2 +- 35 files changed, 9 insertions(+), 169 deletions(-) diff --git a/src/app/dialogs/tools/dialogalongline.cpp b/src/app/dialogs/tools/dialogalongline.cpp index 27133a1c4..686d43a8b 100644 --- a/src/app/dialogs/tools/dialogalongline.cpp +++ b/src/app/dialogs/tools/dialogalongline.cpp @@ -277,16 +277,6 @@ void DialogAlongLine::setPointName(const QString &value) ui->lineEditNamePoint->setText(pointName); } -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name of point - * @return name - */ -QString DialogAlongLine::getPointName() const -{ - return pointName; -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief getTypeLine return type of line diff --git a/src/app/dialogs/tools/dialogalongline.h b/src/app/dialogs/tools/dialogalongline.h index 591603fa0..e8122473a 100644 --- a/src/app/dialogs/tools/dialogalongline.h +++ b/src/app/dialogs/tools/dialogalongline.h @@ -48,7 +48,6 @@ public: DialogAlongLine(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogAlongLine(); - QString getPointName() const; void setPointName(const QString &value); QString getTypeLine() const; diff --git a/src/app/dialogs/tools/dialogbisector.cpp b/src/app/dialogs/tools/dialogbisector.cpp index 2952d0c48..ed1c31ec0 100644 --- a/src/app/dialogs/tools/dialogbisector.cpp +++ b/src/app/dialogs/tools/dialogbisector.cpp @@ -299,16 +299,6 @@ void DialogBisector::closeEvent(QCloseEvent *event) DialogTool::closeEvent(event); } -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name of point - * @return name - */ -QString DialogBisector::getPointName() const -{ - return pointName; -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief getTypeLine return type of line diff --git a/src/app/dialogs/tools/dialogbisector.h b/src/app/dialogs/tools/dialogbisector.h index 36f09da07..ee26a8a0c 100644 --- a/src/app/dialogs/tools/dialogbisector.h +++ b/src/app/dialogs/tools/dialogbisector.h @@ -49,7 +49,6 @@ public: DialogBisector(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogBisector(); - QString getPointName() const; void setPointName(const QString &value); QString getTypeLine() const; diff --git a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp b/src/app/dialogs/tools/dialogcurveintersectaxis.cpp index 85728e8a1..59081bed3 100644 --- a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp +++ b/src/app/dialogs/tools/dialogcurveintersectaxis.cpp @@ -80,12 +80,6 @@ DialogCurveIntersectAxis::~DialogCurveIntersectAxis() delete ui; } -//--------------------------------------------------------------------------------------------------------------------- -QString DialogCurveIntersectAxis::getPointName() const -{ - return pointName; -} - //--------------------------------------------------------------------------------------------------------------------- void DialogCurveIntersectAxis::setPointName(const QString &value) { diff --git a/src/app/dialogs/tools/dialogcurveintersectaxis.h b/src/app/dialogs/tools/dialogcurveintersectaxis.h index 9ab667062..b2b927dbc 100644 --- a/src/app/dialogs/tools/dialogcurveintersectaxis.h +++ b/src/app/dialogs/tools/dialogcurveintersectaxis.h @@ -45,7 +45,6 @@ public: DialogCurveIntersectAxis(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogCurveIntersectAxis(); - QString getPointName() const; void setPointName(const QString &value); QString getTypeLine() const; diff --git a/src/app/dialogs/tools/dialogcutarc.cpp b/src/app/dialogs/tools/dialogcutarc.cpp index ed12ca626..5948de364 100644 --- a/src/app/dialogs/tools/dialogcutarc.cpp +++ b/src/app/dialogs/tools/dialogcutarc.cpp @@ -197,16 +197,6 @@ QString DialogCutArc::getFormula() const return qApp->FormulaFromUser(formula); } -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name point on arc - * @return name - */ -QString DialogCutArc::getPointName() const -{ - return pointName; -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief getArcId return id of arc diff --git a/src/app/dialogs/tools/dialogcutarc.h b/src/app/dialogs/tools/dialogcutarc.h index 375642524..acc788103 100644 --- a/src/app/dialogs/tools/dialogcutarc.h +++ b/src/app/dialogs/tools/dialogcutarc.h @@ -49,7 +49,6 @@ public: DialogCutArc(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogCutArc(); - QString getPointName() const; void setPointName(const QString &value); QString getFormula() const; diff --git a/src/app/dialogs/tools/dialogcutspline.cpp b/src/app/dialogs/tools/dialogcutspline.cpp index 5894681b3..7e9961295 100644 --- a/src/app/dialogs/tools/dialogcutspline.cpp +++ b/src/app/dialogs/tools/dialogcutspline.cpp @@ -180,16 +180,6 @@ void DialogCutSpline::ShowVisualization() } } -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name of point - * @return name - */ -QString DialogCutSpline::getPointName() const -{ - return pointName; -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief getFormula return string of formula diff --git a/src/app/dialogs/tools/dialogcutspline.h b/src/app/dialogs/tools/dialogcutspline.h index 4eb871fa9..d4f5c0142 100644 --- a/src/app/dialogs/tools/dialogcutspline.h +++ b/src/app/dialogs/tools/dialogcutspline.h @@ -48,7 +48,6 @@ public: DialogCutSpline(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogCutSpline(); - QString getPointName() const; void setPointName(const QString &value); QString getFormula() const; diff --git a/src/app/dialogs/tools/dialogcutsplinepath.cpp b/src/app/dialogs/tools/dialogcutsplinepath.cpp index 5eb72b3f9..c8b2386a5 100644 --- a/src/app/dialogs/tools/dialogcutsplinepath.cpp +++ b/src/app/dialogs/tools/dialogcutsplinepath.cpp @@ -180,16 +180,6 @@ void DialogCutSplinePath::ShowVisualization() } } -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name of point - * @return name - */ -QString DialogCutSplinePath::getPointName() const -{ - return pointName; -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief getFormula return string of formula diff --git a/src/app/dialogs/tools/dialogcutsplinepath.h b/src/app/dialogs/tools/dialogcutsplinepath.h index c9cb2fca9..57d2e2800 100644 --- a/src/app/dialogs/tools/dialogcutsplinepath.h +++ b/src/app/dialogs/tools/dialogcutsplinepath.h @@ -48,7 +48,6 @@ public: DialogCutSplinePath(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogCutSplinePath(); - QString getPointName() const; void setPointName(const QString &value); QString getFormula() const; diff --git a/src/app/dialogs/tools/dialogendline.cpp b/src/app/dialogs/tools/dialogendline.cpp index 62770a73f..b403d94ea 100644 --- a/src/app/dialogs/tools/dialogendline.cpp +++ b/src/app/dialogs/tools/dialogendline.cpp @@ -310,16 +310,6 @@ DialogEndLine::~DialogEndLine() delete ui; } -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name of point - * @return name - */ -QString DialogEndLine::getPointName() const -{ - return pointName; -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief getTypeLine return type of line diff --git a/src/app/dialogs/tools/dialogendline.h b/src/app/dialogs/tools/dialogendline.h index 5ef3cd6ca..d6b938d6c 100644 --- a/src/app/dialogs/tools/dialogendline.h +++ b/src/app/dialogs/tools/dialogendline.h @@ -48,7 +48,6 @@ public: DialogEndLine(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogEndLine(); - QString getPointName() const; void setPointName(const QString &value); QString getTypeLine() const; diff --git a/src/app/dialogs/tools/dialogheight.cpp b/src/app/dialogs/tools/dialogheight.cpp index 95acb0c79..2b68e9a47 100644 --- a/src/app/dialogs/tools/dialogheight.cpp +++ b/src/app/dialogs/tools/dialogheight.cpp @@ -264,16 +264,6 @@ void DialogHeight::ShowVisualization() } } -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name of point - * @return name - */ -QString DialogHeight::getPointName() const -{ - return pointName; -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief getTypeLine return type of line diff --git a/src/app/dialogs/tools/dialogheight.h b/src/app/dialogs/tools/dialogheight.h index 03950da35..78538a776 100644 --- a/src/app/dialogs/tools/dialogheight.h +++ b/src/app/dialogs/tools/dialogheight.h @@ -48,7 +48,6 @@ public: DialogHeight(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogHeight(); - QString getPointName() const; void setPointName(const QString &value); QString getTypeLine() const; diff --git a/src/app/dialogs/tools/dialoglineintersect.cpp b/src/app/dialogs/tools/dialoglineintersect.cpp index 25cf95713..a1038cc07 100644 --- a/src/app/dialogs/tools/dialoglineintersect.cpp +++ b/src/app/dialogs/tools/dialoglineintersect.cpp @@ -430,13 +430,3 @@ quint32 DialogLineIntersect::getP2Line2() const { return p2Line2; } - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name of point - * @return name of point - */ -QString DialogLineIntersect::getPointName() const -{ - return pointName; -} diff --git a/src/app/dialogs/tools/dialoglineintersect.h b/src/app/dialogs/tools/dialoglineintersect.h index 2f470c120..dd21b2319 100644 --- a/src/app/dialogs/tools/dialoglineintersect.h +++ b/src/app/dialogs/tools/dialoglineintersect.h @@ -60,7 +60,6 @@ public: quint32 getP2Line2() const; void setP2Line2(const quint32 &value); - QString getPointName() const; void setPointName(const QString &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.cpp b/src/app/dialogs/tools/dialoglineintersectaxis.cpp index 9e62e943b..19b068f7a 100644 --- a/src/app/dialogs/tools/dialoglineintersectaxis.cpp +++ b/src/app/dialogs/tools/dialoglineintersectaxis.cpp @@ -89,12 +89,6 @@ DialogLineIntersectAxis::~DialogLineIntersectAxis() delete ui; } -//--------------------------------------------------------------------------------------------------------------------- -QString DialogLineIntersectAxis::getPointName() const -{ - return pointName; -} - //--------------------------------------------------------------------------------------------------------------------- void DialogLineIntersectAxis::setPointName(const QString &value) { diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.h b/src/app/dialogs/tools/dialoglineintersectaxis.h index 73115d278..6e9fff414 100644 --- a/src/app/dialogs/tools/dialoglineintersectaxis.h +++ b/src/app/dialogs/tools/dialoglineintersectaxis.h @@ -45,7 +45,6 @@ public: DialogLineIntersectAxis(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogLineIntersectAxis(); - QString getPointName() const; void setPointName(const QString &value); QString getTypeLine() const; diff --git a/src/app/dialogs/tools/dialognormal.cpp b/src/app/dialogs/tools/dialognormal.cpp index 109c38d37..6736f3a6b 100644 --- a/src/app/dialogs/tools/dialognormal.cpp +++ b/src/app/dialogs/tools/dialognormal.cpp @@ -270,16 +270,6 @@ void DialogNormal::setPointName(const QString &value) ui->lineEditNamePoint->setText(pointName); } -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name of point - * @return name - */ -QString DialogNormal::getPointName() const -{ - return pointName; -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief getTypeLine return type of line diff --git a/src/app/dialogs/tools/dialognormal.h b/src/app/dialogs/tools/dialognormal.h index cdeb8d5b2..935a6f06f 100644 --- a/src/app/dialogs/tools/dialognormal.h +++ b/src/app/dialogs/tools/dialognormal.h @@ -48,7 +48,6 @@ public: DialogNormal(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogNormal(); - QString getPointName() const; void setPointName(const QString &value); QString getTypeLine() const; diff --git a/src/app/dialogs/tools/dialogpointofcontact.cpp b/src/app/dialogs/tools/dialogpointofcontact.cpp index 862989aa2..d118c5678 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.cpp +++ b/src/app/dialogs/tools/dialogpointofcontact.cpp @@ -297,16 +297,6 @@ void DialogPointOfContact::setPointName(const QString &value) ui->lineEditNamePoint->setText(pointName); } -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name of point - * @return name - */ -QString DialogPointOfContact::getPointName() const -{ - return pointName; -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief getRadius return formula radius of arc diff --git a/src/app/dialogs/tools/dialogpointofcontact.h b/src/app/dialogs/tools/dialogpointofcontact.h index 2fef8c4fc..c773cca40 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.h +++ b/src/app/dialogs/tools/dialogpointofcontact.h @@ -49,7 +49,6 @@ public: DialogPointOfContact(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); virtual ~DialogPointOfContact(); - QString getPointName() const; void setPointName(const QString &value); QString getRadius() const; diff --git a/src/app/dialogs/tools/dialogpointofintersection.cpp b/src/app/dialogs/tools/dialogpointofintersection.cpp index 11420fa44..fdcbcbe15 100644 --- a/src/app/dialogs/tools/dialogpointofintersection.cpp +++ b/src/app/dialogs/tools/dialogpointofintersection.cpp @@ -201,16 +201,6 @@ void DialogPointOfIntersection::setPointName(const QString &value) ui->lineEditNamePoint->setText(pointName); } -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name of point - * @return name - */ -QString DialogPointOfIntersection::getPointName() const -{ - return pointName; -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief getFirstPointId return id of first point diff --git a/src/app/dialogs/tools/dialogpointofintersection.h b/src/app/dialogs/tools/dialogpointofintersection.h index 3ca3b4f8f..8ef0a9795 100644 --- a/src/app/dialogs/tools/dialogpointofintersection.h +++ b/src/app/dialogs/tools/dialogpointofintersection.h @@ -48,7 +48,6 @@ public: DialogPointOfIntersection(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogPointOfIntersection(); - QString getPointName() const; void setPointName(const QString &value); quint32 getFirstPointId() const; diff --git a/src/app/dialogs/tools/dialogshoulderpoint.cpp b/src/app/dialogs/tools/dialogshoulderpoint.cpp index 359ddd072..8a9855733 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.cpp +++ b/src/app/dialogs/tools/dialogshoulderpoint.cpp @@ -298,16 +298,6 @@ void DialogShoulderPoint::setPointName(const QString &value) ui->lineEditNamePoint->setText(pointName); } -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name of point - * @return name - */ -QString DialogShoulderPoint::getPointName() const -{ - return pointName; -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief getTypeLine return type of line diff --git a/src/app/dialogs/tools/dialogshoulderpoint.h b/src/app/dialogs/tools/dialogshoulderpoint.h index 66dd2f0d4..c3989b984 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.h +++ b/src/app/dialogs/tools/dialogshoulderpoint.h @@ -48,7 +48,6 @@ public: DialogShoulderPoint(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogShoulderPoint(); - QString getPointName() const; void setPointName(const QString &value); QString getTypeLine() const; diff --git a/src/app/dialogs/tools/dialogsinglepoint.cpp b/src/app/dialogs/tools/dialogsinglepoint.cpp index 23a0f4ba4..ab7d0012a 100644 --- a/src/app/dialogs/tools/dialogsinglepoint.cpp +++ b/src/app/dialogs/tools/dialogsinglepoint.cpp @@ -108,16 +108,6 @@ DialogSinglePoint::~DialogSinglePoint() delete ui; } -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getName return name - * @return name - */ -QString DialogSinglePoint::getName() const -{ - return pointName; -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief getPoint return point diff --git a/src/app/dialogs/tools/dialogsinglepoint.h b/src/app/dialogs/tools/dialogsinglepoint.h index 80b6ee226..b92fe136f 100644 --- a/src/app/dialogs/tools/dialogsinglepoint.h +++ b/src/app/dialogs/tools/dialogsinglepoint.h @@ -46,7 +46,6 @@ public: DialogSinglePoint(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogSinglePoint(); void setData(const QString &name, const QPointF &point); - QString getName()const; QPointF getPoint()const; public slots: void mousePress(const QPointF &scenePos); diff --git a/src/app/dialogs/tools/dialogtool.cpp b/src/app/dialogs/tools/dialogtool.cpp index ba346bc1a..c89503a6d 100644 --- a/src/app/dialogs/tools/dialogtool.cpp +++ b/src/app/dialogs/tools/dialogtool.cpp @@ -1187,6 +1187,12 @@ void DialogTool::SetToolId(const quint32 &value) toolId = value; } +//--------------------------------------------------------------------------------------------------------------------- +QString DialogTool::getPointName() const +{ + return pointName; +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief ShowVariable show variables in list diff --git a/src/app/dialogs/tools/dialogtool.h b/src/app/dialogs/tools/dialogtool.h index a488b3db2..0927c7595 100644 --- a/src/app/dialogs/tools/dialogtool.h +++ b/src/app/dialogs/tools/dialogtool.h @@ -69,6 +69,8 @@ public: quint32 GetToolId() const; void SetToolId(const quint32 &value); + + QString getPointName() const; signals: /** * @brief DialogClosed signal dialog closed diff --git a/src/app/dialogs/tools/dialogtriangle.cpp b/src/app/dialogs/tools/dialogtriangle.cpp index e61fced17..875b66a8f 100644 --- a/src/app/dialogs/tools/dialogtriangle.cpp +++ b/src/app/dialogs/tools/dialogtriangle.cpp @@ -315,13 +315,3 @@ quint32 DialogTriangle::getSecondPointId() const { return secondPointId; } - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name of point - * @return name - */ -QString DialogTriangle::getPointName() const -{ - return pointName; -} diff --git a/src/app/dialogs/tools/dialogtriangle.h b/src/app/dialogs/tools/dialogtriangle.h index 8b1577b37..df5df7ca2 100644 --- a/src/app/dialogs/tools/dialogtriangle.h +++ b/src/app/dialogs/tools/dialogtriangle.h @@ -60,7 +60,6 @@ public: quint32 getSecondPointId() const; void setSecondPointId(const quint32 &value); - QString getPointName() const; void setPointName(const QString &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); diff --git a/src/app/tools/drawTools/vtoolsinglepoint.cpp b/src/app/tools/drawTools/vtoolsinglepoint.cpp index a90ed60da..1320132b6 100644 --- a/src/app/tools/drawTools/vtoolsinglepoint.cpp +++ b/src/app/tools/drawTools/vtoolsinglepoint.cpp @@ -195,7 +195,7 @@ void VToolSinglePoint::SaveDialog(QDomElement &domElement) DialogSinglePoint *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); QPointF p = dialogTool->getPoint(); - QString name = dialogTool->getName(); + QString name = dialogTool->getPointName(); doc->SetAttribute(domElement, AttrName, name); doc->SetAttribute(domElement, AttrX, QString().setNum(qApp->fromPixel(p.x()))); doc->SetAttribute(domElement, AttrY, QString().setNum(qApp->fromPixel(p.y()))); From 6a9cc6da0a0735a47fa89ac960c2cf081cadd34e Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 3 Feb 2015 00:08:39 +0200 Subject: [PATCH 087/186] Default style for line Qt::SolidLine. --HG-- branch : develop --- src/app/dialogs/tools/dialogtool.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/dialogs/tools/dialogtool.cpp b/src/app/dialogs/tools/dialogtool.cpp index 872a12c20..d02213a1b 100644 --- a/src/app/dialogs/tools/dialogtool.cpp +++ b/src/app/dialogs/tools/dialogtool.cpp @@ -298,7 +298,7 @@ void DialogTool::FillComboBoxTypeLine(QComboBox *box, const QMap ++i; } - box->setCurrentIndex(1); + box->setCurrentIndex(4); } //--------------------------------------------------------------------------------------------------------------------- From b535460715e2887f831544c65238fafae7dcd106 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 3 Feb 2015 09:55:27 +0200 Subject: [PATCH 088/186] Fixed wrong window title. --HG-- branch : develop --- src/app/dialogs/tools/dialogheight.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/dialogs/tools/dialogheight.ui b/src/app/dialogs/tools/dialogheight.ui index 4338c7de7..b818ef23f 100644 --- a/src/app/dialogs/tools/dialogheight.ui +++ b/src/app/dialogs/tools/dialogheight.ui @@ -11,7 +11,7 @@ - Height + Perpendicular point along line From 493f607cac78aee068c3af385db6078fe509d912 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 3 Feb 2015 10:17:59 +0200 Subject: [PATCH 089/186] Refactoring. Deleted additional variables for storing ids. --HG-- branch : feature --- src/app/dialogs/tools/dialogalongline.cpp | 17 ++- src/app/dialogs/tools/dialogalongline.h | 6 - src/app/dialogs/tools/dialogarc.cpp | 16 ++- src/app/dialogs/tools/dialogarc.h | 3 - src/app/dialogs/tools/dialogbisector.cpp | 30 +++-- src/app/dialogs/tools/dialogbisector.h | 9 -- .../tools/dialogcurveintersectaxis.cpp | 20 ++-- .../dialogs/tools/dialogcurveintersectaxis.h | 2 - src/app/dialogs/tools/dialogcutarc.cpp | 13 +-- src/app/dialogs/tools/dialogcutarc.h | 3 - src/app/dialogs/tools/dialogcutspline.cpp | 13 +-- src/app/dialogs/tools/dialogcutspline.h | 3 - src/app/dialogs/tools/dialogcutsplinepath.cpp | 13 +-- src/app/dialogs/tools/dialogcutsplinepath.h | 3 - src/app/dialogs/tools/dialogendline.cpp | 14 +-- src/app/dialogs/tools/dialogendline.h | 4 +- src/app/dialogs/tools/dialogheight.cpp | 30 +++-- src/app/dialogs/tools/dialogheight.h | 8 -- src/app/dialogs/tools/dialogline.cpp | 19 ++-- src/app/dialogs/tools/dialogline.h | 6 - src/app/dialogs/tools/dialoglineintersect.cpp | 106 +++++------------- src/app/dialogs/tools/dialoglineintersect.h | 17 +-- .../dialogs/tools/dialoglineintersectaxis.cpp | 28 ++--- .../dialogs/tools/dialoglineintersectaxis.h | 3 - src/app/dialogs/tools/dialognormal.cpp | 16 ++- src/app/dialogs/tools/dialognormal.h | 6 - .../dialogs/tools/dialogpointofcontact.cpp | 29 +++-- src/app/dialogs/tools/dialogpointofcontact.h | 9 -- .../tools/dialogpointofintersection.cpp | 21 ++-- .../dialogs/tools/dialogpointofintersection.h | 5 - src/app/dialogs/tools/dialogshoulderpoint.cpp | 30 +++-- src/app/dialogs/tools/dialogshoulderpoint.h | 9 -- src/app/dialogs/tools/dialogspline.cpp | 22 ++-- src/app/dialogs/tools/dialogspline.h | 6 - src/app/dialogs/tools/dialogtool.cpp | 34 ++---- src/app/dialogs/tools/dialogtool.h | 11 +- src/app/dialogs/tools/dialogtriangle.cpp | 39 +++---- src/app/dialogs/tools/dialogtriangle.h | 12 -- 38 files changed, 201 insertions(+), 434 deletions(-) diff --git a/src/app/dialogs/tools/dialogalongline.cpp b/src/app/dialogs/tools/dialogalongline.cpp index 686d43a8b..9995d9688 100644 --- a/src/app/dialogs/tools/dialogalongline.cpp +++ b/src/app/dialogs/tools/dialogalongline.cpp @@ -42,8 +42,7 @@ */ DialogAlongLine::DialogAlongLine(const VContainer *data, const quint32 &toolId, QWidget *parent) :DialogTool(data, toolId, parent), ui(new Ui::DialogAlongLine), number(0), - typeLine(QString()), formula(QString()), firstPointId(NULL_ID), secondPointId(NULL_ID), formulaBaseHeight(0), - line(nullptr), lineColor(VAbstractTool::ColorBlack) + typeLine(QString()), formula(QString()), formulaBaseHeight(0), line(nullptr), lineColor(VAbstractTool::ColorBlack) { ui->setupUi(this); InitVariables(ui); @@ -184,11 +183,9 @@ void DialogAlongLine::SaveData() typeLine = GetTypeLine(ui->comboBoxLineType); formula = ui->plainTextEditFormula->toPlainText(); formula.replace("\n", " "); - firstPointId = getCurrentObjectId(ui->comboBoxFirstPoint); - secondPointId = getCurrentObjectId(ui->comboBoxSecondPoint); - line->setPoint1Id(firstPointId); - line->setPoint2Id(secondPointId); + line->setPoint1Id(getFirstPointId()); + line->setPoint2Id(getSecondPointId()); line->setLength(formula); line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); line->RefreshGeometry(); @@ -208,7 +205,7 @@ void DialogAlongLine::closeEvent(QCloseEvent *event) */ void DialogAlongLine::setSecondPointId(const quint32 &value) { - setCurrentPointId(ui->comboBoxSecondPoint, secondPointId, value); + setCurrentPointId(ui->comboBoxSecondPoint, value); line->setPoint2Id(value); } @@ -219,7 +216,7 @@ void DialogAlongLine::setSecondPointId(const quint32 &value) */ void DialogAlongLine::setFirstPointId(const quint32 &value) { - setCurrentPointId(ui->comboBoxFirstPoint, firstPointId, value); + setCurrentPointId(ui->comboBoxFirstPoint, value); line->setPoint1Id(value); } @@ -304,7 +301,7 @@ QString DialogAlongLine::getFormula() const */ quint32 DialogAlongLine::getFirstPointId() const { - return firstPointId; + return getCurrentObjectId(ui->comboBoxFirstPoint); } //--------------------------------------------------------------------------------------------------------------------- @@ -314,5 +311,5 @@ quint32 DialogAlongLine::getFirstPointId() const */ quint32 DialogAlongLine::getSecondPointId() const { - return secondPointId; + return getCurrentObjectId(ui->comboBoxSecondPoint); } diff --git a/src/app/dialogs/tools/dialogalongline.h b/src/app/dialogs/tools/dialogalongline.h index e8122473a..2cd1143da 100644 --- a/src/app/dialogs/tools/dialogalongline.h +++ b/src/app/dialogs/tools/dialogalongline.h @@ -97,12 +97,6 @@ private: /** @brief formula formula */ QString formula; - /** @brief firstPointId id first point of line */ - quint32 firstPointId; - - /** @brief secondPointId id second point of line */ - quint32 secondPointId; - /** @brief formulaBaseHeight base height defined by dialogui */ int formulaBaseHeight; VisToolAlongLine *line; diff --git a/src/app/dialogs/tools/dialogarc.cpp b/src/app/dialogs/tools/dialogarc.cpp index ccf6e0f2d..74b1893b2 100644 --- a/src/app/dialogs/tools/dialogarc.cpp +++ b/src/app/dialogs/tools/dialogarc.cpp @@ -45,9 +45,9 @@ */ DialogArc::DialogArc(const VContainer *data, const quint32 &toolId, QWidget *parent) :DialogTool(data, toolId, parent), ui(new Ui::DialogArc), flagRadius(false), flagF1(false), flagF2(false), - timerRadius(nullptr), timerF1(nullptr), timerF2(nullptr), center(NULL_ID), radius(QString()), - f1(QString()), f2(QString()), formulaBaseHeight(0), formulaBaseHeightF1(0), formulaBaseHeightF2(0), path(nullptr), - angleF1(INT_MIN), angleF2(INT_MIN) + timerRadius(nullptr), timerF1(nullptr), timerF2(nullptr), radius(QString()), f1(QString()), f2(QString()), + formulaBaseHeight(0), formulaBaseHeightF1(0), formulaBaseHeightF2(0), path(nullptr), angleF1(INT_MIN), + angleF2(INT_MIN) { ui->setupUi(this); @@ -132,9 +132,8 @@ DialogArc::~DialogArc() */ void DialogArc::SetCenter(const quint32 &value) { - center = value; - ChangeCurrentData(ui->comboBoxBasePoint, center); - path->setPoint1Id(center); + ChangeCurrentData(ui->comboBoxBasePoint, value); + path->setPoint1Id(value); } //--------------------------------------------------------------------------------------------------------------------- @@ -235,9 +234,8 @@ void DialogArc::SaveData() f1.replace("\n", " "); f2 = ui->plainTextEditF2->toPlainText(); f2.replace("\n", " "); - center = getCurrentObjectId(ui->comboBoxBasePoint); - path->setPoint1Id(center); + path->setPoint1Id(GetCenter()); path->setRadius(radius); path->setF1(f1); path->setF2(f2); @@ -445,7 +443,7 @@ void DialogArc::CheckAngles() */ quint32 DialogArc::GetCenter() const { - return center; + return getCurrentObjectId(ui->comboBoxBasePoint); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogarc.h b/src/app/dialogs/tools/dialogarc.h index 004d3fcf8..7708bc653 100644 --- a/src/app/dialogs/tools/dialogarc.h +++ b/src/app/dialogs/tools/dialogarc.h @@ -108,9 +108,6 @@ private: /** @brief timerF2 timer of check formula of second angle */ QTimer *timerF2; - /** @brief center id of center point */ - quint32 center; - /** @brief radius formula of radius */ QString radius; diff --git a/src/app/dialogs/tools/dialogbisector.cpp b/src/app/dialogs/tools/dialogbisector.cpp index ed1c31ec0..a5a8000ab 100644 --- a/src/app/dialogs/tools/dialogbisector.cpp +++ b/src/app/dialogs/tools/dialogbisector.cpp @@ -43,8 +43,7 @@ */ DialogBisector::DialogBisector(const VContainer *data, const quint32 &toolId, QWidget *parent) :DialogTool(data, toolId, parent), ui(new Ui::DialogBisector), number(0), typeLine(QString()), - formula(QString()), firstPointId(NULL_ID), secondPointId(NULL_ID), thirdPointId(NULL_ID), formulaBaseHeight(0), - line(nullptr) + formula(QString()), formulaBaseHeight(0), line(nullptr) { ui->setupUi(this); InitVariables(ui); @@ -247,8 +246,8 @@ void DialogBisector::setFormula(const QString &value) */ void DialogBisector::setFirstPointId(const quint32 &value) { - setPointId(ui->comboBoxFirstPoint, firstPointId, value); - line->setPoint1Id(firstPointId); + setCurrentPointId(ui->comboBoxFirstPoint, value); + line->setPoint1Id(value); } //--------------------------------------------------------------------------------------------------------------------- @@ -258,8 +257,8 @@ void DialogBisector::setFirstPointId(const quint32 &value) */ void DialogBisector::setSecondPointId(const quint32 &value) { - setPointId(ui->comboBoxSecondPoint, secondPointId, value); - line->setPoint2Id(secondPointId); + setCurrentPointId(ui->comboBoxSecondPoint, value); + line->setPoint2Id(value); } //--------------------------------------------------------------------------------------------------------------------- @@ -269,8 +268,8 @@ void DialogBisector::setSecondPointId(const quint32 &value) */ void DialogBisector::setThirdPointId(const quint32 &value) { - setPointId(ui->comboBoxThirdPoint, thirdPointId, value); - line->setPoint3Id(thirdPointId); + setCurrentPointId(ui->comboBoxThirdPoint, value); + line->setPoint3Id(value); } //--------------------------------------------------------------------------------------------------------------------- @@ -280,13 +279,10 @@ void DialogBisector::SaveData() typeLine = GetTypeLine(ui->comboBoxLineType); formula = ui->plainTextEditFormula->toPlainText(); formula.replace("\n", " "); - firstPointId = getCurrentObjectId(ui->comboBoxFirstPoint); - secondPointId = getCurrentObjectId(ui->comboBoxSecondPoint); - thirdPointId = getCurrentObjectId(ui->comboBoxThirdPoint); - line->setPoint1Id(firstPointId); - line->setPoint2Id(secondPointId); - line->setPoint3Id(thirdPointId); + line->setPoint1Id(getFirstPointId()); + line->setPoint2Id(getSecondPointId()); + line->setPoint3Id(getThirdPointId()); line->setLength(formula); line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); line->RefreshGeometry(); @@ -326,7 +322,7 @@ QString DialogBisector::getFormula() const */ quint32 DialogBisector::getFirstPointId() const { - return firstPointId; + return getCurrentObjectId(ui->comboBoxFirstPoint); } //--------------------------------------------------------------------------------------------------------------------- @@ -336,7 +332,7 @@ quint32 DialogBisector::getFirstPointId() const */ quint32 DialogBisector::getSecondPointId() const { - return secondPointId; + return getCurrentObjectId(ui->comboBoxSecondPoint); } //--------------------------------------------------------------------------------------------------------------------- @@ -346,5 +342,5 @@ quint32 DialogBisector::getSecondPointId() const */ quint32 DialogBisector::getThirdPointId() const { - return thirdPointId; + return getCurrentObjectId(ui->comboBoxThirdPoint); } diff --git a/src/app/dialogs/tools/dialogbisector.h b/src/app/dialogs/tools/dialogbisector.h index ee26a8a0c..8cbccf032 100644 --- a/src/app/dialogs/tools/dialogbisector.h +++ b/src/app/dialogs/tools/dialogbisector.h @@ -98,15 +98,6 @@ private: /** @brief formula formula */ QString formula; - /** @brief firstPointId id of first point */ - quint32 firstPointId; - - /** @brief secondPointId id of second point */ - quint32 secondPointId; - - /** @brief thirdPointId id of third point */ - quint32 thirdPointId; - /** @brief formulaBaseHeight base height defined by dialogui */ int formulaBaseHeight; VisToolBisector *line; diff --git a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp b/src/app/dialogs/tools/dialogcurveintersectaxis.cpp index 59081bed3..060b15e87 100644 --- a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp +++ b/src/app/dialogs/tools/dialogcurveintersectaxis.cpp @@ -39,7 +39,7 @@ //--------------------------------------------------------------------------------------------------------------------- DialogCurveIntersectAxis::DialogCurveIntersectAxis(const VContainer *data, const quint32 &toolId, QWidget *parent) :DialogTool(data, toolId, parent), ui(new Ui::DialogCurveIntersectAxis), number(0), typeLine(QString()), - formulaAngle(QString()), basePointId(NULL_ID), curveId(NULL_ID), formulaBaseHeightAngle(0), line(nullptr) + formulaAngle(QString()), formulaBaseHeightAngle(0), line(nullptr) { ui->setupUi(this); @@ -125,26 +125,26 @@ void DialogCurveIntersectAxis::setAngle(const QString &value) //--------------------------------------------------------------------------------------------------------------------- quint32 DialogCurveIntersectAxis::getBasePointId() const { - return basePointId; + return getCurrentObjectId(ui->comboBoxAxisPoint); } //--------------------------------------------------------------------------------------------------------------------- void DialogCurveIntersectAxis::setBasePointId(const quint32 &value) { - setCurrentPointId(ui->comboBoxAxisPoint, basePointId, value); + setCurrentPointId(ui->comboBoxAxisPoint, value); line->setAxisPointId(value); } //--------------------------------------------------------------------------------------------------------------------- quint32 DialogCurveIntersectAxis::getCurveId() const { - return curveId; + return getCurrentObjectId(ui->comboBoxCurve); } //--------------------------------------------------------------------------------------------------------------------- void DialogCurveIntersectAxis::setCurveId(const quint32 &value) { - setCurrentCurveId(ui->comboBoxCurve, curveId, value); + setCurrentCurveId(ui->comboBoxCurve, value); line->setPoint1Id(value); } @@ -158,7 +158,7 @@ void DialogCurveIntersectAxis::ShowDialog(bool click) /*We will ignore click if poinet is in point circle*/ VMainGraphicsScene *scene = qApp->getCurrentScene(); SCASSERT(scene != nullptr); - const QSharedPointer point = data->GeometricObject(basePointId); + const QSharedPointer point = data->GeometricObject(getBasePointId()); QLineF line = QLineF(point->toQPointF(), scene->getScenePos()); //Radius of point circle, but little bigger. Need handle with hover sizes. @@ -199,7 +199,6 @@ void DialogCurveIntersectAxis::ChosenObject(quint32 id, const SceneObject &type) { if (SetObject(id, ui->comboBoxAxisPoint, "")) { - basePointId = id; line->setAxisPointId(id); line->RefreshGeometry(); prepare = true; @@ -258,11 +257,8 @@ void DialogCurveIntersectAxis::SaveData() formulaAngle = ui->plainTextEditFormula->toPlainText(); formulaAngle.replace("\n", " "); - basePointId = getCurrentObjectId(ui->comboBoxAxisPoint); - curveId = getCurrentObjectId(ui->comboBoxCurve); - - line->setPoint1Id(curveId); - line->setAxisPointId(basePointId); + line->setPoint1Id(getCurveId()); + line->setAxisPointId(getBasePointId()); line->setAngle(formulaAngle); line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); line->RefreshGeometry(); diff --git a/src/app/dialogs/tools/dialogcurveintersectaxis.h b/src/app/dialogs/tools/dialogcurveintersectaxis.h index b2b927dbc..0377f28c4 100644 --- a/src/app/dialogs/tools/dialogcurveintersectaxis.h +++ b/src/app/dialogs/tools/dialogcurveintersectaxis.h @@ -84,8 +84,6 @@ private: QString typeLine; QString formulaAngle; - quint32 basePointId; - quint32 curveId; int formulaBaseHeightAngle; VisToolCurveIntersectAxis *line; diff --git a/src/app/dialogs/tools/dialogcutarc.cpp b/src/app/dialogs/tools/dialogcutarc.cpp index 5948de364..63b956a85 100644 --- a/src/app/dialogs/tools/dialogcutarc.cpp +++ b/src/app/dialogs/tools/dialogcutarc.cpp @@ -42,8 +42,8 @@ * @param parent parent widget */ DialogCutArc::DialogCutArc(const VContainer *data, const quint32 &toolId, QWidget *parent) - : DialogTool(data, toolId, parent), ui(new Ui::DialogCutArc), formula(QString()), - arcId(NULL_ID), formulaBaseHeight(0), path(nullptr) + : DialogTool(data, toolId, parent), ui(new Ui::DialogCutArc), formula(QString()), formulaBaseHeight(0), + path(nullptr) { ui->setupUi(this); InitVariables(ui); @@ -133,9 +133,8 @@ void DialogCutArc::SaveData() pointName = ui->lineEditNamePoint->text(); formula = ui->plainTextEditFormula->toPlainText(); formula.replace("\n", " "); - arcId = getCurrentObjectId(ui->comboBoxArc); - path->setPoint1Id(arcId); + path->setPoint1Id(getArcId()); path->setLength(formula); path->RefreshGeometry(); } @@ -154,8 +153,8 @@ void DialogCutArc::closeEvent(QCloseEvent *event) */ void DialogCutArc::setArcId(const quint32 &value) { - setCurrentArcId(ui->comboBoxArc, arcId, value, ComboBoxCutArc::CutArc); - path->setPoint1Id(arcId); + setCurrentArcId(ui->comboBoxArc, value, ComboBoxCutArc::CutArc); + path->setPoint1Id(value); } //--------------------------------------------------------------------------------------------------------------------- @@ -204,5 +203,5 @@ QString DialogCutArc::getFormula() const */ quint32 DialogCutArc::getArcId() const { - return arcId; + return getCurrentObjectId(ui->comboBoxArc); } diff --git a/src/app/dialogs/tools/dialogcutarc.h b/src/app/dialogs/tools/dialogcutarc.h index acc788103..682161b3c 100644 --- a/src/app/dialogs/tools/dialogcutarc.h +++ b/src/app/dialogs/tools/dialogcutarc.h @@ -81,9 +81,6 @@ private: /** @brief formula string with formula */ QString formula; - /** @brief arcId keep id of arc */ - quint32 arcId; - /** @brief formulaBaseHeight base height defined by dialogui */ int formulaBaseHeight; diff --git a/src/app/dialogs/tools/dialogcutspline.cpp b/src/app/dialogs/tools/dialogcutspline.cpp index 7e9961295..2f5c961ad 100644 --- a/src/app/dialogs/tools/dialogcutspline.cpp +++ b/src/app/dialogs/tools/dialogcutspline.cpp @@ -41,8 +41,8 @@ * @param parent parent widget */ DialogCutSpline::DialogCutSpline(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogCutSpline), formula(QString()), - splineId(NULL_ID), formulaBaseHeight(0), path(nullptr) + :DialogTool(data, toolId, parent), ui(new Ui::DialogCutSpline), formula(QString()), formulaBaseHeight(0), + path(nullptr) { ui->setupUi(this); InitVariables(ui); @@ -115,8 +115,8 @@ void DialogCutSpline::setFormula(const QString &value) */ void DialogCutSpline::setSplineId(const quint32 &value) { - setCurrentSplineId(ui->comboBoxSpline, splineId, value, ComboBoxCutSpline::CutSpline); - path->setPoint1Id(splineId); + setCurrentSplineId(ui->comboBoxSpline, value, ComboBoxCutSpline::CutSpline); + path->setPoint1Id(value); } //--------------------------------------------------------------------------------------------------------------------- @@ -148,9 +148,8 @@ void DialogCutSpline::SaveData() pointName = ui->lineEditNamePoint->text(); formula = ui->plainTextEditFormula->toPlainText(); formula.replace("\n", " "); - splineId = getCurrentObjectId(ui->comboBoxSpline); - path->setPoint1Id(splineId); + path->setPoint1Id(getSplineId()); path->setLength(formula); path->RefreshGeometry(); } @@ -197,5 +196,5 @@ QString DialogCutSpline::getFormula() const */ quint32 DialogCutSpline::getSplineId() const { - return splineId; + return getCurrentObjectId(ui->comboBoxSpline); } diff --git a/src/app/dialogs/tools/dialogcutspline.h b/src/app/dialogs/tools/dialogcutspline.h index d4f5c0142..4d32e5d36 100644 --- a/src/app/dialogs/tools/dialogcutspline.h +++ b/src/app/dialogs/tools/dialogcutspline.h @@ -77,9 +77,6 @@ private: /** @brief formula string with formula */ QString formula; - /** @brief splineId keep id of spline */ - quint32 splineId; - /** @brief formulaBaseHeight base height defined by dialogui */ int formulaBaseHeight; diff --git a/src/app/dialogs/tools/dialogcutsplinepath.cpp b/src/app/dialogs/tools/dialogcutsplinepath.cpp index c8b2386a5..7c3972034 100644 --- a/src/app/dialogs/tools/dialogcutsplinepath.cpp +++ b/src/app/dialogs/tools/dialogcutsplinepath.cpp @@ -41,8 +41,8 @@ * @param parent parent widget */ DialogCutSplinePath::DialogCutSplinePath(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogCutSplinePath), formula(QString()), - splinePathId(NULL_ID), formulaBaseHeight(0), path(nullptr) + :DialogTool(data, toolId, parent), ui(new Ui::DialogCutSplinePath), formula(QString()), formulaBaseHeight(0), + path(nullptr) { ui->setupUi(this); InitVariables(ui); @@ -115,8 +115,8 @@ void DialogCutSplinePath::setFormula(const QString &value) */ void DialogCutSplinePath::setSplinePathId(const quint32 &value) { - setCurrentSplinePathId(ui->comboBoxSplinePath, splinePathId, value, ComboBoxCutSpline::CutSpline); - path->setPoint1Id(splinePathId); + setCurrentSplinePathId(ui->comboBoxSplinePath, value, ComboBoxCutSpline::CutSpline); + path->setPoint1Id(value); } //--------------------------------------------------------------------------------------------------------------------- @@ -148,9 +148,8 @@ void DialogCutSplinePath::SaveData() pointName = ui->lineEditNamePoint->text(); formula = ui->plainTextEditFormula->toPlainText(); formula.replace("\n", " "); - splinePathId = getCurrentObjectId(ui->comboBoxSplinePath); - path->setPoint1Id(splinePathId); + path->setPoint1Id(getSplinePathId()); path->setLength(formula); path->RefreshGeometry(); } @@ -197,5 +196,5 @@ QString DialogCutSplinePath::getFormula() const */ quint32 DialogCutSplinePath::getSplinePathId() const { - return splinePathId; + return getCurrentObjectId(ui->comboBoxSplinePath); } diff --git a/src/app/dialogs/tools/dialogcutsplinepath.h b/src/app/dialogs/tools/dialogcutsplinepath.h index 57d2e2800..c1fbf943d 100644 --- a/src/app/dialogs/tools/dialogcutsplinepath.h +++ b/src/app/dialogs/tools/dialogcutsplinepath.h @@ -77,9 +77,6 @@ private: /** @brief formula string with formula */ QString formula; - /** @brief splinePathId keep id of splinePath */ - quint32 splinePathId; - /** @brief formulaBaseHeight base height defined by dialogui */ int formulaBaseHeight; diff --git a/src/app/dialogs/tools/dialogendline.cpp b/src/app/dialogs/tools/dialogendline.cpp index b403d94ea..8794d125c 100644 --- a/src/app/dialogs/tools/dialogendline.cpp +++ b/src/app/dialogs/tools/dialogendline.cpp @@ -44,8 +44,7 @@ */ DialogEndLine::DialogEndLine(const VContainer *data, const quint32 &toolId, QWidget *parent) :DialogTool(data, toolId, parent), ui(new Ui::DialogEndLine), typeLine(QString()), - formulaLength(QString()), formulaAngle(QString()), basePointId(NULL_ID), formulaBaseHeight(0), - formulaBaseHeightAngle(0), line(nullptr) + formulaLength(QString()), formulaAngle(QString()), formulaBaseHeight(0), formulaBaseHeightAngle(0), line(nullptr) { ui->setupUi(this); InitVariables(ui); @@ -145,7 +144,6 @@ void DialogEndLine::ChosenObject(quint32 id, const SceneObject &type) { if (SetObject(id, ui->comboBoxBasePoint, "")) { - basePointId = id; line->VisualMode(id); connect(line, &VisToolEndLine::ToolTip, this, &DialogTool::ShowVisToolTip); prepare = true; @@ -222,7 +220,7 @@ void DialogEndLine::setAngle(const QString &value) */ void DialogEndLine::setBasePointId(const quint32 &value) { - setCurrentPointId(ui->comboBoxBasePoint, basePointId, value); + setCurrentPointId(ui->comboBoxBasePoint, value); line->setPoint1Id(value); } @@ -240,7 +238,7 @@ void DialogEndLine::ShowDialog(bool click) /*We will ignore click if poinet is in point circle*/ VMainGraphicsScene *scene = qApp->getCurrentScene(); SCASSERT(scene != nullptr); - const QSharedPointer point = data->GeometricObject(basePointId); + const QSharedPointer point = data->GeometricObject(getBasePointId()); QLineF line = QLineF(point->toQPointF(), scene->getScenePos()); //Radius of point circle, but little bigger. Need handle with hover sizes. @@ -283,9 +281,7 @@ void DialogEndLine::SaveData() formulaAngle = ui->plainTextEditAngle->toPlainText(); formulaAngle.replace("\n", " "); - basePointId = getCurrentObjectId(ui->comboBoxBasePoint); - - line->setPoint1Id(basePointId); + line->setPoint1Id(getBasePointId()); line->setLength(formulaLength); line->setAngle(formulaAngle); line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); @@ -347,5 +343,5 @@ QString DialogEndLine::getAngle() const */ quint32 DialogEndLine::getBasePointId() const { - return basePointId; + return getCurrentObjectId(ui->comboBoxBasePoint); } diff --git a/src/app/dialogs/tools/dialogendline.h b/src/app/dialogs/tools/dialogendline.h index d6b938d6c..bbb836b5e 100644 --- a/src/app/dialogs/tools/dialogendline.h +++ b/src/app/dialogs/tools/dialogendline.h @@ -61,6 +61,7 @@ public: quint32 getBasePointId() const; void setBasePointId(const quint32 &value); + virtual void ShowDialog(bool click); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); @@ -98,9 +99,6 @@ private: /** @brief angle angle of line */ QString formulaAngle; - /** @brief basePointId id base point of line */ - quint32 basePointId; - /** @brief formulaBaseHeight base height defined by dialogui */ int formulaBaseHeight; int formulaBaseHeightAngle; diff --git a/src/app/dialogs/tools/dialogheight.cpp b/src/app/dialogs/tools/dialogheight.cpp index 2b68e9a47..76fca0869 100644 --- a/src/app/dialogs/tools/dialogheight.cpp +++ b/src/app/dialogs/tools/dialogheight.cpp @@ -42,8 +42,7 @@ * @param parent parent widget */ DialogHeight::DialogHeight(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogHeight), number(0), - typeLine(QString()), basePointId(NULL_ID), p1LineId(NULL_ID), p2LineId(NULL_ID), line(nullptr) + :DialogTool(data, toolId, parent), ui(new Ui::DialogHeight), number(0), typeLine(QString()), line(nullptr) { ui->setupUi(this); ui->lineEditNamePoint->setText(qApp->getCurrentDocument()->GenerateLabel(LabelType::NewLabel)); @@ -108,8 +107,8 @@ void DialogHeight::setTypeLine(const QString &value) */ void DialogHeight::setBasePointId(const quint32 &value) { - setPointId(ui->comboBoxBasePoint, basePointId, value); - line->setPoint1Id(basePointId); + setCurrentPointId(ui->comboBoxBasePoint, value); + line->setPoint1Id(value); } //--------------------------------------------------------------------------------------------------------------------- @@ -119,8 +118,8 @@ void DialogHeight::setBasePointId(const quint32 &value) */ void DialogHeight::setP1LineId(const quint32 &value) { - setPointId(ui->comboBoxP1Line, p1LineId, value); - line->setLineP1Id(p1LineId); + setCurrentPointId(ui->comboBoxP1Line, value); + line->setLineP1Id(value); } //--------------------------------------------------------------------------------------------------------------------- @@ -130,8 +129,8 @@ void DialogHeight::setP1LineId(const quint32 &value) */ void DialogHeight::setP2LineId(const quint32 &value) { - setPointId(ui->comboBoxP2Line, p2LineId, value); - line->setLineP2Id(p2LineId); + setCurrentPointId(ui->comboBoxP2Line, value); + line->setLineP2Id(value); } //--------------------------------------------------------------------------------------------------------------------- @@ -198,13 +197,10 @@ void DialogHeight::SaveData() { pointName = ui->lineEditNamePoint->text(); typeLine = GetTypeLine(ui->comboBoxLineType); - basePointId = getCurrentObjectId(ui->comboBoxBasePoint); - p1LineId = getCurrentObjectId(ui->comboBoxP1Line); - p2LineId = getCurrentObjectId(ui->comboBoxP2Line); - line->setPoint1Id(basePointId); - line->setLineP1Id(p1LineId); - line->setLineP2Id(p2LineId); + line->setPoint1Id(getBasePointId()); + line->setLineP1Id(getP1LineId()); + line->setLineP2Id(getP2LineId()); line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); line->RefreshGeometry(); } @@ -281,7 +277,7 @@ QString DialogHeight::getTypeLine() const */ quint32 DialogHeight::getBasePointId() const { - return basePointId; + return getCurrentObjectId(ui->comboBoxBasePoint); } //--------------------------------------------------------------------------------------------------------------------- @@ -291,7 +287,7 @@ quint32 DialogHeight::getBasePointId() const */ quint32 DialogHeight::getP1LineId() const { - return p1LineId; + return getCurrentObjectId(ui->comboBoxP1Line); } //--------------------------------------------------------------------------------------------------------------------- @@ -301,5 +297,5 @@ quint32 DialogHeight::getP1LineId() const */ quint32 DialogHeight::getP2LineId() const { - return p2LineId; + return getCurrentObjectId(ui->comboBoxP2Line); } diff --git a/src/app/dialogs/tools/dialogheight.h b/src/app/dialogs/tools/dialogheight.h index 78538a776..e1cc4f719 100644 --- a/src/app/dialogs/tools/dialogheight.h +++ b/src/app/dialogs/tools/dialogheight.h @@ -83,14 +83,6 @@ private: /** @brief typeLine type of line */ QString typeLine; - /** @brief basePointId id base point of height */ - quint32 basePointId; - - /** @brief p1LineId id first point of line */ - quint32 p1LineId; - - /** @brief p2LineId id second point of line */ - quint32 p2LineId; VisToolHeight *line; }; diff --git a/src/app/dialogs/tools/dialogline.cpp b/src/app/dialogs/tools/dialogline.cpp index 11e4bd175..0b1ec4ee8 100644 --- a/src/app/dialogs/tools/dialogline.cpp +++ b/src/app/dialogs/tools/dialogline.cpp @@ -43,8 +43,7 @@ * @param parent parent widget */ DialogLine::DialogLine(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogLine), number(0), firstPoint(NULL_ID), secondPoint(NULL_ID), - typeLine(QString()), line(nullptr) + :DialogTool(data, toolId, parent), ui(new Ui::DialogLine), number(0), typeLine(QString()), line(nullptr) { ui->setupUi(this); InitOkCancelApply(ui); @@ -84,7 +83,7 @@ DialogLine::~DialogLine() */ void DialogLine::setSecondPoint(const quint32 &value) { - setPointId(ui->comboBoxSecondPoint, secondPoint, value); + setCurrentPointId(ui->comboBoxSecondPoint, value); line->setPoint2Id(value); } @@ -107,7 +106,7 @@ void DialogLine::setTypeLine(const QString &value) */ void DialogLine::setFirstPoint(const quint32 &value) { - setPointId(ui->comboBoxFirstPoint, firstPoint, value); + setCurrentPointId(ui->comboBoxFirstPoint, value); line->setPoint1Id(value); } @@ -154,14 +153,10 @@ void DialogLine::ShowVisualization() //--------------------------------------------------------------------------------------------------------------------- void DialogLine::SaveData() { - qint32 index = ui->comboBoxFirstPoint->currentIndex(); - firstPoint = qvariant_cast(ui->comboBoxFirstPoint->itemData(index)); - index = ui->comboBoxSecondPoint->currentIndex(); - secondPoint = qvariant_cast(ui->comboBoxSecondPoint->itemData(index)); typeLine = GetTypeLine(ui->comboBoxLineType); - line->setPoint1Id(firstPoint); - line->setPoint2Id(secondPoint); + line->setPoint1Id(getFirstPoint()); + line->setPoint2Id(getSecondPoint()); line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); line->RefreshGeometry(); } @@ -212,7 +207,7 @@ void DialogLine::ChosenObject(quint32 id, const SceneObject &type) */ quint32 DialogLine::getFirstPoint() const { - return firstPoint; + return qvariant_cast(ui->comboBoxFirstPoint->currentData()); } //--------------------------------------------------------------------------------------------------------------------- @@ -222,7 +217,7 @@ quint32 DialogLine::getFirstPoint() const */ quint32 DialogLine::getSecondPoint() const { - return secondPoint; + return qvariant_cast(ui->comboBoxSecondPoint->currentData()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogline.h b/src/app/dialogs/tools/dialogline.h index b48bbe2a4..c0f1eb019 100644 --- a/src/app/dialogs/tools/dialogline.h +++ b/src/app/dialogs/tools/dialogline.h @@ -75,12 +75,6 @@ private: /** @brief number number of handled objects */ qint32 number; - /** @brief firstPoint id first point */ - quint32 firstPoint; - - /** @brief secondPoint id second point */ - quint32 secondPoint; - /** @brief typeLine type of line */ QString typeLine; VisToolLine *line; diff --git a/src/app/dialogs/tools/dialoglineintersect.cpp b/src/app/dialogs/tools/dialoglineintersect.cpp index a1038cc07..a8a1a67b9 100644 --- a/src/app/dialogs/tools/dialoglineintersect.cpp +++ b/src/app/dialogs/tools/dialoglineintersect.cpp @@ -42,8 +42,7 @@ * @param parent parent widget */ DialogLineIntersect::DialogLineIntersect(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogLineIntersect), number(0), - p1Line1(NULL_ID), p2Line1(NULL_ID), p1Line2(NULL_ID), p2Line2(NULL_ID), flagPoint(true), line(nullptr) + :DialogTool(data, toolId, parent), ui(new Ui::DialogLineIntersect), number(0), flagPoint(true), line(nullptr) { ui->setupUi(this); number = 0; @@ -97,7 +96,6 @@ void DialogLineIntersect::ChosenObject(quint32 id, const SceneObject &type) if (SetObject(id, ui->comboBoxP1Line1, tr("Select second point of first line"))) { number++; - p1Line1 = id; line->VisualMode(id); } break; @@ -107,7 +105,6 @@ void DialogLineIntersect::ChosenObject(quint32 id, const SceneObject &type) if (SetObject(id, ui->comboBoxP2Line1, tr("Select first point of second line"))) { number++; - p2Line1 = id; line->setLine1P2Id(id); line->RefreshGeometry(); } @@ -117,7 +114,6 @@ void DialogLineIntersect::ChosenObject(quint32 id, const SceneObject &type) if (SetObject(id, ui->comboBoxP1Line2, tr("Select second point of second line"))) { number++; - p1Line2 = id; line->setLine2P1Id(id); line->RefreshGeometry(); } @@ -134,7 +130,6 @@ void DialogLineIntersect::ChosenObject(quint32 id, const SceneObject &type) { if (SetObject(id, ui->comboBoxP2Line2, "")) { - p2Line2 = id; line->setLine2P2Id(id); line->RefreshGeometry(); prepare = true; @@ -144,16 +139,16 @@ void DialogLineIntersect::ChosenObject(quint32 id, const SceneObject &type) this->show(); connect(ui->comboBoxP1Line1, static_cast(&QComboBox::currentIndexChanged), this, - &DialogLineIntersect::P1Line1Changed); + &DialogLineIntersect::PointChanged); connect(ui->comboBoxP2Line1, static_cast(&QComboBox::currentIndexChanged), this, - &DialogLineIntersect::P2Line1Changed); + &DialogLineIntersect::PointChanged); connect(ui->comboBoxP1Line2, static_cast(&QComboBox::currentIndexChanged), this, - &DialogLineIntersect::P1Line2Changed); + &DialogLineIntersect::PointChanged); connect(ui->comboBoxP2Line2, static_cast(&QComboBox::currentIndexChanged), this, - &DialogLineIntersect::P2Line2Changed); + &DialogLineIntersect::PointChanged); } } } @@ -169,15 +164,11 @@ void DialogLineIntersect::ChosenObject(quint32 id, const SceneObject &type) void DialogLineIntersect::SaveData() { pointName = ui->lineEditNamePoint->text(); - p1Line1 = getCurrentObjectId(ui->comboBoxP1Line1); - p2Line1 = getCurrentObjectId(ui->comboBoxP2Line1); - p1Line2 = getCurrentObjectId(ui->comboBoxP1Line2); - p2Line2 = getCurrentObjectId(ui->comboBoxP2Line2); - line->setPoint1Id(p1Line1); - line->setLine1P2Id(p2Line1); - line->setLine2P1Id(p1Line2); - line->setLine2P2Id(p2Line2); + line->setPoint1Id(getP1Line1()); + line->setLine1P2Id(getP2Line1()); + line->setLine2P1Id(getP1Line2()); + line->setLine2P2Id(getP2Line2()); line->RefreshGeometry(); } @@ -186,55 +177,10 @@ void DialogLineIntersect::SaveData() * @brief P1Line1Changed changed first point of first line * @param index index in list */ -void DialogLineIntersect::P1Line1Changed( int index) +void DialogLineIntersect::PointChanged() { - p1Line1 = qvariant_cast(ui->comboBoxP1Line1->itemData(index)); flagPoint = CheckIntersecion(); CheckState(); - - line->setPoint1Id(p1Line1); -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief P2Line1Changed changed second point of first line - * @param index index in list - */ -void DialogLineIntersect::P2Line1Changed(int index) -{ - p2Line1 = qvariant_cast(ui->comboBoxP2Line1->itemData(index)); - flagPoint = CheckIntersecion(); - CheckState(); - - line->setLine1P2Id(p2Line1); -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief P1Line2Changed changed first point of second line - * @param index index in list - */ -void DialogLineIntersect::P1Line2Changed(int index) -{ - p1Line2 = qvariant_cast(ui->comboBoxP1Line2->itemData(index)); - flagPoint = CheckIntersecion(); - CheckState(); - - line->setLine2P1Id(p1Line2); -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief P2Line2Changed changed second point of second line - * @param index index in list - */ -void DialogLineIntersect::P2Line2Changed(int index) -{ - p2Line2 = qvariant_cast(ui->comboBoxP2Line2->itemData(index)); - flagPoint = CheckIntersecion(); - CheckState(); - - line->setLine2P2Id(p2Line2); } //--------------------------------------------------------------------------------------------------------------------- @@ -317,10 +263,10 @@ void DialogLineIntersect::CheckState() */ bool DialogLineIntersect::CheckIntersecion() { - const QSharedPointer p1L1 = data->GeometricObject(p1Line1); - const QSharedPointer p2L1 = data->GeometricObject(p2Line1); - const QSharedPointer p1L2 = data->GeometricObject(p1Line2); - const QSharedPointer p2L2 = data->GeometricObject(p2Line2); + const QSharedPointer p1L1 = data->GeometricObject(getP1Line1()); + const QSharedPointer p2L1 = data->GeometricObject(getP2Line1()); + const QSharedPointer p1L2 = data->GeometricObject(getP1Line2()); + const QSharedPointer p2L2 = data->GeometricObject(getP2Line2()); QLineF line1(p1L1->toQPointF(), p2L1->toQPointF()); QLineF line2(p1L2->toQPointF(), p2L2->toQPointF()); @@ -343,8 +289,8 @@ bool DialogLineIntersect::CheckIntersecion() */ void DialogLineIntersect::setP2Line2(const quint32 &value) { - setPointId(ui->comboBoxP2Line2, p2Line2, value); - line->setLine2P2Id(p2Line2); + setCurrentPointId(ui->comboBoxP2Line2, value); + line->setLine2P2Id(value); } //--------------------------------------------------------------------------------------------------------------------- @@ -354,8 +300,8 @@ void DialogLineIntersect::setP2Line2(const quint32 &value) */ void DialogLineIntersect::setP1Line2(const quint32 &value) { - setPointId(ui->comboBoxP1Line2, p1Line2, value); - line->setLine2P1Id(p1Line2); + setCurrentPointId(ui->comboBoxP1Line2, value); + line->setLine2P1Id(value); } //--------------------------------------------------------------------------------------------------------------------- @@ -365,8 +311,8 @@ void DialogLineIntersect::setP1Line2(const quint32 &value) */ void DialogLineIntersect::setP2Line1(const quint32 &value) { - setPointId(ui->comboBoxP2Line1, p2Line1, value); - line->setLine1P2Id(p2Line1); + setCurrentPointId(ui->comboBoxP2Line1, value); + line->setLine1P2Id(value); } //--------------------------------------------------------------------------------------------------------------------- @@ -376,8 +322,8 @@ void DialogLineIntersect::setP2Line1(const quint32 &value) */ void DialogLineIntersect::setP1Line1(const quint32 &value) { - setPointId(ui->comboBoxP1Line1, p1Line1, value); - line->setPoint1Id(p1Line1); + setCurrentPointId(ui->comboBoxP1Line1, value); + line->setPoint1Id(value); } //--------------------------------------------------------------------------------------------------------------------- @@ -398,7 +344,7 @@ void DialogLineIntersect::setPointName(const QString &value) */ quint32 DialogLineIntersect::getP1Line1() const { - return p1Line1; + return getCurrentObjectId(ui->comboBoxP1Line1); } //--------------------------------------------------------------------------------------------------------------------- @@ -408,7 +354,7 @@ quint32 DialogLineIntersect::getP1Line1() const */ quint32 DialogLineIntersect::getP2Line1() const { - return p2Line1; + return getCurrentObjectId(ui->comboBoxP2Line1); } //--------------------------------------------------------------------------------------------------------------------- @@ -418,7 +364,7 @@ quint32 DialogLineIntersect::getP2Line1() const */ quint32 DialogLineIntersect::getP1Line2() const { - return p1Line2; + return getCurrentObjectId(ui->comboBoxP1Line2); } //--------------------------------------------------------------------------------------------------------------------- @@ -428,5 +374,5 @@ quint32 DialogLineIntersect::getP1Line2() const */ quint32 DialogLineIntersect::getP2Line2() const { - return p2Line2; + return getCurrentObjectId(ui->comboBoxP2Line2); } diff --git a/src/app/dialogs/tools/dialoglineintersect.h b/src/app/dialogs/tools/dialoglineintersect.h index dd21b2319..bd9a31a2e 100644 --- a/src/app/dialogs/tools/dialoglineintersect.h +++ b/src/app/dialogs/tools/dialoglineintersect.h @@ -63,10 +63,7 @@ public: void setPointName(const QString &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); - void P1Line1Changed( int index); - void P2Line1Changed( int index); - void P1Line2Changed( int index); - void P2Line2Changed( int index); + void PointChanged(); virtual void PointNameChanged(); virtual void UpdateList(); protected: @@ -84,18 +81,6 @@ private: /** @brief number number of handled objects */ qint32 number; - /** @brief p1Line1 id first point of first line */ - quint32 p1Line1; - - /** @brief p2Line1 id second point of first line */ - quint32 p2Line1; - - /** @brief p1Line2 id first point of second line */ - quint32 p1Line2; - - /** @brief p2Line2 id second point of second line */ - quint32 p2Line2; - /** @brief flagPoint keep state of point */ bool flagPoint; diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.cpp b/src/app/dialogs/tools/dialoglineintersectaxis.cpp index 19b068f7a..15ab6a05c 100644 --- a/src/app/dialogs/tools/dialoglineintersectaxis.cpp +++ b/src/app/dialogs/tools/dialoglineintersectaxis.cpp @@ -39,8 +39,7 @@ //--------------------------------------------------------------------------------------------------------------------- DialogLineIntersectAxis::DialogLineIntersectAxis(const VContainer *data, const quint32 &toolId, QWidget *parent) :DialogTool(data, toolId, parent), ui(new Ui::DialogLineIntersectAxis), number(0), typeLine(QString()), - formulaAngle(QString()), basePointId(NULL_ID), firstPointId(NULL_ID), secondPointId(NULL_ID), - formulaBaseHeightAngle(0), line(nullptr) + formulaAngle(QString()), formulaBaseHeightAngle(0), line(nullptr) { ui->setupUi(this); InitVariables(ui); @@ -134,39 +133,39 @@ void DialogLineIntersectAxis::setAngle(const QString &value) //--------------------------------------------------------------------------------------------------------------------- quint32 DialogLineIntersectAxis::getBasePointId() const { - return basePointId; + return getCurrentObjectId(ui->comboBoxAxisPoint); } //--------------------------------------------------------------------------------------------------------------------- void DialogLineIntersectAxis::setBasePointId(const quint32 &value) { - setCurrentPointId(ui->comboBoxAxisPoint, basePointId, value); + setCurrentPointId(ui->comboBoxAxisPoint, value); line->setAxisPointId(value); } //--------------------------------------------------------------------------------------------------------------------- quint32 DialogLineIntersectAxis::getFirstPointId() const { - return firstPointId; + return getCurrentObjectId(ui->comboBoxFirstLinePoint); } //--------------------------------------------------------------------------------------------------------------------- void DialogLineIntersectAxis::setFirstPointId(const quint32 &value) { - setCurrentPointId(ui->comboBoxFirstLinePoint, firstPointId, value); + setCurrentPointId(ui->comboBoxFirstLinePoint, value); line->setPoint1Id(value); } //--------------------------------------------------------------------------------------------------------------------- quint32 DialogLineIntersectAxis::getSecondPointId() const { - return secondPointId; + return getCurrentObjectId(ui->comboBoxSecondLinePoint); } //--------------------------------------------------------------------------------------------------------------------- void DialogLineIntersectAxis::setSecondPointId(const quint32 &value) { - setCurrentPointId(ui->comboBoxSecondLinePoint, secondPointId, value); + setCurrentPointId(ui->comboBoxSecondLinePoint, value); line->setPoint2Id(value); } @@ -180,7 +179,7 @@ void DialogLineIntersectAxis::ShowDialog(bool click) /*We will ignore click if poinet is in point circle*/ VMainGraphicsScene *scene = qApp->getCurrentScene(); SCASSERT(scene != nullptr); - const QSharedPointer point = data->GeometricObject(basePointId); + const QSharedPointer point = data->GeometricObject(getBasePointId()); QLineF line = QLineF(point->toQPointF(), scene->getScenePos()); //Radius of point circle, but little bigger. Need handle with hover sizes. @@ -237,7 +236,6 @@ void DialogLineIntersectAxis::ChosenObject(quint32 id, const SceneObject &type) { if (SetObject(id, ui->comboBoxAxisPoint, "")) { - basePointId = id; line->setAxisPointId(id); line->RefreshGeometry(); prepare = true; @@ -323,13 +321,9 @@ void DialogLineIntersectAxis::SaveData() formulaAngle = ui->plainTextEditFormula->toPlainText(); formulaAngle.replace("\n", " "); - basePointId = getCurrentObjectId(ui->comboBoxAxisPoint); - firstPointId = getCurrentObjectId(ui->comboBoxFirstLinePoint); - secondPointId = getCurrentObjectId(ui->comboBoxSecondLinePoint); - - line->setPoint1Id(firstPointId); - line->setPoint2Id(secondPointId); - line->setAxisPointId(basePointId); + line->setPoint1Id(getFirstPointId()); + line->setPoint2Id(getSecondPointId()); + line->setAxisPointId(getBasePointId()); line->setAngle(formulaAngle); line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); line->RefreshGeometry(); diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.h b/src/app/dialogs/tools/dialoglineintersectaxis.h index 6e9fff414..752959d6e 100644 --- a/src/app/dialogs/tools/dialoglineintersectaxis.h +++ b/src/app/dialogs/tools/dialoglineintersectaxis.h @@ -88,9 +88,6 @@ private: QString typeLine; QString formulaAngle; - quint32 basePointId; - quint32 firstPointId; - quint32 secondPointId; int formulaBaseHeightAngle; VisToolLineIntersectAxis *line; diff --git a/src/app/dialogs/tools/dialognormal.cpp b/src/app/dialogs/tools/dialognormal.cpp index 6736f3a6b..5f10d5263 100644 --- a/src/app/dialogs/tools/dialognormal.cpp +++ b/src/app/dialogs/tools/dialognormal.cpp @@ -40,7 +40,7 @@ */ DialogNormal::DialogNormal(const VContainer *data, const quint32 &toolId, QWidget *parent) :DialogTool(data, toolId, parent), ui(new Ui::DialogNormal), number(0), typeLine(QString()), - formula(QString()), angle(0), firstPointId(NULL_ID), secondPointId(NULL_ID), formulaBaseHeight(0), line(nullptr) + formula(QString()), angle(0), formulaBaseHeight(0), line(nullptr) { ui->setupUi(this); InitVariables(ui); @@ -177,11 +177,9 @@ void DialogNormal::SaveData() formula = ui->plainTextEditFormula->toPlainText(); formula.replace("\n", " "); angle = ui->doubleSpinBoxAngle->value(); - firstPointId = getCurrentObjectId(ui->comboBoxFirstPoint); - secondPointId = getCurrentObjectId(ui->comboBoxSecondPoint); - line->setPoint1Id(firstPointId); - line->setPoint2Id(secondPointId); + line->setPoint1Id(getFirstPointId()); + line->setPoint2Id(getSecondPointId()); line->setLength(formula); line->setAngle(angle); line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); @@ -202,7 +200,7 @@ void DialogNormal::closeEvent(QCloseEvent *event) */ void DialogNormal::setSecondPointId(const quint32 &value) { - setPointId(ui->comboBoxSecondPoint, secondPointId, value); + setCurrentPointId(ui->comboBoxSecondPoint, value); line->setPoint2Id(value); } @@ -213,7 +211,7 @@ void DialogNormal::setSecondPointId(const quint32 &value) */ void DialogNormal::setFirstPointId(const quint32 &value) { - setPointId(ui->comboBoxFirstPoint, firstPointId, value); + setCurrentPointId(ui->comboBoxFirstPoint, value); line->setPoint1Id(value); } @@ -307,7 +305,7 @@ qreal DialogNormal::getAngle() const */ quint32 DialogNormal::getFirstPointId() const { - return firstPointId; + return getCurrentObjectId(ui->comboBoxFirstPoint); } //--------------------------------------------------------------------------------------------------------------------- @@ -317,5 +315,5 @@ quint32 DialogNormal::getFirstPointId() const */ quint32 DialogNormal::getSecondPointId() const { - return secondPointId; + return getCurrentObjectId(ui->comboBoxSecondPoint); } diff --git a/src/app/dialogs/tools/dialognormal.h b/src/app/dialogs/tools/dialognormal.h index 935a6f06f..a501d5892 100644 --- a/src/app/dialogs/tools/dialognormal.h +++ b/src/app/dialogs/tools/dialognormal.h @@ -100,12 +100,6 @@ private: /** @brief angle aditional angle of normal */ qreal angle; - /** @brief firstPointId id first point of line */ - quint32 firstPointId; - - /** @brief secondPointId id second point of line */ - quint32 secondPointId; - /** @brief formulaBaseHeight base height defined by dialogui */ int formulaBaseHeight; diff --git a/src/app/dialogs/tools/dialogpointofcontact.cpp b/src/app/dialogs/tools/dialogpointofcontact.cpp index d118c5678..20e4f646c 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.cpp +++ b/src/app/dialogs/tools/dialogpointofcontact.cpp @@ -42,7 +42,7 @@ */ DialogPointOfContact::DialogPointOfContact(const VContainer *data, const quint32 &toolId, QWidget *parent) :DialogTool(data, toolId, parent), ui(new Ui::DialogPointOfContact), number(0), - radius(QString()), center(NULL_ID), firstPoint(NULL_ID), secondPoint(NULL_ID), formulaBaseHeight(0), line(nullptr) + radius(QString()), formulaBaseHeight(0), line(nullptr) { ui->setupUi(this); InitVariables(ui); @@ -217,13 +217,10 @@ void DialogPointOfContact::SaveData() pointName = ui->lineEditNamePoint->text(); radius = ui->plainTextEditFormula->toPlainText(); radius.replace("\n", " "); - center = getCurrentObjectId(ui->comboBoxCenter); - firstPoint = getCurrentObjectId(ui->comboBoxFirstPoint); - secondPoint = getCurrentObjectId(ui->comboBoxSecondPoint); - line->setPoint1Id(firstPoint); - line->setLineP2Id(secondPoint); - line->setRadiusId(center); + line->setPoint1Id(getFirstPoint()); + line->setLineP2Id(getSecondPoint()); + line->setRadiusId(getCenter()); line->setRadius(radius); line->RefreshGeometry(); } @@ -242,8 +239,8 @@ void DialogPointOfContact::closeEvent(QCloseEvent *event) */ void DialogPointOfContact::setSecondPoint(const quint32 &value) { - setPointId(ui->comboBoxSecondPoint, secondPoint, value); - line->setLineP2Id(secondPoint); + setCurrentPointId(ui->comboBoxSecondPoint, value); + line->setLineP2Id(value); } //--------------------------------------------------------------------------------------------------------------------- @@ -253,8 +250,8 @@ void DialogPointOfContact::setSecondPoint(const quint32 &value) */ void DialogPointOfContact::setFirstPoint(const quint32 &value) { - setPointId(ui->comboBoxFirstPoint, firstPoint, value); - line->setPoint1Id(firstPoint); + setCurrentPointId(ui->comboBoxFirstPoint, value); + line->setPoint1Id(value); } //--------------------------------------------------------------------------------------------------------------------- @@ -264,8 +261,8 @@ void DialogPointOfContact::setFirstPoint(const quint32 &value) */ void DialogPointOfContact::setCenter(const quint32 &value) { - setPointId(ui->comboBoxCenter, center, value); - line->setRadiusId(center); + setCurrentPointId(ui->comboBoxCenter, value); + line->setRadiusId(value); } //--------------------------------------------------------------------------------------------------------------------- @@ -314,7 +311,7 @@ QString DialogPointOfContact::getRadius() const */ quint32 DialogPointOfContact::getCenter() const { - return center; + return getCurrentObjectId(ui->comboBoxCenter); } //--------------------------------------------------------------------------------------------------------------------- @@ -324,7 +321,7 @@ quint32 DialogPointOfContact::getCenter() const */ quint32 DialogPointOfContact::getFirstPoint() const { - return firstPoint; + return getCurrentObjectId(ui->comboBoxFirstPoint);; } //--------------------------------------------------------------------------------------------------------------------- @@ -334,5 +331,5 @@ quint32 DialogPointOfContact::getFirstPoint() const */ quint32 DialogPointOfContact::getSecondPoint() const { - return secondPoint; + return getCurrentObjectId(ui->comboBoxSecondPoint); } diff --git a/src/app/dialogs/tools/dialogpointofcontact.h b/src/app/dialogs/tools/dialogpointofcontact.h index c773cca40..a6369b008 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.h +++ b/src/app/dialogs/tools/dialogpointofcontact.h @@ -92,15 +92,6 @@ private: /** @brief radius radius of arc */ QString radius; - /** @brief center id center point of arc */ - quint32 center; - - /** @brief firstPoint id first point of line */ - quint32 firstPoint; - - /** @brief secondPoint id second point of line */ - quint32 secondPoint; - /** @brief formulaBaseHeight base height defined by dialogui */ int formulaBaseHeight; diff --git a/src/app/dialogs/tools/dialogpointofintersection.cpp b/src/app/dialogs/tools/dialogpointofintersection.cpp index fdcbcbe15..2efe0db49 100644 --- a/src/app/dialogs/tools/dialogpointofintersection.cpp +++ b/src/app/dialogs/tools/dialogpointofintersection.cpp @@ -42,8 +42,7 @@ * @param parent parent widget */ DialogPointOfIntersection::DialogPointOfIntersection(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogPointOfIntersection), number(0), - firstPointId(NULL_ID), secondPointId(NULL_ID), line(nullptr) + :DialogTool(data, toolId, parent), ui(new Ui::DialogPointOfIntersection), number(0), line(nullptr) { ui->setupUi(this); ui->lineEditNamePoint->setText(qApp->getCurrentDocument()->GenerateLabel(LabelType::NewLabel)); @@ -82,8 +81,8 @@ DialogPointOfIntersection::~DialogPointOfIntersection() */ void DialogPointOfIntersection::setSecondPointId(const quint32 &value) { - setPointId(ui->comboBoxSecondPoint, secondPointId, value); - line->setPoint2Id(secondPointId); + setCurrentPointId(ui->comboBoxSecondPoint, value); + line->setPoint2Id(value); } //--------------------------------------------------------------------------------------------------------------------- @@ -132,11 +131,9 @@ void DialogPointOfIntersection::ChosenObject(quint32 id, const SceneObject &type void DialogPointOfIntersection::SaveData() { pointName = ui->lineEditNamePoint->text(); - firstPointId = getCurrentObjectId(ui->comboBoxFirstPoint); - secondPointId = getCurrentObjectId(ui->comboBoxSecondPoint); - line->setPoint1Id(firstPointId); - line->setPoint2Id(secondPointId); + line->setPoint1Id(getFirstPointId()); + line->setPoint2Id(getSecondPointId()); line->RefreshGeometry(); } @@ -186,8 +183,8 @@ void DialogPointOfIntersection::ShowVisualization() */ void DialogPointOfIntersection::setFirstPointId(const quint32 &value) { - setPointId(ui->comboBoxFirstPoint, firstPointId, value); - line->setPoint1Id(firstPointId); + setCurrentPointId(ui->comboBoxFirstPoint, value); + line->setPoint1Id(value); } //--------------------------------------------------------------------------------------------------------------------- @@ -208,7 +205,7 @@ void DialogPointOfIntersection::setPointName(const QString &value) */ quint32 DialogPointOfIntersection::getFirstPointId() const { - return firstPointId; + return getCurrentObjectId(ui->comboBoxFirstPoint); } //--------------------------------------------------------------------------------------------------------------------- @@ -218,5 +215,5 @@ quint32 DialogPointOfIntersection::getFirstPointId() const */ quint32 DialogPointOfIntersection::getSecondPointId() const { - return secondPointId; + return getCurrentObjectId(ui->comboBoxSecondPoint); } diff --git a/src/app/dialogs/tools/dialogpointofintersection.h b/src/app/dialogs/tools/dialogpointofintersection.h index 8ef0a9795..d04f0ad9c 100644 --- a/src/app/dialogs/tools/dialogpointofintersection.h +++ b/src/app/dialogs/tools/dialogpointofintersection.h @@ -74,11 +74,6 @@ private: /** @brief number number of handled objects */ qint32 number; - /** @brief firstPointId id first point of line */ - quint32 firstPointId; - - /** @brief secondPointId id second point of line */ - quint32 secondPointId; VisToolPointOfIntersection *line; }; diff --git a/src/app/dialogs/tools/dialogshoulderpoint.cpp b/src/app/dialogs/tools/dialogshoulderpoint.cpp index 8a9855733..392418c49 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.cpp +++ b/src/app/dialogs/tools/dialogshoulderpoint.cpp @@ -43,8 +43,7 @@ */ DialogShoulderPoint::DialogShoulderPoint(const VContainer *data, const quint32 &toolId, QWidget *parent) :DialogTool(data, toolId, parent), ui(new Ui::DialogShoulderPoint), number(0), - typeLine(QString()), formula(QString()), p1Line(NULL_ID), p2Line(NULL_ID), pShoulder(NULL_ID), formulaBaseHeight(0), - line (nullptr) + typeLine(QString()), formula(QString()), formulaBaseHeight(0), line (nullptr) { ui->setupUi(this); InitVariables(ui); @@ -205,13 +204,10 @@ void DialogShoulderPoint::SaveData() typeLine = GetTypeLine(ui->comboBoxLineType); formula = ui->plainTextEditFormula->toPlainText(); formula.replace("\n", " "); - p1Line = getCurrentObjectId(ui->comboBoxP1Line); - p2Line = getCurrentObjectId(ui->comboBoxP2Line); - pShoulder = getCurrentObjectId(ui->comboBoxP3); - line->setPoint1Id(pShoulder); - line->setLineP1Id(p1Line); - line->setLineP2Id(p2Line); + line->setPoint1Id(getP3()); + line->setLineP1Id(getP1Line()); + line->setLineP2Id(getP2Line()); line->setLength(formula); line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); line->RefreshGeometry(); @@ -231,8 +227,8 @@ void DialogShoulderPoint::closeEvent(QCloseEvent *event) */ void DialogShoulderPoint::setP3(const quint32 &value) { - setPointId(ui->comboBoxP3, pShoulder, value); - line->setPoint1Id(pShoulder); + setCurrentPointId(ui->comboBoxP3, value); + line->setPoint1Id(value); } //--------------------------------------------------------------------------------------------------------------------- @@ -242,8 +238,8 @@ void DialogShoulderPoint::setP3(const quint32 &value) */ void DialogShoulderPoint::setP2Line(const quint32 &value) { - setPointId(ui->comboBoxP2Line, p2Line, value); - line->setLineP2Id(p2Line); + setCurrentPointId(ui->comboBoxP2Line, value); + line->setLineP2Id(value); } //--------------------------------------------------------------------------------------------------------------------- @@ -253,8 +249,8 @@ void DialogShoulderPoint::setP2Line(const quint32 &value) */ void DialogShoulderPoint::setP1Line(const quint32 &value) { - setPointId(ui->comboBoxP1Line, p1Line, value); - line->setLineP1Id(p1Line); + setCurrentPointId(ui->comboBoxP1Line, value); + line->setLineP1Id(value); } //--------------------------------------------------------------------------------------------------------------------- @@ -325,7 +321,7 @@ QString DialogShoulderPoint::getFormula() const */ quint32 DialogShoulderPoint::getP1Line() const { - return p1Line; + return getCurrentObjectId(ui->comboBoxP1Line); } //--------------------------------------------------------------------------------------------------------------------- @@ -335,7 +331,7 @@ quint32 DialogShoulderPoint::getP1Line() const */ quint32 DialogShoulderPoint::getP2Line() const { - return p2Line; + return getCurrentObjectId(ui->comboBoxP2Line); } //--------------------------------------------------------------------------------------------------------------------- @@ -345,5 +341,5 @@ quint32 DialogShoulderPoint::getP2Line() const */ quint32 DialogShoulderPoint::getP3() const { - return pShoulder; + return getCurrentObjectId(ui->comboBoxP3); } diff --git a/src/app/dialogs/tools/dialogshoulderpoint.h b/src/app/dialogs/tools/dialogshoulderpoint.h index c3989b984..c3fd347f4 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.h +++ b/src/app/dialogs/tools/dialogshoulderpoint.h @@ -97,15 +97,6 @@ private: /** @brief formula formula */ QString formula; - /** @brief p1Line id first point of line */ - quint32 p1Line; - - /** @brief p2Line id second point of line */ - quint32 p2Line; - - /** @brief pShoulder id shoulder point */ - quint32 pShoulder; - /** @brief formulaBaseHeight base height defined by dialogui */ int formulaBaseHeight; VisToolShoulderPoint *line; diff --git a/src/app/dialogs/tools/dialogspline.cpp b/src/app/dialogs/tools/dialogspline.cpp index 26c753773..d5639a6a3 100644 --- a/src/app/dialogs/tools/dialogspline.cpp +++ b/src/app/dialogs/tools/dialogspline.cpp @@ -41,8 +41,8 @@ * @param parent parent widget */ DialogSpline::DialogSpline(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogSpline), number(0), p1(NULL_ID), p4(NULL_ID), angle1(0), - angle2(0), kAsm1(1), kAsm2(1), kCurve(1), path(nullptr) + :DialogTool(data, toolId, parent), ui(new Ui::DialogSpline), number(0), angle1(0), angle2(0), kAsm1(1), kAsm2(1), + kCurve(1), path(nullptr) { ui->setupUi(this); InitOkCancelApply(ui); @@ -76,7 +76,7 @@ DialogSpline::~DialogSpline() */ quint32 DialogSpline::getP1() const { - return p1; + return getCurrentObjectId(ui->comboBoxP1); } //--------------------------------------------------------------------------------------------------------------------- @@ -141,16 +141,14 @@ void DialogSpline::ChosenObject(quint32 id, const SceneObject &type) //--------------------------------------------------------------------------------------------------------------------- void DialogSpline::SaveData() { - p1 = getCurrentObjectId(ui->comboBoxP1); - p4 = getCurrentObjectId(ui->comboBoxP4); angle1 = ui->spinBoxAngle1->value(); angle2 = ui->spinBoxAngle2->value(); kAsm1 = ui->doubleSpinBoxKasm1->value(); kAsm2 = ui->doubleSpinBoxKasm2->value(); kCurve = ui->doubleSpinBoxKcurve->value(); - path->setPoint1Id(p1); - path->setPoint4Id(p4); + path->setPoint1Id(getP1()); + path->setPoint4Id(getP4()); path->setAngle1(angle1); path->setAngle2(angle2); path->setKAsm1(kAsm1); @@ -270,8 +268,8 @@ void DialogSpline::setAngle1(const qreal &value) */ void DialogSpline::setP4(const quint32 &value) { - setPointId(ui->comboBoxP4, p4, value); - path->setPoint4Id(p4); + setCurrentPointId(ui->comboBoxP4, value); + path->setPoint4Id(value); } //--------------------------------------------------------------------------------------------------------------------- @@ -281,8 +279,8 @@ void DialogSpline::setP4(const quint32 &value) */ void DialogSpline::setP1(const quint32 &value) { - setPointId(ui->comboBoxP1, p1, value); - path->setPoint1Id(p1); + setCurrentPointId(ui->comboBoxP1, value); + path->setPoint1Id(value); } //--------------------------------------------------------------------------------------------------------------------- @@ -292,7 +290,7 @@ void DialogSpline::setP1(const quint32 &value) */ quint32 DialogSpline::getP4() const { - return p4; + return getCurrentObjectId(ui->comboBoxP4); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogspline.h b/src/app/dialogs/tools/dialogspline.h index 540c034e5..6c83f420f 100644 --- a/src/app/dialogs/tools/dialogspline.h +++ b/src/app/dialogs/tools/dialogspline.h @@ -87,12 +87,6 @@ private: /** @brief number number of handled objects */ qint32 number; - /** @brief p1 id first point of spline */ - quint32 p1; - - /** @brief p4 id fourth point of spline */ - quint32 p4; - /** @brief angle1 first angle of spline in degree */ qreal angle1; diff --git a/src/app/dialogs/tools/dialogtool.cpp b/src/app/dialogs/tools/dialogtool.cpp index c89503a6d..151e368bf 100644 --- a/src/app/dialogs/tools/dialogtool.cpp +++ b/src/app/dialogs/tools/dialogtool.cpp @@ -582,28 +582,29 @@ qreal DialogTool::Eval(const QString &text, bool &flag, QLabel *label, const QSt } //--------------------------------------------------------------------------------------------------------------------- -void DialogTool::setCurrentPointId(QComboBox *box, quint32 &pointId, const quint32 &value) const +void DialogTool::setCurrentPointId(QComboBox *box, const quint32 &value) const { SCASSERT(box != nullptr); + + box->blockSignals(true); + FillComboBoxPoints(box); - pointId = value; ChangeCurrentData(box, value); + + box->blockSignals(false); } //--------------------------------------------------------------------------------------------------------------------- /** * @brief setCurrentSplineId set current spline id in combobox * @param box combobox - * @param splineId save current spline id * @param value spline id * @param cut if set to ComboMode::CutSpline don't show id+1 and id+2 */ -void DialogTool::setCurrentSplineId(QComboBox *box, quint32 &splineId, const quint32 &value, - ComboBoxCutSpline cut) const +void DialogTool::setCurrentSplineId(QComboBox *box, const quint32 &value, ComboBoxCutSpline cut) const { SCASSERT(box != nullptr); FillComboBoxSplines(box, cut); - splineId = value; ChangeCurrentData(box, value); } @@ -611,15 +612,13 @@ void DialogTool::setCurrentSplineId(QComboBox *box, quint32 &splineId, const qui /** * @brief setCurrentArcId * @param box combobox - * @param arcId save current arc id * @param value arc id * @param cut if set to ComboMode::CutArc don't show id+1 and id+2 */ -void DialogTool::setCurrentArcId(QComboBox *box, quint32 &arcId, const quint32 &value, ComboBoxCutArc cut) const +void DialogTool::setCurrentArcId(QComboBox *box, const quint32 &value, ComboBoxCutArc cut) const { SCASSERT(box != nullptr); FillComboBoxArcs(box, cut); - arcId = value; ChangeCurrentData(box, value); } @@ -627,25 +626,21 @@ void DialogTool::setCurrentArcId(QComboBox *box, quint32 &arcId, const quint32 & /** * @brief setCurrentSplinePathId set current splinePath id in combobox * @param box combobox - * @param splinePathId save current splinePath id * @param value splinePath id * @param cut if set to ComboMode::CutSpline don't show id+1 and id+2 */ -void DialogTool::setCurrentSplinePathId(QComboBox *box, quint32 &splinePathId, const quint32 &value, - ComboBoxCutSpline cut) const +void DialogTool::setCurrentSplinePathId(QComboBox *box, const quint32 &value, ComboBoxCutSpline cut) const { SCASSERT(box != nullptr); FillComboBoxSplinesPath(box, cut); - splinePathId = value; ChangeCurrentData(box, value); } //--------------------------------------------------------------------------------------------------------------------- -void DialogTool::setCurrentCurveId(QComboBox *box, quint32 &curveId, const quint32 &value) const +void DialogTool::setCurrentCurveId(QComboBox *box, const quint32 &value) const { SCASSERT(box != nullptr); FillComboBoxCurves(box); - curveId = value; ChangeCurrentData(box, value); } @@ -800,15 +795,6 @@ void DialogTool::ChangeColor(QWidget *widget, const QColor &color) widget->setPalette(palette); } -//--------------------------------------------------------------------------------------------------------------------- -void DialogTool::setPointId(QComboBox *box, quint32 &pointId, const quint32 &value) -{ - SCASSERT(box != nullptr); - box->blockSignals(true); - setCurrentPointId(box, pointId, value); - box->blockSignals(false); -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief DialogAccepted save data and emit signal about closed dialog. diff --git a/src/app/dialogs/tools/dialogtool.h b/src/app/dialogs/tools/dialogtool.h index 0927c7595..cb9118ee4 100644 --- a/src/app/dialogs/tools/dialogtool.h +++ b/src/app/dialogs/tools/dialogtool.h @@ -233,14 +233,14 @@ protected: void ValFormulaChanged(bool &flag, QPlainTextEdit *edit, QTimer * timer); qreal Eval(const QString &text, bool &flag, QLabel *label, const QString &postfix, bool checkZero = true); - void setCurrentPointId(QComboBox *box, quint32 &pointId, const quint32 &value) const; - void setCurrentSplineId(QComboBox *box, quint32 &splineId, const quint32 &value, + void setCurrentPointId(QComboBox *box, const quint32 &value) const; + void setCurrentSplineId(QComboBox *box, const quint32 &value, ComboBoxCutSpline cut = ComboBoxCutSpline::NoCutSpline) const; - void setCurrentArcId(QComboBox *box, quint32 &arcId, const quint32 &value, + void setCurrentArcId(QComboBox *box, const quint32 &value, ComboBoxCutArc cut = ComboBoxCutArc::NoCutArc) const; - void setCurrentSplinePathId(QComboBox *box, quint32 &splinePathId, const quint32 &value, + void setCurrentSplinePathId(QComboBox *box, const quint32 &value, ComboBoxCutSpline cut = ComboBoxCutSpline::NoCutSpline) const; - void setCurrentCurveId(QComboBox *box, quint32 &curveId, const quint32 &value) const; + void setCurrentCurveId(QComboBox *box, const quint32 &value) const; quint32 getCurrentObjectId(QComboBox *box) const; bool SetObject(const quint32 &id, QComboBox *box, const QString &toolTip); void DeployFormula(QPlainTextEdit *formula, QPushButton *buttonGrowLength, int formulaBaseHeight); @@ -333,7 +333,6 @@ protected: } void ChangeColor(QWidget *widget, const QColor &color); - void setPointId(QComboBox *box, quint32 &pointId, const quint32 &value); virtual void ShowVisualization(){} /** * @brief SaveData Put dialog data in local variables diff --git a/src/app/dialogs/tools/dialogtriangle.cpp b/src/app/dialogs/tools/dialogtriangle.cpp index 875b66a8f..e62b2fa2c 100644 --- a/src/app/dialogs/tools/dialogtriangle.cpp +++ b/src/app/dialogs/tools/dialogtriangle.cpp @@ -41,8 +41,7 @@ * @param parent parent widget */ DialogTriangle::DialogTriangle(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogTriangle), number(0), axisP1Id(NULL_ID), - axisP2Id(NULL_ID), firstPointId(NULL_ID), secondPointId(NULL_ID), line (nullptr) + :DialogTool(data, toolId, parent), ui(new Ui::DialogTriangle), number(0), line (nullptr) { ui->setupUi(this); ui->lineEditNamePoint->setText(qApp->getCurrentDocument()->GenerateLabel(LabelType::NewLabel)); @@ -161,15 +160,11 @@ void DialogTriangle::ChosenObject(quint32 id, const SceneObject &type) void DialogTriangle::SaveData() { pointName = ui->lineEditNamePoint->text(); - firstPointId = getCurrentObjectId(ui->comboBoxFirstPoint); - secondPointId = getCurrentObjectId(ui->comboBoxSecondPoint); - axisP1Id = getCurrentObjectId(ui->comboBoxAxisP1); - axisP2Id = getCurrentObjectId(ui->comboBoxAxisP2); - line->setPoint1Id(axisP1Id); - line->setPoint2Id(axisP2Id); - line->setHypotenuseP1Id(firstPointId); - line->setHypotenuseP2Id(secondPointId); + line->setPoint1Id(getAxisP1Id()); + line->setPoint2Id(getAxisP2Id()); + line->setHypotenuseP1Id(getFirstPointId()); + line->setHypotenuseP2Id(getSecondPointId()); line->RefreshGeometry(); } @@ -239,8 +234,8 @@ void DialogTriangle::setPointName(const QString &value) */ void DialogTriangle::setSecondPointId(const quint32 &value) { - setPointId(ui->comboBoxSecondPoint, secondPointId, value); - line->setHypotenuseP2Id(secondPointId); + setCurrentPointId(ui->comboBoxSecondPoint, value); + line->setHypotenuseP2Id(value); } //--------------------------------------------------------------------------------------------------------------------- @@ -250,8 +245,8 @@ void DialogTriangle::setSecondPointId(const quint32 &value) */ void DialogTriangle::setFirstPointId(const quint32 &value) { - setPointId(ui->comboBoxFirstPoint, firstPointId, value); - line->setHypotenuseP1Id(firstPointId); + setCurrentPointId(ui->comboBoxFirstPoint, value); + line->setHypotenuseP1Id(value); } //--------------------------------------------------------------------------------------------------------------------- @@ -261,8 +256,8 @@ void DialogTriangle::setFirstPointId(const quint32 &value) */ void DialogTriangle::setAxisP2Id(const quint32 &value) { - setPointId(ui->comboBoxAxisP2, axisP2Id, value); - line->setPoint2Id(axisP2Id); + setCurrentPointId(ui->comboBoxAxisP2, value); + line->setPoint2Id(value); } //--------------------------------------------------------------------------------------------------------------------- @@ -272,8 +267,8 @@ void DialogTriangle::setAxisP2Id(const quint32 &value) */ void DialogTriangle::setAxisP1Id(const quint32 &value) { - setPointId(ui->comboBoxAxisP1, axisP1Id, value); - line->setPoint1Id(axisP1Id); + setCurrentPointId(ui->comboBoxAxisP1, value); + line->setPoint1Id(value); } //--------------------------------------------------------------------------------------------------------------------- @@ -283,7 +278,7 @@ void DialogTriangle::setAxisP1Id(const quint32 &value) */ quint32 DialogTriangle::getAxisP1Id() const { - return axisP1Id; + return getCurrentObjectId(ui->comboBoxAxisP1); } //--------------------------------------------------------------------------------------------------------------------- @@ -293,7 +288,7 @@ quint32 DialogTriangle::getAxisP1Id() const */ quint32 DialogTriangle::getAxisP2Id() const { - return axisP2Id; + return getCurrentObjectId(ui->comboBoxAxisP2); } //--------------------------------------------------------------------------------------------------------------------- @@ -303,7 +298,7 @@ quint32 DialogTriangle::getAxisP2Id() const */ quint32 DialogTriangle::getFirstPointId() const { - return firstPointId; + return getCurrentObjectId(ui->comboBoxFirstPoint); } //--------------------------------------------------------------------------------------------------------------------- @@ -313,5 +308,5 @@ quint32 DialogTriangle::getFirstPointId() const */ quint32 DialogTriangle::getSecondPointId() const { - return secondPointId; + return getCurrentObjectId(ui->comboBoxSecondPoint); } diff --git a/src/app/dialogs/tools/dialogtriangle.h b/src/app/dialogs/tools/dialogtriangle.h index df5df7ca2..cdeaf4e31 100644 --- a/src/app/dialogs/tools/dialogtriangle.h +++ b/src/app/dialogs/tools/dialogtriangle.h @@ -80,18 +80,6 @@ private: /** @brief number number of handled objects */ qint32 number; - /** @brief axisP1Id id first point of axis */ - quint32 axisP1Id; - - /** @brief axisP2Id id second point of axis */ - quint32 axisP2Id; - - /** @brief firstPointId id first point of line */ - quint32 firstPointId; - - /** @brief secondPointId id second point of line */ - quint32 secondPointId; - VisToolTriangle *line; }; From f141edad2727c3e3741d279dc1abaaa7b52656a9 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 3 Feb 2015 10:32:32 +0200 Subject: [PATCH 090/186] Refactoring. --HG-- branch : feature --- src/app/dialogs/tools/dialogalongline.cpp | 2 +- src/app/dialogs/tools/dialogalongline.h | 3 --- src/app/dialogs/tools/dialogbisector.cpp | 2 +- src/app/dialogs/tools/dialogbisector.h | 3 --- src/app/dialogs/tools/dialogcurveintersectaxis.cpp | 2 +- src/app/dialogs/tools/dialogcurveintersectaxis.h | 3 --- src/app/dialogs/tools/dialogheight.cpp | 2 +- src/app/dialogs/tools/dialogheight.h | 3 --- src/app/dialogs/tools/dialogline.cpp | 2 +- src/app/dialogs/tools/dialogline.h | 3 --- src/app/dialogs/tools/dialoglineintersect.cpp | 2 +- src/app/dialogs/tools/dialoglineintersect.h | 3 --- src/app/dialogs/tools/dialoglineintersectaxis.cpp | 2 +- src/app/dialogs/tools/dialoglineintersectaxis.h | 3 --- src/app/dialogs/tools/dialognormal.cpp | 2 +- src/app/dialogs/tools/dialognormal.h | 3 --- src/app/dialogs/tools/dialogpointofcontact.cpp | 2 +- src/app/dialogs/tools/dialogpointofcontact.h | 3 --- src/app/dialogs/tools/dialogpointofintersection.cpp | 2 +- src/app/dialogs/tools/dialogpointofintersection.h | 3 --- src/app/dialogs/tools/dialogshoulderpoint.cpp | 4 ++-- src/app/dialogs/tools/dialogshoulderpoint.h | 3 --- src/app/dialogs/tools/dialogspline.cpp | 2 +- src/app/dialogs/tools/dialogspline.h | 3 --- src/app/dialogs/tools/dialogtool.cpp | 2 +- src/app/dialogs/tools/dialogtool.h | 3 +++ src/app/dialogs/tools/dialogtriangle.cpp | 2 +- src/app/dialogs/tools/dialogtriangle.h | 3 --- 28 files changed, 18 insertions(+), 54 deletions(-) diff --git a/src/app/dialogs/tools/dialogalongline.cpp b/src/app/dialogs/tools/dialogalongline.cpp index 9995d9688..2752ec77a 100644 --- a/src/app/dialogs/tools/dialogalongline.cpp +++ b/src/app/dialogs/tools/dialogalongline.cpp @@ -41,7 +41,7 @@ * @param parent parent widget */ DialogAlongLine::DialogAlongLine(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogAlongLine), number(0), + :DialogTool(data, toolId, parent), ui(new Ui::DialogAlongLine), typeLine(QString()), formula(QString()), formulaBaseHeight(0), line(nullptr), lineColor(VAbstractTool::ColorBlack) { ui->setupUi(this); diff --git a/src/app/dialogs/tools/dialogalongline.h b/src/app/dialogs/tools/dialogalongline.h index 2cd1143da..636153379 100644 --- a/src/app/dialogs/tools/dialogalongline.h +++ b/src/app/dialogs/tools/dialogalongline.h @@ -88,9 +88,6 @@ private: /** @brief ui keeps information about user interface */ Ui::DialogAlongLine *ui; - /** @brief number number of handled objects */ - qint32 number; - /** @brief typeLine type of line */ QString typeLine; diff --git a/src/app/dialogs/tools/dialogbisector.cpp b/src/app/dialogs/tools/dialogbisector.cpp index a5a8000ab..70b159e9d 100644 --- a/src/app/dialogs/tools/dialogbisector.cpp +++ b/src/app/dialogs/tools/dialogbisector.cpp @@ -42,7 +42,7 @@ * @param parent parent widget */ DialogBisector::DialogBisector(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogBisector), number(0), typeLine(QString()), + :DialogTool(data, toolId, parent), ui(new Ui::DialogBisector), typeLine(QString()), formula(QString()), formulaBaseHeight(0), line(nullptr) { ui->setupUi(this); diff --git a/src/app/dialogs/tools/dialogbisector.h b/src/app/dialogs/tools/dialogbisector.h index 8cbccf032..63c45e67b 100644 --- a/src/app/dialogs/tools/dialogbisector.h +++ b/src/app/dialogs/tools/dialogbisector.h @@ -89,9 +89,6 @@ private: /** @brief ui keeps information about user interface */ Ui::DialogBisector *ui; - /** @brief number number of handled objects */ - qint32 number; - /** @brief typeLine type of line */ QString typeLine; diff --git a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp b/src/app/dialogs/tools/dialogcurveintersectaxis.cpp index 060b15e87..d395fe276 100644 --- a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp +++ b/src/app/dialogs/tools/dialogcurveintersectaxis.cpp @@ -38,7 +38,7 @@ //--------------------------------------------------------------------------------------------------------------------- DialogCurveIntersectAxis::DialogCurveIntersectAxis(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogCurveIntersectAxis), number(0), typeLine(QString()), + :DialogTool(data, toolId, parent), ui(new Ui::DialogCurveIntersectAxis), typeLine(QString()), formulaAngle(QString()), formulaBaseHeightAngle(0), line(nullptr) { ui->setupUi(this); diff --git a/src/app/dialogs/tools/dialogcurveintersectaxis.h b/src/app/dialogs/tools/dialogcurveintersectaxis.h index 0377f28c4..516c193a1 100644 --- a/src/app/dialogs/tools/dialogcurveintersectaxis.h +++ b/src/app/dialogs/tools/dialogcurveintersectaxis.h @@ -77,9 +77,6 @@ private: Q_DISABLE_COPY(DialogCurveIntersectAxis) Ui::DialogCurveIntersectAxis *ui; - /** @brief number number of handled objects */ - qint32 number; - /** @brief typeLine type of line */ QString typeLine; diff --git a/src/app/dialogs/tools/dialogheight.cpp b/src/app/dialogs/tools/dialogheight.cpp index 76fca0869..fe4057a1a 100644 --- a/src/app/dialogs/tools/dialogheight.cpp +++ b/src/app/dialogs/tools/dialogheight.cpp @@ -42,7 +42,7 @@ * @param parent parent widget */ DialogHeight::DialogHeight(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogHeight), number(0), typeLine(QString()), line(nullptr) + :DialogTool(data, toolId, parent), ui(new Ui::DialogHeight), typeLine(QString()), line(nullptr) { ui->setupUi(this); ui->lineEditNamePoint->setText(qApp->getCurrentDocument()->GenerateLabel(LabelType::NewLabel)); diff --git a/src/app/dialogs/tools/dialogheight.h b/src/app/dialogs/tools/dialogheight.h index e1cc4f719..93f67574e 100644 --- a/src/app/dialogs/tools/dialogheight.h +++ b/src/app/dialogs/tools/dialogheight.h @@ -77,9 +77,6 @@ private: /** @brief ui keeps information about user interface */ Ui::DialogHeight *ui; - /** @brief number number of handled objects */ - qint32 number; - /** @brief typeLine type of line */ QString typeLine; diff --git a/src/app/dialogs/tools/dialogline.cpp b/src/app/dialogs/tools/dialogline.cpp index 0b1ec4ee8..c864c49fa 100644 --- a/src/app/dialogs/tools/dialogline.cpp +++ b/src/app/dialogs/tools/dialogline.cpp @@ -43,7 +43,7 @@ * @param parent parent widget */ DialogLine::DialogLine(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogLine), number(0), typeLine(QString()), line(nullptr) + :DialogTool(data, toolId, parent), ui(new Ui::DialogLine), typeLine(QString()), line(nullptr) { ui->setupUi(this); InitOkCancelApply(ui); diff --git a/src/app/dialogs/tools/dialogline.h b/src/app/dialogs/tools/dialogline.h index c0f1eb019..66ed3c18b 100644 --- a/src/app/dialogs/tools/dialogline.h +++ b/src/app/dialogs/tools/dialogline.h @@ -72,9 +72,6 @@ private: /** @brief ui keeps information about user interface */ Ui::DialogLine *ui; - /** @brief number number of handled objects */ - qint32 number; - /** @brief typeLine type of line */ QString typeLine; VisToolLine *line; diff --git a/src/app/dialogs/tools/dialoglineintersect.cpp b/src/app/dialogs/tools/dialoglineintersect.cpp index a8a1a67b9..ae764162b 100644 --- a/src/app/dialogs/tools/dialoglineintersect.cpp +++ b/src/app/dialogs/tools/dialoglineintersect.cpp @@ -42,7 +42,7 @@ * @param parent parent widget */ DialogLineIntersect::DialogLineIntersect(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogLineIntersect), number(0), flagPoint(true), line(nullptr) + :DialogTool(data, toolId, parent), ui(new Ui::DialogLineIntersect), flagPoint(true), line(nullptr) { ui->setupUi(this); number = 0; diff --git a/src/app/dialogs/tools/dialoglineintersect.h b/src/app/dialogs/tools/dialoglineintersect.h index bd9a31a2e..aff7e03f0 100644 --- a/src/app/dialogs/tools/dialoglineintersect.h +++ b/src/app/dialogs/tools/dialoglineintersect.h @@ -78,9 +78,6 @@ private: /** @brief ui keeps information about user interface */ Ui::DialogLineIntersect *ui; - /** @brief number number of handled objects */ - qint32 number; - /** @brief flagPoint keep state of point */ bool flagPoint; diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.cpp b/src/app/dialogs/tools/dialoglineintersectaxis.cpp index 15ab6a05c..f9c049390 100644 --- a/src/app/dialogs/tools/dialoglineintersectaxis.cpp +++ b/src/app/dialogs/tools/dialoglineintersectaxis.cpp @@ -38,7 +38,7 @@ //--------------------------------------------------------------------------------------------------------------------- DialogLineIntersectAxis::DialogLineIntersectAxis(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogLineIntersectAxis), number(0), typeLine(QString()), + :DialogTool(data, toolId, parent), ui(new Ui::DialogLineIntersectAxis), typeLine(QString()), formulaAngle(QString()), formulaBaseHeightAngle(0), line(nullptr) { ui->setupUi(this); diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.h b/src/app/dialogs/tools/dialoglineintersectaxis.h index 752959d6e..afc1b3ce9 100644 --- a/src/app/dialogs/tools/dialoglineintersectaxis.h +++ b/src/app/dialogs/tools/dialoglineintersectaxis.h @@ -81,9 +81,6 @@ private: Q_DISABLE_COPY(DialogLineIntersectAxis) Ui::DialogLineIntersectAxis *ui; - /** @brief number number of handled objects */ - qint32 number; - /** @brief typeLine type of line */ QString typeLine; diff --git a/src/app/dialogs/tools/dialognormal.cpp b/src/app/dialogs/tools/dialognormal.cpp index 5f10d5263..4e6dd7649 100644 --- a/src/app/dialogs/tools/dialognormal.cpp +++ b/src/app/dialogs/tools/dialognormal.cpp @@ -39,7 +39,7 @@ * @param parent parent widget */ DialogNormal::DialogNormal(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogNormal), number(0), typeLine(QString()), + :DialogTool(data, toolId, parent), ui(new Ui::DialogNormal), typeLine(QString()), formula(QString()), angle(0), formulaBaseHeight(0), line(nullptr) { ui->setupUi(this); diff --git a/src/app/dialogs/tools/dialognormal.h b/src/app/dialogs/tools/dialognormal.h index a501d5892..7bde3c54b 100644 --- a/src/app/dialogs/tools/dialognormal.h +++ b/src/app/dialogs/tools/dialognormal.h @@ -88,9 +88,6 @@ private: /** @brief ui keeps information about user interface */ Ui::DialogNormal *ui; - /** @brief number number of handled objects */ - qint32 number; - /** @brief typeLine type of line */ QString typeLine; diff --git a/src/app/dialogs/tools/dialogpointofcontact.cpp b/src/app/dialogs/tools/dialogpointofcontact.cpp index 20e4f646c..fe1e45c24 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.cpp +++ b/src/app/dialogs/tools/dialogpointofcontact.cpp @@ -41,7 +41,7 @@ * @param parent parent widget */ DialogPointOfContact::DialogPointOfContact(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogPointOfContact), number(0), + :DialogTool(data, toolId, parent), ui(new Ui::DialogPointOfContact), radius(QString()), formulaBaseHeight(0), line(nullptr) { ui->setupUi(this); diff --git a/src/app/dialogs/tools/dialogpointofcontact.h b/src/app/dialogs/tools/dialogpointofcontact.h index a6369b008..80fe12a56 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.h +++ b/src/app/dialogs/tools/dialogpointofcontact.h @@ -86,9 +86,6 @@ private: /** @brief ui keeps information about user interface */ Ui::DialogPointOfContact *ui; - /** @brief number number of handled objects */ - qint32 number; - /** @brief radius radius of arc */ QString radius; diff --git a/src/app/dialogs/tools/dialogpointofintersection.cpp b/src/app/dialogs/tools/dialogpointofintersection.cpp index 2efe0db49..c380255b7 100644 --- a/src/app/dialogs/tools/dialogpointofintersection.cpp +++ b/src/app/dialogs/tools/dialogpointofintersection.cpp @@ -42,7 +42,7 @@ * @param parent parent widget */ DialogPointOfIntersection::DialogPointOfIntersection(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogPointOfIntersection), number(0), line(nullptr) + :DialogTool(data, toolId, parent), ui(new Ui::DialogPointOfIntersection), line(nullptr) { ui->setupUi(this); ui->lineEditNamePoint->setText(qApp->getCurrentDocument()->GenerateLabel(LabelType::NewLabel)); diff --git a/src/app/dialogs/tools/dialogpointofintersection.h b/src/app/dialogs/tools/dialogpointofintersection.h index d04f0ad9c..65c70d50c 100644 --- a/src/app/dialogs/tools/dialogpointofintersection.h +++ b/src/app/dialogs/tools/dialogpointofintersection.h @@ -71,9 +71,6 @@ private: /** @brief ui keeps information about user interface */ Ui::DialogPointOfIntersection *ui; - /** @brief number number of handled objects */ - qint32 number; - VisToolPointOfIntersection *line; }; diff --git a/src/app/dialogs/tools/dialogshoulderpoint.cpp b/src/app/dialogs/tools/dialogshoulderpoint.cpp index 392418c49..a274207f4 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.cpp +++ b/src/app/dialogs/tools/dialogshoulderpoint.cpp @@ -42,8 +42,8 @@ * @param parent parent widget */ DialogShoulderPoint::DialogShoulderPoint(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogShoulderPoint), number(0), - typeLine(QString()), formula(QString()), formulaBaseHeight(0), line (nullptr) + :DialogTool(data, toolId, parent), ui(new Ui::DialogShoulderPoint), typeLine(QString()), + formula(QString()), formulaBaseHeight(0), line (nullptr) { ui->setupUi(this); InitVariables(ui); diff --git a/src/app/dialogs/tools/dialogshoulderpoint.h b/src/app/dialogs/tools/dialogshoulderpoint.h index c3fd347f4..dd60b7c6f 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.h +++ b/src/app/dialogs/tools/dialogshoulderpoint.h @@ -88,9 +88,6 @@ private: /** @brief ui keeps information about user interface */ Ui::DialogShoulderPoint *ui; - /** @brief number number of handled objects */ - qint32 number; - /** @brief typeLine type of line */ QString typeLine; diff --git a/src/app/dialogs/tools/dialogspline.cpp b/src/app/dialogs/tools/dialogspline.cpp index d5639a6a3..77019a510 100644 --- a/src/app/dialogs/tools/dialogspline.cpp +++ b/src/app/dialogs/tools/dialogspline.cpp @@ -41,7 +41,7 @@ * @param parent parent widget */ DialogSpline::DialogSpline(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogSpline), number(0), angle1(0), angle2(0), kAsm1(1), kAsm2(1), + :DialogTool(data, toolId, parent), ui(new Ui::DialogSpline), angle1(0), angle2(0), kAsm1(1), kAsm2(1), kCurve(1), path(nullptr) { ui->setupUi(this); diff --git a/src/app/dialogs/tools/dialogspline.h b/src/app/dialogs/tools/dialogspline.h index 6c83f420f..5713e8dd7 100644 --- a/src/app/dialogs/tools/dialogspline.h +++ b/src/app/dialogs/tools/dialogspline.h @@ -84,9 +84,6 @@ private: /** @brief ui keeps information about user interface */ Ui::DialogSpline *ui; - /** @brief number number of handled objects */ - qint32 number; - /** @brief angle1 first angle of spline in degree */ qreal angle1; diff --git a/src/app/dialogs/tools/dialogtool.cpp b/src/app/dialogs/tools/dialogtool.cpp index 151e368bf..a37dc86d6 100644 --- a/src/app/dialogs/tools/dialogtool.cpp +++ b/src/app/dialogs/tools/dialogtool.cpp @@ -67,7 +67,7 @@ DialogTool::DialogTool(const VContainer *data, const quint32 &toolId, QWidget *p radioButtonIncrements(nullptr), radioButtonLengthLine(nullptr), radioButtonLengthArc(nullptr), radioButtonLengthCurve(nullptr), radioButtonAngleLine(nullptr), checkBoxHideEmpty(nullptr), okColor(QColor(76, 76, 76)), errorColor(Qt::red), associatedTool(nullptr), - toolId(toolId), prepare(false), pointName(QString()) + toolId(toolId), prepare(false), pointName(QString()), number(0) { SCASSERT(data != nullptr); timerFormula = new QTimer(this); diff --git a/src/app/dialogs/tools/dialogtool.h b/src/app/dialogs/tools/dialogtool.h index cb9118ee4..8b2bdd757 100644 --- a/src/app/dialogs/tools/dialogtool.h +++ b/src/app/dialogs/tools/dialogtool.h @@ -209,6 +209,9 @@ protected: /** @brief pointName name of point */ QString pointName; + /** @brief number number of handled objects */ + qint32 number; + virtual void closeEvent ( QCloseEvent * event ); virtual void showEvent( QShowEvent *event ); diff --git a/src/app/dialogs/tools/dialogtriangle.cpp b/src/app/dialogs/tools/dialogtriangle.cpp index e62b2fa2c..e5555ef2a 100644 --- a/src/app/dialogs/tools/dialogtriangle.cpp +++ b/src/app/dialogs/tools/dialogtriangle.cpp @@ -41,7 +41,7 @@ * @param parent parent widget */ DialogTriangle::DialogTriangle(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogTriangle), number(0), line (nullptr) + :DialogTool(data, toolId, parent), ui(new Ui::DialogTriangle), line (nullptr) { ui->setupUi(this); ui->lineEditNamePoint->setText(qApp->getCurrentDocument()->GenerateLabel(LabelType::NewLabel)); diff --git a/src/app/dialogs/tools/dialogtriangle.h b/src/app/dialogs/tools/dialogtriangle.h index cdeaf4e31..22774a7a0 100644 --- a/src/app/dialogs/tools/dialogtriangle.h +++ b/src/app/dialogs/tools/dialogtriangle.h @@ -77,9 +77,6 @@ private: /** @brief ui keeps information about user interface */ Ui::DialogTriangle *ui; - /** @brief number number of handled objects */ - qint32 number; - VisToolTriangle *line; }; From c52d0a045d747ba2b92aa8dfcd58b0f6b66d2bf2 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 3 Feb 2015 10:45:27 +0200 Subject: [PATCH 091/186] Refactoring. --HG-- branch : feature --- src/app/dialogs/tools/dialogalongline.cpp | 11 +++++------ src/app/dialogs/tools/dialogalongline.h | 3 --- src/app/dialogs/tools/dialogbisector.cpp | 13 ++++++------- src/app/dialogs/tools/dialogbisector.h | 3 --- src/app/dialogs/tools/dialogcurveintersectaxis.cpp | 10 ++++------ src/app/dialogs/tools/dialogcurveintersectaxis.h | 3 --- src/app/dialogs/tools/dialogendline.cpp | 10 ++++------ src/app/dialogs/tools/dialogendline.h | 3 --- src/app/dialogs/tools/dialogheight.cpp | 10 ++++------ src/app/dialogs/tools/dialogheight.h | 3 --- src/app/dialogs/tools/dialogline.cpp | 11 ++++------- src/app/dialogs/tools/dialogline.h | 2 -- src/app/dialogs/tools/dialoglineintersectaxis.cpp | 12 +++++------- src/app/dialogs/tools/dialoglineintersectaxis.h | 3 --- src/app/dialogs/tools/dialognormal.cpp | 12 +++++------- src/app/dialogs/tools/dialognormal.h | 3 --- src/app/dialogs/tools/dialogshoulderpoint.cpp | 12 +++++------- src/app/dialogs/tools/dialogshoulderpoint.h | 3 --- 18 files changed, 42 insertions(+), 85 deletions(-) diff --git a/src/app/dialogs/tools/dialogalongline.cpp b/src/app/dialogs/tools/dialogalongline.cpp index 2752ec77a..382b1c2f6 100644 --- a/src/app/dialogs/tools/dialogalongline.cpp +++ b/src/app/dialogs/tools/dialogalongline.cpp @@ -42,7 +42,7 @@ */ DialogAlongLine::DialogAlongLine(const VContainer *data, const quint32 &toolId, QWidget *parent) :DialogTool(data, toolId, parent), ui(new Ui::DialogAlongLine), - typeLine(QString()), formula(QString()), formulaBaseHeight(0), line(nullptr), lineColor(VAbstractTool::ColorBlack) + formula(QString()), formulaBaseHeight(0), line(nullptr), lineColor(VAbstractTool::ColorBlack) { ui->setupUi(this); InitVariables(ui); @@ -180,14 +180,14 @@ void DialogAlongLine::ChosenObject(quint32 id, const SceneObject &type) void DialogAlongLine::SaveData() { pointName = ui->lineEditNamePoint->text(); - typeLine = GetTypeLine(ui->comboBoxLineType); + formula = ui->plainTextEditFormula->toPlainText(); formula.replace("\n", " "); line->setPoint1Id(getFirstPointId()); line->setPoint2Id(getSecondPointId()); line->setLength(formula); - line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(getTypeLine())); line->RefreshGeometry(); } @@ -245,9 +245,8 @@ void DialogAlongLine::setFormula(const QString &value) */ void DialogAlongLine::setTypeLine(const QString &value) { - typeLine = value; ChangeCurrentData(ui->comboBoxLineType, value); - line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value)); } //--------------------------------------------------------------------------------------------------------------------- @@ -281,7 +280,7 @@ void DialogAlongLine::setPointName(const QString &value) */ QString DialogAlongLine::getTypeLine() const { - return typeLine; + return GetTypeLine(ui->comboBoxLineType); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogalongline.h b/src/app/dialogs/tools/dialogalongline.h index 636153379..d506e10c1 100644 --- a/src/app/dialogs/tools/dialogalongline.h +++ b/src/app/dialogs/tools/dialogalongline.h @@ -88,9 +88,6 @@ private: /** @brief ui keeps information about user interface */ Ui::DialogAlongLine *ui; - /** @brief typeLine type of line */ - QString typeLine; - /** @brief formula formula */ QString formula; diff --git a/src/app/dialogs/tools/dialogbisector.cpp b/src/app/dialogs/tools/dialogbisector.cpp index 70b159e9d..b1f46eca3 100644 --- a/src/app/dialogs/tools/dialogbisector.cpp +++ b/src/app/dialogs/tools/dialogbisector.cpp @@ -42,8 +42,8 @@ * @param parent parent widget */ DialogBisector::DialogBisector(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogBisector), typeLine(QString()), - formula(QString()), formulaBaseHeight(0), line(nullptr) + :DialogTool(data, toolId, parent), ui(new Ui::DialogBisector), formula(QString()), formulaBaseHeight(0), + line(nullptr) { ui->setupUi(this); InitVariables(ui); @@ -216,9 +216,8 @@ void DialogBisector::setPointName(const QString &value) */ void DialogBisector::setTypeLine(const QString &value) { - typeLine = value; ChangeCurrentData(ui->comboBoxLineType, value); - line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value)); } //--------------------------------------------------------------------------------------------------------------------- @@ -276,7 +275,7 @@ void DialogBisector::setThirdPointId(const quint32 &value) void DialogBisector::SaveData() { pointName = ui->lineEditNamePoint->text(); - typeLine = GetTypeLine(ui->comboBoxLineType); + formula = ui->plainTextEditFormula->toPlainText(); formula.replace("\n", " "); @@ -284,7 +283,7 @@ void DialogBisector::SaveData() line->setPoint2Id(getSecondPointId()); line->setPoint3Id(getThirdPointId()); line->setLength(formula); - line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(getTypeLine())); line->RefreshGeometry(); } @@ -302,7 +301,7 @@ void DialogBisector::closeEvent(QCloseEvent *event) */ QString DialogBisector::getTypeLine() const { - return typeLine; + return GetTypeLine(ui->comboBoxLineType); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogbisector.h b/src/app/dialogs/tools/dialogbisector.h index 63c45e67b..70b55cb6c 100644 --- a/src/app/dialogs/tools/dialogbisector.h +++ b/src/app/dialogs/tools/dialogbisector.h @@ -89,9 +89,6 @@ private: /** @brief ui keeps information about user interface */ Ui::DialogBisector *ui; - /** @brief typeLine type of line */ - QString typeLine; - /** @brief formula formula */ QString formula; diff --git a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp b/src/app/dialogs/tools/dialogcurveintersectaxis.cpp index d395fe276..74a706bd6 100644 --- a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp +++ b/src/app/dialogs/tools/dialogcurveintersectaxis.cpp @@ -38,7 +38,7 @@ //--------------------------------------------------------------------------------------------------------------------- DialogCurveIntersectAxis::DialogCurveIntersectAxis(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogCurveIntersectAxis), typeLine(QString()), + :DialogTool(data, toolId, parent), ui(new Ui::DialogCurveIntersectAxis), formulaAngle(QString()), formulaBaseHeightAngle(0), line(nullptr) { ui->setupUi(this); @@ -90,15 +90,14 @@ void DialogCurveIntersectAxis::setPointName(const QString &value) //--------------------------------------------------------------------------------------------------------------------- QString DialogCurveIntersectAxis::getTypeLine() const { - return typeLine; + return GetTypeLine(ui->comboBoxLineType); } //--------------------------------------------------------------------------------------------------------------------- void DialogCurveIntersectAxis::setTypeLine(const QString &value) { - typeLine = value; ChangeCurrentData(ui->comboBoxLineType, value); - line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value)); } //--------------------------------------------------------------------------------------------------------------------- @@ -252,7 +251,6 @@ void DialogCurveIntersectAxis::ShowVisualization() void DialogCurveIntersectAxis::SaveData() { pointName = ui->lineEditNamePoint->text(); - typeLine = GetTypeLine(ui->comboBoxLineType); formulaAngle = ui->plainTextEditFormula->toPlainText(); formulaAngle.replace("\n", " "); @@ -260,7 +258,7 @@ void DialogCurveIntersectAxis::SaveData() line->setPoint1Id(getCurveId()); line->setAxisPointId(getBasePointId()); line->setAngle(formulaAngle); - line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(getTypeLine())); line->RefreshGeometry(); } diff --git a/src/app/dialogs/tools/dialogcurveintersectaxis.h b/src/app/dialogs/tools/dialogcurveintersectaxis.h index 516c193a1..19e03ad54 100644 --- a/src/app/dialogs/tools/dialogcurveintersectaxis.h +++ b/src/app/dialogs/tools/dialogcurveintersectaxis.h @@ -77,9 +77,6 @@ private: Q_DISABLE_COPY(DialogCurveIntersectAxis) Ui::DialogCurveIntersectAxis *ui; - /** @brief typeLine type of line */ - QString typeLine; - QString formulaAngle; int formulaBaseHeightAngle; diff --git a/src/app/dialogs/tools/dialogendline.cpp b/src/app/dialogs/tools/dialogendline.cpp index 8794d125c..fd9724d48 100644 --- a/src/app/dialogs/tools/dialogendline.cpp +++ b/src/app/dialogs/tools/dialogendline.cpp @@ -43,7 +43,7 @@ * @param parent parent widget */ DialogEndLine::DialogEndLine(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogEndLine), typeLine(QString()), + :DialogTool(data, toolId, parent), ui(new Ui::DialogEndLine), formulaLength(QString()), formulaAngle(QString()), formulaBaseHeight(0), formulaBaseHeightAngle(0), line(nullptr) { ui->setupUi(this); @@ -170,9 +170,8 @@ void DialogEndLine::setPointName(const QString &value) */ void DialogEndLine::setTypeLine(const QString &value) { - typeLine = value; ChangeCurrentData(ui->comboBoxLineType, value); - line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value)); } //--------------------------------------------------------------------------------------------------------------------- @@ -273,7 +272,6 @@ void DialogEndLine::ShowVisualization() void DialogEndLine::SaveData() { pointName = ui->lineEditNamePoint->text(); - typeLine = GetTypeLine(ui->comboBoxLineType); formulaLength = ui->plainTextEditFormula->toPlainText(); formulaLength.replace("\n", " "); @@ -284,7 +282,7 @@ void DialogEndLine::SaveData() line->setPoint1Id(getBasePointId()); line->setLength(formulaLength); line->setAngle(formulaAngle); - line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(getTypeLine())); line->RefreshGeometry(); } @@ -313,7 +311,7 @@ DialogEndLine::~DialogEndLine() */ QString DialogEndLine::getTypeLine() const { - return typeLine; + return GetTypeLine(ui->comboBoxLineType); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogendline.h b/src/app/dialogs/tools/dialogendline.h index bbb836b5e..8cfbf2ade 100644 --- a/src/app/dialogs/tools/dialogendline.h +++ b/src/app/dialogs/tools/dialogendline.h @@ -90,9 +90,6 @@ private: /** @brief ui keeps information about user interface */ Ui::DialogEndLine *ui; - /** @brief typeLine type of line */ - QString typeLine; - /** @brief formula formula */ QString formulaLength; diff --git a/src/app/dialogs/tools/dialogheight.cpp b/src/app/dialogs/tools/dialogheight.cpp index fe4057a1a..4a463d516 100644 --- a/src/app/dialogs/tools/dialogheight.cpp +++ b/src/app/dialogs/tools/dialogheight.cpp @@ -42,7 +42,7 @@ * @param parent parent widget */ DialogHeight::DialogHeight(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogHeight), typeLine(QString()), line(nullptr) + :DialogTool(data, toolId, parent), ui(new Ui::DialogHeight), line(nullptr) { ui->setupUi(this); ui->lineEditNamePoint->setText(qApp->getCurrentDocument()->GenerateLabel(LabelType::NewLabel)); @@ -95,9 +95,8 @@ void DialogHeight::setPointName(const QString &value) */ void DialogHeight::setTypeLine(const QString &value) { - typeLine = value; ChangeCurrentData(ui->comboBoxLineType, value); - line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value)); } //--------------------------------------------------------------------------------------------------------------------- @@ -196,12 +195,11 @@ void DialogHeight::ChosenObject(quint32 id, const SceneObject &type) void DialogHeight::SaveData() { pointName = ui->lineEditNamePoint->text(); - typeLine = GetTypeLine(ui->comboBoxLineType); line->setPoint1Id(getBasePointId()); line->setLineP1Id(getP1LineId()); line->setLineP2Id(getP2LineId()); - line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(getTypeLine())); line->RefreshGeometry(); } @@ -267,7 +265,7 @@ void DialogHeight::ShowVisualization() */ QString DialogHeight::getTypeLine() const { - return typeLine; + return GetTypeLine(ui->comboBoxLineType); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogheight.h b/src/app/dialogs/tools/dialogheight.h index 93f67574e..863ba0b94 100644 --- a/src/app/dialogs/tools/dialogheight.h +++ b/src/app/dialogs/tools/dialogheight.h @@ -77,9 +77,6 @@ private: /** @brief ui keeps information about user interface */ Ui::DialogHeight *ui; - /** @brief typeLine type of line */ - QString typeLine; - VisToolHeight *line; }; diff --git a/src/app/dialogs/tools/dialogline.cpp b/src/app/dialogs/tools/dialogline.cpp index c864c49fa..b9f79a2cb 100644 --- a/src/app/dialogs/tools/dialogline.cpp +++ b/src/app/dialogs/tools/dialogline.cpp @@ -43,7 +43,7 @@ * @param parent parent widget */ DialogLine::DialogLine(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogLine), typeLine(QString()), line(nullptr) + :DialogTool(data, toolId, parent), ui(new Ui::DialogLine), line(nullptr) { ui->setupUi(this); InitOkCancelApply(ui); @@ -94,9 +94,8 @@ void DialogLine::setSecondPoint(const quint32 &value) */ void DialogLine::setTypeLine(const QString &value) { - typeLine = value; ChangeCurrentData(ui->comboBoxLineType, value); - line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value)); } //--------------------------------------------------------------------------------------------------------------------- @@ -153,11 +152,9 @@ void DialogLine::ShowVisualization() //--------------------------------------------------------------------------------------------------------------------- void DialogLine::SaveData() { - typeLine = GetTypeLine(ui->comboBoxLineType); - line->setPoint1Id(getFirstPoint()); line->setPoint2Id(getSecondPoint()); - line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(getTypeLine())); line->RefreshGeometry(); } @@ -227,5 +224,5 @@ quint32 DialogLine::getSecondPoint() const */ QString DialogLine::getTypeLine() const { - return typeLine; + return GetTypeLine(ui->comboBoxLineType); } diff --git a/src/app/dialogs/tools/dialogline.h b/src/app/dialogs/tools/dialogline.h index 66ed3c18b..209bfadfe 100644 --- a/src/app/dialogs/tools/dialogline.h +++ b/src/app/dialogs/tools/dialogline.h @@ -72,8 +72,6 @@ private: /** @brief ui keeps information about user interface */ Ui::DialogLine *ui; - /** @brief typeLine type of line */ - QString typeLine; VisToolLine *line; }; diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.cpp b/src/app/dialogs/tools/dialoglineintersectaxis.cpp index f9c049390..4d8a8dd6e 100644 --- a/src/app/dialogs/tools/dialoglineintersectaxis.cpp +++ b/src/app/dialogs/tools/dialoglineintersectaxis.cpp @@ -38,8 +38,8 @@ //--------------------------------------------------------------------------------------------------------------------- DialogLineIntersectAxis::DialogLineIntersectAxis(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogLineIntersectAxis), typeLine(QString()), - formulaAngle(QString()), formulaBaseHeightAngle(0), line(nullptr) + :DialogTool(data, toolId, parent), ui(new Ui::DialogLineIntersectAxis), formulaAngle(QString()), + formulaBaseHeightAngle(0), line(nullptr) { ui->setupUi(this); InitVariables(ui); @@ -98,15 +98,14 @@ void DialogLineIntersectAxis::setPointName(const QString &value) //--------------------------------------------------------------------------------------------------------------------- QString DialogLineIntersectAxis::getTypeLine() const { - return typeLine; + return GetTypeLine(ui->comboBoxLineType); } //--------------------------------------------------------------------------------------------------------------------- void DialogLineIntersectAxis::setTypeLine(const QString &value) { - typeLine = value; ChangeCurrentData(ui->comboBoxLineType, value); - line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value)); } //--------------------------------------------------------------------------------------------------------------------- @@ -316,7 +315,6 @@ void DialogLineIntersectAxis::ShowVisualization() void DialogLineIntersectAxis::SaveData() { pointName = ui->lineEditNamePoint->text(); - typeLine = GetTypeLine(ui->comboBoxLineType); formulaAngle = ui->plainTextEditFormula->toPlainText(); formulaAngle.replace("\n", " "); @@ -325,7 +323,7 @@ void DialogLineIntersectAxis::SaveData() line->setPoint2Id(getSecondPointId()); line->setAxisPointId(getBasePointId()); line->setAngle(formulaAngle); - line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(getTypeLine())); line->RefreshGeometry(); } diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.h b/src/app/dialogs/tools/dialoglineintersectaxis.h index afc1b3ce9..0c2476edf 100644 --- a/src/app/dialogs/tools/dialoglineintersectaxis.h +++ b/src/app/dialogs/tools/dialoglineintersectaxis.h @@ -81,9 +81,6 @@ private: Q_DISABLE_COPY(DialogLineIntersectAxis) Ui::DialogLineIntersectAxis *ui; - /** @brief typeLine type of line */ - QString typeLine; - QString formulaAngle; int formulaBaseHeightAngle; diff --git a/src/app/dialogs/tools/dialognormal.cpp b/src/app/dialogs/tools/dialognormal.cpp index 4e6dd7649..1d27aaef6 100644 --- a/src/app/dialogs/tools/dialognormal.cpp +++ b/src/app/dialogs/tools/dialognormal.cpp @@ -39,8 +39,8 @@ * @param parent parent widget */ DialogNormal::DialogNormal(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogNormal), typeLine(QString()), - formula(QString()), angle(0), formulaBaseHeight(0), line(nullptr) + :DialogTool(data, toolId, parent), ui(new Ui::DialogNormal), formula(QString()), angle(0), formulaBaseHeight(0), + line(nullptr) { ui->setupUi(this); InitVariables(ui); @@ -173,7 +173,6 @@ void DialogNormal::ChosenObject(quint32 id, const SceneObject &type) void DialogNormal::SaveData() { pointName = ui->lineEditNamePoint->text(); - typeLine = GetTypeLine(ui->comboBoxLineType); formula = ui->plainTextEditFormula->toPlainText(); formula.replace("\n", " "); angle = ui->doubleSpinBoxAngle->value(); @@ -182,7 +181,7 @@ void DialogNormal::SaveData() line->setPoint2Id(getSecondPointId()); line->setLength(formula); line->setAngle(angle); - line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(getTypeLine())); line->RefreshGeometry(); } @@ -252,9 +251,8 @@ void DialogNormal::setFormula(const QString &value) */ void DialogNormal::setTypeLine(const QString &value) { - typeLine = value; ChangeCurrentData(ui->comboBoxLineType, value); - line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value)); } //--------------------------------------------------------------------------------------------------------------------- @@ -275,7 +273,7 @@ void DialogNormal::setPointName(const QString &value) */ QString DialogNormal::getTypeLine() const { - return typeLine; + return GetTypeLine(ui->comboBoxLineType); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialognormal.h b/src/app/dialogs/tools/dialognormal.h index 7bde3c54b..46ff174b4 100644 --- a/src/app/dialogs/tools/dialognormal.h +++ b/src/app/dialogs/tools/dialognormal.h @@ -88,9 +88,6 @@ private: /** @brief ui keeps information about user interface */ Ui::DialogNormal *ui; - /** @brief typeLine type of line */ - QString typeLine; - /** @brief formula formula */ QString formula; diff --git a/src/app/dialogs/tools/dialogshoulderpoint.cpp b/src/app/dialogs/tools/dialogshoulderpoint.cpp index a274207f4..27fc22b31 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.cpp +++ b/src/app/dialogs/tools/dialogshoulderpoint.cpp @@ -42,8 +42,8 @@ * @param parent parent widget */ DialogShoulderPoint::DialogShoulderPoint(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogShoulderPoint), typeLine(QString()), - formula(QString()), formulaBaseHeight(0), line (nullptr) + :DialogTool(data, toolId, parent), ui(new Ui::DialogShoulderPoint), formula(QString()), + formulaBaseHeight(0), line (nullptr) { ui->setupUi(this); InitVariables(ui); @@ -201,7 +201,6 @@ void DialogShoulderPoint::ChosenObject(quint32 id, const SceneObject &type) void DialogShoulderPoint::SaveData() { pointName = ui->lineEditNamePoint->text(); - typeLine = GetTypeLine(ui->comboBoxLineType); formula = ui->plainTextEditFormula->toPlainText(); formula.replace("\n", " "); @@ -209,7 +208,7 @@ void DialogShoulderPoint::SaveData() line->setLineP1Id(getP1Line()); line->setLineP2Id(getP2Line()); line->setLength(formula); - line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(getTypeLine())); line->RefreshGeometry(); } @@ -278,9 +277,8 @@ void DialogShoulderPoint::setFormula(const QString &value) */ void DialogShoulderPoint::setTypeLine(const QString &value) { - typeLine = value; ChangeCurrentData(ui->comboBoxLineType, value); - line->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value)); } //--------------------------------------------------------------------------------------------------------------------- @@ -301,7 +299,7 @@ void DialogShoulderPoint::setPointName(const QString &value) */ QString DialogShoulderPoint::getTypeLine() const { - return typeLine; + return GetTypeLine(ui->comboBoxLineType); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogshoulderpoint.h b/src/app/dialogs/tools/dialogshoulderpoint.h index dd60b7c6f..62a829aaf 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.h +++ b/src/app/dialogs/tools/dialogshoulderpoint.h @@ -88,9 +88,6 @@ private: /** @brief ui keeps information about user interface */ Ui::DialogShoulderPoint *ui; - /** @brief typeLine type of line */ - QString typeLine; - /** @brief formula formula */ QString formula; From d6a23887629ef287c5d802a420bc3541d346e552 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 3 Feb 2015 10:55:02 +0200 Subject: [PATCH 092/186] Refactoring. --HG-- branch : feature --- src/app/dialogs/tools/dialogalongline.cpp | 6 ++---- src/app/dialogs/tools/dialogalongline.h | 2 -- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/app/dialogs/tools/dialogalongline.cpp b/src/app/dialogs/tools/dialogalongline.cpp index 382b1c2f6..556a9182a 100644 --- a/src/app/dialogs/tools/dialogalongline.cpp +++ b/src/app/dialogs/tools/dialogalongline.cpp @@ -42,7 +42,7 @@ */ DialogAlongLine::DialogAlongLine(const VContainer *data, const quint32 &toolId, QWidget *parent) :DialogTool(data, toolId, parent), ui(new Ui::DialogAlongLine), - formula(QString()), formulaBaseHeight(0), line(nullptr), lineColor(VAbstractTool::ColorBlack) + formula(QString()), formulaBaseHeight(0), line(nullptr) { ui->setupUi(this); InitVariables(ui); @@ -60,7 +60,6 @@ DialogAlongLine::DialogAlongLine(const VContainer *data, const quint32 &toolId, FillComboBoxPoints(ui->comboBoxFirstPoint); FillComboBoxPoints(ui->comboBoxSecondPoint); FillComboBoxTypeLine(ui->comboBoxLineType, VAbstractTool::LineStylesPics()); - ui->comboBoxLineType->setCurrentIndex(0); FillComboBoxLineColors(ui->comboBoxLineColor); connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogAlongLine::PutHere); @@ -252,13 +251,12 @@ void DialogAlongLine::setTypeLine(const QString &value) //--------------------------------------------------------------------------------------------------------------------- QString DialogAlongLine::getLineColor() const { - return lineColor; + return GetLineColor(ui->comboBoxLineColor); } //--------------------------------------------------------------------------------------------------------------------- void DialogAlongLine::setLineColor(const QString &value) { - lineColor = value; ChangeCurrentData(ui->comboBoxLineColor, value); } diff --git a/src/app/dialogs/tools/dialogalongline.h b/src/app/dialogs/tools/dialogalongline.h index d506e10c1..5ae9c2df3 100644 --- a/src/app/dialogs/tools/dialogalongline.h +++ b/src/app/dialogs/tools/dialogalongline.h @@ -94,8 +94,6 @@ private: /** @brief formulaBaseHeight base height defined by dialogui */ int formulaBaseHeight; VisToolAlongLine *line; - - QString lineColor; }; #endif // DIALOGALONGLINE_H From 4572da85c808374a7af393d9573da8654497826f Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 3 Feb 2015 11:27:33 +0200 Subject: [PATCH 093/186] Refactoring. --HG-- branch : feature --- src/app/dialogs/tools/dialogarc.cpp | 12 ++++++++++++ src/app/dialogs/tools/dialogarc.h | 3 +++ src/app/dialogs/tools/dialogbisector.cpp | 12 ++++++++++++ src/app/dialogs/tools/dialogbisector.h | 3 +++ src/app/dialogs/tools/dialogcurveintersectaxis.cpp | 12 ++++++++++++ src/app/dialogs/tools/dialogcurveintersectaxis.h | 3 +++ src/app/dialogs/tools/dialogendline.cpp | 12 ++++++++++++ src/app/dialogs/tools/dialogendline.h | 3 +++ src/app/dialogs/tools/dialogheight.cpp | 12 ++++++++++++ src/app/dialogs/tools/dialogheight.h | 3 +++ src/app/dialogs/tools/dialogline.cpp | 12 ++++++++++++ src/app/dialogs/tools/dialogline.h | 3 +++ src/app/dialogs/tools/dialoglineintersectaxis.cpp | 12 ++++++++++++ src/app/dialogs/tools/dialoglineintersectaxis.h | 3 +++ src/app/dialogs/tools/dialognormal.cpp | 12 ++++++++++++ src/app/dialogs/tools/dialognormal.h | 3 +++ src/app/dialogs/tools/dialogshoulderpoint.cpp | 12 ++++++++++++ src/app/dialogs/tools/dialogshoulderpoint.h | 3 +++ src/app/dialogs/tools/dialogspline.cpp | 12 ++++++++++++ src/app/dialogs/tools/dialogspline.h | 3 +++ src/app/dialogs/tools/dialogsplinepath.cpp | 12 ++++++++++++ src/app/dialogs/tools/dialogsplinepath.h | 3 +++ 22 files changed, 165 insertions(+) diff --git a/src/app/dialogs/tools/dialogarc.cpp b/src/app/dialogs/tools/dialogarc.cpp index 74b1893b2..cf1511104 100644 --- a/src/app/dialogs/tools/dialogarc.cpp +++ b/src/app/dialogs/tools/dialogarc.cpp @@ -154,6 +154,18 @@ void DialogArc::SetF2(const QString &value) MoveCursorToEnd(ui->plainTextEditF2); } +//--------------------------------------------------------------------------------------------------------------------- +QString DialogArc::GetColor() const +{ + return GetLineColor(ui->comboBoxColor); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogArc::SetColor(const QString &value) +{ + ChangeCurrentData(ui->comboBoxColor, value); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief SetF1 set formula first angle of arc diff --git a/src/app/dialogs/tools/dialogarc.h b/src/app/dialogs/tools/dialogarc.h index 7708bc653..40de32e27 100644 --- a/src/app/dialogs/tools/dialogarc.h +++ b/src/app/dialogs/tools/dialogarc.h @@ -59,6 +59,9 @@ public: QString GetF2() const; void SetF2(const QString &value); + + QString GetColor() const; + void SetColor(const QString &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); /** diff --git a/src/app/dialogs/tools/dialogbisector.cpp b/src/app/dialogs/tools/dialogbisector.cpp index b1f46eca3..114f75fb4 100644 --- a/src/app/dialogs/tools/dialogbisector.cpp +++ b/src/app/dialogs/tools/dialogbisector.cpp @@ -271,6 +271,18 @@ void DialogBisector::setThirdPointId(const quint32 &value) line->setPoint3Id(value); } +//--------------------------------------------------------------------------------------------------------------------- +QString DialogBisector::getLineColor() const +{ + return GetLineColor(ui->comboBoxLineColor); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogBisector::setLineColor(const QString &value) +{ + ChangeCurrentData(ui->comboBoxLineColor, value); +} + //--------------------------------------------------------------------------------------------------------------------- void DialogBisector::SaveData() { diff --git a/src/app/dialogs/tools/dialogbisector.h b/src/app/dialogs/tools/dialogbisector.h index 70b55cb6c..39e2facda 100644 --- a/src/app/dialogs/tools/dialogbisector.h +++ b/src/app/dialogs/tools/dialogbisector.h @@ -65,6 +65,9 @@ public: quint32 getThirdPointId() const; void setThirdPointId(const quint32 &value); + + QString getLineColor() const; + void setLineColor(const QString &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); /** diff --git a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp b/src/app/dialogs/tools/dialogcurveintersectaxis.cpp index 74a706bd6..72f07fc34 100644 --- a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp +++ b/src/app/dialogs/tools/dialogcurveintersectaxis.cpp @@ -147,6 +147,18 @@ void DialogCurveIntersectAxis::setCurveId(const quint32 &value) line->setPoint1Id(value); } +//--------------------------------------------------------------------------------------------------------------------- +QString DialogCurveIntersectAxis::getLineColor() const +{ + return GetLineColor(ui->comboBoxLineColor); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogCurveIntersectAxis::setLineColor(const QString &value) +{ + ChangeCurrentData(ui->comboBoxLineColor, value); +} + //--------------------------------------------------------------------------------------------------------------------- void DialogCurveIntersectAxis::ShowDialog(bool click) { diff --git a/src/app/dialogs/tools/dialogcurveintersectaxis.h b/src/app/dialogs/tools/dialogcurveintersectaxis.h index 19e03ad54..1fa7fec7b 100644 --- a/src/app/dialogs/tools/dialogcurveintersectaxis.h +++ b/src/app/dialogs/tools/dialogcurveintersectaxis.h @@ -59,6 +59,9 @@ public: quint32 getCurveId() const; void setCurveId(const quint32 &value); + QString getLineColor() const; + void setLineColor(const QString &value); + virtual void ShowDialog(bool click); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); diff --git a/src/app/dialogs/tools/dialogendline.cpp b/src/app/dialogs/tools/dialogendline.cpp index fd9724d48..1a40718db 100644 --- a/src/app/dialogs/tools/dialogendline.cpp +++ b/src/app/dialogs/tools/dialogendline.cpp @@ -223,6 +223,18 @@ void DialogEndLine::setBasePointId(const quint32 &value) line->setPoint1Id(value); } +//--------------------------------------------------------------------------------------------------------------------- +QString DialogEndLine::getLineColor() const +{ + return GetLineColor(ui->comboBoxLineColor); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogEndLine::setLineColor(const QString &value) +{ + ChangeCurrentData(ui->comboBoxLineColor, value); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief DialogEndLine::ShowDialog show dialog after finish working with visual part diff --git a/src/app/dialogs/tools/dialogendline.h b/src/app/dialogs/tools/dialogendline.h index 8cfbf2ade..24bfe4b0a 100644 --- a/src/app/dialogs/tools/dialogendline.h +++ b/src/app/dialogs/tools/dialogendline.h @@ -62,6 +62,9 @@ public: quint32 getBasePointId() const; void setBasePointId(const quint32 &value); + QString getLineColor() const; + void setLineColor(const QString &value); + virtual void ShowDialog(bool click); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); diff --git a/src/app/dialogs/tools/dialogheight.cpp b/src/app/dialogs/tools/dialogheight.cpp index 4a463d516..9805ccbde 100644 --- a/src/app/dialogs/tools/dialogheight.cpp +++ b/src/app/dialogs/tools/dialogheight.cpp @@ -132,6 +132,18 @@ void DialogHeight::setP2LineId(const quint32 &value) line->setLineP2Id(value); } +//--------------------------------------------------------------------------------------------------------------------- +QString DialogHeight::getLineColor() const +{ + return GetLineColor(ui->comboBoxLineColor); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogHeight::setLineColor(const QString &value) +{ + ChangeCurrentData(ui->comboBoxLineColor, value); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong. diff --git a/src/app/dialogs/tools/dialogheight.h b/src/app/dialogs/tools/dialogheight.h index 863ba0b94..01c13a1d7 100644 --- a/src/app/dialogs/tools/dialogheight.h +++ b/src/app/dialogs/tools/dialogheight.h @@ -61,6 +61,9 @@ public: quint32 getP2LineId() const; void setP2LineId(const quint32 &value); + + QString getLineColor() const; + void setLineColor(const QString &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); virtual void PointNameChanged(); diff --git a/src/app/dialogs/tools/dialogline.cpp b/src/app/dialogs/tools/dialogline.cpp index b9f79a2cb..6a4a9d781 100644 --- a/src/app/dialogs/tools/dialogline.cpp +++ b/src/app/dialogs/tools/dialogline.cpp @@ -98,6 +98,18 @@ void DialogLine::setTypeLine(const QString &value) line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value)); } +//--------------------------------------------------------------------------------------------------------------------- +QString DialogLine::getLineColor() const +{ + return GetLineColor(ui->comboBoxLineColor); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLine::setLineColor(const QString &value) +{ + ChangeCurrentData(ui->comboBoxLineColor, value); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief setFirstPoint set id first point diff --git a/src/app/dialogs/tools/dialogline.h b/src/app/dialogs/tools/dialogline.h index 209bfadfe..4769b41f0 100644 --- a/src/app/dialogs/tools/dialogline.h +++ b/src/app/dialogs/tools/dialogline.h @@ -56,6 +56,9 @@ public: QString getTypeLine() const; void setTypeLine(const QString &value); + + QString getLineColor() const; + void setLineColor(const QString &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); virtual void PointNameChanged(); diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.cpp b/src/app/dialogs/tools/dialoglineintersectaxis.cpp index 4d8a8dd6e..8544780d5 100644 --- a/src/app/dialogs/tools/dialoglineintersectaxis.cpp +++ b/src/app/dialogs/tools/dialoglineintersectaxis.cpp @@ -168,6 +168,18 @@ void DialogLineIntersectAxis::setSecondPointId(const quint32 &value) line->setPoint2Id(value); } +//--------------------------------------------------------------------------------------------------------------------- +QString DialogLineIntersectAxis::getLineColor() const +{ + return GetLineColor(ui->comboBoxLineColor); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLineIntersectAxis::setLineColor(const QString &value) +{ + ChangeCurrentData(ui->comboBoxLineColor, value); +} + //--------------------------------------------------------------------------------------------------------------------- void DialogLineIntersectAxis::ShowDialog(bool click) { diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.h b/src/app/dialogs/tools/dialoglineintersectaxis.h index 0c2476edf..51cda1dbe 100644 --- a/src/app/dialogs/tools/dialoglineintersectaxis.h +++ b/src/app/dialogs/tools/dialoglineintersectaxis.h @@ -62,6 +62,9 @@ public: quint32 getSecondPointId() const; void setSecondPointId(const quint32 &value); + QString getLineColor() const; + void setLineColor(const QString &value); + virtual void ShowDialog(bool click); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); diff --git a/src/app/dialogs/tools/dialognormal.cpp b/src/app/dialogs/tools/dialognormal.cpp index 1d27aaef6..0133149a3 100644 --- a/src/app/dialogs/tools/dialognormal.cpp +++ b/src/app/dialogs/tools/dialognormal.cpp @@ -203,6 +203,18 @@ void DialogNormal::setSecondPointId(const quint32 &value) line->setPoint2Id(value); } +//--------------------------------------------------------------------------------------------------------------------- +QString DialogNormal::getLineColor() const +{ + return GetLineColor(ui->comboBoxLineColor); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogNormal::setLineColor(const QString &value) +{ + ChangeCurrentData(ui->comboBoxLineColor, value); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief setFirstPointId set id of first point diff --git a/src/app/dialogs/tools/dialognormal.h b/src/app/dialogs/tools/dialognormal.h index 46ff174b4..003f24f41 100644 --- a/src/app/dialogs/tools/dialognormal.h +++ b/src/app/dialogs/tools/dialognormal.h @@ -64,6 +64,9 @@ public: quint32 getSecondPointId() const; void setSecondPointId(const quint32 &value); + + QString getLineColor() const; + void setLineColor(const QString &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); /** diff --git a/src/app/dialogs/tools/dialogshoulderpoint.cpp b/src/app/dialogs/tools/dialogshoulderpoint.cpp index 27fc22b31..291f51a73 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.cpp +++ b/src/app/dialogs/tools/dialogshoulderpoint.cpp @@ -230,6 +230,18 @@ void DialogShoulderPoint::setP3(const quint32 &value) line->setPoint1Id(value); } +//--------------------------------------------------------------------------------------------------------------------- +QString DialogShoulderPoint::getLineColor() const +{ + return GetLineColor(ui->comboBoxLineColor); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogShoulderPoint::setLineColor(const QString &value) +{ + ChangeCurrentData(ui->comboBoxLineColor, value); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief setP2Line set id second point of line diff --git a/src/app/dialogs/tools/dialogshoulderpoint.h b/src/app/dialogs/tools/dialogshoulderpoint.h index 62a829aaf..9178dd726 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.h +++ b/src/app/dialogs/tools/dialogshoulderpoint.h @@ -64,6 +64,9 @@ public: quint32 getP3() const; void setP3(const quint32 &value); + + QString getLineColor() const; + void setLineColor(const QString &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); /** diff --git a/src/app/dialogs/tools/dialogspline.cpp b/src/app/dialogs/tools/dialogspline.cpp index 77019a510..956cacaa2 100644 --- a/src/app/dialogs/tools/dialogspline.cpp +++ b/src/app/dialogs/tools/dialogspline.cpp @@ -213,6 +213,18 @@ void DialogSpline::setKCurve(const qreal &value) path->setKCurve(kCurve); } +//--------------------------------------------------------------------------------------------------------------------- +QString DialogSpline::getColor() const +{ + return GetLineColor(ui->comboBoxColor); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogSpline::setColor(const QString &value) +{ + ChangeCurrentData(ui->comboBoxColor, value); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief setKAsm2 set second coefficient asymmetry diff --git a/src/app/dialogs/tools/dialogspline.h b/src/app/dialogs/tools/dialogspline.h index 5713e8dd7..0721eb711 100644 --- a/src/app/dialogs/tools/dialogspline.h +++ b/src/app/dialogs/tools/dialogspline.h @@ -68,6 +68,9 @@ public: qreal getKCurve() const; void setKCurve(const qreal &value); + + QString getColor() const; + void setColor(const QString &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); virtual void PointNameChanged(); diff --git a/src/app/dialogs/tools/dialogsplinepath.cpp b/src/app/dialogs/tools/dialogsplinepath.cpp index 8fef7320f..410739a09 100644 --- a/src/app/dialogs/tools/dialogsplinepath.cpp +++ b/src/app/dialogs/tools/dialogsplinepath.cpp @@ -94,6 +94,18 @@ void DialogSplinePath::SetPath(const VSplinePath &value) ui->listWidget->blockSignals(false); } +//--------------------------------------------------------------------------------------------------------------------- +QString DialogSplinePath::getColor() const +{ + return GetLineColor(ui->comboBoxColor); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogSplinePath::setColor(const QString &value) +{ + ChangeCurrentData(ui->comboBoxColor, value); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong. diff --git a/src/app/dialogs/tools/dialogsplinepath.h b/src/app/dialogs/tools/dialogsplinepath.h index 4316ddefd..fe15980c5 100644 --- a/src/app/dialogs/tools/dialogsplinepath.h +++ b/src/app/dialogs/tools/dialogsplinepath.h @@ -51,6 +51,9 @@ public: VSplinePath GetPath() const; void SetPath(const VSplinePath &value); + + QString getColor() const; + void setColor(const QString &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); void PointChanged(int row); From cf2aea280dfffce262d798ade28457e31af0d218 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 3 Feb 2015 12:17:04 +0200 Subject: [PATCH 094/186] Refactoring. --HG-- branch : feature --- src/app/container/calculator.h | 4 +- src/app/container/vformula.cpp | 10 +- src/app/container/vformula.h | 4 +- src/app/dialogs/tools/dialogalongline.cpp | 50 ++++---- src/app/dialogs/tools/dialogalongline.h | 22 ++-- src/app/dialogs/tools/dialogarc.cpp | 2 +- src/app/dialogs/tools/dialogbisector.cpp | 60 ++++----- src/app/dialogs/tools/dialogbisector.h | 26 ++-- .../tools/dialogcurveintersectaxis.cpp | 34 ++--- .../dialogs/tools/dialogcurveintersectaxis.h | 18 +-- src/app/dialogs/tools/dialogcutarc.cpp | 12 +- src/app/dialogs/tools/dialogcutarc.h | 6 +- src/app/dialogs/tools/dialogcutspline.cpp | 12 +- src/app/dialogs/tools/dialogcutspline.h | 6 +- src/app/dialogs/tools/dialogcutsplinepath.cpp | 12 +- src/app/dialogs/tools/dialogcutsplinepath.h | 6 +- .../dialogs/tools/dialogeditwrongformula.cpp | 4 +- .../dialogs/tools/dialogeditwrongformula.h | 4 +- src/app/dialogs/tools/dialogendline.cpp | 56 ++++----- src/app/dialogs/tools/dialogendline.h | 22 ++-- src/app/dialogs/tools/dialogheight.cpp | 52 ++++---- src/app/dialogs/tools/dialogheight.h | 22 ++-- src/app/dialogs/tools/dialogline.cpp | 38 +++--- src/app/dialogs/tools/dialogline.h | 16 +-- src/app/dialogs/tools/dialoglineintersect.cpp | 52 ++++---- src/app/dialogs/tools/dialoglineintersect.h | 18 +-- .../dialogs/tools/dialoglineintersectaxis.cpp | 46 +++---- .../dialogs/tools/dialoglineintersectaxis.h | 26 ++-- src/app/dialogs/tools/dialognormal.cpp | 62 +++++----- src/app/dialogs/tools/dialognormal.h | 26 ++-- .../dialogs/tools/dialogpointofcontact.cpp | 24 ++-- src/app/dialogs/tools/dialogpointofcontact.h | 10 +- .../tools/dialogpointofintersection.cpp | 24 ++-- .../dialogs/tools/dialogpointofintersection.h | 10 +- src/app/dialogs/tools/dialogshoulderpoint.cpp | 56 ++++----- src/app/dialogs/tools/dialogshoulderpoint.h | 26 ++-- src/app/dialogs/tools/dialogsinglepoint.cpp | 4 +- src/app/dialogs/tools/dialogsinglepoint.h | 6 +- src/app/dialogs/tools/dialogspline.cpp | 86 ++++++------- src/app/dialogs/tools/dialogspline.h | 32 ++--- src/app/dialogs/tools/dialogsplinepath.cpp | 10 +- src/app/dialogs/tools/dialogsplinepath.h | 4 +- src/app/dialogs/tools/dialogtool.cpp | 19 +-- src/app/dialogs/tools/dialogtool.h | 3 +- src/app/dialogs/tools/dialogtriangle.cpp | 44 +++---- src/app/dialogs/tools/dialogtriangle.h | 18 +-- src/app/geometry/varc.cpp | 6 +- src/app/geometry/vsplinepath.cpp | 4 +- src/app/geometry/vsplinepath.h | 12 +- src/app/tools/drawTools/vdrawtool.cpp | 4 +- src/app/tools/drawTools/vtoolalongline.cpp | 30 ++--- src/app/tools/drawTools/vtoolalongline.h | 4 +- src/app/tools/drawTools/vtoolarc.cpp | 12 +- src/app/tools/drawTools/vtoolarc.h | 12 +- src/app/tools/drawTools/vtoolbisector.cpp | 40 +++--- src/app/tools/drawTools/vtoolbisector.h | 8 +- .../drawTools/vtoolcurveintersectaxis.cpp | 30 ++--- .../tools/drawTools/vtoolcurveintersectaxis.h | 4 +- src/app/tools/drawTools/vtoolcut.cpp | 6 +- src/app/tools/drawTools/vtoolcut.h | 4 +- src/app/tools/drawTools/vtoolcutarc.cpp | 8 +- src/app/tools/drawTools/vtoolcutspline.cpp | 8 +- .../tools/drawTools/vtoolcutsplinepath.cpp | 16 +-- src/app/tools/drawTools/vtoolendline.cpp | 36 +++--- src/app/tools/drawTools/vtoolendline.h | 4 +- src/app/tools/drawTools/vtoolheight.cpp | 34 ++--- src/app/tools/drawTools/vtoolheight.h | 8 +- src/app/tools/drawTools/vtoolline.cpp | 28 ++--- src/app/tools/drawTools/vtoolline.h | 10 +- .../tools/drawTools/vtoollineintersect.cpp | 42 +++---- src/app/tools/drawTools/vtoollineintersect.h | 16 +-- .../drawTools/vtoollineintersectaxis.cpp | 50 ++++---- .../tools/drawTools/vtoollineintersectaxis.h | 12 +- src/app/tools/drawTools/vtoollinepoint.cpp | 14 +-- src/app/tools/drawTools/vtoollinepoint.h | 12 +- src/app/tools/drawTools/vtoolnormal.cpp | 40 +++--- src/app/tools/drawTools/vtoolnormal.h | 4 +- .../tools/drawTools/vtoolpointofcontact.cpp | 24 ++-- src/app/tools/drawTools/vtoolpointofcontact.h | 8 +- .../drawTools/vtoolpointofintersection.cpp | 22 ++-- .../drawTools/vtoolpointofintersection.h | 8 +- .../tools/drawTools/vtoolshoulderpoint.cpp | 36 +++--- src/app/tools/drawTools/vtoolshoulderpoint.h | 4 +- src/app/tools/drawTools/vtoolsinglepoint.cpp | 14 +-- src/app/tools/drawTools/vtoolsinglepoint.h | 2 +- src/app/tools/drawTools/vtoolspline.cpp | 58 ++++----- src/app/tools/drawTools/vtoolsplinepath.cpp | 8 +- src/app/tools/drawTools/vtooltriangle.cpp | 42 +++---- src/app/tools/drawTools/vtooltriangle.h | 16 +-- src/app/tools/vabstracttool.cpp | 2 +- src/app/tools/vabstracttool.h | 2 +- src/app/tools/vtooluniondetails.cpp | 4 +- src/app/undocommands/movesplinepath.cpp | 2 +- .../vistoolcurveintersectaxis.cpp | 2 +- .../visualization/vistoolcurveintersectaxis.h | 2 +- .../visualization/vistoolcutsplinepath.cpp | 8 +- src/app/visualization/vistoolendline.cpp | 2 +- src/app/visualization/vistoolendline.h | 2 +- .../vistoollineintersectaxis.cpp | 2 +- .../visualization/vistoollineintersectaxis.h | 2 +- src/app/visualization/vistoolnormal.cpp | 4 +- src/app/visualization/vistoolnormal.h | 4 +- src/app/visualization/vistoolspline.cpp | 10 +- src/app/visualization/vistoolspline.h | 10 +- src/app/widgets/vformulaproperty.cpp | 22 ++-- src/app/widgets/vformulaproperty.h | 4 +- src/app/widgets/vformulapropertyeditor.cpp | 8 +- src/app/widgets/vformulapropertyeditor.h | 6 +- .../widgets/vtooloptionspropertybrowser.cpp | 116 +++++++++--------- .../plugins/vcolorproperty.cpp | 10 +- .../plugins/vcolorpropertyeditor.cpp | 18 +-- .../plugins/vcolorpropertyeditor.h | 10 +- 112 files changed, 1050 insertions(+), 1066 deletions(-) diff --git a/src/app/container/calculator.h b/src/app/container/calculator.h index c00cb2360..cb2089c9f 100644 --- a/src/app/container/calculator.h +++ b/src/app/container/calculator.h @@ -40,10 +40,10 @@ class VContainer; * Note. If created to many parser for different purpes in the same time parser can work wrong. * Example: * DialogEditWrongFormula *dialog = new DialogEditWrongFormula(data); - * dialog->setFormula(formula); + * dialog->SetFormula(formula); * if (dialog->exec() == QDialog::Accepted) * { - * formula = dialog->getFormula(); + * formula = dialog->GetFormula(); * //Need delete dialog here because parser in dialog don't allow use correct separator for parsing here. * //Don't know why. * delete dialog; diff --git a/src/app/container/vformula.cpp b/src/app/container/vformula.cpp index ed3659a20..fa345e4a5 100644 --- a/src/app/container/vformula.cpp +++ b/src/app/container/vformula.cpp @@ -56,7 +56,7 @@ VFormula &VFormula::operator=(const VFormula &formula) { return *this; } - this->formula = formula.getFormula(); + this->formula = formula.GetFormula(); this->value = formula.getStringValue(); this->checkZero = formula.getCheckZero(); this->data = formula.getData(); @@ -69,7 +69,7 @@ VFormula &VFormula::operator=(const VFormula &formula) //--------------------------------------------------------------------------------------------------------------------- VFormula::VFormula(const VFormula &formula) - :formula(formula.getFormula()), value(formula.getStringValue()), checkZero(formula.getCheckZero()), + :formula(formula.GetFormula()), value(formula.getStringValue()), checkZero(formula.getCheckZero()), data(formula.getData()), toolId(formula.getToolId()), postfix(formula.getPostfix()), _error(formula.error()), dValue(formula.getDoubleValue()) {} @@ -78,7 +78,7 @@ VFormula::VFormula(const VFormula &formula) bool VFormula::operator==(const VFormula &formula) const { bool isEqual = false; - if (this->formula == formula.getFormula() && this->value == formula.getStringValue() && + if (this->formula == formula.GetFormula() && this->value == formula.getStringValue() && this->checkZero == formula.getCheckZero() && this->data == formula.getData() && this->toolId == formula.getToolId() && this->postfix == formula.getPostfix() && this->_error == formula.error() && qFuzzyCompare(this->dValue, formula.getDoubleValue())) @@ -94,7 +94,7 @@ bool VFormula::operator!=(const VFormula &formula) const } //--------------------------------------------------------------------------------------------------------------------- -QString VFormula::getFormula(FormulaType type) const +QString VFormula::GetFormula(FormulaType type) const { if (type == FormulaType::ToUser) { @@ -107,7 +107,7 @@ QString VFormula::getFormula(FormulaType type) const } //--------------------------------------------------------------------------------------------------------------------- -void VFormula::setFormula(const QString &value, FormulaType type) +void VFormula::SetFormula(const QString &value, FormulaType type) { if (formula != value) { diff --git a/src/app/container/vformula.h b/src/app/container/vformula.h index 222845442..7599dcdac 100644 --- a/src/app/container/vformula.h +++ b/src/app/container/vformula.h @@ -46,8 +46,8 @@ public: bool operator==(const VFormula &formula) const; bool operator!=(const VFormula &formula) const; - QString getFormula(FormulaType type = FormulaType::ToUser) const; - void setFormula(const QString &value, FormulaType type = FormulaType::ToUser); + QString GetFormula(FormulaType type = FormulaType::ToUser) const; + void SetFormula(const QString &value, FormulaType type = FormulaType::ToUser); QString getStringValue() const; qreal getDoubleValue() const; diff --git a/src/app/dialogs/tools/dialogalongline.cpp b/src/app/dialogs/tools/dialogalongline.cpp index 556a9182a..46463ff6e 100644 --- a/src/app/dialogs/tools/dialogalongline.cpp +++ b/src/app/dialogs/tools/dialogalongline.cpp @@ -183,10 +183,10 @@ void DialogAlongLine::SaveData() formula = ui->plainTextEditFormula->toPlainText(); formula.replace("\n", " "); - line->setPoint1Id(getFirstPointId()); - line->setPoint2Id(getSecondPointId()); + line->setPoint1Id(GetFirstPointId()); + line->setPoint2Id(GetSecondPointId()); line->setLength(formula); - line->setLineStyle(VAbstractTool::LineStyleToPenStyle(getTypeLine())); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(GetTypeLine())); line->RefreshGeometry(); } @@ -199,10 +199,10 @@ void DialogAlongLine::closeEvent(QCloseEvent *event) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setSecondPointId set id second point of line + * @brief SetSecondPointId set id second point of line * @param value id */ -void DialogAlongLine::setSecondPointId(const quint32 &value) +void DialogAlongLine::SetSecondPointId(const quint32 &value) { setCurrentPointId(ui->comboBoxSecondPoint, value); line->setPoint2Id(value); @@ -210,10 +210,10 @@ void DialogAlongLine::setSecondPointId(const quint32 &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setFirstPointId set id first point of line + * @brief SetFirstPointId set id first point of line * @param value id */ -void DialogAlongLine::setFirstPointId(const quint32 &value) +void DialogAlongLine::SetFirstPointId(const quint32 &value) { setCurrentPointId(ui->comboBoxFirstPoint, value); line->setPoint1Id(value); @@ -221,10 +221,10 @@ void DialogAlongLine::setFirstPointId(const quint32 &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setFormula set string of formula + * @brief SetFormula set string of formula * @param value formula */ -void DialogAlongLine::setFormula(const QString &value) +void DialogAlongLine::SetFormula(const QString &value) { formula = qApp->FormulaToUser(value); // increase height if needed. @@ -239,33 +239,33 @@ void DialogAlongLine::setFormula(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setTypeLine set type of line + * @brief SetTypeLine set type of line * @param value type */ -void DialogAlongLine::setTypeLine(const QString &value) +void DialogAlongLine::SetTypeLine(const QString &value) { ChangeCurrentData(ui->comboBoxLineType, value); line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value)); } //--------------------------------------------------------------------------------------------------------------------- -QString DialogAlongLine::getLineColor() const +QString DialogAlongLine::GetLineColor() const { - return GetLineColor(ui->comboBoxLineColor); + return GetComboBoxCurrentData(ui->comboBoxLineColor); } //--------------------------------------------------------------------------------------------------------------------- -void DialogAlongLine::setLineColor(const QString &value) +void DialogAlongLine::SetLineColor(const QString &value) { ChangeCurrentData(ui->comboBoxLineColor, value); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setPointName set name of point + * @brief SetPointName set name of point * @param value name */ -void DialogAlongLine::setPointName(const QString &value) +void DialogAlongLine::SetPointName(const QString &value) { pointName = value; ui->lineEditNamePoint->setText(pointName); @@ -273,40 +273,40 @@ void DialogAlongLine::setPointName(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getTypeLine return type of line + * @brief GetTypeLine return type of line * @return type */ -QString DialogAlongLine::getTypeLine() const +QString DialogAlongLine::GetTypeLine() const { - return GetTypeLine(ui->comboBoxLineType); + return GetComboBoxCurrentData(ui->comboBoxLineType); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getFormula return string of formula + * @brief GetFormula return string of formula * @return formula */ -QString DialogAlongLine::getFormula() const +QString DialogAlongLine::GetFormula() const { return qApp->FormulaFromUser(formula); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getFirstPointId return id first point of line + * @brief GetFirstPointId return id first point of line * @return id */ -quint32 DialogAlongLine::getFirstPointId() const +quint32 DialogAlongLine::GetFirstPointId() const { return getCurrentObjectId(ui->comboBoxFirstPoint); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getSecondPointId return id second point of line + * @brief GetSecondPointId return id second point of line * @return id */ -quint32 DialogAlongLine::getSecondPointId() const +quint32 DialogAlongLine::GetSecondPointId() const { return getCurrentObjectId(ui->comboBoxSecondPoint); } diff --git a/src/app/dialogs/tools/dialogalongline.h b/src/app/dialogs/tools/dialogalongline.h index 5ae9c2df3..057f7763b 100644 --- a/src/app/dialogs/tools/dialogalongline.h +++ b/src/app/dialogs/tools/dialogalongline.h @@ -48,22 +48,22 @@ public: DialogAlongLine(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogAlongLine(); - void setPointName(const QString &value); + void SetPointName(const QString &value); - QString getTypeLine() const; - void setTypeLine(const QString &value); + QString GetTypeLine() const; + void SetTypeLine(const QString &value); - QString getLineColor() const; - void setLineColor(const QString &value); + QString GetLineColor() const; + void SetLineColor(const QString &value); - QString getFormula() const; - void setFormula(const QString &value); + QString GetFormula() const; + void SetFormula(const QString &value); - quint32 getFirstPointId() const; - void setFirstPointId(const quint32 &value); + quint32 GetFirstPointId() const; + void SetFirstPointId(const quint32 &value); - quint32 getSecondPointId() const; - void setSecondPointId(const quint32 &value); + quint32 GetSecondPointId() const; + void SetSecondPointId(const quint32 &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); /** diff --git a/src/app/dialogs/tools/dialogarc.cpp b/src/app/dialogs/tools/dialogarc.cpp index cf1511104..92a78cf4d 100644 --- a/src/app/dialogs/tools/dialogarc.cpp +++ b/src/app/dialogs/tools/dialogarc.cpp @@ -157,7 +157,7 @@ void DialogArc::SetF2(const QString &value) //--------------------------------------------------------------------------------------------------------------------- QString DialogArc::GetColor() const { - return GetLineColor(ui->comboBoxColor); + return GetComboBoxCurrentData(ui->comboBoxColor); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogbisector.cpp b/src/app/dialogs/tools/dialogbisector.cpp index 114f75fb4..98e68ab91 100644 --- a/src/app/dialogs/tools/dialogbisector.cpp +++ b/src/app/dialogs/tools/dialogbisector.cpp @@ -200,10 +200,10 @@ void DialogBisector::ChosenObject(quint32 id, const SceneObject &type) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setPointName set name of point + * @brief SetPointName set name of point * @param value name */ -void DialogBisector::setPointName(const QString &value) +void DialogBisector::SetPointName(const QString &value) { pointName = value; ui->lineEditNamePoint->setText(pointName); @@ -211,10 +211,10 @@ void DialogBisector::setPointName(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setTypeLine set type of line + * @brief SetTypeLine set type of line * @param value type */ -void DialogBisector::setTypeLine(const QString &value) +void DialogBisector::SetTypeLine(const QString &value) { ChangeCurrentData(ui->comboBoxLineType, value); line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value)); @@ -222,10 +222,10 @@ void DialogBisector::setTypeLine(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setFormula set string of formula + * @brief SetFormula set string of formula * @param value formula */ -void DialogBisector::setFormula(const QString &value) +void DialogBisector::SetFormula(const QString &value) { formula = qApp->FormulaToUser(value); // increase height if needed. @@ -240,10 +240,10 @@ void DialogBisector::setFormula(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setFirstPointId set id of first point + * @brief SetFirstPointId set id of first point * @param value id */ -void DialogBisector::setFirstPointId(const quint32 &value) +void DialogBisector::SetFirstPointId(const quint32 &value) { setCurrentPointId(ui->comboBoxFirstPoint, value); line->setPoint1Id(value); @@ -251,10 +251,10 @@ void DialogBisector::setFirstPointId(const quint32 &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setSecondPointId set id of second point + * @brief SetSecondPointId set id of second point * @param value id */ -void DialogBisector::setSecondPointId(const quint32 &value) +void DialogBisector::SetSecondPointId(const quint32 &value) { setCurrentPointId(ui->comboBoxSecondPoint, value); line->setPoint2Id(value); @@ -262,23 +262,23 @@ void DialogBisector::setSecondPointId(const quint32 &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setThirdPointId set id of third point + * @brief SetThirdPointId set id of third point * @param value id */ -void DialogBisector::setThirdPointId(const quint32 &value) +void DialogBisector::SetThirdPointId(const quint32 &value) { setCurrentPointId(ui->comboBoxThirdPoint, value); line->setPoint3Id(value); } //--------------------------------------------------------------------------------------------------------------------- -QString DialogBisector::getLineColor() const +QString DialogBisector::GetLineColor() const { - return GetLineColor(ui->comboBoxLineColor); + return GetComboBoxCurrentData(ui->comboBoxLineColor); } //--------------------------------------------------------------------------------------------------------------------- -void DialogBisector::setLineColor(const QString &value) +void DialogBisector::SetLineColor(const QString &value) { ChangeCurrentData(ui->comboBoxLineColor, value); } @@ -291,11 +291,11 @@ void DialogBisector::SaveData() formula = ui->plainTextEditFormula->toPlainText(); formula.replace("\n", " "); - line->setPoint1Id(getFirstPointId()); - line->setPoint2Id(getSecondPointId()); - line->setPoint3Id(getThirdPointId()); + line->setPoint1Id(GetFirstPointId()); + line->setPoint2Id(GetSecondPointId()); + line->setPoint3Id(GetThirdPointId()); line->setLength(formula); - line->setLineStyle(VAbstractTool::LineStyleToPenStyle(getTypeLine())); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(GetTypeLine())); line->RefreshGeometry(); } @@ -308,50 +308,50 @@ void DialogBisector::closeEvent(QCloseEvent *event) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getTypeLine return type of line + * @brief GetTypeLine return type of line * @return type */ -QString DialogBisector::getTypeLine() const +QString DialogBisector::GetTypeLine() const { - return GetTypeLine(ui->comboBoxLineType); + return GetComboBoxCurrentData(ui->comboBoxLineType); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getFormula return string of formula + * @brief GetFormula return string of formula * @return formula */ -QString DialogBisector::getFormula() const +QString DialogBisector::GetFormula() const { return qApp->FormulaFromUser(formula); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getFirstPointId return id of first point + * @brief GetFirstPointId return id of first point * @return id */ -quint32 DialogBisector::getFirstPointId() const +quint32 DialogBisector::GetFirstPointId() const { return getCurrentObjectId(ui->comboBoxFirstPoint); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getSecondPointId return id of second point + * @brief GetSecondPointId return id of second point * @return id */ -quint32 DialogBisector::getSecondPointId() const +quint32 DialogBisector::GetSecondPointId() const { return getCurrentObjectId(ui->comboBoxSecondPoint); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getThirdPointId return id of third point + * @brief GetThirdPointId return id of third point * @return id */ -quint32 DialogBisector::getThirdPointId() const +quint32 DialogBisector::GetThirdPointId() const { return getCurrentObjectId(ui->comboBoxThirdPoint); } diff --git a/src/app/dialogs/tools/dialogbisector.h b/src/app/dialogs/tools/dialogbisector.h index 39e2facda..4cadc9bb9 100644 --- a/src/app/dialogs/tools/dialogbisector.h +++ b/src/app/dialogs/tools/dialogbisector.h @@ -49,25 +49,25 @@ public: DialogBisector(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogBisector(); - void setPointName(const QString &value); + void SetPointName(const QString &value); - QString getTypeLine() const; - void setTypeLine(const QString &value); + QString GetTypeLine() const; + void SetTypeLine(const QString &value); - QString getFormula() const; - void setFormula(const QString &value); + QString GetFormula() const; + void SetFormula(const QString &value); - quint32 getFirstPointId() const; - void setFirstPointId(const quint32 &value); + quint32 GetFirstPointId() const; + void SetFirstPointId(const quint32 &value); - quint32 getSecondPointId() const; - void setSecondPointId(const quint32 &value); + quint32 GetSecondPointId() const; + void SetSecondPointId(const quint32 &value); - quint32 getThirdPointId() const; - void setThirdPointId(const quint32 &value); + quint32 GetThirdPointId() const; + void SetThirdPointId(const quint32 &value); - QString getLineColor() const; - void setLineColor(const QString &value); + QString GetLineColor() const; + void SetLineColor(const QString &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); /** diff --git a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp b/src/app/dialogs/tools/dialogcurveintersectaxis.cpp index 72f07fc34..839fb5dc5 100644 --- a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp +++ b/src/app/dialogs/tools/dialogcurveintersectaxis.cpp @@ -81,33 +81,33 @@ DialogCurveIntersectAxis::~DialogCurveIntersectAxis() } //--------------------------------------------------------------------------------------------------------------------- -void DialogCurveIntersectAxis::setPointName(const QString &value) +void DialogCurveIntersectAxis::SetPointName(const QString &value) { pointName = value; ui->lineEditNamePoint->setText(pointName); } //--------------------------------------------------------------------------------------------------------------------- -QString DialogCurveIntersectAxis::getTypeLine() const +QString DialogCurveIntersectAxis::GetTypeLine() const { - return GetTypeLine(ui->comboBoxLineType); + return GetComboBoxCurrentData(ui->comboBoxLineType); } //--------------------------------------------------------------------------------------------------------------------- -void DialogCurveIntersectAxis::setTypeLine(const QString &value) +void DialogCurveIntersectAxis::SetTypeLine(const QString &value) { ChangeCurrentData(ui->comboBoxLineType, value); line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value)); } //--------------------------------------------------------------------------------------------------------------------- -QString DialogCurveIntersectAxis::getAngle() const +QString DialogCurveIntersectAxis::GetAngle() const { return qApp->FormulaFromUser(formulaAngle); } //--------------------------------------------------------------------------------------------------------------------- -void DialogCurveIntersectAxis::setAngle(const QString &value) +void DialogCurveIntersectAxis::SetAngle(const QString &value) { formulaAngle = qApp->FormulaToUser(value); // increase height if needed. TODO : see if I can get the max number of caracters in one line @@ -117,18 +117,18 @@ void DialogCurveIntersectAxis::setAngle(const QString &value) this->DeployAngleTextEdit(); } ui->plainTextEditFormula->setPlainText(formulaAngle); - line->setAngle(formulaAngle); + line->SetAngle(formulaAngle); MoveCursorToEnd(ui->plainTextEditFormula); } //--------------------------------------------------------------------------------------------------------------------- -quint32 DialogCurveIntersectAxis::getBasePointId() const +quint32 DialogCurveIntersectAxis::GetBasePointId() const { return getCurrentObjectId(ui->comboBoxAxisPoint); } //--------------------------------------------------------------------------------------------------------------------- -void DialogCurveIntersectAxis::setBasePointId(const quint32 &value) +void DialogCurveIntersectAxis::SetBasePointId(const quint32 &value) { setCurrentPointId(ui->comboBoxAxisPoint, value); line->setAxisPointId(value); @@ -148,13 +148,13 @@ void DialogCurveIntersectAxis::setCurveId(const quint32 &value) } //--------------------------------------------------------------------------------------------------------------------- -QString DialogCurveIntersectAxis::getLineColor() const +QString DialogCurveIntersectAxis::GetLineColor() const { - return GetLineColor(ui->comboBoxLineColor); + return GetComboBoxCurrentData(ui->comboBoxLineColor); } //--------------------------------------------------------------------------------------------------------------------- -void DialogCurveIntersectAxis::setLineColor(const QString &value) +void DialogCurveIntersectAxis::SetLineColor(const QString &value) { ChangeCurrentData(ui->comboBoxLineColor, value); } @@ -169,7 +169,7 @@ void DialogCurveIntersectAxis::ShowDialog(bool click) /*We will ignore click if poinet is in point circle*/ VMainGraphicsScene *scene = qApp->getCurrentScene(); SCASSERT(scene != nullptr); - const QSharedPointer point = data->GeometricObject(getBasePointId()); + const QSharedPointer point = data->GeometricObject(GetBasePointId()); QLineF line = QLineF(point->toQPointF(), scene->getScenePos()); //Radius of point circle, but little bigger. Need handle with hover sizes. @@ -180,7 +180,7 @@ void DialogCurveIntersectAxis::ShowDialog(bool click) } } this->setModal(true); - this->setAngle(line->Angle());//Show in dialog angle what user choose + this->SetAngle(line->Angle());//Show in dialog angle what user choose emit ToolTip(""); timerFormula->start(); this->show(); @@ -268,9 +268,9 @@ void DialogCurveIntersectAxis::SaveData() formulaAngle.replace("\n", " "); line->setPoint1Id(getCurveId()); - line->setAxisPointId(getBasePointId()); - line->setAngle(formulaAngle); - line->setLineStyle(VAbstractTool::LineStyleToPenStyle(getTypeLine())); + line->setAxisPointId(GetBasePointId()); + line->SetAngle(formulaAngle); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(GetTypeLine())); line->RefreshGeometry(); } diff --git a/src/app/dialogs/tools/dialogcurveintersectaxis.h b/src/app/dialogs/tools/dialogcurveintersectaxis.h index 1fa7fec7b..33d5262eb 100644 --- a/src/app/dialogs/tools/dialogcurveintersectaxis.h +++ b/src/app/dialogs/tools/dialogcurveintersectaxis.h @@ -45,22 +45,22 @@ public: DialogCurveIntersectAxis(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogCurveIntersectAxis(); - void setPointName(const QString &value); + void SetPointName(const QString &value); - QString getTypeLine() const; - void setTypeLine(const QString &value); + QString GetTypeLine() const; + void SetTypeLine(const QString &value); - QString getAngle() const; - void setAngle(const QString &value); + QString GetAngle() const; + void SetAngle(const QString &value); - quint32 getBasePointId() const; - void setBasePointId(const quint32 &value); + quint32 GetBasePointId() const; + void SetBasePointId(const quint32 &value); quint32 getCurveId() const; void setCurveId(const quint32 &value); - QString getLineColor() const; - void setLineColor(const QString &value); + QString GetLineColor() const; + void SetLineColor(const QString &value); virtual void ShowDialog(bool click); public slots: diff --git a/src/app/dialogs/tools/dialogcutarc.cpp b/src/app/dialogs/tools/dialogcutarc.cpp index 63b956a85..935642187 100644 --- a/src/app/dialogs/tools/dialogcutarc.cpp +++ b/src/app/dialogs/tools/dialogcutarc.cpp @@ -159,10 +159,10 @@ void DialogCutArc::setArcId(const quint32 &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setFormula set string with formula length + * @brief SetFormula set string with formula length * @param value string with formula */ -void DialogCutArc::setFormula(const QString &value) +void DialogCutArc::SetFormula(const QString &value) { formula = qApp->FormulaToUser(value); // increase height if needed. @@ -177,10 +177,10 @@ void DialogCutArc::setFormula(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setPointName set name point on arc + * @brief SetPointName set name point on arc * @param value name */ -void DialogCutArc::setPointName(const QString &value) +void DialogCutArc::SetPointName(const QString &value) { pointName = value; ui->lineEditNamePoint->setText(pointName); @@ -188,10 +188,10 @@ void DialogCutArc::setPointName(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getFormula return string with formula length + * @brief GetFormula return string with formula length * @return formula */ -QString DialogCutArc::getFormula() const +QString DialogCutArc::GetFormula() const { return qApp->FormulaFromUser(formula); } diff --git a/src/app/dialogs/tools/dialogcutarc.h b/src/app/dialogs/tools/dialogcutarc.h index 682161b3c..91f8dec79 100644 --- a/src/app/dialogs/tools/dialogcutarc.h +++ b/src/app/dialogs/tools/dialogcutarc.h @@ -49,10 +49,10 @@ public: DialogCutArc(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogCutArc(); - void setPointName(const QString &value); + void SetPointName(const QString &value); - QString getFormula() const; - void setFormula(const QString &value); + QString GetFormula() const; + void SetFormula(const QString &value); quint32 getArcId() const; void setArcId(const quint32 &value); diff --git a/src/app/dialogs/tools/dialogcutspline.cpp b/src/app/dialogs/tools/dialogcutspline.cpp index 2f5c961ad..2c386cbd3 100644 --- a/src/app/dialogs/tools/dialogcutspline.cpp +++ b/src/app/dialogs/tools/dialogcutspline.cpp @@ -80,10 +80,10 @@ DialogCutSpline::~DialogCutSpline() //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setPointName set name of point + * @brief SetPointName set name of point * @param value name */ -void DialogCutSpline::setPointName(const QString &value) +void DialogCutSpline::SetPointName(const QString &value) { pointName = value; ui->lineEditNamePoint->setText(pointName); @@ -91,10 +91,10 @@ void DialogCutSpline::setPointName(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setFormula set string of formula + * @brief SetFormula set string of formula * @param value formula */ -void DialogCutSpline::setFormula(const QString &value) +void DialogCutSpline::SetFormula(const QString &value) { formula = qApp->FormulaToUser(value); // increase height if needed. TODO : see if I can get the max number of caracters in one line @@ -181,10 +181,10 @@ void DialogCutSpline::ShowVisualization() //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getFormula return string of formula + * @brief GetFormula return string of formula * @return formula */ -QString DialogCutSpline::getFormula() const +QString DialogCutSpline::GetFormula() const { return qApp->FormulaFromUser(formula); } diff --git a/src/app/dialogs/tools/dialogcutspline.h b/src/app/dialogs/tools/dialogcutspline.h index 4d32e5d36..886860aab 100644 --- a/src/app/dialogs/tools/dialogcutspline.h +++ b/src/app/dialogs/tools/dialogcutspline.h @@ -48,10 +48,10 @@ public: DialogCutSpline(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogCutSpline(); - void setPointName(const QString &value); + void SetPointName(const QString &value); - QString getFormula() const; - void setFormula(const QString &value); + QString GetFormula() const; + void SetFormula(const QString &value); quint32 getSplineId() const; void setSplineId(const quint32 &value); diff --git a/src/app/dialogs/tools/dialogcutsplinepath.cpp b/src/app/dialogs/tools/dialogcutsplinepath.cpp index 7c3972034..90178bd55 100644 --- a/src/app/dialogs/tools/dialogcutsplinepath.cpp +++ b/src/app/dialogs/tools/dialogcutsplinepath.cpp @@ -80,10 +80,10 @@ DialogCutSplinePath::~DialogCutSplinePath() //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setPointName set name of point + * @brief SetPointName set name of point * @param value name */ -void DialogCutSplinePath::setPointName(const QString &value) +void DialogCutSplinePath::SetPointName(const QString &value) { pointName = value; ui->lineEditNamePoint->setText(pointName); @@ -91,10 +91,10 @@ void DialogCutSplinePath::setPointName(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setFormula set string of formula + * @brief SetFormula set string of formula * @param value formula */ -void DialogCutSplinePath::setFormula(const QString &value) +void DialogCutSplinePath::SetFormula(const QString &value) { formula = qApp->FormulaToUser(value); // increase height if needed. TODO : see if I can get the max number of caracters in one line @@ -181,10 +181,10 @@ void DialogCutSplinePath::ShowVisualization() //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getFormula return string of formula + * @brief GetFormula return string of formula * @return formula */ -QString DialogCutSplinePath::getFormula() const +QString DialogCutSplinePath::GetFormula() const { return qApp->FormulaFromUser(formula); } diff --git a/src/app/dialogs/tools/dialogcutsplinepath.h b/src/app/dialogs/tools/dialogcutsplinepath.h index c1fbf943d..8de2c016e 100644 --- a/src/app/dialogs/tools/dialogcutsplinepath.h +++ b/src/app/dialogs/tools/dialogcutsplinepath.h @@ -48,10 +48,10 @@ public: DialogCutSplinePath(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogCutSplinePath(); - void setPointName(const QString &value); + void SetPointName(const QString &value); - QString getFormula() const; - void setFormula(const QString &value); + QString GetFormula() const; + void SetFormula(const QString &value); quint32 getSplinePathId() const; void setSplinePathId(const quint32 &value); diff --git a/src/app/dialogs/tools/dialogeditwrongformula.cpp b/src/app/dialogs/tools/dialogeditwrongformula.cpp index 3987b12a7..804a78ff6 100644 --- a/src/app/dialogs/tools/dialogeditwrongformula.cpp +++ b/src/app/dialogs/tools/dialogeditwrongformula.cpp @@ -121,7 +121,7 @@ void DialogEditWrongFormula::closeEvent(QCloseEvent *event) } //--------------------------------------------------------------------------------------------------------------------- -void DialogEditWrongFormula::setFormula(const QString &value) +void DialogEditWrongFormula::SetFormula(const QString &value) { formula = qApp->FormulaToUser(value); // increase height if needed. TODO : see if I can get the max number of caracters in one line @@ -147,7 +147,7 @@ void DialogEditWrongFormula::setPostfix(const QString &value) } //--------------------------------------------------------------------------------------------------------------------- -QString DialogEditWrongFormula::getFormula() const +QString DialogEditWrongFormula::GetFormula() const { return qApp->FormulaFromUser(formula); } diff --git a/src/app/dialogs/tools/dialogeditwrongformula.h b/src/app/dialogs/tools/dialogeditwrongformula.h index a2d389baf..e163d7c21 100644 --- a/src/app/dialogs/tools/dialogeditwrongformula.h +++ b/src/app/dialogs/tools/dialogeditwrongformula.h @@ -51,8 +51,8 @@ public: explicit DialogEditWrongFormula(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogEditWrongFormula(); - QString getFormula() const; - void setFormula(const QString &value); + QString GetFormula() const; + void SetFormula(const QString &value); void setCheckZero(bool value); void setPostfix(const QString &value); public slots: diff --git a/src/app/dialogs/tools/dialogendline.cpp b/src/app/dialogs/tools/dialogendline.cpp index 1a40718db..3ecb0651d 100644 --- a/src/app/dialogs/tools/dialogendline.cpp +++ b/src/app/dialogs/tools/dialogendline.cpp @@ -154,10 +154,10 @@ void DialogEndLine::ChosenObject(quint32 id, const SceneObject &type) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setPointName set name of point + * @brief SetPointName set name of point * @param value name */ -void DialogEndLine::setPointName(const QString &value) +void DialogEndLine::SetPointName(const QString &value) { pointName = value; ui->lineEditNamePoint->setText(pointName); @@ -165,10 +165,10 @@ void DialogEndLine::setPointName(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setTypeLine set type of line + * @brief SetTypeLine set type of line * @param value type */ -void DialogEndLine::setTypeLine(const QString &value) +void DialogEndLine::SetTypeLine(const QString &value) { ChangeCurrentData(ui->comboBoxLineType, value); line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value)); @@ -176,10 +176,10 @@ void DialogEndLine::setTypeLine(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setFormula set string of formula + * @brief SetFormula set string of formula * @param value formula */ -void DialogEndLine::setFormula(const QString &value) +void DialogEndLine::SetFormula(const QString &value) { formulaLength = qApp->FormulaToUser(value); // increase height if needed. TODO : see if I can get the max number of caracters in one line @@ -195,10 +195,10 @@ void DialogEndLine::setFormula(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setAngle set angle of line + * @brief SetAngle set angle of line * @param value angle in degree */ -void DialogEndLine::setAngle(const QString &value) +void DialogEndLine::SetAngle(const QString &value) { formulaAngle = qApp->FormulaToUser(value); // increase height if needed. TODO : see if I can get the max number of caracters in one line @@ -208,29 +208,29 @@ void DialogEndLine::setAngle(const QString &value) this->DeployAngleTextEdit(); } ui->plainTextEditAngle->setPlainText(formulaAngle); - line->setAngle(formulaAngle); + line->SetAngle(formulaAngle); MoveCursorToEnd(ui->plainTextEditAngle); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setBasePointId set id base point of line + * @brief SetBasePointId set id base point of line * @param value id */ -void DialogEndLine::setBasePointId(const quint32 &value) +void DialogEndLine::SetBasePointId(const quint32 &value) { setCurrentPointId(ui->comboBoxBasePoint, value); line->setPoint1Id(value); } //--------------------------------------------------------------------------------------------------------------------- -QString DialogEndLine::getLineColor() const +QString DialogEndLine::GetLineColor() const { - return GetLineColor(ui->comboBoxLineColor); + return GetComboBoxCurrentData(ui->comboBoxLineColor); } //--------------------------------------------------------------------------------------------------------------------- -void DialogEndLine::setLineColor(const QString &value) +void DialogEndLine::SetLineColor(const QString &value) { ChangeCurrentData(ui->comboBoxLineColor, value); } @@ -249,7 +249,7 @@ void DialogEndLine::ShowDialog(bool click) /*We will ignore click if poinet is in point circle*/ VMainGraphicsScene *scene = qApp->getCurrentScene(); SCASSERT(scene != nullptr); - const QSharedPointer point = data->GeometricObject(getBasePointId()); + const QSharedPointer point = data->GeometricObject(GetBasePointId()); QLineF line = QLineF(point->toQPointF(), scene->getScenePos()); //Radius of point circle, but little bigger. Need handle with hover sizes. @@ -260,7 +260,7 @@ void DialogEndLine::ShowDialog(bool click) } } this->setModal(true); - this->setAngle(line->Angle());//Show in dialog angle what user choose + this->SetAngle(line->Angle());//Show in dialog angle what user choose emit ToolTip(""); timerFormula->start(); this->show(); @@ -291,10 +291,10 @@ void DialogEndLine::SaveData() formulaAngle = ui->plainTextEditAngle->toPlainText(); formulaAngle.replace("\n", " "); - line->setPoint1Id(getBasePointId()); + line->setPoint1Id(GetBasePointId()); line->setLength(formulaLength); - line->setAngle(formulaAngle); - line->setLineStyle(VAbstractTool::LineStyleToPenStyle(getTypeLine())); + line->SetAngle(formulaAngle); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(GetTypeLine())); line->RefreshGeometry(); } @@ -318,40 +318,40 @@ DialogEndLine::~DialogEndLine() //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getTypeLine return type of line + * @brief GetTypeLine return type of line * @return type */ -QString DialogEndLine::getTypeLine() const +QString DialogEndLine::GetTypeLine() const { - return GetTypeLine(ui->comboBoxLineType); + return GetComboBoxCurrentData(ui->comboBoxLineType); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getFormula return string of formula + * @brief GetFormula return string of formula * @return formula */ -QString DialogEndLine::getFormula() const +QString DialogEndLine::GetFormula() const { return qApp->FormulaFromUser(formulaLength); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getAngle return formula angle of line + * @brief GetAngle return formula angle of line * @return angle formula */ -QString DialogEndLine::getAngle() const +QString DialogEndLine::GetAngle() const { return qApp->FormulaFromUser(formulaAngle); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getBasePointId return id base point of line + * @brief GetBasePointId return id base point of line * @return id */ -quint32 DialogEndLine::getBasePointId() const +quint32 DialogEndLine::GetBasePointId() const { return getCurrentObjectId(ui->comboBoxBasePoint); } diff --git a/src/app/dialogs/tools/dialogendline.h b/src/app/dialogs/tools/dialogendline.h index 24bfe4b0a..d31101a12 100644 --- a/src/app/dialogs/tools/dialogendline.h +++ b/src/app/dialogs/tools/dialogendline.h @@ -48,22 +48,22 @@ public: DialogEndLine(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogEndLine(); - void setPointName(const QString &value); + void SetPointName(const QString &value); - QString getTypeLine() const; - void setTypeLine(const QString &value); + QString GetTypeLine() const; + void SetTypeLine(const QString &value); - QString getFormula() const; - void setFormula(const QString &value); + QString GetFormula() const; + void SetFormula(const QString &value); - QString getAngle() const; - void setAngle(const QString &value); + QString GetAngle() const; + void SetAngle(const QString &value); - quint32 getBasePointId() const; - void setBasePointId(const quint32 &value); + quint32 GetBasePointId() const; + void SetBasePointId(const quint32 &value); - QString getLineColor() const; - void setLineColor(const QString &value); + QString GetLineColor() const; + void SetLineColor(const QString &value); virtual void ShowDialog(bool click); public slots: diff --git a/src/app/dialogs/tools/dialogheight.cpp b/src/app/dialogs/tools/dialogheight.cpp index 9805ccbde..59ada77f2 100644 --- a/src/app/dialogs/tools/dialogheight.cpp +++ b/src/app/dialogs/tools/dialogheight.cpp @@ -79,10 +79,10 @@ DialogHeight::~DialogHeight() //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setPointName set name of point + * @brief SetPointName set name of point * @param value name */ -void DialogHeight::setPointName(const QString &value) +void DialogHeight::SetPointName(const QString &value) { pointName = value; ui->lineEditNamePoint->setText(pointName); @@ -90,10 +90,10 @@ void DialogHeight::setPointName(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setTypeLine set type of line + * @brief SetTypeLine set type of line * @param value type */ -void DialogHeight::setTypeLine(const QString &value) +void DialogHeight::SetTypeLine(const QString &value) { ChangeCurrentData(ui->comboBoxLineType, value); line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value)); @@ -101,10 +101,10 @@ void DialogHeight::setTypeLine(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setBasePointId set id base point of height + * @brief SetBasePointId set id base point of height * @param value id */ -void DialogHeight::setBasePointId(const quint32 &value) +void DialogHeight::SetBasePointId(const quint32 &value) { setCurrentPointId(ui->comboBoxBasePoint, value); line->setPoint1Id(value); @@ -112,10 +112,10 @@ void DialogHeight::setBasePointId(const quint32 &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setP1LineId set id first point of line + * @brief SetP1LineId set id first point of line * @param value id */ -void DialogHeight::setP1LineId(const quint32 &value) +void DialogHeight::SetP1LineId(const quint32 &value) { setCurrentPointId(ui->comboBoxP1Line, value); line->setLineP1Id(value); @@ -123,23 +123,23 @@ void DialogHeight::setP1LineId(const quint32 &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setP2LineId set id second point of line + * @brief SetP2LineId set id second point of line * @param value id */ -void DialogHeight::setP2LineId(const quint32 &value) +void DialogHeight::SetP2LineId(const quint32 &value) { setCurrentPointId(ui->comboBoxP2Line, value); line->setLineP2Id(value); } //--------------------------------------------------------------------------------------------------------------------- -QString DialogHeight::getLineColor() const +QString DialogHeight::GetLineColor() const { - return GetLineColor(ui->comboBoxLineColor); + return GetComboBoxCurrentData(ui->comboBoxLineColor); } //--------------------------------------------------------------------------------------------------------------------- -void DialogHeight::setLineColor(const QString &value) +void DialogHeight::SetLineColor(const QString &value) { ChangeCurrentData(ui->comboBoxLineColor, value); } @@ -208,10 +208,10 @@ void DialogHeight::SaveData() { pointName = ui->lineEditNamePoint->text(); - line->setPoint1Id(getBasePointId()); - line->setLineP1Id(getP1LineId()); - line->setLineP2Id(getP2LineId()); - line->setLineStyle(VAbstractTool::LineStyleToPenStyle(getTypeLine())); + line->setPoint1Id(GetBasePointId()); + line->setLineP1Id(GetP1LineId()); + line->setLineP2Id(GetP2LineId()); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(GetTypeLine())); line->RefreshGeometry(); } @@ -272,40 +272,40 @@ void DialogHeight::ShowVisualization() //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getTypeLine return type of line + * @brief GetTypeLine return type of line * @return type */ -QString DialogHeight::getTypeLine() const +QString DialogHeight::GetTypeLine() const { - return GetTypeLine(ui->comboBoxLineType); + return GetComboBoxCurrentData(ui->comboBoxLineType); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getBasePointId return id base point of height + * @brief GetBasePointId return id base point of height * @return id */ -quint32 DialogHeight::getBasePointId() const +quint32 DialogHeight::GetBasePointId() const { return getCurrentObjectId(ui->comboBoxBasePoint); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getP1LineId return id first point of line + * @brief GetP1LineId return id first point of line * @return id id */ -quint32 DialogHeight::getP1LineId() const +quint32 DialogHeight::GetP1LineId() const { return getCurrentObjectId(ui->comboBoxP1Line); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getP2LineId return id second point of line + * @brief GetP2LineId return id second point of line * @return id */ -quint32 DialogHeight::getP2LineId() const +quint32 DialogHeight::GetP2LineId() const { return getCurrentObjectId(ui->comboBoxP2Line); } diff --git a/src/app/dialogs/tools/dialogheight.h b/src/app/dialogs/tools/dialogheight.h index 01c13a1d7..18859f56a 100644 --- a/src/app/dialogs/tools/dialogheight.h +++ b/src/app/dialogs/tools/dialogheight.h @@ -48,22 +48,22 @@ public: DialogHeight(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogHeight(); - void setPointName(const QString &value); + void SetPointName(const QString &value); - QString getTypeLine() const; - void setTypeLine(const QString &value); + QString GetTypeLine() const; + void SetTypeLine(const QString &value); - quint32 getBasePointId() const; - void setBasePointId(const quint32 &value); + quint32 GetBasePointId() const; + void SetBasePointId(const quint32 &value); - quint32 getP1LineId() const; - void setP1LineId(const quint32 &value); + quint32 GetP1LineId() const; + void SetP1LineId(const quint32 &value); - quint32 getP2LineId() const; - void setP2LineId(const quint32 &value); + quint32 GetP2LineId() const; + void SetP2LineId(const quint32 &value); - QString getLineColor() const; - void setLineColor(const QString &value); + QString GetLineColor() const; + void SetLineColor(const QString &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); virtual void PointNameChanged(); diff --git a/src/app/dialogs/tools/dialogline.cpp b/src/app/dialogs/tools/dialogline.cpp index 6a4a9d781..b545f8c9d 100644 --- a/src/app/dialogs/tools/dialogline.cpp +++ b/src/app/dialogs/tools/dialogline.cpp @@ -78,10 +78,10 @@ DialogLine::~DialogLine() //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setSecondPoint set id second point + * @brief SetSecondPoint set id second point * @param value id */ -void DialogLine::setSecondPoint(const quint32 &value) +void DialogLine::SetSecondPoint(const quint32 &value) { setCurrentPointId(ui->comboBoxSecondPoint, value); line->setPoint2Id(value); @@ -89,33 +89,33 @@ void DialogLine::setSecondPoint(const quint32 &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setTypeLine set type of line + * @brief SetTypeLine set type of line * @param value type */ -void DialogLine::setTypeLine(const QString &value) +void DialogLine::SetTypeLine(const QString &value) { ChangeCurrentData(ui->comboBoxLineType, value); line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value)); } //--------------------------------------------------------------------------------------------------------------------- -QString DialogLine::getLineColor() const +QString DialogLine::GetLineColor() const { - return GetLineColor(ui->comboBoxLineColor); + return GetComboBoxCurrentData(ui->comboBoxLineColor); } //--------------------------------------------------------------------------------------------------------------------- -void DialogLine::setLineColor(const QString &value) +void DialogLine::SetLineColor(const QString &value) { ChangeCurrentData(ui->comboBoxLineColor, value); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setFirstPoint set id first point + * @brief SetFirstPoint set id first point * @param value id */ -void DialogLine::setFirstPoint(const quint32 &value) +void DialogLine::SetFirstPoint(const quint32 &value) { setCurrentPointId(ui->comboBoxFirstPoint, value); line->setPoint1Id(value); @@ -164,9 +164,9 @@ void DialogLine::ShowVisualization() //--------------------------------------------------------------------------------------------------------------------- void DialogLine::SaveData() { - line->setPoint1Id(getFirstPoint()); - line->setPoint2Id(getSecondPoint()); - line->setLineStyle(VAbstractTool::LineStyleToPenStyle(getTypeLine())); + line->setPoint1Id(GetFirstPoint()); + line->setPoint2Id(GetSecondPoint()); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(GetTypeLine())); line->RefreshGeometry(); } @@ -211,30 +211,30 @@ void DialogLine::ChosenObject(quint32 id, const SceneObject &type) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getFirstPoint return id first point + * @brief GetFirstPoint return id first point * @return id */ -quint32 DialogLine::getFirstPoint() const +quint32 DialogLine::GetFirstPoint() const { return qvariant_cast(ui->comboBoxFirstPoint->currentData()); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getSecondPoint return id second point + * @brief GetSecondPoint return id second point * @return id */ -quint32 DialogLine::getSecondPoint() const +quint32 DialogLine::GetSecondPoint() const { return qvariant_cast(ui->comboBoxSecondPoint->currentData()); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getTypeLine return type of line + * @brief GetTypeLine return type of line * @return type */ -QString DialogLine::getTypeLine() const +QString DialogLine::GetTypeLine() const { - return GetTypeLine(ui->comboBoxLineType); + return GetComboBoxCurrentData(ui->comboBoxLineType); } diff --git a/src/app/dialogs/tools/dialogline.h b/src/app/dialogs/tools/dialogline.h index 4769b41f0..8c7ff5d8f 100644 --- a/src/app/dialogs/tools/dialogline.h +++ b/src/app/dialogs/tools/dialogline.h @@ -48,17 +48,17 @@ public: DialogLine(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogLine(); - quint32 getFirstPoint() const; - void setFirstPoint(const quint32 &value); + quint32 GetFirstPoint() const; + void SetFirstPoint(const quint32 &value); - quint32 getSecondPoint() const; - void setSecondPoint(const quint32 &value); + quint32 GetSecondPoint() const; + void SetSecondPoint(const quint32 &value); - QString getTypeLine() const; - void setTypeLine(const QString &value); + QString GetTypeLine() const; + void SetTypeLine(const QString &value); - QString getLineColor() const; - void setLineColor(const QString &value); + QString GetLineColor() const; + void SetLineColor(const QString &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); virtual void PointNameChanged(); diff --git a/src/app/dialogs/tools/dialoglineintersect.cpp b/src/app/dialogs/tools/dialoglineintersect.cpp index ae764162b..83e38e663 100644 --- a/src/app/dialogs/tools/dialoglineintersect.cpp +++ b/src/app/dialogs/tools/dialoglineintersect.cpp @@ -165,10 +165,10 @@ void DialogLineIntersect::SaveData() { pointName = ui->lineEditNamePoint->text(); - line->setPoint1Id(getP1Line1()); - line->setLine1P2Id(getP2Line1()); - line->setLine2P1Id(getP1Line2()); - line->setLine2P2Id(getP2Line2()); + line->setPoint1Id(GetP1Line1()); + line->setLine1P2Id(GetP2Line1()); + line->setLine2P1Id(GetP1Line2()); + line->setLine2P2Id(GetP2Line2()); line->RefreshGeometry(); } @@ -263,10 +263,10 @@ void DialogLineIntersect::CheckState() */ bool DialogLineIntersect::CheckIntersecion() { - const QSharedPointer p1L1 = data->GeometricObject(getP1Line1()); - const QSharedPointer p2L1 = data->GeometricObject(getP2Line1()); - const QSharedPointer p1L2 = data->GeometricObject(getP1Line2()); - const QSharedPointer p2L2 = data->GeometricObject(getP2Line2()); + const QSharedPointer p1L1 = data->GeometricObject(GetP1Line1()); + const QSharedPointer p2L1 = data->GeometricObject(GetP2Line1()); + const QSharedPointer p1L2 = data->GeometricObject(GetP1Line2()); + const QSharedPointer p2L2 = data->GeometricObject(GetP2Line2()); QLineF line1(p1L1->toQPointF(), p2L1->toQPointF()); QLineF line2(p1L2->toQPointF(), p2L2->toQPointF()); @@ -284,10 +284,10 @@ bool DialogLineIntersect::CheckIntersecion() //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setP2Line2 set id second point of second line + * @brief SetP2Line2 set id second point of second line * @param value id */ -void DialogLineIntersect::setP2Line2(const quint32 &value) +void DialogLineIntersect::SetP2Line2(const quint32 &value) { setCurrentPointId(ui->comboBoxP2Line2, value); line->setLine2P2Id(value); @@ -295,10 +295,10 @@ void DialogLineIntersect::setP2Line2(const quint32 &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setP1Line2 set id first point of second line + * @brief SetP1Line2 set id first point of second line * @param value id */ -void DialogLineIntersect::setP1Line2(const quint32 &value) +void DialogLineIntersect::SetP1Line2(const quint32 &value) { setCurrentPointId(ui->comboBoxP1Line2, value); line->setLine2P1Id(value); @@ -306,10 +306,10 @@ void DialogLineIntersect::setP1Line2(const quint32 &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setP2Line1 set id second point of first line + * @brief SetP2Line1 set id second point of first line * @param value id */ -void DialogLineIntersect::setP2Line1(const quint32 &value) +void DialogLineIntersect::SetP2Line1(const quint32 &value) { setCurrentPointId(ui->comboBoxP2Line1, value); line->setLine1P2Id(value); @@ -317,10 +317,10 @@ void DialogLineIntersect::setP2Line1(const quint32 &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setP1Line1 set id first point of first line + * @brief SetP1Line1 set id first point of first line * @param value id */ -void DialogLineIntersect::setP1Line1(const quint32 &value) +void DialogLineIntersect::SetP1Line1(const quint32 &value) { setCurrentPointId(ui->comboBoxP1Line1, value); line->setPoint1Id(value); @@ -328,10 +328,10 @@ void DialogLineIntersect::setP1Line1(const quint32 &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setPointName set name of point + * @brief SetPointName set name of point * @param value name of point */ -void DialogLineIntersect::setPointName(const QString &value) +void DialogLineIntersect::SetPointName(const QString &value) { pointName = value; ui->lineEditNamePoint->setText(pointName); @@ -339,40 +339,40 @@ void DialogLineIntersect::setPointName(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getP1Line1 return id first point of first line + * @brief GetP1Line1 return id first point of first line * @return id */ -quint32 DialogLineIntersect::getP1Line1() const +quint32 DialogLineIntersect::GetP1Line1() const { return getCurrentObjectId(ui->comboBoxP1Line1); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getP2Line1 return id second point of first line + * @brief GetP2Line1 return id second point of first line * @return id */ -quint32 DialogLineIntersect::getP2Line1() const +quint32 DialogLineIntersect::GetP2Line1() const { return getCurrentObjectId(ui->comboBoxP2Line1); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getP1Line2 return id first point of second line + * @brief GetP1Line2 return id first point of second line * @return id */ -quint32 DialogLineIntersect::getP1Line2() const +quint32 DialogLineIntersect::GetP1Line2() const { return getCurrentObjectId(ui->comboBoxP1Line2); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getP2Line2 return id second point of second line + * @brief GetP2Line2 return id second point of second line * @return id */ -quint32 DialogLineIntersect::getP2Line2() const +quint32 DialogLineIntersect::GetP2Line2() const { return getCurrentObjectId(ui->comboBoxP2Line2); } diff --git a/src/app/dialogs/tools/dialoglineintersect.h b/src/app/dialogs/tools/dialoglineintersect.h index aff7e03f0..5f7a374f1 100644 --- a/src/app/dialogs/tools/dialoglineintersect.h +++ b/src/app/dialogs/tools/dialoglineintersect.h @@ -48,19 +48,19 @@ public: DialogLineIntersect(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogLineIntersect(); - quint32 getP1Line1() const; - void setP1Line1(const quint32 &value); + quint32 GetP1Line1() const; + void SetP1Line1(const quint32 &value); - quint32 getP2Line1() const; - void setP2Line1(const quint32 &value); + quint32 GetP2Line1() const; + void SetP2Line1(const quint32 &value); - quint32 getP1Line2() const; - void setP1Line2(const quint32 &value); + quint32 GetP1Line2() const; + void SetP1Line2(const quint32 &value); - quint32 getP2Line2() const; - void setP2Line2(const quint32 &value); + quint32 GetP2Line2() const; + void SetP2Line2(const quint32 &value); - void setPointName(const QString &value); + void SetPointName(const QString &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); void PointChanged(); diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.cpp b/src/app/dialogs/tools/dialoglineintersectaxis.cpp index 8544780d5..39e12c91b 100644 --- a/src/app/dialogs/tools/dialoglineintersectaxis.cpp +++ b/src/app/dialogs/tools/dialoglineintersectaxis.cpp @@ -89,33 +89,33 @@ DialogLineIntersectAxis::~DialogLineIntersectAxis() } //--------------------------------------------------------------------------------------------------------------------- -void DialogLineIntersectAxis::setPointName(const QString &value) +void DialogLineIntersectAxis::SetPointName(const QString &value) { pointName = value; ui->lineEditNamePoint->setText(pointName); } //--------------------------------------------------------------------------------------------------------------------- -QString DialogLineIntersectAxis::getTypeLine() const +QString DialogLineIntersectAxis::GetTypeLine() const { - return GetTypeLine(ui->comboBoxLineType); + return GetComboBoxCurrentData(ui->comboBoxLineType); } //--------------------------------------------------------------------------------------------------------------------- -void DialogLineIntersectAxis::setTypeLine(const QString &value) +void DialogLineIntersectAxis::SetTypeLine(const QString &value) { ChangeCurrentData(ui->comboBoxLineType, value); line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value)); } //--------------------------------------------------------------------------------------------------------------------- -QString DialogLineIntersectAxis::getAngle() const +QString DialogLineIntersectAxis::GetAngle() const { return qApp->FormulaFromUser(formulaAngle); } //--------------------------------------------------------------------------------------------------------------------- -void DialogLineIntersectAxis::setAngle(const QString &value) +void DialogLineIntersectAxis::SetAngle(const QString &value) { formulaAngle = qApp->FormulaToUser(value); // increase height if needed. TODO : see if I can get the max number of caracters in one line @@ -125,57 +125,57 @@ void DialogLineIntersectAxis::setAngle(const QString &value) this->DeployAngleTextEdit(); } ui->plainTextEditFormula->setPlainText(formulaAngle); - line->setAngle(formulaAngle); + line->SetAngle(formulaAngle); MoveCursorToEnd(ui->plainTextEditFormula); } //--------------------------------------------------------------------------------------------------------------------- -quint32 DialogLineIntersectAxis::getBasePointId() const +quint32 DialogLineIntersectAxis::GetBasePointId() const { return getCurrentObjectId(ui->comboBoxAxisPoint); } //--------------------------------------------------------------------------------------------------------------------- -void DialogLineIntersectAxis::setBasePointId(const quint32 &value) +void DialogLineIntersectAxis::SetBasePointId(const quint32 &value) { setCurrentPointId(ui->comboBoxAxisPoint, value); line->setAxisPointId(value); } //--------------------------------------------------------------------------------------------------------------------- -quint32 DialogLineIntersectAxis::getFirstPointId() const +quint32 DialogLineIntersectAxis::GetFirstPointId() const { return getCurrentObjectId(ui->comboBoxFirstLinePoint); } //--------------------------------------------------------------------------------------------------------------------- -void DialogLineIntersectAxis::setFirstPointId(const quint32 &value) +void DialogLineIntersectAxis::SetFirstPointId(const quint32 &value) { setCurrentPointId(ui->comboBoxFirstLinePoint, value); line->setPoint1Id(value); } //--------------------------------------------------------------------------------------------------------------------- -quint32 DialogLineIntersectAxis::getSecondPointId() const +quint32 DialogLineIntersectAxis::GetSecondPointId() const { return getCurrentObjectId(ui->comboBoxSecondLinePoint); } //--------------------------------------------------------------------------------------------------------------------- -void DialogLineIntersectAxis::setSecondPointId(const quint32 &value) +void DialogLineIntersectAxis::SetSecondPointId(const quint32 &value) { setCurrentPointId(ui->comboBoxSecondLinePoint, value); line->setPoint2Id(value); } //--------------------------------------------------------------------------------------------------------------------- -QString DialogLineIntersectAxis::getLineColor() const +QString DialogLineIntersectAxis::GetLineColor() const { - return GetLineColor(ui->comboBoxLineColor); + return GetComboBoxCurrentData(ui->comboBoxLineColor); } //--------------------------------------------------------------------------------------------------------------------- -void DialogLineIntersectAxis::setLineColor(const QString &value) +void DialogLineIntersectAxis::SetLineColor(const QString &value) { ChangeCurrentData(ui->comboBoxLineColor, value); } @@ -190,7 +190,7 @@ void DialogLineIntersectAxis::ShowDialog(bool click) /*We will ignore click if poinet is in point circle*/ VMainGraphicsScene *scene = qApp->getCurrentScene(); SCASSERT(scene != nullptr); - const QSharedPointer point = data->GeometricObject(getBasePointId()); + const QSharedPointer point = data->GeometricObject(GetBasePointId()); QLineF line = QLineF(point->toQPointF(), scene->getScenePos()); //Radius of point circle, but little bigger. Need handle with hover sizes. @@ -201,7 +201,7 @@ void DialogLineIntersectAxis::ShowDialog(bool click) } } this->setModal(true); - this->setAngle(line->Angle());//Show in dialog angle what user choose + this->SetAngle(line->Angle());//Show in dialog angle what user choose emit ToolTip(""); timerFormula->start(); this->show(); @@ -331,11 +331,11 @@ void DialogLineIntersectAxis::SaveData() formulaAngle = ui->plainTextEditFormula->toPlainText(); formulaAngle.replace("\n", " "); - line->setPoint1Id(getFirstPointId()); - line->setPoint2Id(getSecondPointId()); - line->setAxisPointId(getBasePointId()); - line->setAngle(formulaAngle); - line->setLineStyle(VAbstractTool::LineStyleToPenStyle(getTypeLine())); + line->setPoint1Id(GetFirstPointId()); + line->setPoint2Id(GetSecondPointId()); + line->setAxisPointId(GetBasePointId()); + line->SetAngle(formulaAngle); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(GetTypeLine())); line->RefreshGeometry(); } diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.h b/src/app/dialogs/tools/dialoglineintersectaxis.h index 51cda1dbe..130510eb5 100644 --- a/src/app/dialogs/tools/dialoglineintersectaxis.h +++ b/src/app/dialogs/tools/dialoglineintersectaxis.h @@ -45,25 +45,25 @@ public: DialogLineIntersectAxis(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogLineIntersectAxis(); - void setPointName(const QString &value); + void SetPointName(const QString &value); - QString getTypeLine() const; - void setTypeLine(const QString &value); + QString GetTypeLine() const; + void SetTypeLine(const QString &value); - QString getAngle() const; - void setAngle(const QString &value); + QString GetAngle() const; + void SetAngle(const QString &value); - quint32 getBasePointId() const; - void setBasePointId(const quint32 &value); + quint32 GetBasePointId() const; + void SetBasePointId(const quint32 &value); - quint32 getFirstPointId() const; - void setFirstPointId(const quint32 &value); + quint32 GetFirstPointId() const; + void SetFirstPointId(const quint32 &value); - quint32 getSecondPointId() const; - void setSecondPointId(const quint32 &value); + quint32 GetSecondPointId() const; + void SetSecondPointId(const quint32 &value); - QString getLineColor() const; - void setLineColor(const QString &value); + QString GetLineColor() const; + void SetLineColor(const QString &value); virtual void ShowDialog(bool click); public slots: diff --git a/src/app/dialogs/tools/dialognormal.cpp b/src/app/dialogs/tools/dialognormal.cpp index 0133149a3..0d6ae44a6 100644 --- a/src/app/dialogs/tools/dialognormal.cpp +++ b/src/app/dialogs/tools/dialognormal.cpp @@ -177,11 +177,11 @@ void DialogNormal::SaveData() formula.replace("\n", " "); angle = ui->doubleSpinBoxAngle->value(); - line->setPoint1Id(getFirstPointId()); - line->setPoint2Id(getSecondPointId()); + line->setPoint1Id(GetFirstPointId()); + line->setPoint2Id(GetSecondPointId()); line->setLength(formula); - line->setAngle(angle); - line->setLineStyle(VAbstractTool::LineStyleToPenStyle(getTypeLine())); + line->SetAngle(angle); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(GetTypeLine())); line->RefreshGeometry(); } @@ -194,33 +194,33 @@ void DialogNormal::closeEvent(QCloseEvent *event) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setSecondPointId set id of second point + * @brief SetSecondPointId set id of second point * @param value id */ -void DialogNormal::setSecondPointId(const quint32 &value) +void DialogNormal::SetSecondPointId(const quint32 &value) { setCurrentPointId(ui->comboBoxSecondPoint, value); line->setPoint2Id(value); } //--------------------------------------------------------------------------------------------------------------------- -QString DialogNormal::getLineColor() const +QString DialogNormal::GetLineColor() const { - return GetLineColor(ui->comboBoxLineColor); + return GetComboBoxCurrentData(ui->comboBoxLineColor); } //--------------------------------------------------------------------------------------------------------------------- -void DialogNormal::setLineColor(const QString &value) +void DialogNormal::SetLineColor(const QString &value) { ChangeCurrentData(ui->comboBoxLineColor, value); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setFirstPointId set id of first point + * @brief SetFirstPointId set id of first point * @param value id */ -void DialogNormal::setFirstPointId(const quint32 &value) +void DialogNormal::SetFirstPointId(const quint32 &value) { setCurrentPointId(ui->comboBoxFirstPoint, value); line->setPoint1Id(value); @@ -228,22 +228,22 @@ void DialogNormal::setFirstPointId(const quint32 &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setAngle set aditional angle of normal + * @brief SetAngle set aditional angle of normal * @param value angle in degree */ -void DialogNormal::setAngle(const qreal &value) +void DialogNormal::SetAngle(const qreal &value) { angle = value; ui->doubleSpinBoxAngle->setValue(angle); - line->setAngle(angle); + line->SetAngle(angle); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setFormula set string of formula + * @brief SetFormula set string of formula * @param value formula */ -void DialogNormal::setFormula(const QString &value) +void DialogNormal::SetFormula(const QString &value) { formula = qApp->FormulaToUser(value); // increase height if needed. @@ -258,10 +258,10 @@ void DialogNormal::setFormula(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setTypeLine set type of line + * @brief SetTypeLine set type of line * @param value type */ -void DialogNormal::setTypeLine(const QString &value) +void DialogNormal::SetTypeLine(const QString &value) { ChangeCurrentData(ui->comboBoxLineType, value); line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value)); @@ -269,10 +269,10 @@ void DialogNormal::setTypeLine(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setPointName set name of point + * @brief SetPointName set name of point * @param value name */ -void DialogNormal::setPointName(const QString &value) +void DialogNormal::SetPointName(const QString &value) { pointName = value; ui->lineEditNamePoint->setText(pointName); @@ -280,50 +280,50 @@ void DialogNormal::setPointName(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getTypeLine return type of line + * @brief GetTypeLine return type of line * @return type */ -QString DialogNormal::getTypeLine() const +QString DialogNormal::GetTypeLine() const { - return GetTypeLine(ui->comboBoxLineType); + return GetComboBoxCurrentData(ui->comboBoxLineType); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getFormula return string of formula + * @brief GetFormula return string of formula * @return formula */ -QString DialogNormal::getFormula() const +QString DialogNormal::GetFormula() const { return qApp->FormulaFromUser(formula); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getAngle return aditional angle of normal + * @brief GetAngle return aditional angle of normal * @return angle in degree */ -qreal DialogNormal::getAngle() const +qreal DialogNormal::GetAngle() const { return angle; } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getFirstPointId return id of first point + * @brief GetFirstPointId return id of first point * @return id */ -quint32 DialogNormal::getFirstPointId() const +quint32 DialogNormal::GetFirstPointId() const { return getCurrentObjectId(ui->comboBoxFirstPoint); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getSecondPointId return id of second point + * @brief GetSecondPointId return id of second point * @return id */ -quint32 DialogNormal::getSecondPointId() const +quint32 DialogNormal::GetSecondPointId() const { return getCurrentObjectId(ui->comboBoxSecondPoint); } diff --git a/src/app/dialogs/tools/dialognormal.h b/src/app/dialogs/tools/dialognormal.h index 003f24f41..8fce4a01a 100644 --- a/src/app/dialogs/tools/dialognormal.h +++ b/src/app/dialogs/tools/dialognormal.h @@ -48,25 +48,25 @@ public: DialogNormal(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogNormal(); - void setPointName(const QString &value); + void SetPointName(const QString &value); - QString getTypeLine() const; - void setTypeLine(const QString &value); + QString GetTypeLine() const; + void SetTypeLine(const QString &value); - QString getFormula() const; - void setFormula(const QString &value); + QString GetFormula() const; + void SetFormula(const QString &value); - qreal getAngle() const; - void setAngle(const qreal &value); + qreal GetAngle() const; + void SetAngle(const qreal &value); - quint32 getFirstPointId() const; - void setFirstPointId(const quint32 &value); + quint32 GetFirstPointId() const; + void SetFirstPointId(const quint32 &value); - quint32 getSecondPointId() const; - void setSecondPointId(const quint32 &value); + quint32 GetSecondPointId() const; + void SetSecondPointId(const quint32 &value); - QString getLineColor() const; - void setLineColor(const QString &value); + QString GetLineColor() const; + void SetLineColor(const QString &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); /** diff --git a/src/app/dialogs/tools/dialogpointofcontact.cpp b/src/app/dialogs/tools/dialogpointofcontact.cpp index fe1e45c24..d01773ffb 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.cpp +++ b/src/app/dialogs/tools/dialogpointofcontact.cpp @@ -218,8 +218,8 @@ void DialogPointOfContact::SaveData() radius = ui->plainTextEditFormula->toPlainText(); radius.replace("\n", " "); - line->setPoint1Id(getFirstPoint()); - line->setLineP2Id(getSecondPoint()); + line->setPoint1Id(GetFirstPoint()); + line->setLineP2Id(GetSecondPoint()); line->setRadiusId(getCenter()); line->setRadius(radius); line->RefreshGeometry(); @@ -234,10 +234,10 @@ void DialogPointOfContact::closeEvent(QCloseEvent *event) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setSecondPoint set id second point + * @brief SetSecondPoint set id second point * @param value id */ -void DialogPointOfContact::setSecondPoint(const quint32 &value) +void DialogPointOfContact::SetSecondPoint(const quint32 &value) { setCurrentPointId(ui->comboBoxSecondPoint, value); line->setLineP2Id(value); @@ -245,10 +245,10 @@ void DialogPointOfContact::setSecondPoint(const quint32 &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setFirstPoint set id first point + * @brief SetFirstPoint set id first point * @param value id */ -void DialogPointOfContact::setFirstPoint(const quint32 &value) +void DialogPointOfContact::SetFirstPoint(const quint32 &value) { setCurrentPointId(ui->comboBoxFirstPoint, value); line->setPoint1Id(value); @@ -285,10 +285,10 @@ void DialogPointOfContact::setRadius(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setPointName set name of point + * @brief SetPointName set name of point * @param value name */ -void DialogPointOfContact::setPointName(const QString &value) +void DialogPointOfContact::SetPointName(const QString &value) { pointName = value; ui->lineEditNamePoint->setText(pointName); @@ -316,20 +316,20 @@ quint32 DialogPointOfContact::getCenter() const //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getFirstPoint return id first point + * @brief GetFirstPoint return id first point * @return id */ -quint32 DialogPointOfContact::getFirstPoint() const +quint32 DialogPointOfContact::GetFirstPoint() const { return getCurrentObjectId(ui->comboBoxFirstPoint);; } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getSecondPoint return id second point + * @brief GetSecondPoint return id second point * @return id */ -quint32 DialogPointOfContact::getSecondPoint() const +quint32 DialogPointOfContact::GetSecondPoint() const { return getCurrentObjectId(ui->comboBoxSecondPoint); } diff --git a/src/app/dialogs/tools/dialogpointofcontact.h b/src/app/dialogs/tools/dialogpointofcontact.h index 80fe12a56..549487a2e 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.h +++ b/src/app/dialogs/tools/dialogpointofcontact.h @@ -49,7 +49,7 @@ public: DialogPointOfContact(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); virtual ~DialogPointOfContact(); - void setPointName(const QString &value); + void SetPointName(const QString &value); QString getRadius() const; void setRadius(const QString &value); @@ -57,11 +57,11 @@ public: quint32 getCenter() const; void setCenter(const quint32 &value); - quint32 getFirstPoint() const; - void setFirstPoint(const quint32 &value); + quint32 GetFirstPoint() const; + void SetFirstPoint(const quint32 &value); - quint32 getSecondPoint() const; - void setSecondPoint(const quint32 &value); + quint32 GetSecondPoint() const; + void SetSecondPoint(const quint32 &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); /** diff --git a/src/app/dialogs/tools/dialogpointofintersection.cpp b/src/app/dialogs/tools/dialogpointofintersection.cpp index c380255b7..882afa5dd 100644 --- a/src/app/dialogs/tools/dialogpointofintersection.cpp +++ b/src/app/dialogs/tools/dialogpointofintersection.cpp @@ -76,10 +76,10 @@ DialogPointOfIntersection::~DialogPointOfIntersection() //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setSecondPointId set id of second point + * @brief SetSecondPointId set id of second point * @param value id */ -void DialogPointOfIntersection::setSecondPointId(const quint32 &value) +void DialogPointOfIntersection::SetSecondPointId(const quint32 &value) { setCurrentPointId(ui->comboBoxSecondPoint, value); line->setPoint2Id(value); @@ -132,8 +132,8 @@ void DialogPointOfIntersection::SaveData() { pointName = ui->lineEditNamePoint->text(); - line->setPoint1Id(getFirstPointId()); - line->setPoint2Id(getSecondPointId()); + line->setPoint1Id(GetFirstPointId()); + line->setPoint2Id(GetSecondPointId()); line->RefreshGeometry(); } @@ -178,10 +178,10 @@ void DialogPointOfIntersection::ShowVisualization() //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setFirstPointId set id of first point + * @brief SetFirstPointId set id of first point * @param value id */ -void DialogPointOfIntersection::setFirstPointId(const quint32 &value) +void DialogPointOfIntersection::SetFirstPointId(const quint32 &value) { setCurrentPointId(ui->comboBoxFirstPoint, value); line->setPoint1Id(value); @@ -189,10 +189,10 @@ void DialogPointOfIntersection::setFirstPointId(const quint32 &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setPointName set name of point + * @brief SetPointName set name of point * @param value name */ -void DialogPointOfIntersection::setPointName(const QString &value) +void DialogPointOfIntersection::SetPointName(const QString &value) { pointName = value; ui->lineEditNamePoint->setText(pointName); @@ -200,20 +200,20 @@ void DialogPointOfIntersection::setPointName(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getFirstPointId return id of first point + * @brief GetFirstPointId return id of first point * @return id */ -quint32 DialogPointOfIntersection::getFirstPointId() const +quint32 DialogPointOfIntersection::GetFirstPointId() const { return getCurrentObjectId(ui->comboBoxFirstPoint); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getSecondPointId return id of second point + * @brief GetSecondPointId return id of second point * @return id */ -quint32 DialogPointOfIntersection::getSecondPointId() const +quint32 DialogPointOfIntersection::GetSecondPointId() const { return getCurrentObjectId(ui->comboBoxSecondPoint); } diff --git a/src/app/dialogs/tools/dialogpointofintersection.h b/src/app/dialogs/tools/dialogpointofintersection.h index 65c70d50c..811375a8d 100644 --- a/src/app/dialogs/tools/dialogpointofintersection.h +++ b/src/app/dialogs/tools/dialogpointofintersection.h @@ -48,13 +48,13 @@ public: DialogPointOfIntersection(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogPointOfIntersection(); - void setPointName(const QString &value); + void SetPointName(const QString &value); - quint32 getFirstPointId() const; - void setFirstPointId(const quint32 &value); + quint32 GetFirstPointId() const; + void SetFirstPointId(const quint32 &value); - quint32 getSecondPointId() const; - void setSecondPointId(const quint32 &value); + quint32 GetSecondPointId() const; + void SetSecondPointId(const quint32 &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); virtual void PointNameChanged(); diff --git a/src/app/dialogs/tools/dialogshoulderpoint.cpp b/src/app/dialogs/tools/dialogshoulderpoint.cpp index 291f51a73..ad92e20c8 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.cpp +++ b/src/app/dialogs/tools/dialogshoulderpoint.cpp @@ -204,11 +204,11 @@ void DialogShoulderPoint::SaveData() formula = ui->plainTextEditFormula->toPlainText(); formula.replace("\n", " "); - line->setPoint1Id(getP3()); - line->setLineP1Id(getP1Line()); - line->setLineP2Id(getP2Line()); + line->setPoint1Id(GetP3()); + line->setLineP1Id(GetP1Line()); + line->setLineP2Id(GetP2Line()); line->setLength(formula); - line->setLineStyle(VAbstractTool::LineStyleToPenStyle(getTypeLine())); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(GetTypeLine())); line->RefreshGeometry(); } @@ -224,30 +224,30 @@ void DialogShoulderPoint::closeEvent(QCloseEvent *event) * @brief setPShoulder set id shoulder point * @param value id */ -void DialogShoulderPoint::setP3(const quint32 &value) +void DialogShoulderPoint::SetP3(const quint32 &value) { setCurrentPointId(ui->comboBoxP3, value); line->setPoint1Id(value); } //--------------------------------------------------------------------------------------------------------------------- -QString DialogShoulderPoint::getLineColor() const +QString DialogShoulderPoint::GetLineColor() const { - return GetLineColor(ui->comboBoxLineColor); + return GetComboBoxCurrentData(ui->comboBoxLineColor); } //--------------------------------------------------------------------------------------------------------------------- -void DialogShoulderPoint::setLineColor(const QString &value) +void DialogShoulderPoint::SetLineColor(const QString &value) { ChangeCurrentData(ui->comboBoxLineColor, value); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setP2Line set id second point of line + * @brief SetP2Line set id second point of line * @param value id */ -void DialogShoulderPoint::setP2Line(const quint32 &value) +void DialogShoulderPoint::SetP2Line(const quint32 &value) { setCurrentPointId(ui->comboBoxP2Line, value); line->setLineP2Id(value); @@ -255,10 +255,10 @@ void DialogShoulderPoint::setP2Line(const quint32 &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setP1Line set id first point of line + * @brief SetP1Line set id first point of line * @param value id */ -void DialogShoulderPoint::setP1Line(const quint32 &value) +void DialogShoulderPoint::SetP1Line(const quint32 &value) { setCurrentPointId(ui->comboBoxP1Line, value); line->setLineP1Id(value); @@ -266,10 +266,10 @@ void DialogShoulderPoint::setP1Line(const quint32 &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setFormula set string of formula + * @brief SetFormula set string of formula * @param value formula */ -void DialogShoulderPoint::setFormula(const QString &value) +void DialogShoulderPoint::SetFormula(const QString &value) { formula = qApp->FormulaToUser(value); // increase height if needed. @@ -284,10 +284,10 @@ void DialogShoulderPoint::setFormula(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setTypeLine set type of line + * @brief SetTypeLine set type of line * @param value type */ -void DialogShoulderPoint::setTypeLine(const QString &value) +void DialogShoulderPoint::SetTypeLine(const QString &value) { ChangeCurrentData(ui->comboBoxLineType, value); line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value)); @@ -295,10 +295,10 @@ void DialogShoulderPoint::setTypeLine(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setPointName set name of point + * @brief SetPointName set name of point * @param value name */ -void DialogShoulderPoint::setPointName(const QString &value) +void DialogShoulderPoint::SetPointName(const QString &value) { pointName = value; ui->lineEditNamePoint->setText(pointName); @@ -306,40 +306,40 @@ void DialogShoulderPoint::setPointName(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getTypeLine return type of line + * @brief GetTypeLine return type of line * @return type */ -QString DialogShoulderPoint::getTypeLine() const +QString DialogShoulderPoint::GetTypeLine() const { - return GetTypeLine(ui->comboBoxLineType); + return GetComboBoxCurrentData(ui->comboBoxLineType); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getFormula return string of formula + * @brief GetFormula return string of formula * @return formula */ -QString DialogShoulderPoint::getFormula() const +QString DialogShoulderPoint::GetFormula() const { return qApp->FormulaFromUser(formula); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getP1Line return id first point of line + * @brief GetP1Line return id first point of line * @return id */ -quint32 DialogShoulderPoint::getP1Line() const +quint32 DialogShoulderPoint::GetP1Line() const { return getCurrentObjectId(ui->comboBoxP1Line); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getP2Line return id second point of line + * @brief GetP2Line return id second point of line * @return id */ -quint32 DialogShoulderPoint::getP2Line() const +quint32 DialogShoulderPoint::GetP2Line() const { return getCurrentObjectId(ui->comboBoxP2Line); } @@ -349,7 +349,7 @@ quint32 DialogShoulderPoint::getP2Line() const * @brief getPShoulder return id shoulder point * @return id */ -quint32 DialogShoulderPoint::getP3() const +quint32 DialogShoulderPoint::GetP3() const { return getCurrentObjectId(ui->comboBoxP3); } diff --git a/src/app/dialogs/tools/dialogshoulderpoint.h b/src/app/dialogs/tools/dialogshoulderpoint.h index 9178dd726..4f5670654 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.h +++ b/src/app/dialogs/tools/dialogshoulderpoint.h @@ -48,25 +48,25 @@ public: DialogShoulderPoint(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogShoulderPoint(); - void setPointName(const QString &value); + void SetPointName(const QString &value); - QString getTypeLine() const; - void setTypeLine(const QString &value); + QString GetTypeLine() const; + void SetTypeLine(const QString &value); - QString getFormula() const; - void setFormula(const QString &value); + QString GetFormula() const; + void SetFormula(const QString &value); - quint32 getP1Line() const; - void setP1Line(const quint32 &value); + quint32 GetP1Line() const; + void SetP1Line(const quint32 &value); - quint32 getP2Line() const; - void setP2Line(const quint32 &value); + quint32 GetP2Line() const; + void SetP2Line(const quint32 &value); - quint32 getP3() const; - void setP3(const quint32 &value); + quint32 GetP3() const; + void SetP3(const quint32 &value); - QString getLineColor() const; - void setLineColor(const QString &value); + QString GetLineColor() const; + void SetLineColor(const QString &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); /** diff --git a/src/app/dialogs/tools/dialogsinglepoint.cpp b/src/app/dialogs/tools/dialogsinglepoint.cpp index ab7d0012a..f218776a4 100644 --- a/src/app/dialogs/tools/dialogsinglepoint.cpp +++ b/src/app/dialogs/tools/dialogsinglepoint.cpp @@ -92,7 +92,7 @@ void DialogSinglePoint::UpdateList() * @param name name of point * @param point data for point */ -void DialogSinglePoint::setData(const QString &name, const QPointF &point) +void DialogSinglePoint::SetData(const QString &name, const QPointF &point) { pointName = name; this->point = point; @@ -113,7 +113,7 @@ DialogSinglePoint::~DialogSinglePoint() * @brief getPoint return point * @return point */ -QPointF DialogSinglePoint::getPoint() const +QPointF DialogSinglePoint::GetPoint() const { return point; } diff --git a/src/app/dialogs/tools/dialogsinglepoint.h b/src/app/dialogs/tools/dialogsinglepoint.h index b92fe136f..0b6ef3d0b 100644 --- a/src/app/dialogs/tools/dialogsinglepoint.h +++ b/src/app/dialogs/tools/dialogsinglepoint.h @@ -45,8 +45,10 @@ class DialogSinglePoint : public DialogTool public: DialogSinglePoint(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogSinglePoint(); - void setData(const QString &name, const QPointF &point); - QPointF getPoint()const; + + void SetData(const QString &name, const QPointF &point); + QPointF GetPoint()const; + public slots: void mousePress(const QPointF &scenePos); virtual void UpdateList(); diff --git a/src/app/dialogs/tools/dialogspline.cpp b/src/app/dialogs/tools/dialogspline.cpp index 956cacaa2..496c461dd 100644 --- a/src/app/dialogs/tools/dialogspline.cpp +++ b/src/app/dialogs/tools/dialogspline.cpp @@ -71,10 +71,10 @@ DialogSpline::~DialogSpline() //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getP1 return id first point of spline + * @brief GetP1 return id first point of spline * @return id */ -quint32 DialogSpline::getP1() const +quint32 DialogSpline::GetP1() const { return getCurrentObjectId(ui->comboBoxP1); } @@ -147,13 +147,13 @@ void DialogSpline::SaveData() kAsm2 = ui->doubleSpinBoxKasm2->value(); kCurve = ui->doubleSpinBoxKcurve->value(); - path->setPoint1Id(getP1()); - path->setPoint4Id(getP4()); - path->setAngle1(angle1); - path->setAngle2(angle2); - path->setKAsm1(kAsm1); - path->setKAsm2(kAsm2); - path->setKCurve(kCurve); + path->setPoint1Id(GetP1()); + path->setPoint4Id(GetP4()); + path->SetAngle1(angle1); + path->SetAngle2(angle2); + path->SetKAsm1(kAsm1); + path->SetKAsm2(kAsm2); + path->SetKCurve(kCurve); path->RefreshGeometry(); } @@ -203,82 +203,82 @@ void DialogSpline::ShowVisualization() //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setKCurve set coefficient curve + * @brief SetKCurve set coefficient curve * @param value value. Can be >= 0. */ -void DialogSpline::setKCurve(const qreal &value) +void DialogSpline::SetKCurve(const qreal &value) { kCurve = value; ui->doubleSpinBoxKcurve->setValue(value); - path->setKCurve(kCurve); + path->SetKCurve(kCurve); } //--------------------------------------------------------------------------------------------------------------------- -QString DialogSpline::getColor() const +QString DialogSpline::GetColor() const { - return GetLineColor(ui->comboBoxColor); + return GetComboBoxCurrentData(ui->comboBoxColor); } //--------------------------------------------------------------------------------------------------------------------- -void DialogSpline::setColor(const QString &value) +void DialogSpline::SetColor(const QString &value) { ChangeCurrentData(ui->comboBoxColor, value); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setKAsm2 set second coefficient asymmetry + * @brief SetKAsm2 set second coefficient asymmetry * @param value value. Can be >= 0. */ -void DialogSpline::setKAsm2(const qreal &value) +void DialogSpline::SetKAsm2(const qreal &value) { kAsm2 = value; ui->doubleSpinBoxKasm2->setValue(value); - path->setKAsm2(kAsm2); + path->SetKAsm2(kAsm2); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setKAsm1 set first coefficient asymmetry + * @brief SetKAsm1 set first coefficient asymmetry * @param value value. Can be >= 0. */ -void DialogSpline::setKAsm1(const qreal &value) +void DialogSpline::SetKAsm1(const qreal &value) { kAsm1 = value; ui->doubleSpinBoxKasm1->setValue(value); - path->setKAsm1(kAsm1); + path->SetKAsm1(kAsm1); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setAngle2 set second angle of spline + * @brief SetAngle2 set second angle of spline * @param value angle in degree */ -void DialogSpline::setAngle2(const qreal &value) +void DialogSpline::SetAngle2(const qreal &value) { angle2 = value; ui->spinBoxAngle2->setValue(static_cast(value)); - path->setAngle2(angle2); + path->SetAngle2(angle2); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setAngle1 set first angle of spline + * @brief SetAngle1 set first angle of spline * @param value angle in degree */ -void DialogSpline::setAngle1(const qreal &value) +void DialogSpline::SetAngle1(const qreal &value) { angle1 = value; ui->spinBoxAngle1->setValue(static_cast(value)); - path->setAngle1(angle1); + path->SetAngle1(angle1); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setP4 set id fourth point of spline + * @brief SetP4 set id fourth point of spline * @param value id */ -void DialogSpline::setP4(const quint32 &value) +void DialogSpline::SetP4(const quint32 &value) { setCurrentPointId(ui->comboBoxP4, value); path->setPoint4Id(value); @@ -286,10 +286,10 @@ void DialogSpline::setP4(const quint32 &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setP1 set id first point of spline + * @brief SetP1 set id first point of spline * @param value id */ -void DialogSpline::setP1(const quint32 &value) +void DialogSpline::SetP1(const quint32 &value) { setCurrentPointId(ui->comboBoxP1, value); path->setPoint1Id(value); @@ -297,60 +297,60 @@ void DialogSpline::setP1(const quint32 &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getP4 return id fourth point of spline + * @brief GetP4 return id fourth point of spline * @return id */ -quint32 DialogSpline::getP4() const +quint32 DialogSpline::GetP4() const { return getCurrentObjectId(ui->comboBoxP4); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getAngle1 return first angle of spline + * @brief GetAngle1 return first angle of spline * @return angle in degree */ -qreal DialogSpline::getAngle1() const +qreal DialogSpline::GetAngle1() const { return angle1; } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getAngle2 return second angle of spline + * @brief GetAngle2 return second angle of spline * @return angle in degree */ -qreal DialogSpline::getAngle2() const +qreal DialogSpline::GetAngle2() const { return angle2; } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getKAsm1 return first coefficient asymmetry + * @brief GetKAsm1 return first coefficient asymmetry * @return value. Can be >= 0. */ -qreal DialogSpline::getKAsm1() const +qreal DialogSpline::GetKAsm1() const { return kAsm1; } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getKAsm2 return second coefficient asymmetry + * @brief GetKAsm2 return second coefficient asymmetry * @return value. Can be >= 0. */ -qreal DialogSpline::getKAsm2() const +qreal DialogSpline::GetKAsm2() const { return kAsm2; } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getKCurve return coefficient curve + * @brief GetKCurve return coefficient curve * @return value. Can be >= 0. */ -qreal DialogSpline::getKCurve() const +qreal DialogSpline::GetKCurve() const { return kCurve; } diff --git a/src/app/dialogs/tools/dialogspline.h b/src/app/dialogs/tools/dialogspline.h index 0721eb711..b2634c5f7 100644 --- a/src/app/dialogs/tools/dialogspline.h +++ b/src/app/dialogs/tools/dialogspline.h @@ -48,29 +48,29 @@ public: DialogSpline(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogSpline(); - quint32 getP1() const; - void setP1(const quint32 &value); + quint32 GetP1() const; + void SetP1(const quint32 &value); - quint32 getP4() const; - void setP4(const quint32 &value); + quint32 GetP4() const; + void SetP4(const quint32 &value); - qreal getAngle1() const; - void setAngle1(const qreal &value); + qreal GetAngle1() const; + void SetAngle1(const qreal &value); - qreal getAngle2() const; - void setAngle2(const qreal &value); + qreal GetAngle2() const; + void SetAngle2(const qreal &value); - qreal getKAsm1() const; - void setKAsm1(const qreal &value); + qreal GetKAsm1() const; + void SetKAsm1(const qreal &value); - qreal getKAsm2() const; - void setKAsm2(const qreal &value); + qreal GetKAsm2() const; + void SetKAsm2(const qreal &value); - qreal getKCurve() const; - void setKCurve(const qreal &value); + qreal GetKCurve() const; + void SetKCurve(const qreal &value); - QString getColor() const; - void setColor(const QString &value); + QString GetColor() const; + void SetColor(const QString &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); virtual void PointNameChanged(); diff --git a/src/app/dialogs/tools/dialogsplinepath.cpp b/src/app/dialogs/tools/dialogsplinepath.cpp index 410739a09..fe059a403 100644 --- a/src/app/dialogs/tools/dialogsplinepath.cpp +++ b/src/app/dialogs/tools/dialogsplinepath.cpp @@ -88,20 +88,20 @@ void DialogSplinePath::SetPath(const VSplinePath &value) NewItem(path.at(i).P().id(), path.at(i).KAsm1(), path.at(i).Angle1(), path.at(i).KAsm2(), path.at(i).Angle2()); } ui->listWidget->setFocus(Qt::OtherFocusReason); - ui->doubleSpinBoxKcurve->setValue(path.getKCurve()); + ui->doubleSpinBoxKcurve->setValue(path.GetKCurve()); visPath->setPath(path); ui->listWidget->blockSignals(false); } //--------------------------------------------------------------------------------------------------------------------- -QString DialogSplinePath::getColor() const +QString DialogSplinePath::GetColor() const { - return GetLineColor(ui->comboBoxColor); + return GetComboBoxCurrentData(ui->comboBoxColor); } //--------------------------------------------------------------------------------------------------------------------- -void DialogSplinePath::setColor(const QString &value) +void DialogSplinePath::SetColor(const QString &value) { ChangeCurrentData(ui->comboBoxColor, value); } @@ -375,5 +375,5 @@ void DialogSplinePath::SavePath() QListWidgetItem *item = ui->listWidget->item(i); path.append( qvariant_cast(item->data(Qt::UserRole))); } - path.setKCurve(ui->doubleSpinBoxKcurve->value()); + path.SetKCurve(ui->doubleSpinBoxKcurve->value()); } diff --git a/src/app/dialogs/tools/dialogsplinepath.h b/src/app/dialogs/tools/dialogsplinepath.h index fe15980c5..d16cb0fd5 100644 --- a/src/app/dialogs/tools/dialogsplinepath.h +++ b/src/app/dialogs/tools/dialogsplinepath.h @@ -52,8 +52,8 @@ public: VSplinePath GetPath() const; void SetPath(const VSplinePath &value); - QString getColor() const; - void setColor(const QString &value); + QString GetColor() const; + void SetColor(const QString &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); void PointChanged(int row); diff --git a/src/app/dialogs/tools/dialogtool.cpp b/src/app/dialogs/tools/dialogtool.cpp index a37dc86d6..3a12c7f50 100644 --- a/src/app/dialogs/tools/dialogtool.cpp +++ b/src/app/dialogs/tools/dialogtool.cpp @@ -346,12 +346,7 @@ void DialogTool::FillComboBoxLineColors(QComboBox *box) const } //--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getTypeLine return type of line - * @param box combobox - * @return type - */ -QString DialogTool::GetTypeLine(const QComboBox *box) const +QString DialogTool::GetComboBoxCurrentData(const QComboBox *box) const { SCASSERT(box != nullptr) QString value = box->currentData().toString(); @@ -362,18 +357,6 @@ QString DialogTool::GetTypeLine(const QComboBox *box) const return value; } -//--------------------------------------------------------------------------------------------------------------------- -QString DialogTool::GetLineColor(const QComboBox *box) const -{ - SCASSERT(box != nullptr) - QString value = box->currentData().toString(); - if (value.isEmpty()) - { - value = VAbstractTool::ColorBlack; - } - return value; -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief ChangeCurrentData select item in combobox by id diff --git a/src/app/dialogs/tools/dialogtool.h b/src/app/dialogs/tools/dialogtool.h index 8b2bdd757..8cd7cece1 100644 --- a/src/app/dialogs/tools/dialogtool.h +++ b/src/app/dialogs/tools/dialogtool.h @@ -225,8 +225,7 @@ protected: void FillComboBoxLineColors(QComboBox *box)const; virtual void CheckState(); - QString GetTypeLine(const QComboBox *box)const; - QString GetLineColor(const QComboBox *box)const; + QString GetComboBoxCurrentData(const QComboBox *box)const; template void ShowVariable(const QMap var); void ChangeCurrentData(QComboBox *box, const QVariant &value) const; diff --git a/src/app/dialogs/tools/dialogtriangle.cpp b/src/app/dialogs/tools/dialogtriangle.cpp index e5555ef2a..ce88a6b80 100644 --- a/src/app/dialogs/tools/dialogtriangle.cpp +++ b/src/app/dialogs/tools/dialogtriangle.cpp @@ -161,10 +161,10 @@ void DialogTriangle::SaveData() { pointName = ui->lineEditNamePoint->text(); - line->setPoint1Id(getAxisP1Id()); - line->setPoint2Id(getAxisP2Id()); - line->setHypotenuseP1Id(getFirstPointId()); - line->setHypotenuseP2Id(getSecondPointId()); + line->setPoint1Id(GetAxisP1Id()); + line->setPoint2Id(GetAxisP2Id()); + line->setHypotenuseP1Id(GetFirstPointId()); + line->setHypotenuseP2Id(GetSecondPointId()); line->RefreshGeometry(); } @@ -218,10 +218,10 @@ void DialogTriangle::ShowVisualization() //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setPointName set name of point + * @brief SetPointName set name of point * @param value name */ -void DialogTriangle::setPointName(const QString &value) +void DialogTriangle::SetPointName(const QString &value) { pointName = value; ui->lineEditNamePoint->setText(pointName); @@ -229,10 +229,10 @@ void DialogTriangle::setPointName(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setSecondPointId set id of second point + * @brief SetSecondPointId set id of second point * @param value id */ -void DialogTriangle::setSecondPointId(const quint32 &value) +void DialogTriangle::SetSecondPointId(const quint32 &value) { setCurrentPointId(ui->comboBoxSecondPoint, value); line->setHypotenuseP2Id(value); @@ -240,10 +240,10 @@ void DialogTriangle::setSecondPointId(const quint32 &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setFirstPointId set id of first point + * @brief SetFirstPointId set id of first point * @param value id */ -void DialogTriangle::setFirstPointId(const quint32 &value) +void DialogTriangle::SetFirstPointId(const quint32 &value) { setCurrentPointId(ui->comboBoxFirstPoint, value); line->setHypotenuseP1Id(value); @@ -251,10 +251,10 @@ void DialogTriangle::setFirstPointId(const quint32 &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setAxisP2Id set id second point of axis + * @brief SetAxisP2Id set id second point of axis * @param value id */ -void DialogTriangle::setAxisP2Id(const quint32 &value) +void DialogTriangle::SetAxisP2Id(const quint32 &value) { setCurrentPointId(ui->comboBoxAxisP2, value); line->setPoint2Id(value); @@ -262,10 +262,10 @@ void DialogTriangle::setAxisP2Id(const quint32 &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setAxisP1Id set id first point of axis + * @brief SetAxisP1Id set id first point of axis * @param value id */ -void DialogTriangle::setAxisP1Id(const quint32 &value) +void DialogTriangle::SetAxisP1Id(const quint32 &value) { setCurrentPointId(ui->comboBoxAxisP1, value); line->setPoint1Id(value); @@ -273,40 +273,40 @@ void DialogTriangle::setAxisP1Id(const quint32 &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getAxisP1Id return id first point of axis + * @brief GetAxisP1Id return id first point of axis * @return id */ -quint32 DialogTriangle::getAxisP1Id() const +quint32 DialogTriangle::GetAxisP1Id() const { return getCurrentObjectId(ui->comboBoxAxisP1); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getAxisP2Id return id second point of axis + * @brief GetAxisP2Id return id second point of axis * @return id */ -quint32 DialogTriangle::getAxisP2Id() const +quint32 DialogTriangle::GetAxisP2Id() const { return getCurrentObjectId(ui->comboBoxAxisP2); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getFirstPointId return id of first point + * @brief GetFirstPointId return id of first point * @return id */ -quint32 DialogTriangle::getFirstPointId() const +quint32 DialogTriangle::GetFirstPointId() const { return getCurrentObjectId(ui->comboBoxFirstPoint); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getSecondPointId return id of second point + * @brief GetSecondPointId return id of second point * @return id */ -quint32 DialogTriangle::getSecondPointId() const +quint32 DialogTriangle::GetSecondPointId() const { return getCurrentObjectId(ui->comboBoxSecondPoint); } diff --git a/src/app/dialogs/tools/dialogtriangle.h b/src/app/dialogs/tools/dialogtriangle.h index 22774a7a0..e4d3d3236 100644 --- a/src/app/dialogs/tools/dialogtriangle.h +++ b/src/app/dialogs/tools/dialogtriangle.h @@ -48,19 +48,19 @@ public: DialogTriangle(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogTriangle(); - quint32 getAxisP1Id() const; - void setAxisP1Id(const quint32 &value); + quint32 GetAxisP1Id() const; + void SetAxisP1Id(const quint32 &value); - quint32 getAxisP2Id() const; - void setAxisP2Id(const quint32 &value); + quint32 GetAxisP2Id() const; + void SetAxisP2Id(const quint32 &value); - quint32 getFirstPointId() const; - void setFirstPointId(const quint32 &value); + quint32 GetFirstPointId() const; + void SetFirstPointId(const quint32 &value); - quint32 getSecondPointId() const; - void setSecondPointId(const quint32 &value); + quint32 GetSecondPointId() const; + void SetSecondPointId(const quint32 &value); - void setPointName(const QString &value); + void SetPointName(const QString &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); virtual void PointNameChanged(); diff --git a/src/app/geometry/varc.cpp b/src/app/geometry/varc.cpp index 2f9c434b8..c407012a3 100644 --- a/src/app/geometry/varc.cpp +++ b/src/app/geometry/varc.cpp @@ -255,7 +255,7 @@ QString VArc::GetFormulaF1() const //--------------------------------------------------------------------------------------------------------------------- void VArc::SetFormulaF1(const VFormula &value) { - d->formulaF1 = value.getFormula(FormulaType::FromUser); + d->formulaF1 = value.GetFormula(FormulaType::FromUser); d->f1 = value.getDoubleValue(); } @@ -282,7 +282,7 @@ QString VArc::GetFormulaF2() const //--------------------------------------------------------------------------------------------------------------------- void VArc::SetFormulaF2(const VFormula &value) { - d->formulaF2 = value.getFormula(FormulaType::FromUser); + d->formulaF2 = value.GetFormula(FormulaType::FromUser); d->f2 = value.getDoubleValue(); } @@ -309,7 +309,7 @@ QString VArc::GetFormulaRadius() const //--------------------------------------------------------------------------------------------------------------------- void VArc::SetFormulaRadius(const VFormula &value) { - d->formulaRadius = value.getFormula(FormulaType::FromUser); + d->formulaRadius = value.GetFormula(FormulaType::FromUser); d->radius = value.getDoubleValue(); } diff --git a/src/app/geometry/vsplinepath.cpp b/src/app/geometry/vsplinepath.cpp index 832b313d2..068c910cb 100644 --- a/src/app/geometry/vsplinepath.cpp +++ b/src/app/geometry/vsplinepath.cpp @@ -255,13 +255,13 @@ void VSplinePath::Clear() } //--------------------------------------------------------------------------------------------------------------------- -qreal VSplinePath::getKCurve() const +qreal VSplinePath::GetKCurve() const { return d->kCurve; } //--------------------------------------------------------------------------------------------------------------------- -void VSplinePath::setKCurve(const qreal &value) +void VSplinePath::SetKCurve(const qreal &value) { if (value > 0) { diff --git a/src/app/geometry/vsplinepath.h b/src/app/geometry/vsplinepath.h index e562be232..b3de10941 100644 --- a/src/app/geometry/vsplinepath.h +++ b/src/app/geometry/vsplinepath.h @@ -118,15 +118,15 @@ public: */ void Clear(); /** - * @brief getKCurve return coefficient of curvature spline path. + * @brief GetKCurve return coefficient of curvature spline path. * @return coefficient of curvature spline. */ - qreal getKCurve() const; + qreal GetKCurve() const; /** - * @brief setKCurve set coefficient of curvature spline path. + * @brief SetKCurve set coefficient of curvature spline path. * @param value coefficient of curvature spline path. */ - void setKCurve(const qreal &value); + void SetKCurve(const qreal &value); /** * @brief GetPoint pointer to list spline point. * @return list. @@ -160,8 +160,8 @@ public: * * VSplinePoint splP1 = splPath->at(p1); * VSplinePoint splP2 = splPath->at(p2); - * VSpline spl1 = VSpline(splP1.P(), spl1p2, spl1p3, *p, splPath->getKCurve()); - * VSpline spl2 = VSpline(*p, spl2p2, spl2p3, splP2.P(), splPath->getKCurve()); + * VSpline spl1 = VSpline(splP1.P(), spl1p2, spl1p3, *p, splPath->GetKCurve()); + * VSpline spl2 = VSpline(*p, spl2p2, spl2p3, splP2.P(), splPath->GetKCurve()); * @param length length first spline path. * @param p1 index first spline point in list. * @param p2 index second spline point in list. diff --git a/src/app/tools/drawTools/vdrawtool.cpp b/src/app/tools/drawTools/vdrawtool.cpp index 0902db7ba..1f3989b77 100644 --- a/src/app/tools/drawTools/vdrawtool.cpp +++ b/src/app/tools/drawTools/vdrawtool.cpp @@ -241,10 +241,10 @@ qreal VDrawTool::CheckFormula(const quint32 &toolId, QString &formula, VContaine { DialogEditWrongFormula *dialog = new DialogEditWrongFormula(data, toolId, qApp->getMainWindow()); dialog->setWindowTitle(tr("Edit wrong formula")); - dialog->setFormula(formula); + dialog->SetFormula(formula); if (dialog->exec() == QDialog::Accepted) { - formula = dialog->getFormula(); + formula = dialog->GetFormula(); /* Need delete dialog here because parser in dialog don't allow use correct separator for parsing * here. */ delete dialog; diff --git a/src/app/tools/drawTools/vtoolalongline.cpp b/src/app/tools/drawTools/vtoolalongline.cpp index 442e8d69a..ec04e8c46 100644 --- a/src/app/tools/drawTools/vtoolalongline.cpp +++ b/src/app/tools/drawTools/vtoolalongline.cpp @@ -144,10 +144,10 @@ void VToolAlongLine::SaveDialog(QDomElement &domElement) DialogAlongLine *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); - doc->SetAttribute(domElement, AttrTypeLine, dialogTool->getTypeLine()); - doc->SetAttribute(domElement, AttrLength, dialogTool->getFormula()); - doc->SetAttribute(domElement, AttrFirstPoint, dialogTool->getFirstPointId()); - doc->SetAttribute(domElement, AttrSecondPoint, dialogTool->getSecondPointId()); + doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine()); + doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula()); + doc->SetAttribute(domElement, AttrFirstPoint, dialogTool->GetFirstPointId()); + doc->SetAttribute(domElement, AttrSecondPoint, dialogTool->GetSecondPointId()); } //--------------------------------------------------------------------------------------------------------------------- @@ -169,13 +169,13 @@ void VToolAlongLine::SaveOptions(QDomElement &tag, QSharedPointer &obj } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolAlongLine::getSecondPointId() const +quint32 VToolAlongLine::GetSecondPointId() const { return secondPointId; } //--------------------------------------------------------------------------------------------------------------------- -void VToolAlongLine::setSecondPointId(const quint32 &value) +void VToolAlongLine::SetSecondPointId(const quint32 &value) { if (value != NULL_ID) { @@ -231,11 +231,11 @@ void VToolAlongLine::setDialog() DialogAlongLine *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QSharedPointer p = VAbstractTool::data.GeometricObject(id); - dialogTool->setTypeLine(typeLine); - dialogTool->setFormula(formulaLength); - dialogTool->setFirstPointId(basePointId); - dialogTool->setSecondPointId(secondPointId); - dialogTool->setPointName(p->name()); + dialogTool->SetTypeLine(typeLine); + dialogTool->SetFormula(formulaLength); + dialogTool->SetFirstPointId(basePointId); + dialogTool->SetSecondPointId(secondPointId); + dialogTool->SetPointName(p->name()); } //--------------------------------------------------------------------------------------------------------------------- @@ -251,10 +251,10 @@ VToolAlongLine* VToolAlongLine::Create(DialogTool *dialog, VMainGraphicsScene *s SCASSERT(dialog != nullptr); DialogAlongLine *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); - QString formula = dialogTool->getFormula(); - const quint32 firstPointId = dialogTool->getFirstPointId(); - const quint32 secondPointId = dialogTool->getSecondPointId(); - const QString typeLine = dialogTool->getTypeLine(); + QString formula = dialogTool->GetFormula(); + const quint32 firstPointId = dialogTool->GetFirstPointId(); + const quint32 secondPointId = dialogTool->GetSecondPointId(); + const QString typeLine = dialogTool->GetTypeLine(); const QString pointName = dialogTool->getPointName(); VToolAlongLine *point=nullptr; point = Create(0, pointName, typeLine, formula, firstPointId, secondPointId, 5, 10, scene, doc, data, diff --git a/src/app/tools/drawTools/vtoolalongline.h b/src/app/tools/drawTools/vtoolalongline.h index 09b44ef31..f83355a94 100644 --- a/src/app/tools/drawTools/vtoolalongline.h +++ b/src/app/tools/drawTools/vtoolalongline.h @@ -52,8 +52,8 @@ public: virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::AlongLine)}; - quint32 getSecondPointId() const; - void setSecondPointId(const quint32 &value); + quint32 GetSecondPointId() const; + void SetSecondPointId(const quint32 &value); virtual void ShowVisualization(bool show); public slots: virtual void FullUpdateFromFile(); diff --git a/src/app/tools/drawTools/vtoolarc.cpp b/src/app/tools/drawTools/vtoolarc.cpp index 5e245d2e3..2e5b2eada 100644 --- a/src/app/tools/drawTools/vtoolarc.cpp +++ b/src/app/tools/drawTools/vtoolarc.cpp @@ -197,7 +197,7 @@ void VToolArc::setCenter(const quint32 &value) } //--------------------------------------------------------------------------------------------------------------------- -VFormula VToolArc::getFormulaRadius() const +VFormula VToolArc::GetFormulaRadius() const { QSharedPointer arc = VAbstractTool::data.GeometricObject(id); SCASSERT(arc.isNull() == false); @@ -210,7 +210,7 @@ VFormula VToolArc::getFormulaRadius() const } //--------------------------------------------------------------------------------------------------------------------- -void VToolArc::setFormulaRadius(const VFormula &value) +void VToolArc::SetFormulaRadius(const VFormula &value) { if (value.error() == false) { @@ -225,7 +225,7 @@ void VToolArc::setFormulaRadius(const VFormula &value) } //--------------------------------------------------------------------------------------------------------------------- -VFormula VToolArc::getFormulaF1() const +VFormula VToolArc::GetFormulaF1() const { QSharedPointer arc = VAbstractTool::data.GeometricObject(id); SCASSERT(arc.isNull() == false); @@ -238,7 +238,7 @@ VFormula VToolArc::getFormulaF1() const } //--------------------------------------------------------------------------------------------------------------------- -void VToolArc::setFormulaF1(const VFormula &value) +void VToolArc::SetFormulaF1(const VFormula &value) { if (value.error() == false) { @@ -254,7 +254,7 @@ void VToolArc::setFormulaF1(const VFormula &value) } //--------------------------------------------------------------------------------------------------------------------- -VFormula VToolArc::getFormulaF2() const +VFormula VToolArc::GetFormulaF2() const { QSharedPointer arc = VAbstractTool::data.GeometricObject(id); SCASSERT(arc.isNull() == false); @@ -267,7 +267,7 @@ VFormula VToolArc::getFormulaF2() const } //--------------------------------------------------------------------------------------------------------------------- -void VToolArc::setFormulaF2(const VFormula &value) +void VToolArc::SetFormulaF2(const VFormula &value) { if (value.error() == false) { diff --git a/src/app/tools/drawTools/vtoolarc.h b/src/app/tools/drawTools/vtoolarc.h index b8264694b..d142b06b6 100644 --- a/src/app/tools/drawTools/vtoolarc.h +++ b/src/app/tools/drawTools/vtoolarc.h @@ -55,14 +55,14 @@ public: quint32 getCenter() const; void setCenter(const quint32 &value); - VFormula getFormulaRadius() const; - void setFormulaRadius(const VFormula &value); + VFormula GetFormulaRadius() const; + void SetFormulaRadius(const VFormula &value); - VFormula getFormulaF1() const; - void setFormulaF1(const VFormula &value); + VFormula GetFormulaF1() const; + void SetFormulaF1(const VFormula &value); - VFormula getFormulaF2() const; - void setFormulaF2(const VFormula &value); + VFormula GetFormulaF2() const; + void SetFormulaF2(const VFormula &value); virtual void ShowVisualization(bool show); protected: diff --git a/src/app/tools/drawTools/vtoolbisector.cpp b/src/app/tools/drawTools/vtoolbisector.cpp index 96b42eadc..0052b60af 100644 --- a/src/app/tools/drawTools/vtoolbisector.cpp +++ b/src/app/tools/drawTools/vtoolbisector.cpp @@ -112,12 +112,12 @@ void VToolBisector::setDialog() DialogBisector *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QSharedPointer p = VAbstractTool::data.GeometricObject(id); - dialogTool->setTypeLine(typeLine); - dialogTool->setFormula(formulaLength); - dialogTool->setFirstPointId(firstPointId); - dialogTool->setSecondPointId(basePointId); - dialogTool->setThirdPointId(thirdPointId); - dialogTool->setPointName(p->name()); + dialogTool->SetTypeLine(typeLine); + dialogTool->SetFormula(formulaLength); + dialogTool->SetFirstPointId(firstPointId); + dialogTool->SetSecondPointId(basePointId); + dialogTool->SetThirdPointId(thirdPointId); + dialogTool->SetPointName(p->name()); } //--------------------------------------------------------------------------------------------------------------------- @@ -134,11 +134,11 @@ VToolBisector* VToolBisector::Create(DialogTool *dialog, VMainGraphicsScene *sce SCASSERT(dialog != nullptr); DialogBisector *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); - QString formula = dialogTool->getFormula(); - const quint32 firstPointId = dialogTool->getFirstPointId(); - const quint32 secondPointId = dialogTool->getSecondPointId(); - const quint32 thirdPointId = dialogTool->getThirdPointId(); - const QString typeLine = dialogTool->getTypeLine(); + QString formula = dialogTool->GetFormula(); + const quint32 firstPointId = dialogTool->GetFirstPointId(); + const quint32 secondPointId = dialogTool->GetSecondPointId(); + const quint32 thirdPointId = dialogTool->GetThirdPointId(); + const QString typeLine = dialogTool->GetTypeLine(); const QString pointName = dialogTool->getPointName(); VToolBisector *point = nullptr; point=Create(0, formula, firstPointId, secondPointId, thirdPointId, typeLine, pointName, 5, 10, scene, doc, data, @@ -296,11 +296,11 @@ void VToolBisector::SaveDialog(QDomElement &domElement) DialogBisector *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); - doc->SetAttribute(domElement, AttrTypeLine, dialogTool->getTypeLine()); - doc->SetAttribute(domElement, AttrLength, dialogTool->getFormula()); - doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->getFirstPointId())); - doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->getSecondPointId())); - doc->SetAttribute(domElement, AttrThirdPoint, QString().setNum(dialogTool->getThirdPointId())); + doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine()); + doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula()); + doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->GetFirstPointId())); + doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->GetSecondPointId())); + doc->SetAttribute(domElement, AttrThirdPoint, QString().setNum(dialogTool->GetThirdPointId())); } //--------------------------------------------------------------------------------------------------------------------- @@ -323,13 +323,13 @@ void VToolBisector::SaveOptions(QDomElement &tag, QSharedPointer &obj) } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolBisector::getThirdPointId() const +quint32 VToolBisector::GetThirdPointId() const { return thirdPointId; } //--------------------------------------------------------------------------------------------------------------------- -void VToolBisector::setThirdPointId(const quint32 &value) +void VToolBisector::SetThirdPointId(const quint32 &value) { if (value != NULL_ID) { @@ -377,13 +377,13 @@ void VToolBisector::ShowVisualization(bool show) } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolBisector::getFirstPointId() const +quint32 VToolBisector::GetFirstPointId() const { return firstPointId; } //--------------------------------------------------------------------------------------------------------------------- -void VToolBisector::setFirstPointId(const quint32 &value) +void VToolBisector::SetFirstPointId(const quint32 &value) { if (value != NULL_ID) { diff --git a/src/app/tools/drawTools/vtoolbisector.h b/src/app/tools/drawTools/vtoolbisector.h index 42ac58091..93aa64302 100644 --- a/src/app/tools/drawTools/vtoolbisector.h +++ b/src/app/tools/drawTools/vtoolbisector.h @@ -56,11 +56,11 @@ public: virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::Bisector)}; - quint32 getFirstPointId() const; - void setFirstPointId(const quint32 &value); + quint32 GetFirstPointId() const; + void SetFirstPointId(const quint32 &value); - quint32 getThirdPointId() const; - void setThirdPointId(const quint32 &value); + quint32 GetThirdPointId() const; + void SetThirdPointId(const quint32 &value); virtual void ShowVisualization(bool show); public slots: diff --git a/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp b/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp index 3aa46c33f..a33b1bca7 100644 --- a/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp +++ b/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp @@ -66,11 +66,11 @@ void VToolCurveIntersectAxis::setDialog() DialogCurveIntersectAxis *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QSharedPointer p = VAbstractTool::data.GeometricObject(id); - dialogTool->setTypeLine(typeLine); - dialogTool->setAngle(formulaAngle); - dialogTool->setBasePointId(basePointId); + dialogTool->SetTypeLine(typeLine); + dialogTool->SetAngle(formulaAngle); + dialogTool->SetBasePointId(basePointId); dialogTool->setCurveId(curveId); - dialogTool->setPointName(p->name()); + dialogTool->SetPointName(p->name()); } //--------------------------------------------------------------------------------------------------------------------- @@ -81,9 +81,9 @@ VToolCurveIntersectAxis *VToolCurveIntersectAxis::Create(DialogTool *dialog, VMa DialogCurveIntersectAxis *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool); const QString pointName = dialogTool->getPointName(); - const QString typeLine = dialogTool->getTypeLine(); - QString formulaAngle = dialogTool->getAngle(); - const quint32 basePointId = dialogTool->getBasePointId(); + const QString typeLine = dialogTool->GetTypeLine(); + QString formulaAngle = dialogTool->GetAngle(); + const quint32 basePointId = dialogTool->GetBasePointId(); const quint32 curveId = dialogTool->getCurveId(); VToolCurveIntersectAxis *point = nullptr; @@ -173,7 +173,7 @@ QPointF VToolCurveIntersectAxis::FindPoint(const QPointF &point, qreal angle, } //--------------------------------------------------------------------------------------------------------------------- -VFormula VToolCurveIntersectAxis::getFormulaAngle() const +VFormula VToolCurveIntersectAxis::GetFormulaAngle() const { VFormula fAngle(formulaAngle, getData()); fAngle.setCheckZero(false); @@ -183,11 +183,11 @@ VFormula VToolCurveIntersectAxis::getFormulaAngle() const } //--------------------------------------------------------------------------------------------------------------------- -void VToolCurveIntersectAxis::setFormulaAngle(const VFormula &value) +void VToolCurveIntersectAxis::SetFormulaAngle(const VFormula &value) { if (value.error() == false) { - formulaAngle = value.getFormula(FormulaType::FromUser); + formulaAngle = value.GetFormula(FormulaType::FromUser); QSharedPointer obj = VAbstractTool::data.GetGObject(id); SaveOption(obj); @@ -226,7 +226,7 @@ void VToolCurveIntersectAxis::ShowVisualization(bool show) visual->setPoint1Id(curveId); visual->setAxisPointId(basePointId); - visual->setAngle(qApp->FormulaToUser(formulaAngle)); + visual->SetAngle(qApp->FormulaToUser(formulaAngle)); visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); vis = visual; @@ -265,7 +265,7 @@ void VToolCurveIntersectAxis::FullUpdateFromFile() VisToolCurveIntersectAxis *visual = qobject_cast(vis); visual->setPoint1Id(curveId); visual->setAxisPointId(basePointId); - visual->setAngle(qApp->FormulaToUser(formulaAngle)); + visual->SetAngle(qApp->FormulaToUser(formulaAngle)); visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); } @@ -290,9 +290,9 @@ void VToolCurveIntersectAxis::SaveDialog(QDomElement &domElement) DialogCurveIntersectAxis *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); - doc->SetAttribute(domElement, AttrTypeLine, dialogTool->getTypeLine()); - doc->SetAttribute(domElement, AttrAngle, dialogTool->getAngle()); - doc->SetAttribute(domElement, AttrBasePoint, QString().setNum(dialogTool->getBasePointId())); + doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine()); + doc->SetAttribute(domElement, AttrAngle, dialogTool->GetAngle()); + doc->SetAttribute(domElement, AttrBasePoint, QString().setNum(dialogTool->GetBasePointId())); doc->SetAttribute(domElement, AttrCurve, QString().setNum(dialogTool->getCurveId())); } diff --git a/src/app/tools/drawTools/vtoolcurveintersectaxis.h b/src/app/tools/drawTools/vtoolcurveintersectaxis.h index fedd78c8b..bf583f3f5 100644 --- a/src/app/tools/drawTools/vtoolcurveintersectaxis.h +++ b/src/app/tools/drawTools/vtoolcurveintersectaxis.h @@ -54,8 +54,8 @@ public: virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::CurveIntersectAxis)}; - VFormula getFormulaAngle() const; - void setFormulaAngle(const VFormula &value); + VFormula GetFormulaAngle() const; + void SetFormulaAngle(const VFormula &value); quint32 getCurveId() const; void setCurveId(const quint32 &value); diff --git a/src/app/tools/drawTools/vtoolcut.cpp b/src/app/tools/drawTools/vtoolcut.cpp index ff2365dcd..606bbb09f 100644 --- a/src/app/tools/drawTools/vtoolcut.cpp +++ b/src/app/tools/drawTools/vtoolcut.cpp @@ -94,7 +94,7 @@ void VToolCut::setCurveCutId(const quint32 &value) } //--------------------------------------------------------------------------------------------------------------------- -VFormula VToolCut::getFormula() const +VFormula VToolCut::GetFormula() const { VFormula val(formula, getData()); val.setCheckZero(true); @@ -104,11 +104,11 @@ VFormula VToolCut::getFormula() const } //--------------------------------------------------------------------------------------------------------------------- -void VToolCut::setFormula(const VFormula &value) +void VToolCut::SetFormula(const VFormula &value) { if (value.error() == false) { - formula = value.getFormula(FormulaType::FromUser); + formula = value.GetFormula(FormulaType::FromUser); QSharedPointer obj = VAbstractTool::data.GetGObject(id); SaveOption(obj); diff --git a/src/app/tools/drawTools/vtoolcut.h b/src/app/tools/drawTools/vtoolcut.h index f99e82847..3ec1a1544 100644 --- a/src/app/tools/drawTools/vtoolcut.h +++ b/src/app/tools/drawTools/vtoolcut.h @@ -43,8 +43,8 @@ public: virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::Cut)}; - VFormula getFormula() const; - void setFormula(const VFormula &value); + VFormula GetFormula() const; + void SetFormula(const VFormula &value); quint32 getCurveCutId() const; void setCurveCutId(const quint32 &value); diff --git a/src/app/tools/drawTools/vtoolcutarc.cpp b/src/app/tools/drawTools/vtoolcutarc.cpp index 1bdb9d222..7e5f4a6e8 100644 --- a/src/app/tools/drawTools/vtoolcutarc.cpp +++ b/src/app/tools/drawTools/vtoolcutarc.cpp @@ -77,9 +77,9 @@ void VToolCutArc::setDialog() DialogCutArc *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QSharedPointer point = VAbstractTool::data.GeometricObject(id); - dialogTool->setFormula(formula); + dialogTool->SetFormula(formula); dialogTool->setArcId(curveCutId); - dialogTool->setPointName(point->name()); + dialogTool->SetPointName(point->name()); } //--------------------------------------------------------------------------------------------------------------------- @@ -96,7 +96,7 @@ VToolCutArc* VToolCutArc::Create(DialogTool *dialog, VMainGraphicsScene *scene, DialogCutArc *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QString pointName = dialogTool->getPointName(); - QString formula = dialogTool->getFormula(); + QString formula = dialogTool->GetFormula(); const quint32 arcId = dialogTool->getArcId(); VToolCutArc* point = nullptr; point=Create(0, pointName, formula, arcId, 5, 10, scene, doc, data, Document::FullParse, Source::FromGui); @@ -271,7 +271,7 @@ void VToolCutArc::SaveDialog(QDomElement &domElement) DialogCutArc *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); - doc->SetAttribute(domElement, AttrLength, dialogTool->getFormula()); + doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula()); doc->SetAttribute(domElement, AttrArc, QString().setNum(dialogTool->getArcId())); } diff --git a/src/app/tools/drawTools/vtoolcutspline.cpp b/src/app/tools/drawTools/vtoolcutspline.cpp index eed9eba7a..a86dafc33 100644 --- a/src/app/tools/drawTools/vtoolcutspline.cpp +++ b/src/app/tools/drawTools/vtoolcutspline.cpp @@ -76,9 +76,9 @@ void VToolCutSpline::setDialog() DialogCutSpline *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QSharedPointer point = VAbstractTool::data.GeometricObject(id); - dialogTool->setFormula(formula); + dialogTool->SetFormula(formula); dialogTool->setSplineId(curveCutId); - dialogTool->setPointName(point->name()); + dialogTool->SetPointName(point->name()); } //--------------------------------------------------------------------------------------------------------------------- @@ -96,7 +96,7 @@ VToolCutSpline* VToolCutSpline::Create(DialogTool *dialog, VMainGraphicsScene *s DialogCutSpline *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QString pointName = dialogTool->getPointName(); - QString formula = dialogTool->getFormula(); + QString formula = dialogTool->GetFormula(); const quint32 splineId = dialogTool->getSplineId(); VToolCutSpline* point = nullptr; point = Create(0, pointName, formula, splineId, 5, 10, scene, doc, data, Document::FullParse, Source::FromGui); @@ -282,7 +282,7 @@ void VToolCutSpline::SaveDialog(QDomElement &domElement) DialogCutSpline *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); - doc->SetAttribute(domElement, AttrLength, dialogTool->getFormula()); + doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula()); doc->SetAttribute(domElement, AttrSpline, QString().setNum(dialogTool->getSplineId())); } diff --git a/src/app/tools/drawTools/vtoolcutsplinepath.cpp b/src/app/tools/drawTools/vtoolcutsplinepath.cpp index 92678b185..dc088e998 100644 --- a/src/app/tools/drawTools/vtoolcutsplinepath.cpp +++ b/src/app/tools/drawTools/vtoolcutsplinepath.cpp @@ -80,9 +80,9 @@ void VToolCutSplinePath::setDialog() DialogCutSplinePath *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QSharedPointer point = VAbstractTool::data.GeometricObject(id); - dialogTool->setFormula(formula); + dialogTool->SetFormula(formula); dialogTool->setSplinePathId(curveCutId); - dialogTool->setPointName(point->name()); + dialogTool->SetPointName(point->name()); } //--------------------------------------------------------------------------------------------------------------------- @@ -100,7 +100,7 @@ VToolCutSplinePath* VToolCutSplinePath::Create(DialogTool *dialog, VMainGraphics DialogCutSplinePath *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QString pointName = dialogTool->getPointName(); - QString formula = dialogTool->getFormula(); + QString formula = dialogTool->GetFormula(); const quint32 splinePathId = dialogTool->getSplinePathId(); VToolCutSplinePath* point = nullptr; point = Create(0, pointName, formula, splinePathId, 5, 10, scene, doc, data, Document::FullParse, Source::FromGui); @@ -156,8 +156,8 @@ VToolCutSplinePath* VToolCutSplinePath::Create(const quint32 _id, const QString VSplinePoint splP1 = splPath->at(p1); VSplinePoint splP2 = splPath->at(p2); - const VSpline spl1 = VSpline(splP1.P(), spl1p2, spl1p3, *p, splPath->getKCurve()); - const VSpline spl2 = VSpline(*p, spl2p2, spl2p3, splP2.P(), splPath->getKCurve()); + const VSpline spl1 = VSpline(splP1.P(), spl1p2, spl1p3, *p, splPath->GetKCurve()); + const VSpline spl2 = VSpline(*p, spl2p2, spl2p3, splP2.P(), splPath->GetKCurve()); VSplinePath *splPath1 = new VSplinePath(); VSplinePath *splPath2 = new VSplinePath(); @@ -191,8 +191,8 @@ VToolCutSplinePath* VToolCutSplinePath::Create(const quint32 _id, const QString splPath2->append(splPath->at(i)); } } - splPath1->setKCurve(splPath->getKCurve()); - splPath2->setKCurve(splPath->getKCurve()); + splPath1->SetKCurve(splPath->GetKCurve()); + splPath2->SetKCurve(splPath->GetKCurve()); splPath1->setMaxCountPoints(splPath->CountPoint()); splPath2->setMaxCountPoints(splPath->CountPoint()); @@ -331,7 +331,7 @@ void VToolCutSplinePath::SaveDialog(QDomElement &domElement) DialogCutSplinePath *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); - doc->SetAttribute(domElement, AttrLength, dialogTool->getFormula()); + doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula()); doc->SetAttribute(domElement, AttrSplinePath, QString().setNum(dialogTool->getSplinePathId())); } diff --git a/src/app/tools/drawTools/vtoolendline.cpp b/src/app/tools/drawTools/vtoolendline.cpp index 3bc0fc2f8..6476e145d 100644 --- a/src/app/tools/drawTools/vtoolendline.cpp +++ b/src/app/tools/drawTools/vtoolendline.cpp @@ -79,11 +79,11 @@ void VToolEndLine::setDialog() DialogEndLine *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QSharedPointer p = VAbstractTool::data.GeometricObject(id); - dialogTool->setTypeLine(typeLine); - dialogTool->setFormula(formulaLength); - dialogTool->setAngle(formulaAngle); - dialogTool->setBasePointId(basePointId); - dialogTool->setPointName(p->name()); + dialogTool->SetTypeLine(typeLine); + dialogTool->SetFormula(formulaLength); + dialogTool->SetAngle(formulaAngle); + dialogTool->SetBasePointId(basePointId); + dialogTool->SetPointName(p->name()); } //--------------------------------------------------------------------------------------------------------------------- @@ -101,10 +101,10 @@ VToolEndLine* VToolEndLine::Create(DialogTool *dialog, VMainGraphicsScene *scene DialogEndLine *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool); const QString pointName = dialogTool->getPointName(); - const QString typeLine = dialogTool->getTypeLine(); - QString formulaLength = dialogTool->getFormula(); - QString formulaAngle = dialogTool->getAngle(); - const quint32 basePointId = dialogTool->getBasePointId(); + const QString typeLine = dialogTool->GetTypeLine(); + QString formulaLength = dialogTool->GetFormula(); + QString formulaAngle = dialogTool->GetAngle(); + const quint32 basePointId = dialogTool->GetBasePointId(); VToolEndLine *point = nullptr; point=Create(0, pointName, typeLine, formulaLength, formulaAngle, basePointId, 5, 10, scene, doc, data, @@ -196,7 +196,7 @@ void VToolEndLine::FullUpdateFromFile() VisToolEndLine *visual = qobject_cast(vis); visual->setPoint1Id(basePointId); visual->setLength(qApp->FormulaToUser(formulaLength)); - visual->setAngle(qApp->FormulaToUser(formulaAngle)); + visual->SetAngle(qApp->FormulaToUser(formulaAngle)); visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); } @@ -232,10 +232,10 @@ void VToolEndLine::SaveDialog(QDomElement &domElement) DialogEndLine *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); - doc->SetAttribute(domElement, AttrTypeLine, dialogTool->getTypeLine()); - doc->SetAttribute(domElement, AttrLength, dialogTool->getFormula()); - doc->SetAttribute(domElement, AttrAngle, dialogTool->getAngle()); - doc->SetAttribute(domElement, AttrBasePoint, QString().setNum(dialogTool->getBasePointId())); + doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine()); + doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula()); + doc->SetAttribute(domElement, AttrAngle, dialogTool->GetAngle()); + doc->SetAttribute(domElement, AttrBasePoint, QString().setNum(dialogTool->GetBasePointId())); } //--------------------------------------------------------------------------------------------------------------------- @@ -257,7 +257,7 @@ void VToolEndLine::SaveOptions(QDomElement &tag, QSharedPointer &obj) } //--------------------------------------------------------------------------------------------------------------------- -VFormula VToolEndLine::getFormulaAngle() const +VFormula VToolEndLine::GetFormulaAngle() const { VFormula fAngle(formulaAngle, getData()); fAngle.setCheckZero(false); @@ -267,11 +267,11 @@ VFormula VToolEndLine::getFormulaAngle() const } //--------------------------------------------------------------------------------------------------------------------- -void VToolEndLine::setFormulaAngle(const VFormula &value) +void VToolEndLine::SetFormulaAngle(const VFormula &value) { if (value.error() == false) { - formulaAngle = value.getFormula(FormulaType::FromUser); + formulaAngle = value.GetFormula(FormulaType::FromUser); QSharedPointer obj = VAbstractTool::data.GetGObject(id); SaveOption(obj); @@ -292,7 +292,7 @@ void VToolEndLine::ShowVisualization(bool show) visual->setPoint1Id(basePointId); visual->setLength(qApp->FormulaToUser(formulaLength)); - visual->setAngle(qApp->FormulaToUser(formulaAngle)); + visual->SetAngle(qApp->FormulaToUser(formulaAngle)); visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); vis = visual; diff --git a/src/app/tools/drawTools/vtoolendline.h b/src/app/tools/drawTools/vtoolendline.h index b60014931..b92500f39 100644 --- a/src/app/tools/drawTools/vtoolendline.h +++ b/src/app/tools/drawTools/vtoolendline.h @@ -53,8 +53,8 @@ public: virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::EndLine)}; - VFormula getFormulaAngle() const; - void setFormulaAngle(const VFormula &value); + VFormula GetFormulaAngle() const; + void SetFormulaAngle(const VFormula &value); virtual void ShowVisualization(bool show); public slots: virtual void FullUpdateFromFile(); diff --git a/src/app/tools/drawTools/vtoolheight.cpp b/src/app/tools/drawTools/vtoolheight.cpp index fd878a4ee..6b3acfdab 100644 --- a/src/app/tools/drawTools/vtoolheight.cpp +++ b/src/app/tools/drawTools/vtoolheight.cpp @@ -72,11 +72,11 @@ void VToolHeight::setDialog() DialogHeight *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QSharedPointer p = VAbstractTool::data.GeometricObject(id); - dialogTool->setTypeLine(typeLine); - dialogTool->setBasePointId(basePointId); - dialogTool->setP1LineId(p1LineId); - dialogTool->setP2LineId(p2LineId); - dialogTool->setPointName(p->name()); + dialogTool->SetTypeLine(typeLine); + dialogTool->SetBasePointId(basePointId); + dialogTool->SetP1LineId(p1LineId); + dialogTool->SetP2LineId(p2LineId); + dialogTool->SetPointName(p->name()); } //--------------------------------------------------------------------------------------------------------------------- @@ -95,10 +95,10 @@ VToolHeight* VToolHeight::Create(DialogTool *dialog, VMainGraphicsScene *scene, SCASSERT(dialogTool != nullptr); disconnect(doc, &VPattern::FullUpdateFromFile, dialogTool, &DialogHeight::UpdateList); const QString pointName = dialogTool->getPointName(); - const QString typeLine = dialogTool->getTypeLine(); - const quint32 basePointId = dialogTool->getBasePointId(); - const quint32 p1LineId = dialogTool->getP1LineId(); - const quint32 p2LineId = dialogTool->getP2LineId(); + const QString typeLine = dialogTool->GetTypeLine(); + const quint32 basePointId = dialogTool->GetBasePointId(); + const quint32 p1LineId = dialogTool->GetP1LineId(); + const quint32 p2LineId = dialogTool->GetP2LineId(); VToolHeight *point = nullptr; point = Create(0, pointName, typeLine, basePointId, p1LineId, p2LineId, 5, 10, scene, doc, data, @@ -244,10 +244,10 @@ void VToolHeight::SaveDialog(QDomElement &domElement) DialogHeight *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); - doc->SetAttribute(domElement, AttrTypeLine, dialogTool->getTypeLine()); - doc->SetAttribute(domElement, AttrBasePoint, QString().setNum(dialogTool->getBasePointId())); - doc->SetAttribute(domElement, AttrP1Line, QString().setNum(dialogTool->getP1LineId())); - doc->SetAttribute(domElement, AttrP2Line, QString().setNum(dialogTool->getP2LineId())); + doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine()); + doc->SetAttribute(domElement, AttrBasePoint, QString().setNum(dialogTool->GetBasePointId())); + doc->SetAttribute(domElement, AttrP1Line, QString().setNum(dialogTool->GetP1LineId())); + doc->SetAttribute(domElement, AttrP2Line, QString().setNum(dialogTool->GetP2LineId())); } //--------------------------------------------------------------------------------------------------------------------- @@ -269,13 +269,13 @@ void VToolHeight::SaveOptions(QDomElement &tag, QSharedPointer &obj) } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolHeight::getP2LineId() const +quint32 VToolHeight::GetP2LineId() const { return p2LineId; } //--------------------------------------------------------------------------------------------------------------------- -void VToolHeight::setP2LineId(const quint32 &value) +void VToolHeight::SetP2LineId(const quint32 &value) { if (value != NULL_ID) { @@ -322,13 +322,13 @@ void VToolHeight::ShowVisualization(bool show) } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolHeight::getP1LineId() const +quint32 VToolHeight::GetP1LineId() const { return p1LineId; } //--------------------------------------------------------------------------------------------------------------------- -void VToolHeight::setP1LineId(const quint32 &value) +void VToolHeight::SetP1LineId(const quint32 &value) { if (value != NULL_ID) { diff --git a/src/app/tools/drawTools/vtoolheight.h b/src/app/tools/drawTools/vtoolheight.h index 79dcfe08f..9fc74299a 100644 --- a/src/app/tools/drawTools/vtoolheight.h +++ b/src/app/tools/drawTools/vtoolheight.h @@ -53,11 +53,11 @@ public: virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::Height)}; - quint32 getP1LineId() const; - void setP1LineId(const quint32 &value); + quint32 GetP1LineId() const; + void SetP1LineId(const quint32 &value); - quint32 getP2LineId() const; - void setP2LineId(const quint32 &value); + quint32 GetP2LineId() const; + void SetP2LineId(const quint32 &value); virtual void ShowVisualization(bool show); public slots: diff --git a/src/app/tools/drawTools/vtoolline.cpp b/src/app/tools/drawTools/vtoolline.cpp index a38daf2d5..618448867 100644 --- a/src/app/tools/drawTools/vtoolline.cpp +++ b/src/app/tools/drawTools/vtoolline.cpp @@ -82,9 +82,9 @@ void VToolLine::setDialog() SCASSERT(dialog != nullptr); DialogLine *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); - dialogTool->setFirstPoint(firstPoint); - dialogTool->setSecondPoint(secondPoint); - dialogTool->setTypeLine(typeLine); + dialogTool->SetFirstPoint(firstPoint); + dialogTool->SetSecondPoint(secondPoint); + dialogTool->SetTypeLine(typeLine); } //--------------------------------------------------------------------------------------------------------------------- @@ -100,9 +100,9 @@ VToolLine *VToolLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPat SCASSERT(dialog != nullptr); DialogLine *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); - const quint32 firstPoint = dialogTool->getFirstPoint(); - const quint32 secondPoint = dialogTool->getSecondPoint(); - const QString typeLine = dialogTool->getTypeLine(); + const quint32 firstPoint = dialogTool->GetFirstPoint(); + const quint32 secondPoint = dialogTool->GetSecondPoint(); + const QString typeLine = dialogTool->GetTypeLine(); VToolLine *line = nullptr; line = Create(0, firstPoint, secondPoint, typeLine, scene, doc, data, Document::FullParse, Source::FromGui); @@ -366,9 +366,9 @@ void VToolLine::SaveDialog(QDomElement &domElement) SCASSERT(dialog != nullptr); DialogLine *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); - doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->getFirstPoint())); - doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->getSecondPoint())); - doc->SetAttribute(domElement, AttrTypeLine, dialogTool->getTypeLine()); + doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->GetFirstPoint())); + doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->GetSecondPoint())); + doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine()); } //--------------------------------------------------------------------------------------------------------------------- @@ -383,13 +383,13 @@ void VToolLine::SaveOptions(QDomElement &tag, QSharedPointer &obj) } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolLine::getSecondPoint() const +quint32 VToolLine::GetSecondPoint() const { return secondPoint; } //--------------------------------------------------------------------------------------------------------------------- -void VToolLine::setSecondPoint(const quint32 &value) +void VToolLine::SetSecondPoint(const quint32 &value) { if (value != NULL_ID) { @@ -435,7 +435,7 @@ void VToolLine::ShowVisualization(bool show) } //--------------------------------------------------------------------------------------------------------------------- -void VToolLine::setTypeLine(const QString &value) +void VToolLine::SetTypeLine(const QString &value) { typeLine = value; @@ -444,13 +444,13 @@ void VToolLine::setTypeLine(const QString &value) } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolLine::getFirstPoint() const +quint32 VToolLine::GetFirstPoint() const { return firstPoint; } //--------------------------------------------------------------------------------------------------------------------- -void VToolLine::setFirstPoint(const quint32 &value) +void VToolLine::SetFirstPoint(const quint32 &value) { if (value != NULL_ID) { diff --git a/src/app/tools/drawTools/vtoolline.h b/src/app/tools/drawTools/vtoolline.h index 1d852957a..7e2d55d17 100644 --- a/src/app/tools/drawTools/vtoolline.h +++ b/src/app/tools/drawTools/vtoolline.h @@ -51,14 +51,14 @@ public: virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::Line)}; virtual QString getTagName() const; - quint32 getFirstPoint() const; - void setFirstPoint(const quint32 &value); + quint32 GetFirstPoint() const; + void SetFirstPoint(const quint32 &value); - quint32 getSecondPoint() const; - void setSecondPoint(const quint32 &value); + quint32 GetSecondPoint() const; + void SetSecondPoint(const quint32 &value); virtual void ShowVisualization(bool show); - virtual void setTypeLine(const QString &value); + virtual void SetTypeLine(const QString &value); public slots: virtual void FullUpdateFromFile(); virtual void ChangedActivDraw(const QString &newName); diff --git a/src/app/tools/drawTools/vtoollineintersect.cpp b/src/app/tools/drawTools/vtoollineintersect.cpp index 973836f6a..fcb27fcde 100644 --- a/src/app/tools/drawTools/vtoollineintersect.cpp +++ b/src/app/tools/drawTools/vtoollineintersect.cpp @@ -74,11 +74,11 @@ void VToolLineIntersect::setDialog() DialogLineIntersect *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QSharedPointer p = VAbstractTool::data.GeometricObject(id); - dialogTool->setP1Line1(p1Line1); - dialogTool->setP2Line1(p2Line1); - dialogTool->setP1Line2(p1Line2); - dialogTool->setP2Line2(p2Line2); - dialogTool->setPointName(p->name()); + dialogTool->SetP1Line1(p1Line1); + dialogTool->SetP2Line1(p2Line1); + dialogTool->SetP1Line2(p1Line2); + dialogTool->SetP2Line2(p2Line2); + dialogTool->SetPointName(p->name()); } //--------------------------------------------------------------------------------------------------------------------- @@ -96,10 +96,10 @@ VToolLineIntersect* VToolLineIntersect::Create(DialogTool *dialog, VMainGraphics SCASSERT(dialog != nullptr); DialogLineIntersect *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); - const quint32 p1Line1Id = dialogTool->getP1Line1(); - const quint32 p2Line1Id = dialogTool->getP2Line1(); - const quint32 p1Line2Id = dialogTool->getP1Line2(); - const quint32 p2Line2Id = dialogTool->getP2Line2(); + const quint32 p1Line1Id = dialogTool->GetP1Line1(); + const quint32 p2Line1Id = dialogTool->GetP2Line1(); + const quint32 p1Line2Id = dialogTool->GetP1Line2(); + const quint32 p2Line2Id = dialogTool->GetP2Line2(); const QString pointName = dialogTool->getPointName(); VToolLineIntersect* point = nullptr; point = Create(0, p1Line1Id, p2Line1Id, p1Line2Id, p2Line2Id, pointName, 5, 10, scene, doc, data, @@ -267,10 +267,10 @@ void VToolLineIntersect::SaveDialog(QDomElement &domElement) DialogLineIntersect *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); - doc->SetAttribute(domElement, AttrP1Line1, QString().setNum(dialogTool->getP1Line1())); - doc->SetAttribute(domElement, AttrP2Line1, QString().setNum(dialogTool->getP2Line1())); - doc->SetAttribute(domElement, AttrP1Line2, QString().setNum(dialogTool->getP1Line2())); - doc->SetAttribute(domElement, AttrP2Line2, QString().setNum(dialogTool->getP2Line2())); + doc->SetAttribute(domElement, AttrP1Line1, QString().setNum(dialogTool->GetP1Line1())); + doc->SetAttribute(domElement, AttrP2Line1, QString().setNum(dialogTool->GetP2Line1())); + doc->SetAttribute(domElement, AttrP1Line2, QString().setNum(dialogTool->GetP1Line2())); + doc->SetAttribute(domElement, AttrP2Line2, QString().setNum(dialogTool->GetP2Line2())); } //--------------------------------------------------------------------------------------------------------------------- @@ -292,13 +292,13 @@ void VToolLineIntersect::SaveOptions(QDomElement &tag, QSharedPointer } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolLineIntersect::getP2Line2() const +quint32 VToolLineIntersect::GetP2Line2() const { return p2Line2; } //--------------------------------------------------------------------------------------------------------------------- -void VToolLineIntersect::setP2Line2(const quint32 &value) +void VToolLineIntersect::SetP2Line2(const quint32 &value) { if (value != NULL_ID) { @@ -345,13 +345,13 @@ void VToolLineIntersect::ShowVisualization(bool show) } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolLineIntersect::getP1Line2() const +quint32 VToolLineIntersect::GetP1Line2() const { return p1Line2; } //--------------------------------------------------------------------------------------------------------------------- -void VToolLineIntersect::setP1Line2(const quint32 &value) +void VToolLineIntersect::SetP1Line2(const quint32 &value) { if (value != NULL_ID) { @@ -363,13 +363,13 @@ void VToolLineIntersect::setP1Line2(const quint32 &value) } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolLineIntersect::getP2Line1() const +quint32 VToolLineIntersect::GetP2Line1() const { return p2Line1; } //--------------------------------------------------------------------------------------------------------------------- -void VToolLineIntersect::setP2Line1(const quint32 &value) +void VToolLineIntersect::SetP2Line1(const quint32 &value) { if (value != NULL_ID) { @@ -381,13 +381,13 @@ void VToolLineIntersect::setP2Line1(const quint32 &value) } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolLineIntersect::getP1Line1() const +quint32 VToolLineIntersect::GetP1Line1() const { return p1Line1; } //--------------------------------------------------------------------------------------------------------------------- -void VToolLineIntersect::setP1Line1(const quint32 &value) +void VToolLineIntersect::SetP1Line1(const quint32 &value) { if (value != NULL_ID) { diff --git a/src/app/tools/drawTools/vtoollineintersect.h b/src/app/tools/drawTools/vtoollineintersect.h index dd28d16b9..2322ed7f1 100644 --- a/src/app/tools/drawTools/vtoollineintersect.h +++ b/src/app/tools/drawTools/vtoollineintersect.h @@ -51,17 +51,17 @@ public: virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::LineIntersect)}; - quint32 getP1Line1() const; - void setP1Line1(const quint32 &value); + quint32 GetP1Line1() const; + void SetP1Line1(const quint32 &value); - quint32 getP2Line1() const; - void setP2Line1(const quint32 &value); + quint32 GetP2Line1() const; + void SetP2Line1(const quint32 &value); - quint32 getP1Line2() const; - void setP1Line2(const quint32 &value); + quint32 GetP1Line2() const; + void SetP1Line2(const quint32 &value); - quint32 getP2Line2() const; - void setP2Line2(const quint32 &value); + quint32 GetP2Line2() const; + void SetP2Line2(const quint32 &value); virtual void ShowVisualization(bool show); public slots: diff --git a/src/app/tools/drawTools/vtoollineintersectaxis.cpp b/src/app/tools/drawTools/vtoollineintersectaxis.cpp index 53f88fb5a..00b0b6dd4 100644 --- a/src/app/tools/drawTools/vtoollineintersectaxis.cpp +++ b/src/app/tools/drawTools/vtoollineintersectaxis.cpp @@ -67,12 +67,12 @@ void VToolLineIntersectAxis::setDialog() DialogLineIntersectAxis *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QSharedPointer p = VAbstractTool::data.GeometricObject(id); - dialogTool->setTypeLine(typeLine); - dialogTool->setAngle(formulaAngle); - dialogTool->setBasePointId(basePointId); - dialogTool->setFirstPointId(firstPointId); - dialogTool->setSecondPointId(secondPointId); - dialogTool->setPointName(p->name()); + dialogTool->SetTypeLine(typeLine); + dialogTool->SetAngle(formulaAngle); + dialogTool->SetBasePointId(basePointId); + dialogTool->SetFirstPointId(firstPointId); + dialogTool->SetSecondPointId(secondPointId); + dialogTool->SetPointName(p->name()); } //--------------------------------------------------------------------------------------------------------------------- @@ -83,11 +83,11 @@ VToolLineIntersectAxis *VToolLineIntersectAxis::Create(DialogTool *dialog, VMain DialogLineIntersectAxis *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool); const QString pointName = dialogTool->getPointName(); - const QString typeLine = dialogTool->getTypeLine(); - QString formulaAngle = dialogTool->getAngle(); - const quint32 basePointId = dialogTool->getBasePointId(); - const quint32 firstPointId = dialogTool->getFirstPointId(); - const quint32 secondPointId = dialogTool->getSecondPointId(); + const QString typeLine = dialogTool->GetTypeLine(); + QString formulaAngle = dialogTool->GetAngle(); + const quint32 basePointId = dialogTool->GetBasePointId(); + const quint32 firstPointId = dialogTool->GetFirstPointId(); + const quint32 secondPointId = dialogTool->GetSecondPointId(); VToolLineIntersectAxis *point = nullptr; point=Create(0, pointName, typeLine, formulaAngle, basePointId, firstPointId, secondPointId, 5, 10, scene, doc, @@ -170,7 +170,7 @@ QPointF VToolLineIntersectAxis::FindPoint(const QLineF &axis, const QLineF &line } //--------------------------------------------------------------------------------------------------------------------- -VFormula VToolLineIntersectAxis::getFormulaAngle() const +VFormula VToolLineIntersectAxis::GetFormulaAngle() const { VFormula fAngle(formulaAngle, getData()); fAngle.setCheckZero(false); @@ -180,11 +180,11 @@ VFormula VToolLineIntersectAxis::getFormulaAngle() const } //--------------------------------------------------------------------------------------------------------------------- -void VToolLineIntersectAxis::setFormulaAngle(const VFormula &value) +void VToolLineIntersectAxis::SetFormulaAngle(const VFormula &value) { if (value.error() == false) { - formulaAngle = value.getFormula(FormulaType::FromUser); + formulaAngle = value.GetFormula(FormulaType::FromUser); QSharedPointer obj = VAbstractTool::data.GetGObject(id); SaveOption(obj); @@ -192,13 +192,13 @@ void VToolLineIntersectAxis::setFormulaAngle(const VFormula &value) } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolLineIntersectAxis::getFirstPointId() const +quint32 VToolLineIntersectAxis::GetFirstPointId() const { return firstPointId; } //--------------------------------------------------------------------------------------------------------------------- -void VToolLineIntersectAxis::setFirstPointId(const quint32 &value) +void VToolLineIntersectAxis::SetFirstPointId(const quint32 &value) { if (value != NULL_ID) { @@ -210,13 +210,13 @@ void VToolLineIntersectAxis::setFirstPointId(const quint32 &value) } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolLineIntersectAxis::getSecondPointId() const +quint32 VToolLineIntersectAxis::GetSecondPointId() const { return secondPointId; } //--------------------------------------------------------------------------------------------------------------------- -void VToolLineIntersectAxis::setSecondPointId(const quint32 &value) +void VToolLineIntersectAxis::SetSecondPointId(const quint32 &value) { if (value != NULL_ID) { @@ -242,7 +242,7 @@ void VToolLineIntersectAxis::ShowVisualization(bool show) visual->setPoint1Id(firstPointId); visual->setPoint2Id(secondPointId); visual->setAxisPointId(basePointId); - visual->setAngle(qApp->FormulaToUser(formulaAngle)); + visual->SetAngle(qApp->FormulaToUser(formulaAngle)); visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); vis = visual; @@ -283,7 +283,7 @@ void VToolLineIntersectAxis::FullUpdateFromFile() visual->setPoint1Id(firstPointId); visual->setPoint2Id(secondPointId); visual->setAxisPointId(basePointId); - visual->setAngle(qApp->FormulaToUser(formulaAngle)); + visual->SetAngle(qApp->FormulaToUser(formulaAngle)); visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); } @@ -308,11 +308,11 @@ void VToolLineIntersectAxis::SaveDialog(QDomElement &domElement) DialogLineIntersectAxis *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); - doc->SetAttribute(domElement, AttrTypeLine, dialogTool->getTypeLine()); - doc->SetAttribute(domElement, AttrAngle, dialogTool->getAngle()); - doc->SetAttribute(domElement, AttrBasePoint, QString().setNum(dialogTool->getBasePointId())); - doc->SetAttribute(domElement, AttrP1Line, QString().setNum(dialogTool->getFirstPointId())); - doc->SetAttribute(domElement, AttrP2Line, QString().setNum(dialogTool->getSecondPointId())); + doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine()); + doc->SetAttribute(domElement, AttrAngle, dialogTool->GetAngle()); + doc->SetAttribute(domElement, AttrBasePoint, QString().setNum(dialogTool->GetBasePointId())); + doc->SetAttribute(domElement, AttrP1Line, QString().setNum(dialogTool->GetFirstPointId())); + doc->SetAttribute(domElement, AttrP2Line, QString().setNum(dialogTool->GetSecondPointId())); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/tools/drawTools/vtoollineintersectaxis.h b/src/app/tools/drawTools/vtoollineintersectaxis.h index b7ddb00d7..9de3f38c4 100644 --- a/src/app/tools/drawTools/vtoollineintersectaxis.h +++ b/src/app/tools/drawTools/vtoollineintersectaxis.h @@ -55,14 +55,14 @@ public: virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::LineIntersectAxis)}; - VFormula getFormulaAngle() const; - void setFormulaAngle(const VFormula &value); + VFormula GetFormulaAngle() const; + void SetFormulaAngle(const VFormula &value); - quint32 getFirstPointId() const; - void setFirstPointId(const quint32 &value); + quint32 GetFirstPointId() const; + void SetFirstPointId(const quint32 &value); - quint32 getSecondPointId() const; - void setSecondPointId(const quint32 &value); + quint32 GetSecondPointId() const; + void SetSecondPointId(const quint32 &value); virtual void ShowVisualization(bool show); public slots: diff --git a/src/app/tools/drawTools/vtoollinepoint.cpp b/src/app/tools/drawTools/vtoollinepoint.cpp index 1213c85ca..59823347e 100644 --- a/src/app/tools/drawTools/vtoollinepoint.cpp +++ b/src/app/tools/drawTools/vtoollinepoint.cpp @@ -108,13 +108,13 @@ void VToolLinePoint::SetFactor(qreal factor) } //--------------------------------------------------------------------------------------------------------------------- -qreal VToolLinePoint::getAngle() const +qreal VToolLinePoint::GetAngle() const { return angle; } //--------------------------------------------------------------------------------------------------------------------- -void VToolLinePoint::setAngle(const qreal &value) +void VToolLinePoint::SetAngle(const qreal &value) { angle = value; QSharedPointer obj = VAbstractTool::data.GetGObject(id); @@ -122,13 +122,13 @@ void VToolLinePoint::setAngle(const qreal &value) } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolLinePoint::getBasePointId() const +quint32 VToolLinePoint::GetBasePointId() const { return basePointId; } //--------------------------------------------------------------------------------------------------------------------- -void VToolLinePoint::setBasePointId(const quint32 &value) +void VToolLinePoint::SetBasePointId(const quint32 &value) { if (value != NULL_ID) { @@ -140,7 +140,7 @@ void VToolLinePoint::setBasePointId(const quint32 &value) } //--------------------------------------------------------------------------------------------------------------------- -VFormula VToolLinePoint::getFormulaLength() const +VFormula VToolLinePoint::GetFormulaLength() const { VFormula fLength(formulaLength, this->getData()); fLength.setCheckZero(true); @@ -151,11 +151,11 @@ VFormula VToolLinePoint::getFormulaLength() const } //--------------------------------------------------------------------------------------------------------------------- -void VToolLinePoint::setFormulaLength(const VFormula &value) +void VToolLinePoint::SetFormulaLength(const VFormula &value) { if (value.error() == false) { - formulaLength = value.getFormula(FormulaType::FromUser); + formulaLength = value.GetFormula(FormulaType::FromUser); QSharedPointer obj = VAbstractTool::data.GetGObject(id); SaveOption(obj); diff --git a/src/app/tools/drawTools/vtoollinepoint.h b/src/app/tools/drawTools/vtoollinepoint.h index 3c29e248e..d605dd797 100644 --- a/src/app/tools/drawTools/vtoollinepoint.h +++ b/src/app/tools/drawTools/vtoollinepoint.h @@ -44,14 +44,14 @@ public: virtual ~VToolLinePoint(); virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::LinePoint)}; - VFormula getFormulaLength() const; - void setFormulaLength(const VFormula &value); + VFormula GetFormulaLength() const; + void SetFormulaLength(const VFormula &value); - quint32 getBasePointId() const; - void setBasePointId(const quint32 &value); + quint32 GetBasePointId() const; + void SetBasePointId(const quint32 &value); - qreal getAngle() const; - void setAngle(const qreal &value); + qreal GetAngle() const; + void SetAngle(const qreal &value); public slots: virtual void ChangedActivDraw(const QString &newName); diff --git a/src/app/tools/drawTools/vtoolnormal.cpp b/src/app/tools/drawTools/vtoolnormal.cpp index c4d9f9268..117519d46 100644 --- a/src/app/tools/drawTools/vtoolnormal.cpp +++ b/src/app/tools/drawTools/vtoolnormal.cpp @@ -75,12 +75,12 @@ void VToolNormal::setDialog() DialogNormal *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QSharedPointer p = VAbstractTool::data.GeometricObject(id); - dialogTool->setTypeLine(typeLine); - dialogTool->setFormula(formulaLength); - dialogTool->setAngle(angle); - dialogTool->setFirstPointId(basePointId); - dialogTool->setSecondPointId(secondPointId); - dialogTool->setPointName(p->name()); + dialogTool->SetTypeLine(typeLine); + dialogTool->SetFormula(formulaLength); + dialogTool->SetAngle(angle); + dialogTool->SetFirstPointId(basePointId); + dialogTool->SetSecondPointId(secondPointId); + dialogTool->SetPointName(p->name()); } //--------------------------------------------------------------------------------------------------------------------- @@ -96,12 +96,12 @@ VToolNormal* VToolNormal::Create(DialogTool *dialog, VMainGraphicsScene *scene, SCASSERT(dialog != nullptr); DialogNormal *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); - QString formula = dialogTool->getFormula(); - const quint32 firstPointId = dialogTool->getFirstPointId(); - const quint32 secondPointId = dialogTool->getSecondPointId(); - const QString typeLine = dialogTool->getTypeLine(); + QString formula = dialogTool->GetFormula(); + const quint32 firstPointId = dialogTool->GetFirstPointId(); + const quint32 secondPointId = dialogTool->GetSecondPointId(); + const QString typeLine = dialogTool->GetTypeLine(); const QString pointName = dialogTool->getPointName(); - const qreal angle = dialogTool->getAngle(); + const qreal angle = dialogTool->GetAngle(); VToolNormal *point = nullptr; point=Create(0, formula, firstPointId, secondPointId, typeLine, pointName, angle, 5, 10, scene, doc, data, Document::FullParse, Source::FromGui); @@ -217,7 +217,7 @@ void VToolNormal::FullUpdateFromFile() visual->setPoint1Id(basePointId); visual->setPoint2Id(secondPointId); visual->setLength(qApp->FormulaToUser(formulaLength)); - visual->setAngle(angle); + visual->SetAngle(angle); visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); } @@ -274,11 +274,11 @@ void VToolNormal::SaveDialog(QDomElement &domElement) DialogNormal *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); - doc->SetAttribute(domElement, AttrTypeLine, dialogTool->getTypeLine()); - doc->SetAttribute(domElement, AttrLength, dialogTool->getFormula()); - doc->SetAttribute(domElement, AttrAngle, QString().setNum(dialogTool->getAngle())); - doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->getFirstPointId())); - doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->getSecondPointId())); + doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine()); + doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula()); + doc->SetAttribute(domElement, AttrAngle, QString().setNum(dialogTool->GetAngle())); + doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->GetFirstPointId())); + doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->GetSecondPointId())); } //--------------------------------------------------------------------------------------------------------------------- @@ -301,13 +301,13 @@ void VToolNormal::SaveOptions(QDomElement &tag, QSharedPointer &obj) } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolNormal::getSecondPointId() const +quint32 VToolNormal::GetSecondPointId() const { return secondPointId; } //--------------------------------------------------------------------------------------------------------------------- -void VToolNormal::setSecondPointId(const quint32 &value) +void VToolNormal::SetSecondPointId(const quint32 &value) { if (value != NULL_ID) { @@ -333,7 +333,7 @@ void VToolNormal::ShowVisualization(bool show) visual->setPoint1Id(basePointId); visual->setPoint2Id(secondPointId); visual->setLength(qApp->FormulaToUser(formulaLength)); - visual->setAngle(angle); + visual->SetAngle(angle); visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); vis = visual; diff --git a/src/app/tools/drawTools/vtoolnormal.h b/src/app/tools/drawTools/vtoolnormal.h index 3c85cb439..02da26909 100644 --- a/src/app/tools/drawTools/vtoolnormal.h +++ b/src/app/tools/drawTools/vtoolnormal.h @@ -53,8 +53,8 @@ public: virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::Normal)}; - quint32 getSecondPointId() const; - void setSecondPointId(const quint32 &value); + quint32 GetSecondPointId() const; + void SetSecondPointId(const quint32 &value); virtual void ShowVisualization(bool show); public slots: diff --git a/src/app/tools/drawTools/vtoolpointofcontact.cpp b/src/app/tools/drawTools/vtoolpointofcontact.cpp index 96e4eabe7..cc56bf460 100644 --- a/src/app/tools/drawTools/vtoolpointofcontact.cpp +++ b/src/app/tools/drawTools/vtoolpointofcontact.cpp @@ -78,9 +78,9 @@ void VToolPointOfContact::setDialog() const QSharedPointer p = VAbstractTool::data.GeometricObject(id); dialogTool->setRadius(arcRadius); dialogTool->setCenter(center); - dialogTool->setFirstPoint(firstPointId); - dialogTool->setSecondPoint(secondPointId); - dialogTool->setPointName(p->name()); + dialogTool->SetFirstPoint(firstPointId); + dialogTool->SetSecondPoint(secondPointId); + dialogTool->SetPointName(p->name()); } //--------------------------------------------------------------------------------------------------------------------- @@ -138,8 +138,8 @@ VToolPointOfContact* VToolPointOfContact::Create(DialogTool *dialog, VMainGraphi SCASSERT(dialogTool != nullptr); QString radius = dialogTool->getRadius(); const quint32 center = dialogTool->getCenter(); - const quint32 firstPointId = dialogTool->getFirstPoint(); - const quint32 secondPointId = dialogTool->getSecondPoint(); + const quint32 firstPointId = dialogTool->GetFirstPoint(); + const quint32 secondPointId = dialogTool->GetSecondPoint(); const QString pointName = dialogTool->getPointName(); VToolPointOfContact *point = nullptr; point=Create(0, radius, center, firstPointId, secondPointId, pointName, 5, 10, scene, doc, data, @@ -300,8 +300,8 @@ void VToolPointOfContact::SaveDialog(QDomElement &domElement) doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); doc->SetAttribute(domElement, AttrRadius, dialogTool->getRadius()); doc->SetAttribute(domElement, AttrCenter, QString().setNum(dialogTool->getCenter())); - doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->getFirstPoint())); - doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->getSecondPoint())); + doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->GetFirstPoint())); + doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->GetSecondPoint())); } //--------------------------------------------------------------------------------------------------------------------- @@ -323,13 +323,13 @@ void VToolPointOfContact::SaveOptions(QDomElement &tag, QSharedPointer } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolPointOfContact::getSecondPointId() const +quint32 VToolPointOfContact::GetSecondPointId() const { return secondPointId; } //--------------------------------------------------------------------------------------------------------------------- -void VToolPointOfContact::setSecondPointId(const quint32 &value) +void VToolPointOfContact::SetSecondPointId(const quint32 &value) { secondPointId = value; } @@ -370,13 +370,13 @@ void VToolPointOfContact::ShowVisualization(bool show) } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolPointOfContact::getFirstPointId() const +quint32 VToolPointOfContact::GetFirstPointId() const { return firstPointId; } //--------------------------------------------------------------------------------------------------------------------- -void VToolPointOfContact::setFirstPointId(const quint32 &value) +void VToolPointOfContact::SetFirstPointId(const quint32 &value) { firstPointId = value; } @@ -415,7 +415,7 @@ void VToolPointOfContact::setArcRadius(const VFormula &value) { if (value.error() == false) { - arcRadius = value.getFormula(FormulaType::FromUser); + arcRadius = value.GetFormula(FormulaType::FromUser); QSharedPointer obj = VAbstractTool::data.GetGObject(id); SaveOption(obj); diff --git a/src/app/tools/drawTools/vtoolpointofcontact.h b/src/app/tools/drawTools/vtoolpointofcontact.h index 1cbc84815..7c58a9ac7 100644 --- a/src/app/tools/drawTools/vtoolpointofcontact.h +++ b/src/app/tools/drawTools/vtoolpointofcontact.h @@ -62,11 +62,11 @@ public: quint32 getCenter() const; void setCenter(const quint32 &value); - quint32 getFirstPointId() const; - void setFirstPointId(const quint32 &value); + quint32 GetFirstPointId() const; + void SetFirstPointId(const quint32 &value); - quint32 getSecondPointId() const; - void setSecondPointId(const quint32 &value); + quint32 GetSecondPointId() const; + void SetSecondPointId(const quint32 &value); virtual void ShowVisualization(bool show); public slots: diff --git a/src/app/tools/drawTools/vtoolpointofintersection.cpp b/src/app/tools/drawTools/vtoolpointofintersection.cpp index 52ef71132..f8f771723 100644 --- a/src/app/tools/drawTools/vtoolpointofintersection.cpp +++ b/src/app/tools/drawTools/vtoolpointofintersection.cpp @@ -70,9 +70,9 @@ void VToolPointOfIntersection::setDialog() DialogPointOfIntersection *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QSharedPointer p = VAbstractTool::data.GeometricObject(id); - dialogTool->setFirstPointId(firstPointId); - dialogTool->setSecondPointId(secondPointId); - dialogTool->setPointName(p->name()); + dialogTool->SetFirstPointId(firstPointId); + dialogTool->SetSecondPointId(secondPointId); + dialogTool->SetPointName(p->name()); } //--------------------------------------------------------------------------------------------------------------------- @@ -90,8 +90,8 @@ VToolPointOfIntersection *VToolPointOfIntersection::Create(DialogTool *dialog, V SCASSERT(dialog != nullptr); DialogPointOfIntersection *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); - const quint32 firstPointId = dialogTool->getFirstPointId(); - const quint32 secondPointId = dialogTool->getSecondPointId(); + const quint32 firstPointId = dialogTool->GetFirstPointId(); + const quint32 secondPointId = dialogTool->GetSecondPointId(); const QString pointName = dialogTool->getPointName(); VToolPointOfIntersection *point = nullptr; point = Create(0, pointName, firstPointId, secondPointId, 5, 10, scene, doc, data, Document::FullParse, @@ -222,8 +222,8 @@ void VToolPointOfIntersection::SaveDialog(QDomElement &domElement) DialogPointOfIntersection *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); - doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->getFirstPointId())); - doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->getSecondPointId())); + doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->GetFirstPointId())); + doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->GetSecondPointId())); } //--------------------------------------------------------------------------------------------------------------------- @@ -243,13 +243,13 @@ void VToolPointOfIntersection::SaveOptions(QDomElement &tag, QSharedPointer(Tool::PointOfIntersection) }; - quint32 getFirstPointId() const; - void setFirstPointId(const quint32 &value); + quint32 GetFirstPointId() const; + void SetFirstPointId(const quint32 &value); - quint32 getSecondPointId() const; - void setSecondPointId(const quint32 &value); + quint32 GetSecondPointId() const; + void SetSecondPointId(const quint32 &value); virtual void ShowVisualization(bool show); public slots: diff --git a/src/app/tools/drawTools/vtoolshoulderpoint.cpp b/src/app/tools/drawTools/vtoolshoulderpoint.cpp index 312aa5d9d..338ae3e75 100644 --- a/src/app/tools/drawTools/vtoolshoulderpoint.cpp +++ b/src/app/tools/drawTools/vtoolshoulderpoint.cpp @@ -74,12 +74,12 @@ void VToolShoulderPoint::setDialog() DialogShoulderPoint *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QSharedPointer p = VAbstractTool::data.GeometricObject(id); - dialogTool->setTypeLine(typeLine); - dialogTool->setFormula(formulaLength); - dialogTool->setP1Line(basePointId); - dialogTool->setP2Line(p2Line); - dialogTool->setP3(pShoulder); - dialogTool->setPointName(p->name()); + dialogTool->SetTypeLine(typeLine); + dialogTool->SetFormula(formulaLength); + dialogTool->SetP1Line(basePointId); + dialogTool->SetP2Line(p2Line); + dialogTool->SetP3(pShoulder); + dialogTool->SetPointName(p->name()); } //--------------------------------------------------------------------------------------------------------------------- @@ -134,11 +134,11 @@ VToolShoulderPoint* VToolShoulderPoint::Create(DialogTool *dialog, VMainGraphics SCASSERT(dialog != nullptr); DialogShoulderPoint *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool); - QString formula = dialogTool->getFormula(); - const quint32 p1Line = dialogTool->getP1Line(); - const quint32 p2Line = dialogTool->getP2Line(); - const quint32 pShoulder = dialogTool->getP3(); - const QString typeLine = dialogTool->getTypeLine(); + QString formula = dialogTool->GetFormula(); + const quint32 p1Line = dialogTool->GetP1Line(); + const quint32 p2Line = dialogTool->GetP2Line(); + const quint32 pShoulder = dialogTool->GetP3(); + const QString typeLine = dialogTool->GetTypeLine(); const QString pointName = dialogTool->getPointName(); VToolShoulderPoint * point = nullptr; point=Create(0, formula, p1Line, p2Line, pShoulder, typeLine, pointName, 5, 10, scene, doc, data, @@ -300,11 +300,11 @@ void VToolShoulderPoint::SaveDialog(QDomElement &domElement) DialogShoulderPoint *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); - doc->SetAttribute(domElement, AttrTypeLine, dialogTool->getTypeLine()); - doc->SetAttribute(domElement, AttrLength, dialogTool->getFormula()); - doc->SetAttribute(domElement, AttrP1Line, QString().setNum(dialogTool->getP1Line())); - doc->SetAttribute(domElement, AttrP2Line, QString().setNum(dialogTool->getP2Line())); - doc->SetAttribute(domElement, AttrPShoulder, QString().setNum(dialogTool->getP3())); + doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine()); + doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula()); + doc->SetAttribute(domElement, AttrP1Line, QString().setNum(dialogTool->GetP1Line())); + doc->SetAttribute(domElement, AttrP2Line, QString().setNum(dialogTool->GetP2Line())); + doc->SetAttribute(domElement, AttrPShoulder, QString().setNum(dialogTool->GetP3())); } //--------------------------------------------------------------------------------------------------------------------- @@ -381,13 +381,13 @@ void VToolShoulderPoint::ShowVisualization(bool show) } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolShoulderPoint::getP2Line() const +quint32 VToolShoulderPoint::GetP2Line() const { return p2Line; } //--------------------------------------------------------------------------------------------------------------------- -void VToolShoulderPoint::setP2Line(const quint32 &value) +void VToolShoulderPoint::SetP2Line(const quint32 &value) { if (value != NULL_ID) { diff --git a/src/app/tools/drawTools/vtoolshoulderpoint.h b/src/app/tools/drawTools/vtoolshoulderpoint.h index ef8c08df6..32bdd257c 100644 --- a/src/app/tools/drawTools/vtoolshoulderpoint.h +++ b/src/app/tools/drawTools/vtoolshoulderpoint.h @@ -54,8 +54,8 @@ public: virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::ShoulderPoint) }; - quint32 getP2Line() const; - void setP2Line(const quint32 &value); + quint32 GetP2Line() const; + void SetP2Line(const quint32 &value); quint32 getPShoulder() const; void setPShoulder(const quint32 &value); diff --git a/src/app/tools/drawTools/vtoolsinglepoint.cpp b/src/app/tools/drawTools/vtoolsinglepoint.cpp index 1320132b6..204849b16 100644 --- a/src/app/tools/drawTools/vtoolsinglepoint.cpp +++ b/src/app/tools/drawTools/vtoolsinglepoint.cpp @@ -58,7 +58,7 @@ VToolSinglePoint::VToolSinglePoint (VPattern *doc, VContainer *data, quint32 id, this->setFlag(QGraphicsItem::ItemIsMovable, true); this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); this->setFlag(QGraphicsItem::ItemIsFocusable, false); - setColorLabel(Qt::black); + SetColorLabel(Qt::black); if (typeCreation == Source::FromGui) { AddToFile(); @@ -79,7 +79,7 @@ void VToolSinglePoint::setDialog() DialogSinglePoint *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QSharedPointer p = VAbstractTool::data.GeometricObject(id); - dialogTool->setData(p->name(), p->toQPointF()); + dialogTool->SetData(p->name(), p->toQPointF()); } //--------------------------------------------------------------------------------------------------------------------- @@ -194,7 +194,7 @@ void VToolSinglePoint::SaveDialog(QDomElement &domElement) SCASSERT(dialog != nullptr); DialogSinglePoint *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); - QPointF p = dialogTool->getPoint(); + QPointF p = dialogTool->GetPoint(); QString name = dialogTool->getPointName(); doc->SetAttribute(domElement, AttrName, name); doc->SetAttribute(domElement, AttrX, QString().setNum(qApp->fromPixel(p.x()))); @@ -241,10 +241,10 @@ void VToolSinglePoint::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setColorLabel change color for label and label line. + * @brief SetColorLabel change color for label and label line. * @param color new color. */ -void VToolSinglePoint::setColorLabel(const Qt::GlobalColor &color) +void VToolSinglePoint::SetColorLabel(const Qt::GlobalColor &color) { namePoint->setBrush(color); lineName->setPen(QPen(color, qApp->toPixel(qApp->widthHairLine())/factor)); @@ -310,12 +310,12 @@ void VToolSinglePoint::ChangedActivDraw(const QString &newName) if (nameActivDraw == newName) { this->setEnabled(true); - setColorLabel(Qt::black); + SetColorLabel(Qt::black); } else { this->setEnabled(false); - setColorLabel(Qt::gray); + SetColorLabel(Qt::gray); } } diff --git a/src/app/tools/drawTools/vtoolsinglepoint.h b/src/app/tools/drawTools/vtoolsinglepoint.h index 2e9aa14f1..3cbcdb202 100644 --- a/src/app/tools/drawTools/vtoolsinglepoint.h +++ b/src/app/tools/drawTools/vtoolsinglepoint.h @@ -71,7 +71,7 @@ protected: private: QString namePP; QString mPath; - void setColorLabel(const Qt::GlobalColor & color); + void SetColorLabel(const Qt::GlobalColor & color); }; diff --git a/src/app/tools/drawTools/vtoolspline.cpp b/src/app/tools/drawTools/vtoolspline.cpp index 96eddc313..979c51751 100644 --- a/src/app/tools/drawTools/vtoolspline.cpp +++ b/src/app/tools/drawTools/vtoolspline.cpp @@ -98,13 +98,13 @@ void VToolSpline::setDialog() DialogSpline *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QSharedPointer spl = VAbstractTool::data.GeometricObject(id); - dialogTool->setP1(spl->GetP1().id()); - dialogTool->setP4(spl->GetP4().id()); - dialogTool->setAngle1(spl->GetAngle1()); - dialogTool->setAngle2(spl->GetAngle2()); - dialogTool->setKAsm1(spl->GetKasm1()); - dialogTool->setKAsm2(spl->GetKasm2()); - dialogTool->setKCurve(spl->GetKcurve()); + dialogTool->SetP1(spl->GetP1().id()); + dialogTool->SetP4(spl->GetP4().id()); + dialogTool->SetAngle1(spl->GetAngle1()); + dialogTool->SetAngle2(spl->GetAngle2()); + dialogTool->SetKAsm1(spl->GetKasm1()); + dialogTool->SetKAsm2(spl->GetKasm2()); + dialogTool->SetKCurve(spl->GetKcurve()); } //--------------------------------------------------------------------------------------------------------------------- @@ -121,13 +121,13 @@ VToolSpline* VToolSpline::Create(DialogTool *dialog, VMainGraphicsScene *scene, SCASSERT(dialog != nullptr); DialogSpline *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); - const quint32 p1 = dialogTool->getP1(); - const quint32 p4 = dialogTool->getP4(); - const qreal kAsm1 = dialogTool->getKAsm1(); - const qreal kAsm2 = dialogTool->getKAsm2(); - const qreal angle1 = dialogTool->getAngle1(); - const qreal angle2 = dialogTool->getAngle2(); - const qreal kCurve = dialogTool->getKCurve(); + const quint32 p1 = dialogTool->GetP1(); + const quint32 p4 = dialogTool->GetP4(); + const qreal kAsm1 = dialogTool->GetKAsm1(); + const qreal kAsm2 = dialogTool->GetKAsm2(); + const qreal angle1 = dialogTool->GetAngle1(); + const qreal angle2 = dialogTool->GetAngle2(); + const qreal kCurve = dialogTool->GetKCurve(); VToolSpline *spl = nullptr; spl = Create(0, p1, p4, kAsm1, kAsm2, angle1, angle2, kCurve, scene, doc, data, Document::FullParse, Source::FromGui); @@ -225,11 +225,11 @@ void VToolSpline::ShowVisualization(bool show) const QSharedPointer spl = VAbstractTool::data.GeometricObject(id); visual->setPoint1Id(spl->GetP1().id()); visual->setPoint4Id(spl->GetP4().id()); - visual->setAngle1(spl->GetAngle1()); - visual->setAngle2(spl->GetAngle2()); - visual->setKAsm1(spl->GetKasm1()); - visual->setKAsm2(spl->GetKasm2()); - visual->setKCurve(spl->GetKcurve()); + visual->SetAngle1(spl->GetAngle1()); + visual->SetAngle2(spl->GetAngle2()); + visual->SetKAsm1(spl->GetKasm1()); + visual->SetKAsm2(spl->GetKasm2()); + visual->SetKCurve(spl->GetKcurve()); visual->RefreshGeometry(); vis = visual; } @@ -308,10 +308,10 @@ void VToolSpline::SaveDialog(QDomElement &domElement) DialogSpline *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); - VPointF point1 = *VAbstractTool::data.GeometricObject(dialogTool->getP1()); - VPointF point4 = *VAbstractTool::data.GeometricObject(dialogTool->getP4()); - VSpline spl = VSpline (point1, point4, dialogTool->getAngle1(), dialogTool->getAngle2(), - dialogTool->getKAsm1(), dialogTool->getKAsm2(), dialogTool->getKCurve()); + VPointF point1 = *VAbstractTool::data.GeometricObject(dialogTool->GetP1()); + VPointF point4 = *VAbstractTool::data.GeometricObject(dialogTool->GetP4()); + VSpline spl = VSpline (point1, point4, dialogTool->GetAngle1(), dialogTool->GetAngle2(), + dialogTool->GetKAsm1(), dialogTool->GetKAsm2(), dialogTool->GetKCurve()); controlPoints[0]->blockSignals(true); controlPoints[1]->blockSignals(true); @@ -322,7 +322,7 @@ void VToolSpline::SaveDialog(QDomElement &domElement) controlPoints[0]->blockSignals(false); controlPoints[1]->blockSignals(false); - spl = VSpline (point1, controlPoints[0]->pos(), controlPoints[1]->pos(), point4, dialogTool->getKCurve()); + spl = VSpline (point1, controlPoints[0]->pos(), controlPoints[1]->pos(), point4, dialogTool->GetKCurve()); doc->SetAttribute(domElement, AttrPoint1, spl.GetP1().id()); doc->SetAttribute(domElement, AttrPoint4, spl.GetP4().id()); @@ -388,11 +388,11 @@ void VToolSpline::RefreshGeometry() VisToolSpline *visual = qobject_cast(vis); visual->setPoint1Id(spl->GetP1().id()); visual->setPoint4Id(spl->GetP4().id()); - visual->setAngle1(spl->GetAngle1()); - visual->setAngle2(spl->GetAngle2()); - visual->setKAsm1(spl->GetKasm1()); - visual->setKAsm2(spl->GetKasm2()); - visual->setKCurve(spl->GetKcurve()); + visual->SetAngle1(spl->GetAngle1()); + visual->SetAngle2(spl->GetAngle2()); + visual->SetKAsm1(spl->GetKasm1()); + visual->SetKAsm2(spl->GetKasm2()); + visual->SetKCurve(spl->GetKcurve()); visual->RefreshGeometry(); } } diff --git a/src/app/tools/drawTools/vtoolsplinepath.cpp b/src/app/tools/drawTools/vtoolsplinepath.cpp index c77576e96..601ac96b5 100644 --- a/src/app/tools/drawTools/vtoolsplinepath.cpp +++ b/src/app/tools/drawTools/vtoolsplinepath.cpp @@ -237,7 +237,7 @@ void VToolSplinePath::RefreshSplinePath(VSplinePath &splPath) controlPoints[j-1]->blockSignals(false); spl = VSpline (spl.GetP1(), controlPoints[j-2]->pos(), controlPoints[j-1]->pos(), spl.GetP4(), - splPath.getKCurve()); + splPath.GetKCurve()); UpdateControlPoints(spl, splPath, i); } } @@ -340,7 +340,7 @@ void VToolSplinePath::RefreshDataInFile() } VSplinePath splPath = *VAbstractTool::data.GeometricObject(id); RefreshSplinePath(splPath); - doc->SetAttribute(domElement, AttrKCurve, QString().setNum(splPath.getKCurve())); + doc->SetAttribute(domElement, AttrKCurve, QString().setNum(splPath.GetKCurve())); UpdatePathPoint(doc, domElement, splPath); } @@ -388,7 +388,7 @@ void VToolSplinePath::SaveDialog(QDomElement &domElement) VSplinePath splPath = dialogTool->GetPath(); RefreshSplinePath(splPath); - doc->SetAttribute(domElement, AttrKCurve, QString().setNum(splPath.getKCurve())); + doc->SetAttribute(domElement, AttrKCurve, QString().setNum(splPath.GetKCurve())); UpdatePathPoint(doc, domElement, splPath); } @@ -400,7 +400,7 @@ void VToolSplinePath::SaveOptions(QDomElement &tag, QSharedPointer &ob doc->SetAttribute(tag, VDomDocument::AttrId, id); doc->SetAttribute(tag, AttrType, ToolType); - doc->SetAttribute(tag, AttrKCurve, splPath->getKCurve()); + doc->SetAttribute(tag, AttrKCurve, splPath->GetKCurve()); doc->RemoveAllChild(tag); for (qint32 i = 0; i < splPath->CountPoint(); ++i) diff --git a/src/app/tools/drawTools/vtooltriangle.cpp b/src/app/tools/drawTools/vtooltriangle.cpp index 6afce72ce..bf7d99bdd 100644 --- a/src/app/tools/drawTools/vtooltriangle.cpp +++ b/src/app/tools/drawTools/vtooltriangle.cpp @@ -74,11 +74,11 @@ void VToolTriangle::setDialog() DialogTriangle *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QSharedPointer p = VAbstractTool::data.GeometricObject(id); - dialogTool->setAxisP1Id(axisP1Id); - dialogTool->setAxisP2Id(axisP2Id); - dialogTool->setFirstPointId(firstPointId); - dialogTool->setSecondPointId(secondPointId); - dialogTool->setPointName(p->name()); + dialogTool->SetAxisP1Id(axisP1Id); + dialogTool->SetAxisP2Id(axisP2Id); + dialogTool->SetFirstPointId(firstPointId); + dialogTool->SetSecondPointId(secondPointId); + dialogTool->SetPointName(p->name()); } //--------------------------------------------------------------------------------------------------------------------- @@ -95,10 +95,10 @@ VToolTriangle* VToolTriangle::Create(DialogTool *dialog, VMainGraphicsScene *sce SCASSERT(dialog != nullptr); DialogTriangle *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); - const quint32 axisP1Id = dialogTool->getAxisP1Id(); - const quint32 axisP2Id = dialogTool->getAxisP2Id(); - const quint32 firstPointId = dialogTool->getFirstPointId(); - const quint32 secondPointId = dialogTool->getSecondPointId(); + const quint32 axisP1Id = dialogTool->GetAxisP1Id(); + const quint32 axisP2Id = dialogTool->GetAxisP2Id(); + const quint32 firstPointId = dialogTool->GetFirstPointId(); + const quint32 secondPointId = dialogTool->GetSecondPointId(); const QString pointName = dialogTool->getPointName(); VToolTriangle* point = nullptr; point = Create(0, pointName, axisP1Id, axisP2Id, firstPointId, secondPointId, 5, 10, scene, doc, data, @@ -283,10 +283,10 @@ void VToolTriangle::SaveDialog(QDomElement &domElement) DialogTriangle *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); - doc->SetAttribute(domElement, AttrAxisP1, QString().setNum(dialogTool->getAxisP1Id())); - doc->SetAttribute(domElement, AttrAxisP2, QString().setNum(dialogTool->getAxisP2Id())); - doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->getFirstPointId())); - doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->getSecondPointId())); + doc->SetAttribute(domElement, AttrAxisP1, QString().setNum(dialogTool->GetAxisP1Id())); + doc->SetAttribute(domElement, AttrAxisP2, QString().setNum(dialogTool->GetAxisP2Id())); + doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->GetFirstPointId())); + doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->GetSecondPointId())); } //--------------------------------------------------------------------------------------------------------------------- @@ -308,13 +308,13 @@ void VToolTriangle::SaveOptions(QDomElement &tag, QSharedPointer &obj) } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolTriangle::getSecondPointId() const +quint32 VToolTriangle::GetSecondPointId() const { return secondPointId; } //--------------------------------------------------------------------------------------------------------------------- -void VToolTriangle::setSecondPointId(const quint32 &value) +void VToolTriangle::SetSecondPointId(const quint32 &value) { if (value != NULL_ID) { @@ -361,13 +361,13 @@ void VToolTriangle::ShowVisualization(bool show) } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolTriangle::getFirstPointId() const +quint32 VToolTriangle::GetFirstPointId() const { return firstPointId; } //--------------------------------------------------------------------------------------------------------------------- -void VToolTriangle::setFirstPointId(const quint32 &value) +void VToolTriangle::SetFirstPointId(const quint32 &value) { if (value != NULL_ID) { @@ -379,13 +379,13 @@ void VToolTriangle::setFirstPointId(const quint32 &value) } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolTriangle::getAxisP2Id() const +quint32 VToolTriangle::GetAxisP2Id() const { return axisP2Id; } //--------------------------------------------------------------------------------------------------------------------- -void VToolTriangle::setAxisP2Id(const quint32 &value) +void VToolTriangle::SetAxisP2Id(const quint32 &value) { if (value != NULL_ID) { @@ -397,13 +397,13 @@ void VToolTriangle::setAxisP2Id(const quint32 &value) } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolTriangle::getAxisP1Id() const +quint32 VToolTriangle::GetAxisP1Id() const { return axisP1Id; } //--------------------------------------------------------------------------------------------------------------------- -void VToolTriangle::setAxisP1Id(const quint32 &value) +void VToolTriangle::SetAxisP1Id(const quint32 &value) { if (value != NULL_ID) { diff --git a/src/app/tools/drawTools/vtooltriangle.h b/src/app/tools/drawTools/vtooltriangle.h index 5ae0743dc..678f4da40 100644 --- a/src/app/tools/drawTools/vtooltriangle.h +++ b/src/app/tools/drawTools/vtooltriangle.h @@ -54,17 +54,17 @@ public: virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::Triangle)}; - quint32 getAxisP1Id() const; - void setAxisP1Id(const quint32 &value); + quint32 GetAxisP1Id() const; + void SetAxisP1Id(const quint32 &value); - quint32 getAxisP2Id() const; - void setAxisP2Id(const quint32 &value); + quint32 GetAxisP2Id() const; + void SetAxisP2Id(const quint32 &value); - quint32 getFirstPointId() const; - void setFirstPointId(const quint32 &value); + quint32 GetFirstPointId() const; + void SetFirstPointId(const quint32 &value); - quint32 getSecondPointId() const; - void setSecondPointId(const quint32 &value); + quint32 GetSecondPointId() const; + void SetSecondPointId(const quint32 &value); virtual void ShowVisualization(bool show); public slots: diff --git a/src/app/tools/vabstracttool.cpp b/src/app/tools/vabstracttool.cpp index 7b5034667..b2375c224 100644 --- a/src/app/tools/vabstracttool.cpp +++ b/src/app/tools/vabstracttool.cpp @@ -239,7 +239,7 @@ QString VAbstractTool::getLineType() const } //--------------------------------------------------------------------------------------------------------------------- -void VAbstractTool::setTypeLine(const QString &value) +void VAbstractTool::SetTypeLine(const QString &value) { typeLine = value; diff --git a/src/app/tools/vabstracttool.h b/src/app/tools/vabstracttool.h index dca1083a1..0a8505bd5 100644 --- a/src/app/tools/vabstracttool.h +++ b/src/app/tools/vabstracttool.h @@ -115,7 +115,7 @@ public: const VContainer *getData() const; QString getLineType() const; - virtual void setTypeLine(const QString &value); + virtual void SetTypeLine(const QString &value); QMap PointsList() const; virtual QString getTagName() const =0; virtual void ShowVisualization(bool show) =0; diff --git a/src/app/tools/vtooluniondetails.cpp b/src/app/tools/vtooluniondetails.cpp index d59f93e40..32350ad1d 100644 --- a/src/app/tools/vtooluniondetails.cpp +++ b/src/app/tools/vtooluniondetails.cpp @@ -206,7 +206,7 @@ void VToolUnionDetails::AddToNewDetail(QObject *tool, VPattern *doc, VContainer { VSpline spline(splinePath->at(i-1).P(), splinePath->at(i).P(), splinePath->at(i-1).Angle2(), splinePath->at(i).Angle1(), splinePath->at(i-1).KAsm2(), - splinePath->at(i).KAsm1(), splinePath->getKCurve()); + splinePath->at(i).KAsm1(), splinePath->GetKCurve()); VPointF *p1 = new VPointF(spline.GetP1()); BiasRotatePoint(p1, dx, dy, data->GeometricObject(pRotate)->toQPointF(), @@ -366,7 +366,7 @@ void VToolUnionDetails::UpdatePoints(const quint32 &idDetail, VContainer *data, { VSpline spline(splinePath->at(i-1).P(), splinePath->at(i).P(), splinePath->at(i-1).Angle2(), splinePath->at(i).Angle1(), splinePath->at(i-1).KAsm2(), - splinePath->at(i).KAsm1(), splinePath->getKCurve()); + splinePath->at(i).KAsm1(), splinePath->GetKCurve()); VPointF *p1 = new VPointF(spline.GetP1()); BiasRotatePoint(p1, dx, dy, data->GeometricObject(pRotate)->toQPointF(), diff --git a/src/app/undocommands/movesplinepath.cpp b/src/app/undocommands/movesplinepath.cpp index 1e756ad8a..86f72b5a3 100644 --- a/src/app/undocommands/movesplinepath.cpp +++ b/src/app/undocommands/movesplinepath.cpp @@ -89,7 +89,7 @@ void MoveSplinePath::Do(const VSplinePath &splPath) QDomElement domElement = doc->elementById(QString().setNum(nodeId)); if (domElement.isElement()) { - doc->SetAttribute(domElement, VToolSplinePath::AttrKCurve, QString().setNum(splPath.getKCurve())); + doc->SetAttribute(domElement, VToolSplinePath::AttrKCurve, QString().setNum(splPath.GetKCurve())); VToolSplinePath::UpdatePathPoint(doc, domElement, splPath); emit NeedLiteParsing(Document::LiteParse); diff --git a/src/app/visualization/vistoolcurveintersectaxis.cpp b/src/app/visualization/vistoolcurveintersectaxis.cpp index d3cabc903..9ceb59a18 100644 --- a/src/app/visualization/vistoolcurveintersectaxis.cpp +++ b/src/app/visualization/vistoolcurveintersectaxis.cpp @@ -92,7 +92,7 @@ QString VisToolCurveIntersectAxis::Angle() const } //--------------------------------------------------------------------------------------------------------------------- -void VisToolCurveIntersectAxis::setAngle(const QString &expression) +void VisToolCurveIntersectAxis::SetAngle(const QString &expression) { angle = FindVal(expression); } diff --git a/src/app/visualization/vistoolcurveintersectaxis.h b/src/app/visualization/vistoolcurveintersectaxis.h index d6481bf48..1398a01ce 100644 --- a/src/app/visualization/vistoolcurveintersectaxis.h +++ b/src/app/visualization/vistoolcurveintersectaxis.h @@ -43,7 +43,7 @@ public: virtual void RefreshGeometry(); QString Angle() const; - void setAngle(const QString &expression); + void SetAngle(const QString &expression); void setAxisPointId(const quint32 &value); virtual int type() const {return Type;} diff --git a/src/app/visualization/vistoolcutsplinepath.cpp b/src/app/visualization/vistoolcutsplinepath.cpp index fcea7e2ee..f79105cc8 100644 --- a/src/app/visualization/vistoolcutsplinepath.cpp +++ b/src/app/visualization/vistoolcutsplinepath.cpp @@ -67,8 +67,8 @@ void VisToolCutSplinePath::RefreshGeometry() VSplinePoint splP1 = splPath->at(p1); VSplinePoint splP2 = splPath->at(p2); - const VSpline spl1 = VSpline(splP1.P(), spl1p2, spl1p3, p, splPath->getKCurve()); - const VSpline spl2 = VSpline(p, spl2p2, spl2p3, splP2.P(), splPath->getKCurve()); + const VSpline spl1 = VSpline(splP1.P(), spl1p2, spl1p3, p, splPath->GetKCurve()); + const VSpline spl2 = VSpline(p, spl2p2, spl2p3, splP2.P(), splPath->GetKCurve()); VSplinePath spPath1 = VSplinePath(); VSplinePath spPath2 = VSplinePath(); @@ -104,8 +104,8 @@ void VisToolCutSplinePath::RefreshGeometry() } } - spPath1.setKCurve(splPath->getKCurve()); - spPath2.setKCurve(splPath->getKCurve()); + spPath1.SetKCurve(splPath->GetKCurve()); + spPath2.SetKCurve(splPath->GetKCurve()); DrawPoint(point, cutPoint, mainColor); diff --git a/src/app/visualization/vistoolendline.cpp b/src/app/visualization/vistoolendline.cpp index 0bd977362..a3483c829 100644 --- a/src/app/visualization/vistoolendline.cpp +++ b/src/app/visualization/vistoolendline.cpp @@ -72,7 +72,7 @@ QString VisToolEndLine::Angle() const } //--------------------------------------------------------------------------------------------------------------------- -void VisToolEndLine::setAngle(const QString &expression) +void VisToolEndLine::SetAngle(const QString &expression) { angle = FindVal(expression); } diff --git a/src/app/visualization/vistoolendline.h b/src/app/visualization/vistoolendline.h index 7b44f697f..cc3dd3f14 100644 --- a/src/app/visualization/vistoolendline.h +++ b/src/app/visualization/vistoolendline.h @@ -42,7 +42,7 @@ public: virtual void RefreshGeometry(); QString Angle() const; - void setAngle(const QString &expression); + void SetAngle(const QString &expression); void setLength(const QString &expression); virtual int type() const {return Type;} enum { Type = UserType + static_cast(Vis::ToolEndLine)}; diff --git a/src/app/visualization/vistoollineintersectaxis.cpp b/src/app/visualization/vistoollineintersectaxis.cpp index 371d46cad..bf757847f 100644 --- a/src/app/visualization/vistoollineintersectaxis.cpp +++ b/src/app/visualization/vistoollineintersectaxis.cpp @@ -108,7 +108,7 @@ QString VisToolLineIntersectAxis::Angle() const } //--------------------------------------------------------------------------------------------------------------------- -void VisToolLineIntersectAxis::setAngle(const QString &expression) +void VisToolLineIntersectAxis::SetAngle(const QString &expression) { angle = FindVal(expression); } diff --git a/src/app/visualization/vistoollineintersectaxis.h b/src/app/visualization/vistoollineintersectaxis.h index f9f0f370e..419873f80 100644 --- a/src/app/visualization/vistoollineintersectaxis.h +++ b/src/app/visualization/vistoollineintersectaxis.h @@ -43,7 +43,7 @@ public: virtual void RefreshGeometry(); QString Angle() const; - void setAngle(const QString &expression); + void SetAngle(const QString &expression); void setPoint2Id(const quint32 &value); void setAxisPointId(const quint32 &value); diff --git a/src/app/visualization/vistoolnormal.cpp b/src/app/visualization/vistoolnormal.cpp index e9b5402c5..858415366 100644 --- a/src/app/visualization/vistoolnormal.cpp +++ b/src/app/visualization/vistoolnormal.cpp @@ -104,13 +104,13 @@ void VisToolNormal::setLength(const QString &expression) } //--------------------------------------------------------------------------------------------------------------------- -qreal VisToolNormal::getAngle() const +qreal VisToolNormal::GetAngle() const { return angle; } //--------------------------------------------------------------------------------------------------------------------- -void VisToolNormal::setAngle(const qreal &value) +void VisToolNormal::SetAngle(const qreal &value) { angle = value; } diff --git a/src/app/visualization/vistoolnormal.h b/src/app/visualization/vistoolnormal.h index 1593d03f5..c73a0cace 100644 --- a/src/app/visualization/vistoolnormal.h +++ b/src/app/visualization/vistoolnormal.h @@ -42,8 +42,8 @@ public: void setPoint2Id(const quint32 &value); void setLength(const QString &expression); - qreal getAngle() const; - void setAngle(const qreal &value); + qreal GetAngle() const; + void SetAngle(const qreal &value); virtual int type() const {return Type;} enum { Type = UserType + static_cast(Vis::ToolNormal)}; private: diff --git a/src/app/visualization/vistoolspline.cpp b/src/app/visualization/vistoolspline.cpp index 92562e751..5c014feeb 100644 --- a/src/app/visualization/vistoolspline.cpp +++ b/src/app/visualization/vistoolspline.cpp @@ -84,31 +84,31 @@ void VisToolSpline::setPoint4Id(const quint32 &value) } //--------------------------------------------------------------------------------------------------------------------- -void VisToolSpline::setAngle1(const qreal &value) +void VisToolSpline::SetAngle1(const qreal &value) { angle1 = value; } //--------------------------------------------------------------------------------------------------------------------- -void VisToolSpline::setAngle2(const qreal &value) +void VisToolSpline::SetAngle2(const qreal &value) { angle2 = value; } //--------------------------------------------------------------------------------------------------------------------- -void VisToolSpline::setKAsm1(const qreal &value) +void VisToolSpline::SetKAsm1(const qreal &value) { kAsm1 = value; } //--------------------------------------------------------------------------------------------------------------------- -void VisToolSpline::setKAsm2(const qreal &value) +void VisToolSpline::SetKAsm2(const qreal &value) { kAsm2 = value; } //--------------------------------------------------------------------------------------------------------------------- -void VisToolSpline::setKCurve(const qreal &value) +void VisToolSpline::SetKCurve(const qreal &value) { kCurve = value; } diff --git a/src/app/visualization/vistoolspline.h b/src/app/visualization/vistoolspline.h index 56c12d021..df24af01b 100644 --- a/src/app/visualization/vistoolspline.h +++ b/src/app/visualization/vistoolspline.h @@ -41,11 +41,11 @@ public: virtual void RefreshGeometry(); void setPoint4Id(const quint32 &value); - void setAngle1(const qreal &value); - void setAngle2(const qreal &value); - void setKAsm1(const qreal &value); - void setKAsm2(const qreal &value); - void setKCurve(const qreal &value); + void SetAngle1(const qreal &value); + void SetAngle2(const qreal &value); + void SetKAsm1(const qreal &value); + void SetKAsm2(const qreal &value); + void SetKCurve(const qreal &value); virtual int type() const {return Type;} enum { Type = UserType + static_cast(Vis::ToolSpline)}; diff --git a/src/app/widgets/vformulaproperty.cpp b/src/app/widgets/vformulaproperty.cpp index 444a9fca6..09fbd2057 100644 --- a/src/app/widgets/vformulaproperty.cpp +++ b/src/app/widgets/vformulaproperty.cpp @@ -95,7 +95,7 @@ QWidget* VFormulaProperty::createEditor(QWidget* parent, const QStyleOptionViewI VFormula formula = VProperty::d_ptr->VariantValue.value(); VFormulaPropertyEditor* tmpEditor = new VFormulaPropertyEditor(parent); - tmpEditor->setFormula(formula); + tmpEditor->SetFormula(formula); VProperty::d_ptr->editor = tmpEditor; return VProperty::d_ptr->editor; } @@ -108,7 +108,7 @@ bool VFormulaProperty::setEditorData(QWidget* editor) if (tmpWidget) { VFormula formula = VProperty::d_ptr->VariantValue.value(); - tmpWidget->setFormula(formula); + tmpWidget->SetFormula(formula); } else return false; @@ -124,7 +124,7 @@ QVariant VFormulaProperty::getEditorData(const QWidget *editor) const if (tmpWidget) { QVariant value; - value.setValue(tmpWidget->getFormula()); + value.setValue(tmpWidget->GetFormula()); return value; } @@ -163,26 +163,26 @@ VProperty *VFormulaProperty::clone(bool include_children, VProperty *container) void VFormulaProperty::setValue(const QVariant &value) { VFormula tmpFormula = value.value(); - setFormula(tmpFormula); + SetFormula(tmpFormula); } //--------------------------------------------------------------------------------------------------------------------- QVariant VFormulaProperty::getValue() const { - VFormula tmpFormula = getFormula(); + VFormula tmpFormula = GetFormula(); QVariant value; value.setValue(tmpFormula); return value; } //--------------------------------------------------------------------------------------------------------------------- -VFormula VFormulaProperty::getFormula() const +VFormula VFormulaProperty::GetFormula() const { return VProperty::d_ptr->VariantValue.value(); } //--------------------------------------------------------------------------------------------------------------------- -void VFormulaProperty::setFormula(const VFormula &formula) +void VFormulaProperty::SetFormula(const VFormula &formula) { if (d_ptr->Children.count() < 2) { @@ -197,7 +197,7 @@ void VFormulaProperty::setFormula(const VFormula &formula) QVariant tmpValue(formula.getStringValue()); tmpValue.convert(QVariant::String); - QVariant tmpFormula(formula.getFormula()); + QVariant tmpFormula(formula.GetFormula()); tmpFormula.convert(QVariant::String); VProperty::d_ptr->Children.at(0)->setValue(tmpValue); @@ -213,8 +213,8 @@ void VFormulaProperty::ValueChildChanged(const QVariant &value, int typeForParen { if (typeForParent == static_cast(ChildType::Formula)) { - VFormula newFormula = getFormula(); - newFormula.setFormula(value.toString()); - setFormula(newFormula); + VFormula newFormula = GetFormula(); + newFormula.SetFormula(value.toString()); + SetFormula(newFormula); } } diff --git a/src/app/widgets/vformulaproperty.h b/src/app/widgets/vformulaproperty.h index 90c177aed..bcbc2f407 100644 --- a/src/app/widgets/vformulaproperty.h +++ b/src/app/widgets/vformulaproperty.h @@ -76,10 +76,10 @@ public: virtual QVariant getValue() const; //! Returns the formula - virtual VFormula getFormula() const; + virtual VFormula GetFormula() const; //! Sets the formula - virtual void setFormula(const VFormula &formula); + virtual void SetFormula(const VFormula &formula); public slots: virtual void ValueChildChanged(const QVariant &value, int typeForParent); diff --git a/src/app/widgets/vformulapropertyeditor.cpp b/src/app/widgets/vformulapropertyeditor.cpp index 7030ae7fa..cc583ccfb 100644 --- a/src/app/widgets/vformulapropertyeditor.cpp +++ b/src/app/widgets/vformulapropertyeditor.cpp @@ -73,7 +73,7 @@ VFormulaPropertyEditor::VFormulaPropertyEditor(QWidget *parent) } //--------------------------------------------------------------------------------------------------------------------- -void VFormulaPropertyEditor::setFormula(const VFormula& formula) +void VFormulaPropertyEditor::SetFormula(const VFormula& formula) { if (this->formula != formula) { @@ -89,11 +89,11 @@ void VFormulaPropertyEditor::onToolButtonClicked() qApp->getMainWindow()); tmpWidget->setCheckZero(formula.getCheckZero()); tmpWidget->setPostfix(formula.getPostfix()); - tmpWidget->setFormula(formula.getFormula(FormulaType::FromUser)); + tmpWidget->SetFormula(formula.GetFormula(FormulaType::FromUser)); if (tmpWidget->exec() == QDialog::Accepted) { - formula.setFormula(tmpWidget->getFormula(), FormulaType::ToUser); + formula.SetFormula(tmpWidget->GetFormula(), FormulaType::ToUser); TextLabel->setText(formula.getStringValue()); delete tmpWidget; emit dataChangedByUser(formula, this); @@ -122,7 +122,7 @@ VFormulaPropertyEditor::~VFormulaPropertyEditor() } //--------------------------------------------------------------------------------------------------------------------- -VFormula VFormulaPropertyEditor::getFormula() const +VFormula VFormulaPropertyEditor::GetFormula() const { return formula; } diff --git a/src/app/widgets/vformulapropertyeditor.h b/src/app/widgets/vformulapropertyeditor.h index e7a1ab291..52de778aa 100644 --- a/src/app/widgets/vformulapropertyeditor.h +++ b/src/app/widgets/vformulapropertyeditor.h @@ -49,20 +49,20 @@ public: virtual ~VFormulaPropertyEditor(); //! Returns the formula currently set - VFormula getFormula() const; + VFormula GetFormula() const; //! Needed for proper event handling bool eventFilter(QObject *obj, QEvent *ev); signals: //! This is emitted, when the user changes the color - void dataChangedByUser(const VFormula &getFormula, VFormulaPropertyEditor* editor); + void dataChangedByUser(const VFormula &GetFormula, VFormulaPropertyEditor* editor); void dataChanged(); public slots: //! Sets the color of the widget - void setFormula(const VFormula &formula); + void SetFormula(const VFormula &formula); private slots: void onToolButtonClicked(); diff --git a/src/app/widgets/vtooloptionspropertybrowser.cpp b/src/app/widgets/vtooloptionspropertybrowser.cpp index 178d6c6f3..3c030e12c 100644 --- a/src/app/widgets/vtooloptionspropertybrowser.cpp +++ b/src/app/widgets/vtooloptionspropertybrowser.cpp @@ -367,7 +367,7 @@ void VToolOptionsPropertyBrowser::AddPropertyFormula(const QString &propertyName const QString &attrName) { VFormulaProperty* itemLength = new VFormulaProperty(propertyName); - itemLength->setFormula(formula); + itemLength->SetFormula(formula); AddProperty(itemLength, attrName); } @@ -469,13 +469,13 @@ void VToolOptionsPropertyBrowser::ChangeDataToolEndLine(VProperty *property) SetPointName(value.toString()); break; case 3: // VAbstractTool::AttrTypeLine - i->setTypeLine(value.toString()); + i->SetTypeLine(value.toString()); break; case 4: // VAbstractTool::AttrLength - i->setFormulaLength(value.value()); + i->SetFormulaLength(value.value()); break; case 5: // VAbstractTool::AttrAngle - i->setFormulaAngle(value.value()); + i->SetFormulaAngle(value.value()); break; default: qWarning()<<"Unknown property type. id = "<(value.toString()); break; case 3: // VAbstractTool::AttrTypeLine - i->setTypeLine(value.toString()); + i->SetTypeLine(value.toString()); break; case 4: // VAbstractTool::AttrLength - i->setFormulaLength(value.value()); + i->SetFormulaLength(value.value()); break; default: qWarning()<<"Unknown property type. id = "<setFormulaRadius(value.value()); + i->SetFormulaRadius(value.value()); break; case 9: // VAbstractTool::AttrAngle1 - i->setFormulaF1(value.value()); + i->SetFormulaF1(value.value()); break; case 10: // VAbstractTool::AttrAngle2 - i->setFormulaF2(value.value()); + i->SetFormulaF2(value.value()); break; default: qWarning()<<"Unknown property type. id = "<(value.toString()); break; case 4: // VAbstractTool::AttrLength - i->setFormulaLength(value.value()); + i->SetFormulaLength(value.value()); break; case 3: // VAbstractTool::AttrTypeLine - i->setTypeLine(value.toString()); + i->SetTypeLine(value.toString()); break; default: qWarning()<<"Unknown property type. id = "<(value.toString()); break; case 4: // VAbstractTool::AttrLength - i->setFormula(value.value()); + i->SetFormula(value.value()); break; default: qWarning()<<"Unknown property type. id = "<(value.toString()); break; case 4: // VAbstractTool::AttrLength - i->setFormula(value.value()); + i->SetFormula(value.value()); break; default: qWarning()<<"Unknown property type. id = "<(value.toString()); break; case 4: // VAbstractTool::AttrLength - i->setFormula(value.value()); + i->SetFormula(value.value()); break; default: qWarning()<<"Unknown property type. id = "<(value.toString()); break; case 3: // VAbstractTool::AttrTypeLine - i->setTypeLine(value.toString()); + i->SetTypeLine(value.toString()); break; default: qWarning()<<"Unknown property type. id = "<setTypeLine(value.toString()); + i->SetTypeLine(value.toString()); break; default: qWarning()<<"Unknown property type. id = "<setFormulaLength(value.value()); + i->SetFormulaLength(value.value()); break; case 0: // VAbstractTool::AttrName SetPointName(value.toString()); break; case 5: // VAbstractTool::AttrAngle - i->setAngle(value.toDouble()); + i->SetAngle(value.toDouble()); break; case 3: // VAbstractTool::AttrTypeLine - i->setTypeLine(value.toString()); + i->SetTypeLine(value.toString()); break; default: qWarning()<<"Unknown property type. id = "<setFormulaLength(value.value()); + i->SetFormulaLength(value.value()); break; case 0: // VAbstractTool::AttrName SetPointName(value.toString()); break; case 3: // VAbstractTool::AttrTypeLine - i->setTypeLine(value.toString()); + i->SetTypeLine(value.toString()); break; default: qWarning()<<"Unknown property type. id = "<getSplinePath(); - splPath.setKCurve(value.toDouble()); + splPath.SetKCurve(value.toDouble()); i->setSplinePath(splPath); break; } @@ -885,10 +885,10 @@ void VToolOptionsPropertyBrowser::ChangeDataToolLineIntersectAxis(VProperty *pro SetPointName(value.toString()); break; case 3: // VAbstractTool::AttrTypeLine - i->setTypeLine(value.toString()); + i->SetTypeLine(value.toString()); break; case 5: // VAbstractTool::AttrAngle - i->setFormulaAngle(value.value()); + i->SetFormulaAngle(value.value()); break; default: qWarning()<<"Unknown property type. id = "<(value.toString()); break; case 3: // VAbstractTool::AttrTypeLine - i->setTypeLine(value.toString()); + i->SetTypeLine(value.toString()); break; case 5: // VAbstractTool::AttrAngle - i->setFormulaAngle(value.value()); + i->SetFormulaAngle(value.value()); break; default: qWarning()<<"Unknown property type. id = "<getFormulaLength(), VAbstractTool::AttrLength); - AddPropertyFormula(tr("Angle"), i->getFormulaAngle(), VAbstractTool::AttrAngle); + AddPropertyFormula(tr("Length"), i->GetFormulaLength(), VAbstractTool::AttrLength); + AddPropertyFormula(tr("Angle"), i->GetFormulaAngle(), VAbstractTool::AttrAngle); } //--------------------------------------------------------------------------------------------------------------------- @@ -959,7 +959,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolAlongLine(QGraphicsItem *item) AddPropertyPointName(i, tr("Point label")); AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); - AddPropertyFormula(tr("Length"), i->getFormulaLength(), VAbstractTool::AttrLength); + AddPropertyFormula(tr("Length"), i->GetFormulaLength(), VAbstractTool::AttrLength); } //--------------------------------------------------------------------------------------------------------------------- @@ -969,9 +969,9 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolArc(QGraphicsItem *item) i->ShowVisualization(true); formView->setTitle(tr("Arc")); - AddPropertyFormula(tr("Radius"), i->getFormulaRadius(), VAbstractTool::AttrRadius); - AddPropertyFormula(tr("First angle"), i->getFormulaF1(), VAbstractTool::AttrAngle1); - AddPropertyFormula(tr("Second angle"), i->getFormulaF2(), VAbstractTool::AttrAngle2); + AddPropertyFormula(tr("Radius"), i->GetFormulaRadius(), VAbstractTool::AttrRadius); + AddPropertyFormula(tr("First angle"), i->GetFormulaF1(), VAbstractTool::AttrAngle1); + AddPropertyFormula(tr("Second angle"), i->GetFormulaF2(), VAbstractTool::AttrAngle2); } //--------------------------------------------------------------------------------------------------------------------- @@ -983,7 +983,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolBisector(QGraphicsItem *item) AddPropertyPointName(i, tr("Point label")); AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); - AddPropertyFormula(tr("Length"), i->getFormulaLength(), VAbstractTool::AttrLength); + AddPropertyFormula(tr("Length"), i->GetFormulaLength(), VAbstractTool::AttrLength); } //--------------------------------------------------------------------------------------------------------------------- @@ -994,7 +994,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolCutArc(QGraphicsItem *item) formView->setTitle(tr("Cut arc tool")); AddPropertyPointName(i, tr("Point label")); - AddPropertyFormula(tr("Length"), i->getFormula(), VAbstractTool::AttrLength); + AddPropertyFormula(tr("Length"), i->GetFormula(), VAbstractTool::AttrLength); } //--------------------------------------------------------------------------------------------------------------------- @@ -1005,7 +1005,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolCutSpline(QGraphicsItem *item) formView->setTitle(tr("Tool for segmenting a curve")); AddPropertyPointName(i, tr("Point label")); - AddPropertyFormula(tr("Length"), i->getFormula(), VAbstractTool::AttrLength); + AddPropertyFormula(tr("Length"), i->GetFormula(), VAbstractTool::AttrLength); } //--------------------------------------------------------------------------------------------------------------------- @@ -1016,7 +1016,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolCutSplinePath(QGraphicsItem *it formView->setTitle(tr("Tool segment a pathed curve")); AddPropertyPointName(i, tr("Point label")); - AddPropertyFormula(tr("Length"), i->getFormula(), VAbstractTool::AttrLength); + AddPropertyFormula(tr("Length"), i->GetFormula(), VAbstractTool::AttrLength); } //--------------------------------------------------------------------------------------------------------------------- @@ -1059,12 +1059,12 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolNormal(QGraphicsItem *item) i->ShowVisualization(true); formView->setTitle(tr("Point along perpendicular")); - AddPropertyFormula(tr("Length"), i->getFormulaLength(), VAbstractTool::AttrLength); + AddPropertyFormula(tr("Length"), i->GetFormulaLength(), VAbstractTool::AttrLength); AddPropertyPointName(i, tr("Point label")); AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); VDoubleProperty* itemAngle = new VDoubleProperty(tr("Additional angle degrees")); - itemAngle->setValue(i->getAngle()); + itemAngle->setValue(i->GetAngle()); itemAngle->setSetting("Min", -360); itemAngle->setSetting("Max", 360); itemAngle->setSetting("Precision", 3); @@ -1101,7 +1101,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolShoulderPoint(QGraphicsItem *it AddPropertyPointName(i, tr("Point label")); AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); - AddPropertyFormula(tr("Length"), i->getFormulaLength(), VAbstractTool::AttrLength); + AddPropertyFormula(tr("Length"), i->GetFormulaLength(), VAbstractTool::AttrLength); } //--------------------------------------------------------------------------------------------------------------------- @@ -1134,7 +1134,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolSplinePath(QGraphicsItem *item) itemFactor->setSetting("Max", 1000); itemFactor->setSetting("Step", 0.01); itemFactor->setSetting("Precision", 3); - itemFactor->setValue(splPath.getKCurve()); + itemFactor->setValue(splPath.GetKCurve()); AddProperty(itemFactor, VAbstractTool::AttrKCurve); } @@ -1157,7 +1157,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolLineIntersectAxis(QGraphicsItem AddPropertyPointName(i, tr("Point label")); AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); - AddPropertyFormula(tr("Angle"), i->getFormulaAngle(), VAbstractTool::AttrAngle); + AddPropertyFormula(tr("Angle"), i->GetFormulaAngle(), VAbstractTool::AttrAngle); } //--------------------------------------------------------------------------------------------------------------------- @@ -1169,7 +1169,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolCurveIntersectAxis(QGraphicsIte AddPropertyPointName(i, tr("Point label")); AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); - AddPropertyFormula(tr("Angle"), i->getFormulaAngle(), VAbstractTool::AttrAngle); + AddPropertyFormula(tr("Angle"), i->GetFormulaAngle(), VAbstractTool::AttrAngle); } //--------------------------------------------------------------------------------------------------------------------- @@ -1190,11 +1190,11 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolEndLine() idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); QVariant valueFormula; - valueFormula.setValue(i->getFormulaLength()); + valueFormula.setValue(i->GetFormulaLength()); idToProperty[VAbstractTool::AttrLength]->setValue(valueFormula); QVariant valueAngle; - valueAngle.setValue(i->getFormulaAngle()); + valueAngle.setValue(i->GetFormulaAngle()); idToProperty[VAbstractTool::AttrAngle]->setValue(valueAngle); } @@ -1208,7 +1208,7 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolAlongLine() idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); QVariant valueFormula; - valueFormula.setValue(i->getFormulaLength()); + valueFormula.setValue(i->GetFormulaLength()); idToProperty[VAbstractTool::AttrLength]->setValue(valueFormula); } @@ -1219,15 +1219,15 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolArc() QVariant valueRadius; - valueRadius.setValue(i->getFormulaRadius()); + valueRadius.setValue(i->GetFormulaRadius()); idToProperty[VAbstractTool::AttrRadius]->setValue(valueRadius); QVariant valueFirstAngle; - valueFirstAngle.setValue(i->getFormulaF1()); + valueFirstAngle.setValue(i->GetFormulaF1()); idToProperty[VAbstractTool::AttrAngle1]->setValue(valueFirstAngle); QVariant valueSecondAngle; - valueSecondAngle.setValue(i->getFormulaF2()); + valueSecondAngle.setValue(i->GetFormulaF2()); idToProperty[VAbstractTool::AttrAngle2]->setValue(valueSecondAngle); } @@ -1239,7 +1239,7 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolBisector() idToProperty[VAbstractTool::AttrName]->setValue(i->name()); QVariant valueFormula; - valueFormula.setValue(i->getFormulaLength()); + valueFormula.setValue(i->GetFormulaLength()); idToProperty[VAbstractTool::AttrLength]->setValue(valueFormula); const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); @@ -1254,7 +1254,7 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolCutArc() idToProperty[VAbstractTool::AttrName]->setValue(i->name()); QVariant valueFormula; - valueFormula.setValue(i->getFormula()); + valueFormula.setValue(i->GetFormula()); idToProperty[VAbstractTool::AttrLength]->setValue(valueFormula); } @@ -1266,7 +1266,7 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolCutSpline() idToProperty[VAbstractTool::AttrName]->setValue(i->name()); QVariant valueFormula; - valueFormula.setValue(i->getFormula()); + valueFormula.setValue(i->GetFormula()); idToProperty[VAbstractTool::AttrLength]->setValue(valueFormula); } @@ -1278,7 +1278,7 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolCutSplinePath() idToProperty[VAbstractTool::AttrName]->setValue(i->name()); QVariant valueFormula; - valueFormula.setValue(i->getFormula()); + valueFormula.setValue(i->GetFormula()); idToProperty[VAbstractTool::AttrLength]->setValue(valueFormula); } @@ -1316,12 +1316,12 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolNormal() VToolNormal *i = qgraphicsitem_cast(currentItem); QVariant valueFormula; - valueFormula.setValue(i->getFormulaLength()); + valueFormula.setValue(i->GetFormulaLength()); idToProperty[VAbstractTool::AttrLength]->setValue(valueFormula); idToProperty[VAbstractTool::AttrName]->setValue(i->name()); - idToProperty[VAbstractTool::AttrAngle]->setValue( i->getAngle()); + idToProperty[VAbstractTool::AttrAngle]->setValue( i->GetAngle()); const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); @@ -1353,7 +1353,7 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolShoulderPoint() VToolShoulderPoint *i = qgraphicsitem_cast(currentItem); QVariant valueFormula; - valueFormula.setValue(i->getFormulaLength()); + valueFormula.setValue(i->GetFormulaLength()); idToProperty[VAbstractTool::AttrLength]->setValue(valueFormula); idToProperty[VAbstractTool::AttrName]->setValue(i->name()); @@ -1377,7 +1377,7 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolSplinePath() VToolSplinePath *i = qgraphicsitem_cast(currentItem); VSplinePath splPath = i->getSplinePath(); - idToProperty[VAbstractTool::AttrKCurve]->setValue(splPath.getKCurve()); + idToProperty[VAbstractTool::AttrKCurve]->setValue(splPath.GetKCurve()); } //--------------------------------------------------------------------------------------------------------------------- @@ -1398,7 +1398,7 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolLineIntersectAxis() idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); QVariant valueAngle; - valueAngle.setValue(i->getFormulaAngle()); + valueAngle.setValue(i->GetFormulaAngle()); idToProperty[VAbstractTool::AttrAngle]->setValue(valueAngle); } @@ -1412,7 +1412,7 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolCurveIntersectAxis() idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); QVariant valueAngle; - valueAngle.setValue(i->getFormulaAngle()); + valueAngle.setValue(i->GetFormulaAngle()); idToProperty[VAbstractTool::AttrAngle]->setValue(valueAngle); } diff --git a/src/libs/vpropertyexplorer/plugins/vcolorproperty.cpp b/src/libs/vpropertyexplorer/plugins/vcolorproperty.cpp index f47b41856..38a1791a9 100644 --- a/src/libs/vpropertyexplorer/plugins/vcolorproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vcolorproperty.cpp @@ -36,7 +36,7 @@ QVariant VColorProperty::data (int column, int role) const { if (column == DPC_Data && (Qt::DisplayRole == role)) { - return VColorPropertyEditor::getColorString(d_ptr->VariantValue.value()); + return VColorPropertyEditor::GetColorString(d_ptr->VariantValue.value()); } else if (Qt::EditRole == role) { @@ -44,7 +44,7 @@ QVariant VColorProperty::data (int column, int role) const } else if (column == DPC_Data && (Qt::DecorationRole == role)) { - return VColorPropertyEditor::getColorPixmap(d_ptr->VariantValue.value()); + return VColorPropertyEditor::GetColorPixmap(d_ptr->VariantValue.value()); } else return VProperty::data(column, role); @@ -58,7 +58,7 @@ QWidget* VColorProperty::createEditor(QWidget* parent, const QStyleOptionViewIte Q_UNUSED(delegate); VColorPropertyEditor* tmpWidget = new VColorPropertyEditor(parent); - tmpWidget->setColor(d_ptr->VariantValue.value()); + tmpWidget->SetColor(d_ptr->VariantValue.value()); return tmpWidget; } @@ -68,7 +68,7 @@ bool VColorProperty::setEditorData(QWidget* editor) VColorPropertyEditor* tmpWidget = qobject_cast(editor); if (tmpWidget) { - tmpWidget->setColor(d_ptr->VariantValue.value()); + tmpWidget->SetColor(d_ptr->VariantValue.value()); } else return false; @@ -82,7 +82,7 @@ QVariant VColorProperty::getEditorData(const QWidget *editor) const const VColorPropertyEditor* tmpWidget = qobject_cast(editor); if (tmpWidget) { - return tmpWidget->getColor(); + return tmpWidget->GetColor(); } return QVariant(); diff --git a/src/libs/vpropertyexplorer/plugins/vcolorpropertyeditor.cpp b/src/libs/vpropertyexplorer/plugins/vcolorpropertyeditor.cpp index ab55c2378..8dface9a7 100644 --- a/src/libs/vpropertyexplorer/plugins/vcolorpropertyeditor.cpp +++ b/src/libs/vpropertyexplorer/plugins/vcolorpropertyeditor.cpp @@ -47,11 +47,11 @@ VColorPropertyEditor::VColorPropertyEditor(QWidget *parent) // Create the text label TextLabel = new QLabel(this); - TextLabel->setText(getColorString(Color)); + TextLabel->setText(GetColorString(Color)); // Create the label for the pixmap ColorLabel = new QLabel(this); - ColorLabel->setPixmap(getColorPixmap(Color)); + ColorLabel->setPixmap(GetColorPixmap(Color)); // Spacer (this is needed for proper display of the label and button) Spacer = new QSpacerItem(1, 0, QSizePolicy::Expanding, QSizePolicy::Ignored); @@ -68,17 +68,17 @@ VColorPropertyEditor::VColorPropertyEditor(QWidget *parent) //ColorLabel->hide(); // for now, we just use the standard display and only add the button } -void VColorPropertyEditor::setColor(const QColor& color_) +void VColorPropertyEditor::SetColor(const QColor& color_) { if (Color != color_) { Color = color_; - ColorLabel->setPixmap(getColorPixmap(Color)); - TextLabel->setText(getColorString(Color)); + ColorLabel->setPixmap(GetColorPixmap(Color)); + TextLabel->setText(GetColorString(Color)); } } -QPixmap VColorPropertyEditor::getColorPixmap(const QColor& color, unsigned int size) +QPixmap VColorPropertyEditor::GetColorPixmap(const QColor& color, unsigned int size) { QImage tmpImgage(static_cast(size), static_cast(size), QImage::Format_ARGB32_Premultiplied); tmpImgage.fill(static_cast(color.rgb())); @@ -86,7 +86,7 @@ QPixmap VColorPropertyEditor::getColorPixmap(const QColor& color, unsigned int s // todo: support alpha channel } -QString VColorPropertyEditor::getColorString(const QColor& color) +QString VColorPropertyEditor::GetColorString(const QColor& color) { return QString("[%1, %2, %3] (%4)").arg(color.red()).arg(color.green()).arg(color.blue()).arg(color.alpha()); } @@ -98,7 +98,7 @@ void VColorPropertyEditor::onToolButtonClicked() QRgb newRgba = QColorDialog::getRgba(oldRgba, &ok, this); if (ok && newRgba != oldRgba) { - setColor(QColor::fromRgba(newRgba)); + SetColor(QColor::fromRgba(newRgba)); emit dataChangedByUser(Color, this); UserChangeEvent *event = new UserChangeEvent(); QCoreApplication::postEvent ( this, event ); @@ -123,7 +123,7 @@ VColorPropertyEditor::~VColorPropertyEditor() // } -QColor VColorPropertyEditor::getColor() const +QColor VColorPropertyEditor::GetColor() const { return Color; } diff --git a/src/libs/vpropertyexplorer/plugins/vcolorpropertyeditor.h b/src/libs/vpropertyexplorer/plugins/vcolorpropertyeditor.h index ac6dba31a..2de237f34 100644 --- a/src/libs/vpropertyexplorer/plugins/vcolorpropertyeditor.h +++ b/src/libs/vpropertyexplorer/plugins/vcolorpropertyeditor.h @@ -45,31 +45,31 @@ public: //! Returns the color currently set - QColor getColor() const; + QColor GetColor() const; //! A little helper function generating an image to represent a color //! \param color The color to fill the image with //! \size The size of the generated pixmap //! \return Returns a QPixmap - static QPixmap getColorPixmap(const QColor& color, unsigned int size = 16); + static QPixmap GetColorPixmap(const QColor& color, unsigned int size = 16); //! A helper function to convert a color into a string. //! \param color The color to fill the image with //! \return The color as string, usually in the format [RRR, GGG, BBB] (AAA) - static QString getColorString(const QColor& color); + static QString GetColorString(const QColor& color); //! Needed for proper event handling bool eventFilter(QObject *obj, QEvent *ev); signals: //! This is emitted, when the user changes the color - void dataChangedByUser(const QColor &getColor, VColorPropertyEditor* editor); + void dataChangedByUser(const QColor &GetColor, VColorPropertyEditor* editor); void dataChanged(); public slots: //! Sets the color of the widget - void setColor(const QColor &color_); + void SetColor(const QColor &color_); private slots: void onToolButtonClicked(); From e1283c410e940aa64b969d98814533e63aa5a020 Mon Sep 17 00:00:00 2001 From: Felix ulber Date: Tue, 3 Feb 2015 11:29:34 +0100 Subject: [PATCH 095/186] Fixed some tooltips in tool dialogs. --HG-- branch : develop --- src/app/dialogs/tools/dialogcurveintersectaxis.ui | 4 ++-- src/app/dialogs/tools/dialogcutarc.ui | 2 +- src/app/dialogs/tools/dialogheight.ui | 4 ++-- src/app/dialogs/tools/dialoglineintersectaxis.ui | 4 ++-- src/app/dialogs/tools/dialognormal.ui | 12 ++++++++++-- src/app/dialogs/tools/dialogtriangle.ui | 6 +++--- 6 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/app/dialogs/tools/dialogcurveintersectaxis.ui b/src/app/dialogs/tools/dialogcurveintersectaxis.ui index 39a9ccba9..e48091695 100644 --- a/src/app/dialogs/tools/dialogcurveintersectaxis.ui +++ b/src/app/dialogs/tools/dialogcurveintersectaxis.ui @@ -229,7 +229,7 @@ - First point of line + Axis Point @@ -249,7 +249,7 @@ - First point of line + Curve diff --git a/src/app/dialogs/tools/dialogcutarc.ui b/src/app/dialogs/tools/dialogcutarc.ui index 8313e5784..feb4d2d1e 100644 --- a/src/app/dialogs/tools/dialogcutarc.ui +++ b/src/app/dialogs/tools/dialogcutarc.ui @@ -230,7 +230,7 @@ - Selected curve + Selected arc diff --git a/src/app/dialogs/tools/dialogheight.ui b/src/app/dialogs/tools/dialogheight.ui index b818ef23f..39e855ae5 100644 --- a/src/app/dialogs/tools/dialogheight.ui +++ b/src/app/dialogs/tools/dialogheight.ui @@ -58,7 +58,7 @@ - First point of line + Base Point @@ -98,7 +98,7 @@ - First point of line + Second point of line diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.ui b/src/app/dialogs/tools/dialoglineintersectaxis.ui index 2ad7bac18..de2030551 100644 --- a/src/app/dialogs/tools/dialoglineintersectaxis.ui +++ b/src/app/dialogs/tools/dialoglineintersectaxis.ui @@ -226,7 +226,7 @@ - First point of line + Axis Point @@ -266,7 +266,7 @@ - First point of line + Second point of line diff --git a/src/app/dialogs/tools/dialognormal.ui b/src/app/dialogs/tools/dialognormal.ui index 959714a6d..6cbff13b9 100644 --- a/src/app/dialogs/tools/dialognormal.ui +++ b/src/app/dialogs/tools/dialognormal.ui @@ -245,7 +245,11 @@ - + + + First point of line + + @@ -261,7 +265,11 @@ - + + + Second point of line + + diff --git a/src/app/dialogs/tools/dialogtriangle.ui b/src/app/dialogs/tools/dialogtriangle.ui index f56958fd4..f962903f9 100644 --- a/src/app/dialogs/tools/dialogtriangle.ui +++ b/src/app/dialogs/tools/dialogtriangle.ui @@ -55,7 +55,7 @@ - First point of line + First point of the axis @@ -75,7 +75,7 @@ - First point of line + Second point of the axis @@ -115,7 +115,7 @@ - First point of line + Second point of line From 76074f282002f83ed37c959b9e73b51208801c7c Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 3 Feb 2015 13:15:52 +0200 Subject: [PATCH 096/186] Pattern format 0.1.3 support colors. --HG-- branch : feature --- src/libs/ifc/schema.qrc | 1 + src/libs/ifc/schema/pattern/v0.1.3.xsd | 307 +++++++++++++++++++++++++ src/libs/ifc/xml/vpatternconverter.cpp | 22 +- src/libs/ifc/xml/vpatternconverter.h | 1 + 4 files changed, 328 insertions(+), 3 deletions(-) create mode 100644 src/libs/ifc/schema/pattern/v0.1.3.xsd diff --git a/src/libs/ifc/schema.qrc b/src/libs/ifc/schema.qrc index 2037ec8b5..f8b8fe11e 100644 --- a/src/libs/ifc/schema.qrc +++ b/src/libs/ifc/schema.qrc @@ -5,5 +5,6 @@ schema/pattern/v0.1.0.xsd schema/pattern/v0.1.1.xsd schema/pattern/v0.1.2.xsd + schema/pattern/v0.1.3.xsd diff --git a/src/libs/ifc/schema/pattern/v0.1.3.xsd b/src/libs/ifc/schema/pattern/v0.1.3.xsd new file mode 100644 index 000000000..18cf62b78 --- /dev/null +++ b/src/libs/ifc/schema/pattern/v0.1.3.xsd @@ -0,0 +1,307 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/libs/ifc/xml/vpatternconverter.cpp b/src/libs/ifc/xml/vpatternconverter.cpp index af47c64ed..df94c32cc 100644 --- a/src/libs/ifc/xml/vpatternconverter.cpp +++ b/src/libs/ifc/xml/vpatternconverter.cpp @@ -40,8 +40,8 @@ */ const QString VPatternConverter::PatternMinVerStr = QStringLiteral("0.1.0"); -const QString VPatternConverter::PatternMaxVerStr = QStringLiteral("0.1.2"); -const QString VPatternConverter::CurrentSchema = QStringLiteral("://schema/pattern/v0.1.2.xsd"); +const QString VPatternConverter::PatternMaxVerStr = QStringLiteral("0.1.3"); +const QString VPatternConverter::CurrentSchema = QStringLiteral("://schema/pattern/v0.1.3.xsd"); //--------------------------------------------------------------------------------------------------------------------- VPatternConverter::VPatternConverter(const QString &fileName) @@ -91,6 +91,8 @@ QString VPatternConverter::XSDSchema(int ver) const case (0x000101): return QStringLiteral("://schema/pattern/v0.1.1.xsd"); case (0x000102): + return QStringLiteral("://schema/pattern/v0.1.2.xsd"); + case (0x000103): return CurrentSchema; default: { @@ -119,9 +121,16 @@ void VPatternConverter::ApplyPatches() ToV0_1_2(); const QString schema = XSDSchema(0x000102); ValidateXML(schema, fileName); - break; + // continue conversion } case (0x000102): + { + ToV0_1_3(); + const QString schema = XSDSchema(0x000103); + ValidateXML(schema, fileName); + // continue conversion + } + case (0x000103): break; default: break; @@ -159,3 +168,10 @@ void VPatternConverter::ToV0_1_2() SetVersion(QStringLiteral("0.1.2")); Save(); } + +//--------------------------------------------------------------------------------------------------------------------- +void VPatternConverter::ToV0_1_3() +{ + SetVersion(QStringLiteral("0.1.3")); + Save(); +} diff --git a/src/libs/ifc/xml/vpatternconverter.h b/src/libs/ifc/xml/vpatternconverter.h index 5d8b4c651..b8afb8c3c 100644 --- a/src/libs/ifc/xml/vpatternconverter.h +++ b/src/libs/ifc/xml/vpatternconverter.h @@ -57,6 +57,7 @@ private: void ToV0_1_1(); void ToV0_1_2(); + void ToV0_1_3(); }; #endif // VPATTERNCONVERTER_H From 278c4e7ee89a03ffa567c62bf9bff57e26f9040d Mon Sep 17 00:00:00 2001 From: Felix ulber Date: Tue, 3 Feb 2015 12:21:01 +0100 Subject: [PATCH 097/186] Fixed wrong title in vtooloptionspropertybrowser for curve intersect axis tool. --HG-- branch : develop --- src/app/widgets/vtooloptionspropertybrowser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/widgets/vtooloptionspropertybrowser.cpp b/src/app/widgets/vtooloptionspropertybrowser.cpp index 178d6c6f3..8ad42eb67 100644 --- a/src/app/widgets/vtooloptionspropertybrowser.cpp +++ b/src/app/widgets/vtooloptionspropertybrowser.cpp @@ -1165,7 +1165,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolCurveIntersectAxis(QGraphicsIte { VToolCurveIntersectAxis *i = qgraphicsitem_cast(item); i->ShowVisualization(true); - formView->setTitle(tr("Point intersection line and axis")); + formView->setTitle(tr("Point intersection curve and axis")); AddPropertyPointName(i, tr("Point label")); AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); From 9d9bc2404b051d016ddb26c3399cbe3e53371c94 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 3 Feb 2015 16:46:14 +0200 Subject: [PATCH 098/186] Refactoring. Move line type to VDrawTool class. --HG-- branch : feature --- src/app/tools/drawTools/vdrawtool.cpp | 19 +++++++++++++++++-- src/app/tools/drawTools/vdrawtool.h | 8 +++++++- src/app/tools/vabstracttool.cpp | 18 +----------------- src/app/tools/vabstracttool.h | 5 ----- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/app/tools/drawTools/vdrawtool.cpp b/src/app/tools/drawTools/vdrawtool.cpp index 1f3989b77..02076e6a3 100644 --- a/src/app/tools/drawTools/vdrawtool.cpp +++ b/src/app/tools/drawTools/vdrawtool.cpp @@ -46,8 +46,8 @@ qreal VDrawTool::factor = 1; * @param id object id in container. */ VDrawTool::VDrawTool(VPattern *doc, VContainer *data, quint32 id, QObject *parent) - :VAbstractTool(doc, data, id, parent), ignoreFullUpdate(false), - nameActivDraw(doc->GetNameActivPP()), dialog(nullptr) + :VAbstractTool(doc, data, id, parent), ignoreFullUpdate(false), nameActivDraw(doc->GetNameActivPP()), + dialog(nullptr), typeLine(TypeLineLine) { connect(this->doc, &VPattern::ChangedActivPP, this, &VDrawTool::ChangedActivDraw); connect(this->doc, &VPattern::ChangedNameDraw, this, &VDrawTool::ChangedNameDraw); @@ -285,3 +285,18 @@ void VDrawTool::AddToCalculation(const QDomElement &domElement) connect(addToCal, &AddToCalc::NeedFullParsing, doc, &VPattern::NeedFullParsing); qApp->getUndoStack()->push(addToCal); } + +//--------------------------------------------------------------------------------------------------------------------- +QString VDrawTool::getLineType() const +{ + return typeLine; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VDrawTool::SetTypeLine(const QString &value) +{ + typeLine = value; + + QSharedPointer obj = VAbstractTool::data.GetGObject(id); + SaveOption(obj); +} diff --git a/src/app/tools/drawTools/vdrawtool.h b/src/app/tools/drawTools/vdrawtool.h index 14044c766..85f2662bc 100644 --- a/src/app/tools/drawTools/vdrawtool.h +++ b/src/app/tools/drawTools/vdrawtool.h @@ -55,6 +55,9 @@ public: virtual void setDialog() {} virtual void DialogLinkDestroy(); static qreal CheckFormula(const quint32 &toolId, QString &formula, VContainer *data); + + QString getLineType() const; + virtual void SetTypeLine(const QString &value); public slots: virtual void ShowTool(quint32 id, Qt::GlobalColor color, bool enable); virtual void ChangedActivDraw(const QString &newName); @@ -71,7 +74,10 @@ protected: QString nameActivDraw; /** @brief dialog dialog options.*/ - DialogTool *dialog; + DialogTool *dialog; + + /** @brief typeLine line type. */ + QString typeLine; void AddToCalculation(const QDomElement &domElement); diff --git a/src/app/tools/vabstracttool.cpp b/src/app/tools/vabstracttool.cpp index b2375c224..a8daea5b3 100644 --- a/src/app/tools/vabstracttool.cpp +++ b/src/app/tools/vabstracttool.cpp @@ -97,8 +97,7 @@ const QString VAbstractTool::ColorYellow = QStringLiteral("yellow"); * @param parent parent object. */ VAbstractTool::VAbstractTool(VPattern *doc, VContainer *data, quint32 id, QObject *parent) - :VDataTool(data, parent), doc(doc), id(id), baseColor(Qt::black), currentColor(Qt::black), typeLine(TypeLineLine), - vis(nullptr) + :VDataTool(data, parent), doc(doc), id(id), baseColor(Qt::black), currentColor(Qt::black), vis(nullptr) { SCASSERT(doc != nullptr); connect(this, &VAbstractTool::toolhaveChange, this->doc, &VPattern::haveLiteChange); @@ -232,21 +231,6 @@ const QStringList VAbstractTool::Colors() return colors; } -//--------------------------------------------------------------------------------------------------------------------- -QString VAbstractTool::getLineType() const -{ - return typeLine; -} - -//--------------------------------------------------------------------------------------------------------------------- -void VAbstractTool::SetTypeLine(const QString &value) -{ - typeLine = value; - - QSharedPointer obj = VAbstractTool::data.GetGObject(id); - SaveOption(obj); -} - //--------------------------------------------------------------------------------------------------------------------- QMap VAbstractTool::PointsList() const { diff --git a/src/app/tools/vabstracttool.h b/src/app/tools/vabstracttool.h index 0a8505bd5..fab8c8dfd 100644 --- a/src/app/tools/vabstracttool.h +++ b/src/app/tools/vabstracttool.h @@ -114,8 +114,6 @@ public: const VContainer *getData() const; - QString getLineType() const; - virtual void SetTypeLine(const QString &value); QMap PointsList() const; virtual QString getTagName() const =0; virtual void ShowVisualization(bool show) =0; @@ -152,9 +150,6 @@ protected: /** @brief currentColor current tool color. */ Qt::GlobalColor currentColor; - /** @brief typeLine line type. */ - QString typeLine; - Visualization *vis; /** From 4d6fae5840e6eae69c009dee6f2db39d9a2c3a75 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 4 Feb 2015 11:21:09 +0200 Subject: [PATCH 099/186] Setter and getter for attribute line color. --HG-- branch : feature --- src/app/tools/drawTools/vdrawtool.cpp | 18 +++++++++++++++++- src/app/tools/drawTools/vdrawtool.h | 7 +++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/app/tools/drawTools/vdrawtool.cpp b/src/app/tools/drawTools/vdrawtool.cpp index 02076e6a3..a510b940e 100644 --- a/src/app/tools/drawTools/vdrawtool.cpp +++ b/src/app/tools/drawTools/vdrawtool.cpp @@ -47,7 +47,7 @@ qreal VDrawTool::factor = 1; */ VDrawTool::VDrawTool(VPattern *doc, VContainer *data, quint32 id, QObject *parent) :VAbstractTool(doc, data, id, parent), ignoreFullUpdate(false), nameActivDraw(doc->GetNameActivPP()), - dialog(nullptr), typeLine(TypeLineLine) + dialog(nullptr), typeLine(TypeLineLine), lineColor(ColorBlack) { connect(this->doc, &VPattern::ChangedActivPP, this, &VDrawTool::ChangedActivDraw); connect(this->doc, &VPattern::ChangedNameDraw, this, &VDrawTool::ChangedNameDraw); @@ -300,3 +300,19 @@ void VDrawTool::SetTypeLine(const QString &value) QSharedPointer obj = VAbstractTool::data.GetGObject(id); SaveOption(obj); } + +//--------------------------------------------------------------------------------------------------------------------- +QString VDrawTool::GetLineColor() const +{ + return lineColor; +} + + +//--------------------------------------------------------------------------------------------------------------------- +void VDrawTool::SetLineColor(const QString &value) +{ + lineColor = value; + + QSharedPointer obj = VAbstractTool::data.GetGObject(id); + SaveOption(obj); +} diff --git a/src/app/tools/drawTools/vdrawtool.h b/src/app/tools/drawTools/vdrawtool.h index 85f2662bc..0f7576568 100644 --- a/src/app/tools/drawTools/vdrawtool.h +++ b/src/app/tools/drawTools/vdrawtool.h @@ -58,6 +58,10 @@ public: QString getLineType() const; virtual void SetTypeLine(const QString &value); + + QString GetLineColor() const; + void SetLineColor(const QString &value); + public slots: virtual void ShowTool(quint32 id, Qt::GlobalColor color, bool enable); virtual void ChangedActivDraw(const QString &newName); @@ -79,6 +83,9 @@ protected: /** @brief typeLine line type. */ QString typeLine; + /** @brief lineColor color line or curve, but not a point. */ + QString lineColor; + void AddToCalculation(const QDomElement &domElement); /** @brief SaveDialog save options into file after change in dialog. */ From 8aa84380648ff4d51f192929da6c42c1f15cebd4 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 4 Feb 2015 13:47:53 +0200 Subject: [PATCH 100/186] Disable label if pattern piece disabled. --HG-- branch : feature --- src/app/tools/drawTools/vtoolpoint.cpp | 6 +----- src/app/visualization/vgraphicssimpletextitem.cpp | 15 +++++++++++++++ src/app/visualization/vgraphicssimpletextitem.h | 2 ++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/app/tools/drawTools/vtoolpoint.cpp b/src/app/tools/drawTools/vtoolpoint.cpp index 53025c402..99bae27da 100644 --- a/src/app/tools/drawTools/vtoolpoint.cpp +++ b/src/app/tools/drawTools/vtoolpoint.cpp @@ -50,9 +50,7 @@ VToolPoint::VToolPoint(VPattern *doc, VContainer *data, quint32 id, QGraphicsIte namePoint = new VGraphicsSimpleTextItem(this); connect(namePoint, &VGraphicsSimpleTextItem::ShowContextMenu, this, &VToolPoint::ShowContextMenu); connect(namePoint, &VGraphicsSimpleTextItem::DeleteTool, this, &VToolPoint::DeleteFromLabel); - namePoint->setBrush(Qt::black); lineName = new QGraphicsLineItem(this); - lineName->setPen(QPen(Qt::black)); connect(namePoint, &VGraphicsSimpleTextItem::NameChangePosition, this, &VToolPoint::NameChangePosition); this->setBrush(QBrush(Qt::NoBrush)); this->setFlag(QGraphicsItem::ItemIsSelectable, true); @@ -136,9 +134,7 @@ void VToolPoint::ChangedActivDraw(const QString &newName) { VDrawTool::ChangedActivDraw(newName); this->setEnabled(nameActivDraw == newName); - namePoint->setBrush(QBrush(currentColor)); - lineName->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor)); - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor)); + namePoint->setEnabled(nameActivDraw == newName); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/visualization/vgraphicssimpletextitem.cpp b/src/app/visualization/vgraphicssimpletextitem.cpp index 49921e86b..85f07a71d 100644 --- a/src/app/visualization/vgraphicssimpletextitem.cpp +++ b/src/app/visualization/vgraphicssimpletextitem.cpp @@ -83,6 +83,21 @@ void VGraphicsSimpleTextItem::paint(QPainter *painter, const QStyleOptionGraphic QGraphicsSimpleTextItem::paint(painter, &myOption, widget); } +//--------------------------------------------------------------------------------------------------------------------- +void VGraphicsSimpleTextItem::setEnabled(bool enabled) +{ + QGraphicsSimpleTextItem::setEnabled(enabled); + const QPalette palet = this->scene()->palette(); + if (enabled) + { + setBrush(palet.brush(QPalette::Active, QPalette::Text)); + } + else + { + setBrush(palet.brush(QPalette::Disabled, QPalette::Text)); + } +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief itemChange handle item change. diff --git a/src/app/visualization/vgraphicssimpletextitem.h b/src/app/visualization/vgraphicssimpletextitem.h index daf3c9297..3868e33f6 100644 --- a/src/app/visualization/vgraphicssimpletextitem.h +++ b/src/app/visualization/vgraphicssimpletextitem.h @@ -47,6 +47,8 @@ public: virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); virtual int type() const {return Type;} enum { Type = UserType + static_cast(Vis::GraphicsSimpleTextItem)}; + + void setEnabled(bool enabled); signals: /** * @brief NameChangePosition emit when label change position. From 06d415f32085d8ec2bf3b20dd169663cc25ac1a2 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 4 Feb 2015 14:17:49 +0200 Subject: [PATCH 101/186] Disable curve if pattern piece disabled. --HG-- branch : feature --- src/app/tools/drawTools/vabstractspline.cpp | 15 ++++++++++++++- src/app/tools/drawTools/vabstractspline.h | 3 +++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/app/tools/drawTools/vabstractspline.cpp b/src/app/tools/drawTools/vabstractspline.cpp index aa6efbe7e..5549da759 100644 --- a/src/app/tools/drawTools/vabstractspline.cpp +++ b/src/app/tools/drawTools/vabstractspline.cpp @@ -87,7 +87,6 @@ void VAbstractSpline::ChangedActivDraw(const QString &newName) VDrawTool::ChangedActivDraw(newName); const bool selectable = (nameActivDraw == newName); this->setEnabled(selectable); - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor)); emit setEnabledPoint(selectable); } @@ -219,3 +218,17 @@ void VAbstractSpline::ShowFoot(bool show) controlPoints.at(i)->setVisible(show); } } + +//--------------------------------------------------------------------------------------------------------------------- +void VAbstractSpline::setEnabled(bool enabled) +{ + QGraphicsPathItem::setEnabled(enabled); + if (enabled) + { + setPen(QPen(QColor(lineColor), qApp->toPixel(qApp->widthHairLine())/factor)); + } + else + { + setPen(QPen(Qt::gray, qApp->toPixel(qApp->widthHairLine())/factor)); + } +} diff --git a/src/app/tools/drawTools/vabstractspline.h b/src/app/tools/drawTools/vabstractspline.h index 2c39f033f..3476081cf 100644 --- a/src/app/tools/drawTools/vabstractspline.h +++ b/src/app/tools/drawTools/vabstractspline.h @@ -45,6 +45,9 @@ public: enum { Type = UserType + static_cast(Tool::AbstractSpline)}; virtual QString getTagName() const; void ShowFoot(bool show); + + void setEnabled(bool enabled); + public slots: virtual void FullUpdateFromFile (); void Disable(bool disable); From 8b7567c32a9e36f065c0d3dd537c96f4e465fcbd Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 4 Feb 2015 15:09:37 +0200 Subject: [PATCH 102/186] Use method setEnabled instead direct change Pen where possible. --HG-- branch : feature --- src/app/tools/drawTools/vtoolline.cpp | 1 - src/app/tools/drawTools/vtoollinepoint.cpp | 2 +- src/app/tools/drawTools/vtoolsinglepoint.cpp | 20 -------------------- src/app/tools/drawTools/vtoolsinglepoint.h | 1 - src/app/visualization/vsimplecurve.cpp | 3 +-- 5 files changed, 2 insertions(+), 25 deletions(-) diff --git a/src/app/tools/drawTools/vtoolline.cpp b/src/app/tools/drawTools/vtoolline.cpp index 618448867..42b3bce4d 100644 --- a/src/app/tools/drawTools/vtoolline.cpp +++ b/src/app/tools/drawTools/vtoolline.cpp @@ -239,7 +239,6 @@ void VToolLine::ChangedActivDraw(const QString &newName) { VDrawTool::ChangedActivDraw(newName); this->setEnabled(nameActivDraw == newName); - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor, LineStyleToPenStyle(typeLine))); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/tools/drawTools/vtoollinepoint.cpp b/src/app/tools/drawTools/vtoollinepoint.cpp index 59823347e..598c84c32 100644 --- a/src/app/tools/drawTools/vtoollinepoint.cpp +++ b/src/app/tools/drawTools/vtoollinepoint.cpp @@ -71,7 +71,7 @@ void VToolLinePoint::ChangedActivDraw(const QString &newName) { VToolPoint::ChangedActivDraw(newName); this->setEnabled(nameActivDraw == newName); - mainLine->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor, LineStyleToPenStyle(typeLine))); + mainLine->setEnabled(nameActivDraw == newName); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/tools/drawTools/vtoolsinglepoint.cpp b/src/app/tools/drawTools/vtoolsinglepoint.cpp index 204849b16..069e79ffc 100644 --- a/src/app/tools/drawTools/vtoolsinglepoint.cpp +++ b/src/app/tools/drawTools/vtoolsinglepoint.cpp @@ -299,26 +299,6 @@ void VToolSinglePoint::FullUpdateFromFile() RefreshPointGeometry(point); } -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief ChangedActivDraw disable or enable context menu after change active pattern peace. - * @param newName new name active pattern peace. - */ -void VToolSinglePoint::ChangedActivDraw(const QString &newName) -{ - VToolPoint::ChangedActivDraw(newName); - if (nameActivDraw == newName) - { - this->setEnabled(true); - SetColorLabel(Qt::black); - } - else - { - this->setEnabled(false); - SetColorLabel(Qt::gray); - } -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief SetFactor set current scale factor of scene. diff --git a/src/app/tools/drawTools/vtoolsinglepoint.h b/src/app/tools/drawTools/vtoolsinglepoint.h index 3cbcdb202..df2727580 100644 --- a/src/app/tools/drawTools/vtoolsinglepoint.h +++ b/src/app/tools/drawTools/vtoolsinglepoint.h @@ -48,7 +48,6 @@ public: virtual void ShowVisualization(bool show); public slots: virtual void FullUpdateFromFile(); - virtual void ChangedActivDraw(const QString &newName); virtual void SetFactor(qreal factor); virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event); signals: diff --git a/src/app/visualization/vsimplecurve.cpp b/src/app/visualization/vsimplecurve.cpp index 92ba03fba..10c3927b0 100644 --- a/src/app/visualization/vsimplecurve.cpp +++ b/src/app/visualization/vsimplecurve.cpp @@ -60,8 +60,7 @@ VSimpleCurve::VSimpleCurve(quint32 id, Qt::GlobalColor *currentColor, SimpleCurv //--------------------------------------------------------------------------------------------------------------------- void VSimpleCurve::ChangedActivDraw(const bool &flag) { - setFlag(QGraphicsItem::ItemIsSelectable, flag); - setAcceptHoverEvents(flag); + setEnabled(flag); setPen(QPen(*currentColor, qApp->toPixel(qApp->widthHairLine())/ *factor)); } From e64e3a9044973340ae6538448e9430744682d671 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 5 Feb 2015 13:56:51 +0200 Subject: [PATCH 103/186] Wrong conversion expression if number has 0 in fractional part. Example 10,0. Such numbers ignored and left untouched. This cause error in calculation. --HG-- branch : develop --- src/app/core/vapplication.cpp | 51 ++++++++++++++++------------------- 1 file changed, 23 insertions(+), 28 deletions(-) diff --git a/src/app/core/vapplication.cpp b/src/app/core/vapplication.cpp index 6d47aa27f..c23c427c4 100644 --- a/src/app/core/vapplication.cpp +++ b/src/app/core/vapplication.cpp @@ -1771,27 +1771,25 @@ QString VApplication::FormulaFromUser(const QString &formula) QList nValues = numbers.values(); for (int i = 0; i < nKeys.size(); ++i) { + loc = QLocale::system(); bool ok = false; - qreal d = loc.toDouble(nValues.at(i), &ok); + const qreal d = loc.toDouble(nValues.at(i), &ok); if (ok == false) { qDebug()<<"Can't convert to double token"< nValues = numbers.values(); for (int i = 0; i < nKeys.size(); ++i) { - QLocale loc = QLocale(QLocale::C); + loc = QLocale(QLocale::C); bool ok = false; - qreal d = loc.toDouble(nValues.at(i), &ok); + const qreal d = loc.toDouble(nValues.at(i), &ok); if (ok == false) { qDebug()<<"Can't convert to double token"< Date: Fri, 6 Feb 2015 11:53:36 +0200 Subject: [PATCH 104/186] If pattern piece disabled need correct tool color. --HG-- branch : feature --- src/app/tools/drawTools/vdrawtool.cpp | 24 ++++++++++++------- src/app/tools/drawTools/vdrawtool.h | 3 +++ src/app/tools/drawTools/vtoolline.cpp | 3 ++- src/app/tools/drawTools/vtoollinepoint.cpp | 3 ++- src/app/tools/drawTools/vtoolpoint.cpp | 25 ++++++++++++------- src/app/tools/drawTools/vtoolpoint.h | 2 ++ src/app/tools/drawTools/vtoolspline.cpp | 2 +- src/app/visualization/vsimplecurve.cpp | 28 ++++++++++++++++------ src/app/visualization/vsimplecurve.h | 4 ++++ 9 files changed, 66 insertions(+), 28 deletions(-) diff --git a/src/app/tools/drawTools/vdrawtool.cpp b/src/app/tools/drawTools/vdrawtool.cpp index a510b940e..e993e0b07 100644 --- a/src/app/tools/drawTools/vdrawtool.cpp +++ b/src/app/tools/drawTools/vdrawtool.cpp @@ -47,7 +47,7 @@ qreal VDrawTool::factor = 1; */ VDrawTool::VDrawTool(VPattern *doc, VContainer *data, quint32 id, QObject *parent) :VAbstractTool(doc, data, id, parent), ignoreFullUpdate(false), nameActivDraw(doc->GetNameActivPP()), - dialog(nullptr), typeLine(TypeLineLine), lineColor(ColorBlack) + dialog(nullptr), typeLine(TypeLineLine), lineColor(ColorBlack), enabled(true) { connect(this->doc, &VPattern::ChangedActivPP, this, &VDrawTool::ChangedActivDraw); connect(this->doc, &VPattern::ChangedNameDraw, this, &VDrawTool::ChangedNameDraw); @@ -81,14 +81,7 @@ void VDrawTool::ShowTool(quint32 id, Qt::GlobalColor color, bool enable) */ void VDrawTool::ChangedActivDraw(const QString &newName) { - if (nameActivDraw == newName) - { - currentColor = baseColor; - } - else - { - currentColor = Qt::gray; - } + enabled = nameActivDraw == newName; } //--------------------------------------------------------------------------------------------------------------------- @@ -179,6 +172,19 @@ void VDrawTool::RefreshDataInFile() } } +//--------------------------------------------------------------------------------------------------------------------- +QColor VDrawTool::CorrectColor(const QColor &color) const +{ + if (enabled) + { + return color; + } + else + { + return Qt::gray; + } +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief DialogLinkDestroy removes dialog pointer diff --git a/src/app/tools/drawTools/vdrawtool.h b/src/app/tools/drawTools/vdrawtool.h index 0f7576568..2ecd28f20 100644 --- a/src/app/tools/drawTools/vdrawtool.h +++ b/src/app/tools/drawTools/vdrawtool.h @@ -86,6 +86,8 @@ protected: /** @brief lineColor color line or curve, but not a point. */ QString lineColor; + bool enabled; + void AddToCalculation(const QDomElement &domElement); /** @brief SaveDialog save options into file after change in dialog. */ @@ -93,6 +95,7 @@ protected: void SaveDialogChange(); virtual void AddToFile(); virtual void RefreshDataInFile(); + QColor CorrectColor(const QColor &color) const; template /** diff --git a/src/app/tools/drawTools/vtoolline.cpp b/src/app/tools/drawTools/vtoolline.cpp index 42b3bce4d..a14e2d399 100644 --- a/src/app/tools/drawTools/vtoolline.cpp +++ b/src/app/tools/drawTools/vtoolline.cpp @@ -476,5 +476,6 @@ void VToolLine::RefreshGeometry() const QSharedPointer first = VAbstractTool::data.GeometricObject(firstPoint); const QSharedPointer second = VAbstractTool::data.GeometricObject(secondPoint); this->setLine(QLineF(first->toQPointF(), second->toQPointF())); - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor, LineStyleToPenStyle(typeLine))); + this->setPen(QPen(CorrectColor(currentColor), qApp->toPixel(qApp->widthHairLine())/factor, + LineStyleToPenStyle(typeLine))); } diff --git a/src/app/tools/drawTools/vtoollinepoint.cpp b/src/app/tools/drawTools/vtoollinepoint.cpp index 598c84c32..6066602af 100644 --- a/src/app/tools/drawTools/vtoollinepoint.cpp +++ b/src/app/tools/drawTools/vtoollinepoint.cpp @@ -80,7 +80,8 @@ void VToolLinePoint::ChangedActivDraw(const QString &newName) */ void VToolLinePoint::RefreshGeometry() { - mainLine->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor, LineStyleToPenStyle(typeLine))); + mainLine->setPen(QPen(CorrectColor(currentColor), qApp->toPixel(qApp->widthHairLine())/factor, + LineStyleToPenStyle(typeLine))); VToolPoint::RefreshPointGeometry(*VDrawTool::data.GeometricObject(id)); QPointF point = VDrawTool::data.GeometricObject(id)->toQPointF(); QPointF basePoint = VDrawTool::data.GeometricObject(basePointId)->toQPointF(); diff --git a/src/app/tools/drawTools/vtoolpoint.cpp b/src/app/tools/drawTools/vtoolpoint.cpp index 99bae27da..0b9b202ed 100644 --- a/src/app/tools/drawTools/vtoolpoint.cpp +++ b/src/app/tools/drawTools/vtoolpoint.cpp @@ -227,7 +227,7 @@ void VToolPoint::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) void VToolPoint::RefreshPointGeometry(const VPointF &point) { this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, false); - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor)); + this->setPen(QPen(CorrectColor(currentColor), qApp->toPixel(qApp->widthHairLine())/factor)); QRectF rec = QRectF(0, 0, radius*2, radius*2); rec.translate(-rec.center().x(), -rec.center().y()); this->setRect(rec); @@ -259,14 +259,7 @@ void VToolPoint::RefreshLine() VGObject::LineIntersectCircle(QPointF(), radius, QLineF(QPointF(), nameRec.center() - scenePos()), p1, p2); QPointF pRec = VGObject::LineIntersectRect(nameRec, QLineF(scenePos(), nameRec.center())); lineName->setLine(QLineF(p1, pRec - scenePos())); - if (currentColor == Qt::gray) - { - lineName->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor)); - } - else - { - lineName->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine())/factor)); - } + lineName->setPen(QPen(CorrectColor(Qt::black), qApp->toPixel(qApp->widthHairLine())/factor)); if (QLineF(p1, pRec - scenePos()).length() <= qApp->toPixel(4, Unit::Mm)) { @@ -325,3 +318,17 @@ void VToolPoint::keyReleaseEvent(QKeyEvent *event) } QGraphicsEllipseItem::keyReleaseEvent ( event ); } + +//--------------------------------------------------------------------------------------------------------------------- +void VToolPoint::setEnabled(bool enabled) +{ + QGraphicsEllipseItem::setEnabled(enabled); + if (enabled) + { + setPen(QPen(QColor(baseColor), qApp->toPixel(qApp->widthHairLine())/factor)); + } + else + { + setPen(QPen(Qt::gray, qApp->toPixel(qApp->widthHairLine())/factor)); + } +} diff --git a/src/app/tools/drawTools/vtoolpoint.h b/src/app/tools/drawTools/vtoolpoint.h index 218753e31..8601e6c47 100644 --- a/src/app/tools/drawTools/vtoolpoint.h +++ b/src/app/tools/drawTools/vtoolpoint.h @@ -49,6 +49,8 @@ public: void setName(const QString &name); virtual QString getTagName() const; static const QString TagName; + + void setEnabled(bool enabled); public slots: void NameChangePosition(const QPointF &pos); virtual void ChangedActivDraw(const QString &newName); diff --git a/src/app/tools/drawTools/vtoolspline.cpp b/src/app/tools/drawTools/vtoolspline.cpp index 979c51751..16a6ff4ce 100644 --- a/src/app/tools/drawTools/vtoolspline.cpp +++ b/src/app/tools/drawTools/vtoolspline.cpp @@ -356,7 +356,7 @@ void VToolSpline::SaveOptions(QDomElement &tag, QSharedPointer &obj) */ void VToolSpline::RefreshGeometry() { - //this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor)); + this->setPen(QPen(CorrectColor(currentColor), qApp->toPixel(qApp->widthHairLine())/factor)); if (isHovered) { this->setPath(ToolPath(PathDirection::Show)); diff --git a/src/app/visualization/vsimplecurve.cpp b/src/app/visualization/vsimplecurve.cpp index 10c3927b0..de572b3e2 100644 --- a/src/app/visualization/vsimplecurve.cpp +++ b/src/app/visualization/vsimplecurve.cpp @@ -43,7 +43,7 @@ VSimpleCurve::VSimpleCurve(quint32 id, Qt::GlobalColor *currentColor, SimpleCurvePoint pointPosition, qreal *factor, QObject *parent) :QObject(parent), QGraphicsPathItem(), id (id), factor(factor), currentColor(currentColor), - curvePosition(pointPosition) + curvePosition(pointPosition), enabled(true) { if (factor == nullptr) { @@ -60,8 +60,9 @@ VSimpleCurve::VSimpleCurve(quint32 id, Qt::GlobalColor *currentColor, SimpleCurv //--------------------------------------------------------------------------------------------------------------------- void VSimpleCurve::ChangedActivDraw(const bool &flag) { - setEnabled(flag); - setPen(QPen(*currentColor, qApp->toPixel(qApp->widthHairLine())/ *factor)); + enabled = flag; + setEnabled(enabled); + setPen(QPen(CorrectColor(*currentColor), qApp->toPixel(qApp->widthHairLine())/ *factor)); } //--------------------------------------------------------------------------------------------------------------------- @@ -101,11 +102,11 @@ void VSimpleCurve::hoverMoveEvent(QGraphicsSceneHoverEvent *event) Q_UNUSED(event); if (factor == nullptr) { - this->setPen(QPen(*currentColor, qApp->toPixel(qApp->widthMainLine()))); + this->setPen(QPen(CorrectColor(*currentColor), qApp->toPixel(qApp->widthMainLine()))); } else { - this->setPen(QPen(*currentColor, qApp->toPixel(qApp->widthMainLine())/ *factor)); + this->setPen(QPen(CorrectColor(*currentColor), qApp->toPixel(qApp->widthMainLine())/ *factor)); } emit HoverPath(id, curvePosition, PathDirection::Show); } @@ -120,12 +121,25 @@ void VSimpleCurve::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) Q_UNUSED(event); if (factor == nullptr) { - this->setPen(QPen(*currentColor, qApp->toPixel(qApp->widthHairLine()))); + this->setPen(QPen(CorrectColor(*currentColor), qApp->toPixel(qApp->widthHairLine()))); } else { - this->setPen(QPen(*currentColor, qApp->toPixel(qApp->widthHairLine())/ *factor)); + this->setPen(QPen(CorrectColor(*currentColor), qApp->toPixel(qApp->widthHairLine())/ *factor)); } emit HoverPath(id, curvePosition, PathDirection::Hide); } + +//--------------------------------------------------------------------------------------------------------------------- +QColor VSimpleCurve::CorrectColor(const QColor &color) const +{ + if (enabled) + { + return color; + } + else + { + return Qt::gray; + } +} diff --git a/src/app/visualization/vsimplecurve.h b/src/app/visualization/vsimplecurve.h index d33afb269..a9b34c2db 100644 --- a/src/app/visualization/vsimplecurve.h +++ b/src/app/visualization/vsimplecurve.h @@ -71,6 +71,10 @@ private: Qt::GlobalColor *currentColor; SimpleCurvePoint curvePosition; + + bool enabled; + + QColor CorrectColor(const QColor &color) const; }; #endif // VSIMPLECURVE_H From 16662a34d53dbd209f8e53735b728a5301d97b8f Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 6 Feb 2015 11:58:04 +0200 Subject: [PATCH 105/186] Use variable "enabled" everywhere. --HG-- branch : feature --- src/app/tools/drawTools/vabstractspline.cpp | 5 ++--- src/app/tools/drawTools/vtoolcut.cpp | 6 ++---- src/app/tools/drawTools/vtoolline.cpp | 2 +- src/app/tools/drawTools/vtoollinepoint.cpp | 4 ++-- src/app/tools/drawTools/vtoolpoint.cpp | 4 ++-- 5 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/app/tools/drawTools/vabstractspline.cpp b/src/app/tools/drawTools/vabstractspline.cpp index 5549da759..9ff70ace0 100644 --- a/src/app/tools/drawTools/vabstractspline.cpp +++ b/src/app/tools/drawTools/vabstractspline.cpp @@ -85,9 +85,8 @@ void VAbstractSpline::Disable(bool disable) void VAbstractSpline::ChangedActivDraw(const QString &newName) { VDrawTool::ChangedActivDraw(newName); - const bool selectable = (nameActivDraw == newName); - this->setEnabled(selectable); - emit setEnabledPoint(selectable); + this->setEnabled(enabled); + emit setEnabledPoint(enabled); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/tools/drawTools/vtoolcut.cpp b/src/app/tools/drawTools/vtoolcut.cpp index 606bbb09f..45d90d990 100644 --- a/src/app/tools/drawTools/vtoolcut.cpp +++ b/src/app/tools/drawTools/vtoolcut.cpp @@ -60,10 +60,8 @@ VToolCut::VToolCut(VPattern *doc, VContainer *data, const quint32 &id, const QSt void VToolCut::ChangedActivDraw(const QString &newName) { VToolPoint::ChangedActivDraw(newName); - const bool flag = (nameActivDraw == newName); - this->setEnabled(flag); - firstCurve->ChangedActivDraw(flag); - secondCurve->ChangedActivDraw(flag); + firstCurve->ChangedActivDraw(enabled); + secondCurve->ChangedActivDraw(enabled); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/tools/drawTools/vtoolline.cpp b/src/app/tools/drawTools/vtoolline.cpp index a14e2d399..11da97d8f 100644 --- a/src/app/tools/drawTools/vtoolline.cpp +++ b/src/app/tools/drawTools/vtoolline.cpp @@ -238,7 +238,7 @@ void VToolLine::Disable(bool disable) void VToolLine::ChangedActivDraw(const QString &newName) { VDrawTool::ChangedActivDraw(newName); - this->setEnabled(nameActivDraw == newName); + this->setEnabled(enabled); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/tools/drawTools/vtoollinepoint.cpp b/src/app/tools/drawTools/vtoollinepoint.cpp index 6066602af..2037165b4 100644 --- a/src/app/tools/drawTools/vtoollinepoint.cpp +++ b/src/app/tools/drawTools/vtoollinepoint.cpp @@ -70,8 +70,8 @@ VToolLinePoint::~VToolLinePoint() void VToolLinePoint::ChangedActivDraw(const QString &newName) { VToolPoint::ChangedActivDraw(newName); - this->setEnabled(nameActivDraw == newName); - mainLine->setEnabled(nameActivDraw == newName); + this->setEnabled(enabled); + mainLine->setEnabled(enabled); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/tools/drawTools/vtoolpoint.cpp b/src/app/tools/drawTools/vtoolpoint.cpp index 0b9b202ed..1901ac768 100644 --- a/src/app/tools/drawTools/vtoolpoint.cpp +++ b/src/app/tools/drawTools/vtoolpoint.cpp @@ -133,8 +133,8 @@ void VToolPoint::UpdateNamePosition(qreal mx, qreal my) void VToolPoint::ChangedActivDraw(const QString &newName) { VDrawTool::ChangedActivDraw(newName); - this->setEnabled(nameActivDraw == newName); - namePoint->setEnabled(nameActivDraw == newName); + this->setEnabled(enabled); + namePoint->setEnabled(enabled); } //--------------------------------------------------------------------------------------------------------------------- From 5f4939423695ed7ff441e655316dc641c5bee784 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 6 Feb 2015 13:41:30 +0200 Subject: [PATCH 106/186] Use different colors for different parts of tool. --HG-- branch : feature --- src/app/tools/drawTools/vabstractspline.cpp | 7 +++- src/app/tools/drawTools/vdrawtool.h | 42 +++++++++---------- src/app/tools/drawTools/vtoolarc.cpp | 2 +- src/app/tools/drawTools/vtoolcut.cpp | 4 +- src/app/tools/drawTools/vtoolcutarc.cpp | 1 + src/app/tools/drawTools/vtoolcutspline.cpp | 1 + .../tools/drawTools/vtoolcutsplinepath.cpp | 1 + src/app/tools/drawTools/vtoolline.cpp | 9 ++-- src/app/tools/drawTools/vtoollinepoint.cpp | 4 +- src/app/tools/drawTools/vtoolpoint.cpp | 6 +-- src/app/tools/drawTools/vtoolsinglepoint.cpp | 3 +- src/app/tools/drawTools/vtoolspline.cpp | 2 +- src/app/tools/nodeDetails/vabstractnode.cpp | 2 +- src/app/tools/nodeDetails/vabstractnode.h | 3 ++ src/app/tools/vabstracttool.cpp | 2 +- src/app/tools/vabstracttool.h | 3 -- src/app/visualization/vsimplecurve.cpp | 29 +++++++++---- src/app/visualization/vsimplecurve.h | 8 +++- 18 files changed, 78 insertions(+), 51 deletions(-) diff --git a/src/app/tools/drawTools/vabstractspline.cpp b/src/app/tools/drawTools/vabstractspline.cpp index 9ff70ace0..c20e68cdc 100644 --- a/src/app/tools/drawTools/vabstractspline.cpp +++ b/src/app/tools/drawTools/vabstractspline.cpp @@ -86,6 +86,8 @@ void VAbstractSpline::ChangedActivDraw(const QString &newName) { VDrawTool::ChangedActivDraw(newName); this->setEnabled(enabled); + this->setPen(QPen(CorrectColor(lineColor), qApp->toPixel(qApp->widthMainLine())/factor, Qt::SolidLine, + Qt::RoundCap)); emit setEnabledPoint(enabled); } @@ -121,7 +123,8 @@ void VAbstractSpline::SetFactor(qreal factor) void VAbstractSpline::hoverEnterEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthMainLine())/factor, Qt::SolidLine, Qt::RoundCap)); + this->setPen(QPen(CorrectColor(lineColor), qApp->toPixel(qApp->widthMainLine())/factor, Qt::SolidLine, + Qt::RoundCap)); this->setPath(ToolPath(PathDirection::Show)); isHovered = true; QGraphicsPathItem::hoverEnterEvent(event); @@ -136,7 +139,7 @@ void VAbstractSpline::hoverEnterEvent(QGraphicsSceneHoverEvent *event) void VAbstractSpline::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor)); + this->setPen(QPen(CorrectColor(lineColor), qApp->toPixel(qApp->widthHairLine())/factor)); this->setPath(ToolPath()); isHovered = false; QGraphicsPathItem::hoverLeaveEvent(event); diff --git a/src/app/tools/drawTools/vdrawtool.h b/src/app/tools/drawTools/vdrawtool.h index 2ecd28f20..e978111bc 100644 --- a/src/app/tools/drawTools/vdrawtool.h +++ b/src/app/tools/drawTools/vdrawtool.h @@ -164,32 +164,32 @@ protected: void ShowItem(Item *item, quint32 id, Qt::GlobalColor color, bool enable) { SCASSERT(item != nullptr); - if (id == item->id) - { - if (enable == false) - { - currentColor = baseColor; - } - else - { - currentColor = color; - } - item->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor)); - } +// if (id == item->id) +// { +// if (enable == false) +// { +// currentColor = baseColor; +// } +// else +// { +// currentColor = color; +// } +// item->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor)); +// } } template void DisableItem(Item *item, bool disable) { SCASSERT(item != nullptr); - if (disable) - { - currentColor = Qt::gray; - } - else - { - currentColor = baseColor; - } - item->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor)); +// if (disable) +// { +// currentColor = Qt::gray; +// } +// else +// { +// currentColor = baseColor; +// } +// item->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor)); } private: Q_DISABLE_COPY(VDrawTool) diff --git a/src/app/tools/drawTools/vtoolarc.cpp b/src/app/tools/drawTools/vtoolarc.cpp index 2e5b2eada..6363d017b 100644 --- a/src/app/tools/drawTools/vtoolarc.cpp +++ b/src/app/tools/drawTools/vtoolarc.cpp @@ -373,7 +373,7 @@ void VToolArc::SaveOptions(QDomElement &tag, QSharedPointer &obj) */ void VToolArc::RefreshGeometry() { - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor)); + this->setPen(QPen(CorrectColor(lineColor), qApp->toPixel(qApp->widthHairLine())/factor)); this->setPath(ToolPath()); if (vis != nullptr) diff --git a/src/app/tools/drawTools/vtoolcut.cpp b/src/app/tools/drawTools/vtoolcut.cpp index 45d90d990..0c506d2e7 100644 --- a/src/app/tools/drawTools/vtoolcut.cpp +++ b/src/app/tools/drawTools/vtoolcut.cpp @@ -41,12 +41,12 @@ VToolCut::VToolCut(VPattern *doc, VContainer *data, const quint32 &id, const QSt Q_ASSERT_X(curve1id > 0, Q_FUNC_INFO, "curve1id <= 0"); Q_ASSERT_X(curve2id > 0, Q_FUNC_INFO, "curve2id <= 0"); - firstCurve = new VSimpleCurve(curve1id, ¤tColor, SimpleCurvePoint::ForthPoint, &factor); + firstCurve = new VSimpleCurve(curve1id, QColor(lineColor), SimpleCurvePoint::ForthPoint, &factor); firstCurve->setParentItem(this); connect(firstCurve, &VSimpleCurve::Choosed, this, &VToolCut::CurveChoosed); connect(firstCurve, &VSimpleCurve::HoverPath, this, &VToolCut::HoverPath); - secondCurve = new VSimpleCurve(curve2id, ¤tColor, SimpleCurvePoint::FirstPoint, &factor); + secondCurve = new VSimpleCurve(curve2id, QColor(lineColor), SimpleCurvePoint::FirstPoint, &factor); secondCurve->setParentItem(this); connect(secondCurve, &VSimpleCurve::Choosed, this, &VToolCut::CurveChoosed); connect(secondCurve, &VSimpleCurve::HoverPath, this, &VToolCut::HoverPath); diff --git a/src/app/tools/drawTools/vtoolcutarc.cpp b/src/app/tools/drawTools/vtoolcutarc.cpp index 7e5f4a6e8..e5d475aa2 100644 --- a/src/app/tools/drawTools/vtoolcutarc.cpp +++ b/src/app/tools/drawTools/vtoolcutarc.cpp @@ -296,6 +296,7 @@ void VToolCutArc::RefreshCurve(VSimpleCurve *curve, quint32 curveId, SimpleCurve { path.translate(-arc->GetP2().x(), -arc->GetP2().y()); } + curve->SetCurrentColor(QColor(lineColor)); curve->setPath(path); } diff --git a/src/app/tools/drawTools/vtoolcutspline.cpp b/src/app/tools/drawTools/vtoolcutspline.cpp index a86dafc33..afd15db56 100644 --- a/src/app/tools/drawTools/vtoolcutspline.cpp +++ b/src/app/tools/drawTools/vtoolcutspline.cpp @@ -307,6 +307,7 @@ void VToolCutSpline::RefreshCurve(VSimpleCurve *curve, quint32 curveId, SimpleCu { path.translate(-spl->GetP4().toQPointF().x(), -spl->GetP4().toQPointF().y()); } + curve->SetCurrentColor(QColor(lineColor)); curve->setPath(path); } diff --git a/src/app/tools/drawTools/vtoolcutsplinepath.cpp b/src/app/tools/drawTools/vtoolcutsplinepath.cpp index dc088e998..7f8b1a005 100644 --- a/src/app/tools/drawTools/vtoolcutsplinepath.cpp +++ b/src/app/tools/drawTools/vtoolcutsplinepath.cpp @@ -358,6 +358,7 @@ void VToolCutSplinePath::RefreshCurve(VSimpleCurve *curve, quint32 curveId, Simp VSpline spl = splPath->GetSpline(splPath->Count()); path.translate(-spl.GetP4().toQPointF().x(), -spl.GetP4().toQPointF().y()); } + curve->SetCurrentColor(QColor(lineColor)); curve->setPath(path); } diff --git a/src/app/tools/drawTools/vtoolline.cpp b/src/app/tools/drawTools/vtoolline.cpp index 11da97d8f..f9d67bddc 100644 --- a/src/app/tools/drawTools/vtoolline.cpp +++ b/src/app/tools/drawTools/vtoolline.cpp @@ -239,6 +239,7 @@ void VToolLine::ChangedActivDraw(const QString &newName) { VDrawTool::ChangedActivDraw(newName); this->setEnabled(enabled); + this->setPen(QPen(QColor(baseColor), qApp->toPixel(qApp->widthHairLine())/factor, LineStyleToPenStyle(typeLine))); } //--------------------------------------------------------------------------------------------------------------------- @@ -289,7 +290,8 @@ void VToolLine::RefreshDataInFile() void VToolLine::hoverEnterEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthMainLine())/factor, LineStyleToPenStyle(typeLine))); + this->setPen(QPen(CorrectColor(lineColor), qApp->toPixel(qApp->widthMainLine())/factor, + LineStyleToPenStyle(typeLine))); } //--------------------------------------------------------------------------------------------------------------------- @@ -300,7 +302,8 @@ void VToolLine::hoverEnterEvent(QGraphicsSceneHoverEvent *event) void VToolLine::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor, LineStyleToPenStyle(typeLine))); + this->setPen(QPen(CorrectColor(lineColor), qApp->toPixel(qApp->widthHairLine())/factor, + LineStyleToPenStyle(typeLine))); } //--------------------------------------------------------------------------------------------------------------------- @@ -476,6 +479,6 @@ void VToolLine::RefreshGeometry() const QSharedPointer first = VAbstractTool::data.GeometricObject(firstPoint); const QSharedPointer second = VAbstractTool::data.GeometricObject(secondPoint); this->setLine(QLineF(first->toQPointF(), second->toQPointF())); - this->setPen(QPen(CorrectColor(currentColor), qApp->toPixel(qApp->widthHairLine())/factor, + this->setPen(QPen(CorrectColor(baseColor), qApp->toPixel(qApp->widthHairLine())/factor, LineStyleToPenStyle(typeLine))); } diff --git a/src/app/tools/drawTools/vtoollinepoint.cpp b/src/app/tools/drawTools/vtoollinepoint.cpp index 2037165b4..e66bcae6e 100644 --- a/src/app/tools/drawTools/vtoollinepoint.cpp +++ b/src/app/tools/drawTools/vtoollinepoint.cpp @@ -71,6 +71,8 @@ void VToolLinePoint::ChangedActivDraw(const QString &newName) { VToolPoint::ChangedActivDraw(newName); this->setEnabled(enabled); + mainLine->setPen(QPen(QColor(lineColor), qApp->toPixel(qApp->widthHairLine())/factor, + LineStyleToPenStyle(typeLine))); mainLine->setEnabled(enabled); } @@ -80,7 +82,7 @@ void VToolLinePoint::ChangedActivDraw(const QString &newName) */ void VToolLinePoint::RefreshGeometry() { - mainLine->setPen(QPen(CorrectColor(currentColor), qApp->toPixel(qApp->widthHairLine())/factor, + mainLine->setPen(QPen(CorrectColor(QColor(lineColor)), qApp->toPixel(qApp->widthHairLine())/factor, LineStyleToPenStyle(typeLine))); VToolPoint::RefreshPointGeometry(*VDrawTool::data.GeometricObject(id)); QPointF point = VDrawTool::data.GeometricObject(id)->toQPointF(); diff --git a/src/app/tools/drawTools/vtoolpoint.cpp b/src/app/tools/drawTools/vtoolpoint.cpp index 1901ac768..74053b9e7 100644 --- a/src/app/tools/drawTools/vtoolpoint.cpp +++ b/src/app/tools/drawTools/vtoolpoint.cpp @@ -204,7 +204,7 @@ void VToolPoint::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) void VToolPoint::hoverEnterEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthMainLine())/factor)); + this->setPen(QPen(CorrectColor(baseColor), qApp->toPixel(qApp->widthMainLine())/factor)); QGraphicsEllipseItem::hoverEnterEvent(event); } @@ -216,7 +216,7 @@ void VToolPoint::hoverEnterEvent(QGraphicsSceneHoverEvent *event) void VToolPoint::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor)); + this->setPen(QPen(CorrectColor(baseColor), qApp->toPixel(qApp->widthHairLine())/factor)); } //--------------------------------------------------------------------------------------------------------------------- @@ -227,7 +227,7 @@ void VToolPoint::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) void VToolPoint::RefreshPointGeometry(const VPointF &point) { this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, false); - this->setPen(QPen(CorrectColor(currentColor), qApp->toPixel(qApp->widthHairLine())/factor)); + this->setPen(QPen(CorrectColor(baseColor), qApp->toPixel(qApp->widthHairLine())/factor)); QRectF rec = QRectF(0, 0, radius*2, radius*2); rec.translate(-rec.center().x(), -rec.center().y()); this->setRect(rec); diff --git a/src/app/tools/drawTools/vtoolsinglepoint.cpp b/src/app/tools/drawTools/vtoolsinglepoint.cpp index 069e79ffc..bb37898ef 100644 --- a/src/app/tools/drawTools/vtoolsinglepoint.cpp +++ b/src/app/tools/drawTools/vtoolsinglepoint.cpp @@ -52,8 +52,7 @@ VToolSinglePoint::VToolSinglePoint (VPattern *doc, VContainer *data, quint32 id, :VToolPoint(doc, data, id, parent), namePP(namePP), mPath(mPath) { baseColor = Qt::red; - currentColor = baseColor; - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor)); + this->setPen(QPen(baseColor, qApp->toPixel(qApp->widthHairLine())/factor)); ignoreFullUpdate = true; this->setFlag(QGraphicsItem::ItemIsMovable, true); this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); diff --git a/src/app/tools/drawTools/vtoolspline.cpp b/src/app/tools/drawTools/vtoolspline.cpp index 16a6ff4ce..02e86c7c8 100644 --- a/src/app/tools/drawTools/vtoolspline.cpp +++ b/src/app/tools/drawTools/vtoolspline.cpp @@ -356,7 +356,7 @@ void VToolSpline::SaveOptions(QDomElement &tag, QSharedPointer &obj) */ void VToolSpline::RefreshGeometry() { - this->setPen(QPen(CorrectColor(currentColor), qApp->toPixel(qApp->widthHairLine())/factor)); + this->setPen(QPen(CorrectColor(baseColor), qApp->toPixel(qApp->widthHairLine())/factor)); if (isHovered) { this->setPath(ToolPath(PathDirection::Show)); diff --git a/src/app/tools/nodeDetails/vabstractnode.cpp b/src/app/tools/nodeDetails/vabstractnode.cpp index 13ea1b71b..c4c1df277 100644 --- a/src/app/tools/nodeDetails/vabstractnode.cpp +++ b/src/app/tools/nodeDetails/vabstractnode.cpp @@ -47,7 +47,7 @@ const QString VAbstractNode::AttrIdTool = QStringLiteral("idTool"); */ VAbstractNode::VAbstractNode(VPattern *doc, VContainer *data, const quint32 &id, const quint32 &idNode, const quint32 &idTool, QObject *parent) - : VAbstractTool(doc, data, id, parent), idNode(idNode), idTool(idTool) + : VAbstractTool(doc, data, id, parent), idNode(idNode), idTool(idTool), currentColor(Qt::black) { _referens = 0; } diff --git a/src/app/tools/nodeDetails/vabstractnode.h b/src/app/tools/nodeDetails/vabstractnode.h index 61f505ccc..95a668378 100644 --- a/src/app/tools/nodeDetails/vabstractnode.h +++ b/src/app/tools/nodeDetails/vabstractnode.h @@ -53,6 +53,9 @@ protected: /** @brief idTool id tool. */ quint32 idTool; + /** @brief currentColor current tool color. */ + QColor currentColor; + void AddToModeling(const QDomElement &domElement); virtual void decrementReferens(); virtual void RemoveReferens(); diff --git a/src/app/tools/vabstracttool.cpp b/src/app/tools/vabstracttool.cpp index a8daea5b3..216803dc1 100644 --- a/src/app/tools/vabstracttool.cpp +++ b/src/app/tools/vabstracttool.cpp @@ -97,7 +97,7 @@ const QString VAbstractTool::ColorYellow = QStringLiteral("yellow"); * @param parent parent object. */ VAbstractTool::VAbstractTool(VPattern *doc, VContainer *data, quint32 id, QObject *parent) - :VDataTool(data, parent), doc(doc), id(id), baseColor(Qt::black), currentColor(Qt::black), vis(nullptr) + :VDataTool(data, parent), doc(doc), id(id), baseColor(Qt::black), vis(nullptr) { SCASSERT(doc != nullptr); connect(this, &VAbstractTool::toolhaveChange, this->doc, &VPattern::haveLiteChange); diff --git a/src/app/tools/vabstracttool.h b/src/app/tools/vabstracttool.h index fab8c8dfd..406bf57c8 100644 --- a/src/app/tools/vabstracttool.h +++ b/src/app/tools/vabstracttool.h @@ -147,9 +147,6 @@ protected: /** @brief baseColor base color for tool. */ Qt::GlobalColor baseColor; - /** @brief currentColor current tool color. */ - Qt::GlobalColor currentColor; - Visualization *vis; /** diff --git a/src/app/visualization/vsimplecurve.cpp b/src/app/visualization/vsimplecurve.cpp index de572b3e2..33031f3eb 100644 --- a/src/app/visualization/vsimplecurve.cpp +++ b/src/app/visualization/vsimplecurve.cpp @@ -40,18 +40,18 @@ * @param currentColor current color. * @param parent parent object. */ -VSimpleCurve::VSimpleCurve(quint32 id, Qt::GlobalColor *currentColor, SimpleCurvePoint pointPosition, qreal *factor, +VSimpleCurve::VSimpleCurve(quint32 id, QColor currentColor, SimpleCurvePoint pointPosition, qreal *factor, QObject *parent) :QObject(parent), QGraphicsPathItem(), id (id), factor(factor), currentColor(currentColor), curvePosition(pointPosition), enabled(true) { if (factor == nullptr) { - setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine()))); + setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine()))); } else { - setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine())/ *factor)); + setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/ *factor)); } setFlag(QGraphicsItem::ItemIsSelectable, true); setAcceptHoverEvents(true); @@ -62,7 +62,7 @@ void VSimpleCurve::ChangedActivDraw(const bool &flag) { enabled = flag; setEnabled(enabled); - setPen(QPen(CorrectColor(*currentColor), qApp->toPixel(qApp->widthHairLine())/ *factor)); + setPen(QPen(CorrectColor(currentColor), qApp->toPixel(qApp->widthHairLine())/ *factor)); } //--------------------------------------------------------------------------------------------------------------------- @@ -102,11 +102,11 @@ void VSimpleCurve::hoverMoveEvent(QGraphicsSceneHoverEvent *event) Q_UNUSED(event); if (factor == nullptr) { - this->setPen(QPen(CorrectColor(*currentColor), qApp->toPixel(qApp->widthMainLine()))); + this->setPen(QPen(CorrectColor(currentColor), qApp->toPixel(qApp->widthMainLine()))); } else { - this->setPen(QPen(CorrectColor(*currentColor), qApp->toPixel(qApp->widthMainLine())/ *factor)); + this->setPen(QPen(CorrectColor(currentColor), qApp->toPixel(qApp->widthMainLine())/ *factor)); } emit HoverPath(id, curvePosition, PathDirection::Show); } @@ -121,16 +121,29 @@ void VSimpleCurve::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) Q_UNUSED(event); if (factor == nullptr) { - this->setPen(QPen(CorrectColor(*currentColor), qApp->toPixel(qApp->widthHairLine()))); + this->setPen(QPen(CorrectColor(currentColor), qApp->toPixel(qApp->widthHairLine()))); } else { - this->setPen(QPen(CorrectColor(*currentColor), qApp->toPixel(qApp->widthHairLine())/ *factor)); + this->setPen(QPen(CorrectColor(currentColor), qApp->toPixel(qApp->widthHairLine())/ *factor)); } emit HoverPath(id, curvePosition, PathDirection::Hide); } +//--------------------------------------------------------------------------------------------------------------------- +QColor VSimpleCurve::GetCurrentColor() const +{ + return currentColor; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VSimpleCurve::SetCurrentColor(const QColor &value) +{ + currentColor = value; + setPen(QPen(CorrectColor(currentColor), pen().widthF())); +} + //--------------------------------------------------------------------------------------------------------------------- QColor VSimpleCurve::CorrectColor(const QColor &color) const { diff --git a/src/app/visualization/vsimplecurve.h b/src/app/visualization/vsimplecurve.h index a9b34c2db..a013727c2 100644 --- a/src/app/visualization/vsimplecurve.h +++ b/src/app/visualization/vsimplecurve.h @@ -41,13 +41,17 @@ class VSimpleCurve : public QObject, public QGraphicsPathItem { Q_OBJECT public: - VSimpleCurve(quint32 id, Qt::GlobalColor *currentColor, SimpleCurvePoint curvePosition, + VSimpleCurve(quint32 id, QColor currentColor, SimpleCurvePoint curvePosition, qreal *factor = nullptr, QObject *parent = 0); void ChangedActivDraw(const bool &flag); virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0); virtual int type() const {return Type;} enum { Type = UserType + static_cast(Vis::SimpleSplinePath)}; + + QColor GetCurrentColor() const; + void SetCurrentColor(const QColor &value); + signals: /** * @brief Choosed send id when clicked. @@ -68,7 +72,7 @@ private: qreal *factor; /** @brief currentColor current color. */ - Qt::GlobalColor *currentColor; + QColor currentColor; SimpleCurvePoint curvePosition; From 4f91c69127892e46e9a3d054160b1a52b9813206 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 6 Feb 2015 14:31:40 +0200 Subject: [PATCH 107/186] Refactoring, correct disabling tool. --HG-- branch : feature --- src/app/tools/drawTools/vabstractspline.cpp | 12 ++++++------ src/app/tools/drawTools/vdrawtool.h | 14 -------------- src/app/tools/drawTools/vtoolcut.cpp | 12 +++++++++--- src/app/tools/drawTools/vtoolcut.h | 1 + src/app/tools/drawTools/vtoolline.cpp | 8 ++++---- src/app/tools/drawTools/vtoollinepoint.cpp | 15 ++++++++++----- src/app/tools/drawTools/vtoollinepoint.h | 1 + src/app/tools/drawTools/vtoolpoint.cpp | 8 ++++---- 8 files changed, 35 insertions(+), 36 deletions(-) diff --git a/src/app/tools/drawTools/vabstractspline.cpp b/src/app/tools/drawTools/vabstractspline.cpp index c20e68cdc..94df69d36 100644 --- a/src/app/tools/drawTools/vabstractspline.cpp +++ b/src/app/tools/drawTools/vabstractspline.cpp @@ -74,7 +74,11 @@ void VAbstractSpline::FullUpdateFromFile() //--------------------------------------------------------------------------------------------------------------------- void VAbstractSpline::Disable(bool disable) { - DisableItem(this, disable); + enabled = !disable; + this->setEnabled(enabled); + this->setPen(QPen(CorrectColor(lineColor), qApp->toPixel(qApp->widthMainLine())/factor, Qt::SolidLine, + Qt::RoundCap)); + emit setEnabledPoint(enabled); } //--------------------------------------------------------------------------------------------------------------------- @@ -84,11 +88,7 @@ void VAbstractSpline::Disable(bool disable) */ void VAbstractSpline::ChangedActivDraw(const QString &newName) { - VDrawTool::ChangedActivDraw(newName); - this->setEnabled(enabled); - this->setPen(QPen(CorrectColor(lineColor), qApp->toPixel(qApp->widthMainLine())/factor, Qt::SolidLine, - Qt::RoundCap)); - emit setEnabledPoint(enabled); + Disable(!(nameActivDraw == newName)); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/tools/drawTools/vdrawtool.h b/src/app/tools/drawTools/vdrawtool.h index e978111bc..52b320b39 100644 --- a/src/app/tools/drawTools/vdrawtool.h +++ b/src/app/tools/drawTools/vdrawtool.h @@ -177,20 +177,6 @@ protected: // item->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor)); // } } - template - void DisableItem(Item *item, bool disable) - { - SCASSERT(item != nullptr); -// if (disable) -// { -// currentColor = Qt::gray; -// } -// else -// { -// currentColor = baseColor; -// } -// item->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor)); - } private: Q_DISABLE_COPY(VDrawTool) }; diff --git a/src/app/tools/drawTools/vtoolcut.cpp b/src/app/tools/drawTools/vtoolcut.cpp index 0c506d2e7..78544c8b1 100644 --- a/src/app/tools/drawTools/vtoolcut.cpp +++ b/src/app/tools/drawTools/vtoolcut.cpp @@ -59,9 +59,7 @@ VToolCut::VToolCut(VPattern *doc, VContainer *data, const quint32 &id, const QSt */ void VToolCut::ChangedActivDraw(const QString &newName) { - VToolPoint::ChangedActivDraw(newName); - firstCurve->ChangedActivDraw(enabled); - secondCurve->ChangedActivDraw(enabled); + Disable(!(nameActivDraw == newName)); } //--------------------------------------------------------------------------------------------------------------------- @@ -74,6 +72,14 @@ void VToolCut::HoverPath(quint32 id, SimpleCurvePoint curvePosition, PathDirecti } } +//--------------------------------------------------------------------------------------------------------------------- +void VToolCut::Disable(bool disable) +{ + VToolPoint::Disable(disable); + firstCurve->ChangedActivDraw(enabled); + secondCurve->ChangedActivDraw(enabled); +} + //--------------------------------------------------------------------------------------------------------------------- quint32 VToolCut::getCurveCutId() const { diff --git a/src/app/tools/drawTools/vtoolcut.h b/src/app/tools/drawTools/vtoolcut.h index 3ec1a1544..c203cc9d3 100644 --- a/src/app/tools/drawTools/vtoolcut.h +++ b/src/app/tools/drawTools/vtoolcut.h @@ -53,6 +53,7 @@ public slots: virtual void ChangedActivDraw(const QString &newName); virtual void CurveChoosed(quint32 id)=0; void HoverPath(quint32 id, SimpleCurvePoint curvePosition, PathDirection direction); + void Disable(bool disable); protected: /** @brief formula keep formula of length */ QString formula; diff --git a/src/app/tools/drawTools/vtoolline.cpp b/src/app/tools/drawTools/vtoolline.cpp index f9d67bddc..a4df670d5 100644 --- a/src/app/tools/drawTools/vtoolline.cpp +++ b/src/app/tools/drawTools/vtoolline.cpp @@ -227,7 +227,9 @@ void VToolLine::SetFactor(qreal factor) //--------------------------------------------------------------------------------------------------------------------- void VToolLine::Disable(bool disable) { - DisableItem(this, disable); + enabled = !disable; + this->setEnabled(enabled); + this->setPen(QPen(QColor(baseColor), qApp->toPixel(qApp->widthHairLine())/factor, LineStyleToPenStyle(typeLine))); } //--------------------------------------------------------------------------------------------------------------------- @@ -237,9 +239,7 @@ void VToolLine::Disable(bool disable) */ void VToolLine::ChangedActivDraw(const QString &newName) { - VDrawTool::ChangedActivDraw(newName); - this->setEnabled(enabled); - this->setPen(QPen(QColor(baseColor), qApp->toPixel(qApp->widthHairLine())/factor, LineStyleToPenStyle(typeLine))); + Disable(!(nameActivDraw == newName)); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/tools/drawTools/vtoollinepoint.cpp b/src/app/tools/drawTools/vtoollinepoint.cpp index e66bcae6e..5862a677e 100644 --- a/src/app/tools/drawTools/vtoollinepoint.cpp +++ b/src/app/tools/drawTools/vtoollinepoint.cpp @@ -69,11 +69,7 @@ VToolLinePoint::~VToolLinePoint() */ void VToolLinePoint::ChangedActivDraw(const QString &newName) { - VToolPoint::ChangedActivDraw(newName); - this->setEnabled(enabled); - mainLine->setPen(QPen(QColor(lineColor), qApp->toPixel(qApp->widthHairLine())/factor, - LineStyleToPenStyle(typeLine))); - mainLine->setEnabled(enabled); + Disable(!(nameActivDraw == newName)); } //--------------------------------------------------------------------------------------------------------------------- @@ -110,6 +106,15 @@ void VToolLinePoint::SetFactor(qreal factor) RefreshGeometry(); } +//--------------------------------------------------------------------------------------------------------------------- +void VToolLinePoint::Disable(bool disable) +{ + VToolPoint::Disable(disable); + mainLine->setPen(QPen(QColor(lineColor), qApp->toPixel(qApp->widthHairLine())/factor, + LineStyleToPenStyle(typeLine))); + mainLine->setEnabled(enabled); +} + //--------------------------------------------------------------------------------------------------------------------- qreal VToolLinePoint::GetAngle() const { diff --git a/src/app/tools/drawTools/vtoollinepoint.h b/src/app/tools/drawTools/vtoollinepoint.h index d605dd797..7b57dfbfd 100644 --- a/src/app/tools/drawTools/vtoollinepoint.h +++ b/src/app/tools/drawTools/vtoollinepoint.h @@ -56,6 +56,7 @@ public: public slots: virtual void ChangedActivDraw(const QString &newName); virtual void SetFactor(qreal factor); + void Disable(bool disable); protected: /** @brief formula string with length formula. */ QString formulaLength; diff --git a/src/app/tools/drawTools/vtoolpoint.cpp b/src/app/tools/drawTools/vtoolpoint.cpp index 74053b9e7..94e3a6abd 100644 --- a/src/app/tools/drawTools/vtoolpoint.cpp +++ b/src/app/tools/drawTools/vtoolpoint.cpp @@ -132,9 +132,7 @@ void VToolPoint::UpdateNamePosition(qreal mx, qreal my) */ void VToolPoint::ChangedActivDraw(const QString &newName) { - VDrawTool::ChangedActivDraw(newName); - this->setEnabled(enabled); - namePoint->setEnabled(enabled); + Disable(!(nameActivDraw == newName)); } //--------------------------------------------------------------------------------------------------------------------- @@ -173,7 +171,9 @@ void VToolPoint::ShowContextMenu(QGraphicsSceneContextMenuEvent *event) //--------------------------------------------------------------------------------------------------------------------- void VToolPoint::Disable(bool disable) { - DisableItem(this, disable); + enabled = !disable; + this->setEnabled(enabled); + namePoint->setEnabled(enabled); } //--------------------------------------------------------------------------------------------------------------------- From 25691639d4dfef09f755efdbd0e6dab204428340 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 6 Feb 2015 14:34:02 +0200 Subject: [PATCH 108/186] This method now can be virtual. --HG-- branch : feature --- src/app/tools/drawTools/vdrawtool.cpp | 10 ---------- src/app/tools/drawTools/vdrawtool.h | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/app/tools/drawTools/vdrawtool.cpp b/src/app/tools/drawTools/vdrawtool.cpp index e993e0b07..765af4cea 100644 --- a/src/app/tools/drawTools/vdrawtool.cpp +++ b/src/app/tools/drawTools/vdrawtool.cpp @@ -74,16 +74,6 @@ void VDrawTool::ShowTool(quint32 id, Qt::GlobalColor color, bool enable) Q_UNUSED(enable); } -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief ChangedActivDraw disable or enable context menu after change active pattern peace. - * @param newName new name active pattern peace. name new active pattern peace. - */ -void VDrawTool::ChangedActivDraw(const QString &newName) -{ - enabled = nameActivDraw == newName; -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief ChangedNameDraw save new name active pattern peace. diff --git a/src/app/tools/drawTools/vdrawtool.h b/src/app/tools/drawTools/vdrawtool.h index 52b320b39..40dc27722 100644 --- a/src/app/tools/drawTools/vdrawtool.h +++ b/src/app/tools/drawTools/vdrawtool.h @@ -64,7 +64,7 @@ public: public slots: virtual void ShowTool(quint32 id, Qt::GlobalColor color, bool enable); - virtual void ChangedActivDraw(const QString &newName); + virtual void ChangedActivDraw(const QString &newName) = 0; void ChangedNameDraw(const QString &oldName, const QString &newName); virtual void FullUpdateFromGuiOk(int result); virtual void FullUpdateFromGuiApply(); From b8e7cbd1acf3f054c2cc36d4c2b67cd134b56624 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 6 Feb 2015 16:25:04 +0200 Subject: [PATCH 109/186] Use for each tool correct method Disable. --HG-- branch : feature --- src/app/tools/drawTools/vtoolbisector.cpp | 2 +- src/app/tools/drawTools/vtoolcurveintersectaxis.cpp | 4 ++-- src/app/tools/drawTools/vtoolcutarc.cpp | 2 +- src/app/tools/drawTools/vtoolcutspline.cpp | 2 +- src/app/tools/drawTools/vtoolcutsplinepath.cpp | 4 ++-- src/app/tools/drawTools/vtoolendline.cpp | 4 ++-- src/app/tools/drawTools/vtoolheight.cpp | 4 ++-- src/app/tools/drawTools/vtoollineintersect.cpp | 2 +- src/app/tools/drawTools/vtoollineintersectaxis.cpp | 4 ++-- src/app/tools/drawTools/vtoolnormal.cpp | 2 +- src/app/tools/drawTools/vtoolpointofcontact.cpp | 2 +- src/app/tools/drawTools/vtoolpointofintersection.cpp | 2 +- src/app/tools/drawTools/vtoolshoulderpoint.cpp | 2 +- src/app/tools/drawTools/vtooltriangle.cpp | 2 +- src/app/xml/vpattern.cpp | 2 +- 15 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/app/tools/drawTools/vtoolbisector.cpp b/src/app/tools/drawTools/vtoolbisector.cpp index 0052b60af..81d9011af 100644 --- a/src/app/tools/drawTools/vtoolbisector.cpp +++ b/src/app/tools/drawTools/vtoolbisector.cpp @@ -205,7 +205,7 @@ VToolBisector* VToolBisector::Create(const quint32 _id, QString &formula, const scene->addItem(point); connect(point, &VToolPoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolBisector::SetFactor); - connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolPoint::Disable); + connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolBisector::Disable); doc->AddTool(id, point); doc->IncrementReferens(firstPointId); doc->IncrementReferens(secondPointId); diff --git a/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp b/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp index a33b1bca7..e3cce5d22 100644 --- a/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp +++ b/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp @@ -131,8 +131,8 @@ VToolCurveIntersectAxis *VToolCurveIntersectAxis::Create(const quint32 _id, cons curveId, typeCreation); scene->addItem(point); connect(point, &VToolPoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); - connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolPoint::SetFactor); - connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolPoint::Disable); + connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolCurveIntersectAxis::SetFactor); + connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolCurveIntersectAxis::Disable); doc->AddTool(id, point); doc->IncrementReferens(basePointId); doc->IncrementReferens(curveId); diff --git a/src/app/tools/drawTools/vtoolcutarc.cpp b/src/app/tools/drawTools/vtoolcutarc.cpp index e5d475aa2..b99bad029 100644 --- a/src/app/tools/drawTools/vtoolcutarc.cpp +++ b/src/app/tools/drawTools/vtoolcutarc.cpp @@ -171,7 +171,7 @@ VToolCutArc* VToolCutArc::Create(const quint32 _id, const QString &pointName, QS scene->addItem(point); connect(point, &VToolPoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolCutArc::SetFactor); - connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolPoint::Disable); + connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolCutArc::Disable); doc->AddTool(id, point); doc->AddTool(arc1id, point); doc->AddTool(arc2id, point); diff --git a/src/app/tools/drawTools/vtoolcutspline.cpp b/src/app/tools/drawTools/vtoolcutspline.cpp index afd15db56..edab6ce3e 100644 --- a/src/app/tools/drawTools/vtoolcutspline.cpp +++ b/src/app/tools/drawTools/vtoolcutspline.cpp @@ -178,7 +178,7 @@ VToolCutSpline* VToolCutSpline::Create(const quint32 _id, const QString &pointNa scene->addItem(point); connect(point, &VToolPoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolCutSpline::SetFactor); - connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolPoint::Disable); + connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolCutSpline::Disable); doc->AddTool(id, point); doc->AddTool(spl1id, point); doc->AddTool(spl2id, point); diff --git a/src/app/tools/drawTools/vtoolcutsplinepath.cpp b/src/app/tools/drawTools/vtoolcutsplinepath.cpp index 7f8b1a005..98f1d820f 100644 --- a/src/app/tools/drawTools/vtoolcutsplinepath.cpp +++ b/src/app/tools/drawTools/vtoolcutsplinepath.cpp @@ -226,8 +226,8 @@ VToolCutSplinePath* VToolCutSplinePath::Create(const quint32 _id, const QString splPath2id, typeCreation); scene->addItem(point); connect(point, &VToolPoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); - connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolPoint::SetFactor); - connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolPoint::Disable); + connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolCutSplinePath::SetFactor); + connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolCutSplinePath::Disable); doc->AddTool(id, point); doc->AddTool(splPath1id, point); doc->AddTool(splPath2id, point); diff --git a/src/app/tools/drawTools/vtoolendline.cpp b/src/app/tools/drawTools/vtoolendline.cpp index 6476e145d..05dd4b4f3 100644 --- a/src/app/tools/drawTools/vtoolendline.cpp +++ b/src/app/tools/drawTools/vtoolendline.cpp @@ -166,8 +166,8 @@ VToolEndLine* VToolEndLine::Create(const quint32 _id, const QString &pointName, typeCreation); scene->addItem(point); connect(point, &VToolPoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); - connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolPoint::SetFactor); - connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolPoint::Disable); + connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolEndLine::SetFactor); + connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolEndLine::Disable); doc->AddTool(id, point); doc->IncrementReferens(basePointId); return point; diff --git a/src/app/tools/drawTools/vtoolheight.cpp b/src/app/tools/drawTools/vtoolheight.cpp index 6b3acfdab..583d5e136 100644 --- a/src/app/tools/drawTools/vtoolheight.cpp +++ b/src/app/tools/drawTools/vtoolheight.cpp @@ -164,8 +164,8 @@ VToolHeight* VToolHeight::Create(const quint32 _id, const QString &pointName, co typeCreation); scene->addItem(point); connect(point, &VToolPoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); - connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolPoint::SetFactor); - connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolPoint::Disable); + connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolHeight::SetFactor); + connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolHeight::Disable); doc->AddTool(id, point); doc->IncrementReferens(basePointId); doc->IncrementReferens(p1LineId); diff --git a/src/app/tools/drawTools/vtoollineintersect.cpp b/src/app/tools/drawTools/vtoollineintersect.cpp index fcb27fcde..e87b4df57 100644 --- a/src/app/tools/drawTools/vtoollineintersect.cpp +++ b/src/app/tools/drawTools/vtoollineintersect.cpp @@ -175,7 +175,7 @@ VToolLineIntersect* VToolLineIntersect::Create(const quint32 _id, const quint32 scene->addItem(point); connect(point, &VToolLineIntersect::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolLineIntersect::SetFactor); - connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolPoint::Disable); + connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolLineIntersect::Disable); doc->AddTool(id, point); doc->IncrementReferens(p1Line1Id); doc->IncrementReferens(p2Line1Id); diff --git a/src/app/tools/drawTools/vtoollineintersectaxis.cpp b/src/app/tools/drawTools/vtoollineintersectaxis.cpp index 00b0b6dd4..4290f5007 100644 --- a/src/app/tools/drawTools/vtoollineintersectaxis.cpp +++ b/src/app/tools/drawTools/vtoollineintersectaxis.cpp @@ -143,8 +143,8 @@ VToolLineIntersectAxis *VToolLineIntersectAxis::Create(const quint32 _id, const typeCreation); scene->addItem(point); connect(point, &VToolPoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); - connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolPoint::SetFactor); - connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolPoint::Disable); + connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolLineIntersectAxis::SetFactor); + connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolLineIntersectAxis::Disable); doc->AddTool(id, point); doc->IncrementReferens(basePointId); doc->IncrementReferens(firstPointId); diff --git a/src/app/tools/drawTools/vtoolnormal.cpp b/src/app/tools/drawTools/vtoolnormal.cpp index 117519d46..c09472e2a 100644 --- a/src/app/tools/drawTools/vtoolnormal.cpp +++ b/src/app/tools/drawTools/vtoolnormal.cpp @@ -166,7 +166,7 @@ VToolNormal* VToolNormal::Create(const quint32 _id, QString &formula, const quin scene->addItem(point); connect(point, &VToolNormal::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolNormal::SetFactor); - connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolPoint::Disable); + connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolNormal::Disable); doc->AddTool(id, point); doc->IncrementReferens(firstPointId); doc->IncrementReferens(secondPointId); diff --git a/src/app/tools/drawTools/vtoolpointofcontact.cpp b/src/app/tools/drawTools/vtoolpointofcontact.cpp index cc56bf460..9e1575d03 100644 --- a/src/app/tools/drawTools/vtoolpointofcontact.cpp +++ b/src/app/tools/drawTools/vtoolpointofcontact.cpp @@ -209,7 +209,7 @@ VToolPointOfContact* VToolPointOfContact::Create(const quint32 _id, QString &rad scene->addItem(point); connect(point, &VToolPointOfContact::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolPointOfContact::SetFactor); - connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolPoint::Disable); + connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolPointOfContact::Disable); doc->AddTool(id, point); doc->IncrementReferens(center); doc->IncrementReferens(firstPointId); diff --git a/src/app/tools/drawTools/vtoolpointofintersection.cpp b/src/app/tools/drawTools/vtoolpointofintersection.cpp index f8f771723..3e7efe603 100644 --- a/src/app/tools/drawTools/vtoolpointofintersection.cpp +++ b/src/app/tools/drawTools/vtoolpointofintersection.cpp @@ -150,7 +150,7 @@ VToolPointOfIntersection *VToolPointOfIntersection::Create(const quint32 _id, co scene->addItem(point); connect(point, &VToolPointOfIntersection::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolPointOfIntersection::SetFactor); - connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolPoint::Disable); + connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolPointOfIntersection::Disable); doc->AddTool(id, point); doc->IncrementReferens(firstPointId); doc->IncrementReferens(secondPointId); diff --git a/src/app/tools/drawTools/vtoolshoulderpoint.cpp b/src/app/tools/drawTools/vtoolshoulderpoint.cpp index 338ae3e75..bc9e5cbeb 100644 --- a/src/app/tools/drawTools/vtoolshoulderpoint.cpp +++ b/src/app/tools/drawTools/vtoolshoulderpoint.cpp @@ -209,7 +209,7 @@ VToolShoulderPoint* VToolShoulderPoint::Create(const quint32 _id, QString &formu scene->addItem(point); connect(point, &VToolShoulderPoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolShoulderPoint::SetFactor); - connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolPoint::Disable); + connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolShoulderPoint::Disable); doc->AddTool(id, point); doc->IncrementReferens(p1Line); doc->IncrementReferens(p2Line); diff --git a/src/app/tools/drawTools/vtooltriangle.cpp b/src/app/tools/drawTools/vtooltriangle.cpp index bf7d99bdd..5d01d3202 100644 --- a/src/app/tools/drawTools/vtooltriangle.cpp +++ b/src/app/tools/drawTools/vtooltriangle.cpp @@ -161,7 +161,7 @@ VToolTriangle* VToolTriangle::Create(const quint32 _id, const QString &pointName scene->addItem(point); connect(point, &VToolTriangle::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolTriangle::SetFactor); - connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolPoint::Disable); + connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolTriangle::Disable); doc->AddTool(id, point); doc->IncrementReferens(axisP1Id); doc->IncrementReferens(axisP2Id); diff --git a/src/app/xml/vpattern.cpp b/src/app/xml/vpattern.cpp index 02b401175..a163d7653 100644 --- a/src/app/xml/vpattern.cpp +++ b/src/app/xml/vpattern.cpp @@ -1161,7 +1161,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem scene->addItem(spoint); connect(spoint, &VToolSinglePoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, spoint, &VToolSinglePoint::SetFactor); - connect(scene, &VMainGraphicsScene::DisableItem, spoint, &VToolPoint::Disable); + connect(scene, &VMainGraphicsScene::DisableItem, spoint, &VToolSinglePoint::Disable); tools[id] = spoint; } } From f687105905c2b89460fd767a0d0cfa83d29b6d5d Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 6 Feb 2015 19:43:31 +0200 Subject: [PATCH 110/186] Refactoring. Also read attribute color from xml. --HG-- branch : feature --- src/app/tools/drawTools/vabstractspline.cpp | 7 ++++++ src/app/tools/drawTools/vabstractspline.h | 1 + src/app/tools/drawTools/vdrawtool.cpp | 16 +++++++++++++- src/app/tools/drawTools/vdrawtool.h | 3 +++ src/app/tools/drawTools/vtoolalongline.cpp | 20 ++++++++++------- src/app/tools/drawTools/vtoolalongline.h | 1 + src/app/tools/drawTools/vtoolarc.cpp | 1 + src/app/tools/drawTools/vtoolbisector.cpp | 22 +++++++++++-------- src/app/tools/drawTools/vtoolbisector.h | 1 + .../drawTools/vtoolcurveintersectaxis.cpp | 20 ++++++++++------- .../tools/drawTools/vtoolcurveintersectaxis.h | 1 + src/app/tools/drawTools/vtoolcut.cpp | 1 - src/app/tools/drawTools/vtoolcutarc.cpp | 10 ++++++++- src/app/tools/drawTools/vtoolcutarc.h | 1 + src/app/tools/drawTools/vtoolcutspline.cpp | 10 ++++++++- src/app/tools/drawTools/vtoolcutspline.h | 1 + .../tools/drawTools/vtoolcutsplinepath.cpp | 10 ++++++++- src/app/tools/drawTools/vtoolcutsplinepath.h | 1 + src/app/tools/drawTools/vtoolendline.cpp | 22 ++++++++++++------- src/app/tools/drawTools/vtoolendline.h | 1 + src/app/tools/drawTools/vtoolheight.cpp | 20 ++++++++++------- src/app/tools/drawTools/vtoolheight.h | 1 + src/app/tools/drawTools/vtoolline.cpp | 18 +++++++++------ src/app/tools/drawTools/vtoolline.h | 1 + .../tools/drawTools/vtoollineintersect.cpp | 18 ++++++++------- src/app/tools/drawTools/vtoollineintersect.h | 1 + .../drawTools/vtoollineintersectaxis.cpp | 22 +++++++++++-------- .../tools/drawTools/vtoollineintersectaxis.h | 1 + src/app/tools/drawTools/vtoolnormal.cpp | 21 ++++++++++-------- src/app/tools/drawTools/vtoolnormal.h | 1 + .../tools/drawTools/vtoolpointofcontact.cpp | 18 ++++++++------- src/app/tools/drawTools/vtoolpointofcontact.h | 1 + .../drawTools/vtoolpointofintersection.cpp | 14 +++++++----- .../drawTools/vtoolpointofintersection.h | 1 + .../tools/drawTools/vtoolshoulderpoint.cpp | 22 +++++++++++-------- src/app/tools/drawTools/vtoolshoulderpoint.h | 1 + src/app/tools/drawTools/vtoolsinglepoint.cpp | 7 ++++++ src/app/tools/drawTools/vtoolsinglepoint.h | 1 + src/app/tools/drawTools/vtoolspline.cpp | 1 + src/app/tools/drawTools/vtoolsplinepath.cpp | 1 + src/app/tools/drawTools/vtooltriangle.cpp | 18 ++++++++------- src/app/tools/drawTools/vtooltriangle.h | 1 + 42 files changed, 230 insertions(+), 110 deletions(-) diff --git a/src/app/tools/drawTools/vabstractspline.cpp b/src/app/tools/drawTools/vabstractspline.cpp index 94df69d36..385622c0c 100644 --- a/src/app/tools/drawTools/vabstractspline.cpp +++ b/src/app/tools/drawTools/vabstractspline.cpp @@ -68,6 +68,7 @@ QString VAbstractSpline::getTagName() const */ void VAbstractSpline::FullUpdateFromFile() { + ReadAttributes(); RefreshGeometry(); } @@ -212,6 +213,12 @@ QPainterPath VAbstractSpline::ToolPath(PathDirection direction) const return path; } +//--------------------------------------------------------------------------------------------------------------------- +void VAbstractSpline::ReadToolAttributes(const QDomElement &domElement) +{ + lineColor = doc->GetParametrString(domElement, AttrColor, ColorBlack); +} + //--------------------------------------------------------------------------------------------------------------------- void VAbstractSpline::ShowFoot(bool show) { diff --git a/src/app/tools/drawTools/vabstractspline.h b/src/app/tools/drawTools/vabstractspline.h index 3476081cf..b1e5cdd05 100644 --- a/src/app/tools/drawTools/vabstractspline.h +++ b/src/app/tools/drawTools/vabstractspline.h @@ -86,6 +86,7 @@ protected: virtual void keyReleaseEvent(QKeyEvent * event); virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event ); QPainterPath ToolPath(PathDirection direction = PathDirection::Hide) const; + virtual void ReadToolAttributes(const QDomElement &domElement); private: Q_DISABLE_COPY(VAbstractSpline) }; diff --git a/src/app/tools/drawTools/vdrawtool.cpp b/src/app/tools/drawTools/vdrawtool.cpp index 765af4cea..70b538e86 100644 --- a/src/app/tools/drawTools/vdrawtool.cpp +++ b/src/app/tools/drawTools/vdrawtool.cpp @@ -158,7 +158,7 @@ void VDrawTool::RefreshDataInFile() } else { - qDebug()<<"Can't find tool with id ="<< id << Q_FUNC_INFO; + qCDebug(vTool)<<"Can't find tool with id ="<< id << Q_FUNC_INFO; } } @@ -175,6 +175,20 @@ QColor VDrawTool::CorrectColor(const QColor &color) const } } +//--------------------------------------------------------------------------------------------------------------------- +void VDrawTool::ReadAttributes() +{ + const QDomElement domElement = doc->elementById(QString().setNum(id)); + if (domElement.isElement()) + { + ReadToolAttributes(domElement); + } + else + { + qCDebug(vTool)<<"Can't find tool with id ="<< id << Q_FUNC_INFO; + } +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief DialogLinkDestroy removes dialog pointer diff --git a/src/app/tools/drawTools/vdrawtool.h b/src/app/tools/drawTools/vdrawtool.h index 40dc27722..1e4025f70 100644 --- a/src/app/tools/drawTools/vdrawtool.h +++ b/src/app/tools/drawTools/vdrawtool.h @@ -97,6 +97,9 @@ protected: virtual void RefreshDataInFile(); QColor CorrectColor(const QColor &color) const; + void ReadAttributes(); + virtual void ReadToolAttributes(const QDomElement &domElement)=0; + template /** * @brief ContextMenu show context menu for tool. diff --git a/src/app/tools/drawTools/vtoolalongline.cpp b/src/app/tools/drawTools/vtoolalongline.cpp index ec04e8c46..27c624a55 100644 --- a/src/app/tools/drawTools/vtoolalongline.cpp +++ b/src/app/tools/drawTools/vtoolalongline.cpp @@ -71,14 +71,7 @@ VToolAlongLine::VToolAlongLine(VPattern *doc, VContainer *data, quint32 id, cons */ void VToolAlongLine::FullUpdateFromFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); - if (domElement.isElement()) - { - typeLine = domElement.attribute(AttrTypeLine, ""); - formulaLength = domElement.attribute(AttrLength, ""); - basePointId = domElement.attribute(AttrFirstPoint, "").toUInt(); - secondPointId = domElement.attribute(AttrSecondPoint, "").toUInt(); - } + ReadAttributes(); RefreshGeometry(); if (vis != nullptr) @@ -168,6 +161,16 @@ void VToolAlongLine::SaveOptions(QDomElement &tag, QSharedPointer &obj doc->SetAttribute(tag, AttrSecondPoint, secondPointId); } +//--------------------------------------------------------------------------------------------------------------------- +void VToolAlongLine::ReadToolAttributes(const QDomElement &domElement) +{ + typeLine = doc->GetParametrString(domElement, AttrTypeLine, TypeLineLine); + lineColor = doc->GetParametrString(domElement, AttrLineColor, ColorBlack); + formulaLength = doc->GetParametrString(domElement, AttrLength, ""); + basePointId = doc->GetParametrUInt(domElement, AttrFirstPoint, NULL_ID_STR); + secondPointId = doc->GetParametrUInt(domElement, AttrSecondPoint, NULL_ID_STR); +} + //--------------------------------------------------------------------------------------------------------------------- quint32 VToolAlongLine::GetSecondPointId() const { @@ -232,6 +235,7 @@ void VToolAlongLine::setDialog() SCASSERT(dialogTool != nullptr); const QSharedPointer p = VAbstractTool::data.GeometricObject(id); dialogTool->SetTypeLine(typeLine); + dialogTool->SetLineColor(lineColor); dialogTool->SetFormula(formulaLength); dialogTool->SetFirstPointId(basePointId); dialogTool->SetSecondPointId(secondPointId); diff --git a/src/app/tools/drawTools/vtoolalongline.h b/src/app/tools/drawTools/vtoolalongline.h index f83355a94..1ece5bf76 100644 --- a/src/app/tools/drawTools/vtoolalongline.h +++ b/src/app/tools/drawTools/vtoolalongline.h @@ -64,6 +64,7 @@ protected: virtual void RemoveReferens(); virtual void SaveDialog(QDomElement &domElement); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void ReadToolAttributes(const QDomElement &domElement); private: /** @brief secondPointId id second point of line. */ quint32 secondPointId; diff --git a/src/app/tools/drawTools/vtoolarc.cpp b/src/app/tools/drawTools/vtoolarc.cpp index 6363d017b..e4509da86 100644 --- a/src/app/tools/drawTools/vtoolarc.cpp +++ b/src/app/tools/drawTools/vtoolarc.cpp @@ -82,6 +82,7 @@ void VToolArc::setDialog() dialogTool->SetF1(arc->GetFormulaF1()); dialogTool->SetF2(arc->GetFormulaF2()); dialogTool->SetRadius(arc->GetFormulaRadius()); + dialogTool->SetColor(lineColor); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/tools/drawTools/vtoolbisector.cpp b/src/app/tools/drawTools/vtoolbisector.cpp index 81d9011af..580a84872 100644 --- a/src/app/tools/drawTools/vtoolbisector.cpp +++ b/src/app/tools/drawTools/vtoolbisector.cpp @@ -113,6 +113,7 @@ void VToolBisector::setDialog() SCASSERT(dialogTool != nullptr); const QSharedPointer p = VAbstractTool::data.GeometricObject(id); dialogTool->SetTypeLine(typeLine); + dialogTool->SetLineColor(lineColor); dialogTool->SetFormula(formulaLength); dialogTool->SetFirstPointId(firstPointId); dialogTool->SetSecondPointId(basePointId); @@ -221,15 +222,7 @@ VToolBisector* VToolBisector::Create(const quint32 _id, QString &formula, const */ void VToolBisector::FullUpdateFromFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); - if (domElement.isElement()) - { - typeLine = domElement.attribute(AttrTypeLine, ""); - formulaLength = domElement.attribute(AttrLength, ""); - firstPointId = domElement.attribute(AttrFirstPoint, "").toUInt(); - basePointId = domElement.attribute(AttrSecondPoint, "").toUInt(); - thirdPointId = domElement.attribute(AttrThirdPoint, "").toUInt(); - } + ReadAttributes(); RefreshGeometry(); if (vis != nullptr) @@ -322,6 +315,17 @@ void VToolBisector::SaveOptions(QDomElement &tag, QSharedPointer &obj) doc->SetAttribute(tag, AttrThirdPoint, thirdPointId); } +//--------------------------------------------------------------------------------------------------------------------- +void VToolBisector::ReadToolAttributes(const QDomElement &domElement) +{ + typeLine = doc->GetParametrString(domElement, AttrTypeLine, TypeLineLine); + lineColor = doc->GetParametrString(domElement, AttrLineColor, ColorBlack); + formulaLength = doc->GetParametrString(domElement, AttrLength, ""); + firstPointId = doc->GetParametrUInt(domElement, AttrFirstPoint, NULL_ID_STR); + basePointId = doc->GetParametrUInt(domElement, AttrSecondPoint, NULL_ID_STR); + thirdPointId = doc->GetParametrUInt(domElement, AttrThirdPoint, NULL_ID_STR); +} + //--------------------------------------------------------------------------------------------------------------------- quint32 VToolBisector::GetThirdPointId() const { diff --git a/src/app/tools/drawTools/vtoolbisector.h b/src/app/tools/drawTools/vtoolbisector.h index 93aa64302..9d5ab776f 100644 --- a/src/app/tools/drawTools/vtoolbisector.h +++ b/src/app/tools/drawTools/vtoolbisector.h @@ -72,6 +72,7 @@ protected: virtual void RemoveReferens(); virtual void SaveDialog(QDomElement &domElement); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void ReadToolAttributes(const QDomElement &domElement); private: /** @brief firstPointId id first point of angle. */ quint32 firstPointId; diff --git a/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp b/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp index e3cce5d22..e2953eaf5 100644 --- a/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp +++ b/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp @@ -67,6 +67,7 @@ void VToolCurveIntersectAxis::setDialog() SCASSERT(dialogTool != nullptr); const QSharedPointer p = VAbstractTool::data.GeometricObject(id); dialogTool->SetTypeLine(typeLine); + dialogTool->SetLineColor(lineColor); dialogTool->SetAngle(formulaAngle); dialogTool->SetBasePointId(basePointId); dialogTool->setCurveId(curveId); @@ -250,14 +251,7 @@ void VToolCurveIntersectAxis::ShowVisualization(bool show) //--------------------------------------------------------------------------------------------------------------------- void VToolCurveIntersectAxis::FullUpdateFromFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); - if (domElement.isElement()) - { - typeLine = domElement.attribute(AttrTypeLine, ""); - basePointId = domElement.attribute(AttrBasePoint, "").toUInt(); - curveId = domElement.attribute(AttrCurve, "").toUInt(); - formulaAngle = domElement.attribute(AttrAngle, ""); - } + ReadAttributes(); RefreshGeometry(); if (vis != nullptr) @@ -313,3 +307,13 @@ void VToolCurveIntersectAxis::SaveOptions(QDomElement &tag, QSharedPointerSetAttribute(tag, AttrBasePoint, basePointId); doc->SetAttribute(tag, AttrCurve, curveId); } + +//--------------------------------------------------------------------------------------------------------------------- +void VToolCurveIntersectAxis::ReadToolAttributes(const QDomElement &domElement) +{ + typeLine = doc->GetParametrString(domElement, AttrTypeLine, TypeLineLine); + lineColor = doc->GetParametrString(domElement, AttrLineColor, ColorBlack); + basePointId = doc->GetParametrUInt(domElement, AttrBasePoint, NULL_ID_STR); + curveId = doc->GetParametrUInt(domElement, AttrCurve, NULL_ID_STR); + formulaAngle = doc->GetParametrString(domElement, AttrAngle, ""); +} diff --git a/src/app/tools/drawTools/vtoolcurveintersectaxis.h b/src/app/tools/drawTools/vtoolcurveintersectaxis.h index bf583f3f5..768fe5ac1 100644 --- a/src/app/tools/drawTools/vtoolcurveintersectaxis.h +++ b/src/app/tools/drawTools/vtoolcurveintersectaxis.h @@ -68,6 +68,7 @@ protected: virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event ); virtual void SaveDialog(QDomElement &domElement); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void ReadToolAttributes(const QDomElement &domElement); private: Q_DISABLE_COPY(VToolCurveIntersectAxis) QString formulaAngle; diff --git a/src/app/tools/drawTools/vtoolcut.cpp b/src/app/tools/drawTools/vtoolcut.cpp index 78544c8b1..a7ab6c27a 100644 --- a/src/app/tools/drawTools/vtoolcut.cpp +++ b/src/app/tools/drawTools/vtoolcut.cpp @@ -150,5 +150,4 @@ void VToolCut::FullUpdateCurveFromFile(const QString &attrCurve) formula = domElement.attribute(AttrLength, ""); curveCutId = domElement.attribute(attrCurve, "").toUInt(); } - RefreshGeometry(); } diff --git a/src/app/tools/drawTools/vtoolcutarc.cpp b/src/app/tools/drawTools/vtoolcutarc.cpp index b99bad029..fe3c0731e 100644 --- a/src/app/tools/drawTools/vtoolcutarc.cpp +++ b/src/app/tools/drawTools/vtoolcutarc.cpp @@ -220,7 +220,8 @@ void VToolCutArc::ShowVisualization(bool show) */ void VToolCutArc::FullUpdateFromFile() { - FullUpdateCurveFromFile(AttrArc); + ReadAttributes(); + RefreshGeometry(); if (vis != nullptr) { @@ -315,3 +316,10 @@ void VToolCutArc::SaveOptions(QDomElement &tag, QSharedPointer &obj) doc->SetAttribute(tag, AttrLength, formula); doc->SetAttribute(tag, AttrArc, curveCutId); } + +//--------------------------------------------------------------------------------------------------------------------- +void VToolCutArc::ReadToolAttributes(const QDomElement &domElement) +{ + formula = doc->GetParametrString(domElement, AttrLength, ""); + curveCutId = doc->GetParametrUInt(domElement, AttrArc, NULL_ID_STR); +} diff --git a/src/app/tools/drawTools/vtoolcutarc.h b/src/app/tools/drawTools/vtoolcutarc.h index 2e852cdca..e8a5cf75f 100644 --- a/src/app/tools/drawTools/vtoolcutarc.h +++ b/src/app/tools/drawTools/vtoolcutarc.h @@ -61,6 +61,7 @@ protected: virtual void RefreshCurve(VSimpleCurve *curve, quint32 curveId, SimpleCurvePoint curvePosition, PathDirection direction = PathDirection::Hide); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void ReadToolAttributes(const QDomElement &domElement); private: Q_DISABLE_COPY(VToolCutArc) }; diff --git a/src/app/tools/drawTools/vtoolcutspline.cpp b/src/app/tools/drawTools/vtoolcutspline.cpp index edab6ce3e..f8ced20b6 100644 --- a/src/app/tools/drawTools/vtoolcutspline.cpp +++ b/src/app/tools/drawTools/vtoolcutspline.cpp @@ -231,7 +231,8 @@ void VToolCutSpline::ShowVisualization(bool show) */ void VToolCutSpline::FullUpdateFromFile() { - FullUpdateCurveFromFile(AttrSpline); + ReadAttributes(); + RefreshGeometry(); if (vis != nullptr) { @@ -326,3 +327,10 @@ void VToolCutSpline::SaveOptions(QDomElement &tag, QSharedPointer &obj doc->SetAttribute(tag, AttrLength, formula); doc->SetAttribute(tag, AttrSpline, curveCutId); } + +//--------------------------------------------------------------------------------------------------------------------- +void VToolCutSpline::ReadToolAttributes(const QDomElement &domElement) +{ + formula = doc->GetParametrString(domElement, AttrLength, ""); + curveCutId = doc->GetParametrUInt(domElement, AttrSpline, NULL_ID_STR); +} diff --git a/src/app/tools/drawTools/vtoolcutspline.h b/src/app/tools/drawTools/vtoolcutspline.h index d1b184edc..90e576009 100644 --- a/src/app/tools/drawTools/vtoolcutspline.h +++ b/src/app/tools/drawTools/vtoolcutspline.h @@ -62,6 +62,7 @@ protected: virtual void RefreshCurve(VSimpleCurve *curve, quint32 curveId, SimpleCurvePoint curvePosition, PathDirection direction = PathDirection::Hide); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void ReadToolAttributes(const QDomElement &domElement); private: Q_DISABLE_COPY(VToolCutSpline) }; diff --git a/src/app/tools/drawTools/vtoolcutsplinepath.cpp b/src/app/tools/drawTools/vtoolcutsplinepath.cpp index 98f1d820f..605e33f17 100644 --- a/src/app/tools/drawTools/vtoolcutsplinepath.cpp +++ b/src/app/tools/drawTools/vtoolcutsplinepath.cpp @@ -280,7 +280,8 @@ void VToolCutSplinePath::ShowVisualization(bool show) */ void VToolCutSplinePath::FullUpdateFromFile() { - FullUpdateCurveFromFile(AttrSplinePath); + ReadAttributes(); + RefreshGeometry(); if (vis != nullptr) { @@ -377,3 +378,10 @@ void VToolCutSplinePath::SaveOptions(QDomElement &tag, QSharedPointer doc->SetAttribute(tag, AttrLength, formula); doc->SetAttribute(tag, AttrSplinePath, curveCutId); } + +//--------------------------------------------------------------------------------------------------------------------- +void VToolCutSplinePath::ReadToolAttributes(const QDomElement &domElement) +{ + formula = doc->GetParametrString(domElement, AttrLength, ""); + curveCutId = doc->GetParametrUInt(domElement, AttrSplinePath, NULL_ID_STR); +} diff --git a/src/app/tools/drawTools/vtoolcutsplinepath.h b/src/app/tools/drawTools/vtoolcutsplinepath.h index 6f5db493c..05cdf22df 100644 --- a/src/app/tools/drawTools/vtoolcutsplinepath.h +++ b/src/app/tools/drawTools/vtoolcutsplinepath.h @@ -64,6 +64,7 @@ protected: virtual void RefreshCurve(VSimpleCurve *curve, quint32 curveId, SimpleCurvePoint curvePosition, PathDirection direction = PathDirection::Hide); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void ReadToolAttributes(const QDomElement &domElement); private: Q_DISABLE_COPY(VToolCutSplinePath) }; diff --git a/src/app/tools/drawTools/vtoolendline.cpp b/src/app/tools/drawTools/vtoolendline.cpp index 05dd4b4f3..76efe667f 100644 --- a/src/app/tools/drawTools/vtoolendline.cpp +++ b/src/app/tools/drawTools/vtoolendline.cpp @@ -80,6 +80,7 @@ void VToolEndLine::setDialog() SCASSERT(dialogTool != nullptr); const QSharedPointer p = VAbstractTool::data.GeometricObject(id); dialogTool->SetTypeLine(typeLine); + dialogTool->SetLineColor(lineColor); dialogTool->SetFormula(formulaLength); dialogTool->SetAngle(formulaAngle); dialogTool->SetBasePointId(basePointId); @@ -181,14 +182,7 @@ VToolEndLine* VToolEndLine::Create(const quint32 _id, const QString &pointName, */ void VToolEndLine::FullUpdateFromFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); - if (domElement.isElement()) - { - typeLine = domElement.attribute(AttrTypeLine, ""); - formulaLength = domElement.attribute(AttrLength, ""); - basePointId = domElement.attribute(AttrBasePoint, "").toUInt(); - formulaAngle = domElement.attribute(AttrAngle, ""); - } + ReadAttributes(); RefreshGeometry(); if (vis != nullptr) @@ -233,6 +227,7 @@ void VToolEndLine::SaveDialog(QDomElement &domElement) SCASSERT(dialogTool != nullptr); doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine()); + doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor()); doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula()); doc->SetAttribute(domElement, AttrAngle, dialogTool->GetAngle()); doc->SetAttribute(domElement, AttrBasePoint, QString().setNum(dialogTool->GetBasePointId())); @@ -251,11 +246,22 @@ void VToolEndLine::SaveOptions(QDomElement &tag, QSharedPointer &obj) doc->SetAttribute(tag, AttrMy, qApp->fromPixel(point->my())); doc->SetAttribute(tag, AttrTypeLine, typeLine); + doc->SetAttribute(tag, AttrLineColor, lineColor); doc->SetAttribute(tag, AttrLength, formulaLength); doc->SetAttribute(tag, AttrAngle, formulaAngle); doc->SetAttribute(tag, AttrBasePoint, basePointId); } +//--------------------------------------------------------------------------------------------------------------------- +void VToolEndLine::ReadToolAttributes(const QDomElement &domElement) +{ + typeLine = doc->GetParametrString(domElement, AttrTypeLine, TypeLineLine); + lineColor = doc->GetParametrString(domElement, AttrLineColor, ColorBlack); + formulaLength = doc->GetParametrString(domElement, AttrLength, ""); + basePointId = doc->GetParametrUInt(domElement, AttrBasePoint, NULL_ID_STR); + formulaAngle = doc->GetParametrString(domElement, AttrAngle, ""); +} + //--------------------------------------------------------------------------------------------------------------------- VFormula VToolEndLine::GetFormulaAngle() const { diff --git a/src/app/tools/drawTools/vtoolendline.h b/src/app/tools/drawTools/vtoolendline.h index b92500f39..b0529de0a 100644 --- a/src/app/tools/drawTools/vtoolendline.h +++ b/src/app/tools/drawTools/vtoolendline.h @@ -63,6 +63,7 @@ protected: virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event ); virtual void SaveDialog(QDomElement &domElement); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void ReadToolAttributes(const QDomElement &domElement); private: QString formulaAngle; }; diff --git a/src/app/tools/drawTools/vtoolheight.cpp b/src/app/tools/drawTools/vtoolheight.cpp index 583d5e136..29742d1f3 100644 --- a/src/app/tools/drawTools/vtoolheight.cpp +++ b/src/app/tools/drawTools/vtoolheight.cpp @@ -73,6 +73,7 @@ void VToolHeight::setDialog() SCASSERT(dialogTool != nullptr); const QSharedPointer p = VAbstractTool::data.GeometricObject(id); dialogTool->SetTypeLine(typeLine); + dialogTool->SetLineColor(lineColor); dialogTool->SetBasePointId(basePointId); dialogTool->SetP1LineId(p1LineId); dialogTool->SetP2LineId(p2LineId); @@ -193,14 +194,7 @@ QPointF VToolHeight::FindPoint(const QLineF &line, const QPointF &point) */ void VToolHeight::FullUpdateFromFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); - if (domElement.isElement()) - { - typeLine = domElement.attribute(AttrTypeLine, ""); - basePointId = domElement.attribute(AttrBasePoint, "").toUInt(); - p1LineId = domElement.attribute(AttrP1Line, "").toUInt(); - p2LineId = domElement.attribute(AttrP2Line, "").toUInt(); - } + ReadAttributes(); RefreshGeometry(); if (vis != nullptr) @@ -268,6 +262,16 @@ void VToolHeight::SaveOptions(QDomElement &tag, QSharedPointer &obj) doc->SetAttribute(tag, AttrP2Line, p2LineId); } +//--------------------------------------------------------------------------------------------------------------------- +void VToolHeight::ReadToolAttributes(const QDomElement &domElement) +{ + typeLine = doc->GetParametrString(domElement, AttrTypeLine, TypeLineLine); + lineColor = doc->GetParametrString(domElement, AttrLineColor, ColorBlack); + basePointId = doc->GetParametrUInt(domElement, AttrBasePoint, NULL_ID_STR); + p1LineId = doc->GetParametrUInt(domElement, AttrP1Line, NULL_ID_STR); + p2LineId = doc->GetParametrUInt(domElement, AttrP2Line, NULL_ID_STR); +} + //--------------------------------------------------------------------------------------------------------------------- quint32 VToolHeight::GetP2LineId() const { diff --git a/src/app/tools/drawTools/vtoolheight.h b/src/app/tools/drawTools/vtoolheight.h index 9fc74299a..846f23ae3 100644 --- a/src/app/tools/drawTools/vtoolheight.h +++ b/src/app/tools/drawTools/vtoolheight.h @@ -67,6 +67,7 @@ protected: virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event ); virtual void SaveDialog(QDomElement &domElement); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void ReadToolAttributes(const QDomElement &domElement); private: /** @brief p1LineId id first point of line. */ quint32 p1LineId; diff --git a/src/app/tools/drawTools/vtoolline.cpp b/src/app/tools/drawTools/vtoolline.cpp index a4df670d5..17f89f14b 100644 --- a/src/app/tools/drawTools/vtoolline.cpp +++ b/src/app/tools/drawTools/vtoolline.cpp @@ -85,6 +85,7 @@ void VToolLine::setDialog() dialogTool->SetFirstPoint(firstPoint); dialogTool->SetSecondPoint(secondPoint); dialogTool->SetTypeLine(typeLine); + dialogTool->SetLineColor(lineColor); } //--------------------------------------------------------------------------------------------------------------------- @@ -189,6 +190,7 @@ QString VToolLine::getTagName() const */ void VToolLine::FullUpdateFromFile() { + ReadAttributes(); RefreshGeometry(); if (vis != nullptr) @@ -384,6 +386,15 @@ void VToolLine::SaveOptions(QDomElement &tag, QSharedPointer &obj) doc->SetAttribute(tag, AttrTypeLine, typeLine); } +//--------------------------------------------------------------------------------------------------------------------- +void VToolLine::ReadToolAttributes(const QDomElement &domElement) +{ + firstPoint = doc->GetParametrUInt(domElement, AttrFirstPoint, NULL_ID_STR); + secondPoint = doc->GetParametrUInt(domElement, AttrSecondPoint, NULL_ID_STR); + typeLine = doc->GetParametrString(domElement, AttrTypeLine, TypeLineLine); + lineColor = doc->GetParametrString(domElement, AttrLineColor, ColorBlack); +} + //--------------------------------------------------------------------------------------------------------------------- quint32 VToolLine::GetSecondPoint() const { @@ -469,13 +480,6 @@ void VToolLine::SetFirstPoint(const quint32 &value) */ void VToolLine::RefreshGeometry() { - QDomElement domElement = doc->elementById(QString().setNum(id)); - if (domElement.isElement()) - { - firstPoint = doc->GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, NULL_ID_STR); - secondPoint = doc->GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, NULL_ID_STR); - typeLine = doc->GetParametrString(domElement, VAbstractTool::AttrTypeLine, VAbstractTool::TypeLineLine); - } const QSharedPointer first = VAbstractTool::data.GeometricObject(firstPoint); const QSharedPointer second = VAbstractTool::data.GeometricObject(secondPoint); this->setLine(QLineF(first->toQPointF(), second->toQPointF())); diff --git a/src/app/tools/drawTools/vtoolline.h b/src/app/tools/drawTools/vtoolline.h index 7e2d55d17..a98b1766b 100644 --- a/src/app/tools/drawTools/vtoolline.h +++ b/src/app/tools/drawTools/vtoolline.h @@ -76,6 +76,7 @@ protected: virtual void keyReleaseEvent(QKeyEvent * event); virtual void SaveDialog(QDomElement &domElement); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void ReadToolAttributes(const QDomElement &domElement); private: /** @brief firstPoint id first line point. */ quint32 firstPoint; diff --git a/src/app/tools/drawTools/vtoollineintersect.cpp b/src/app/tools/drawTools/vtoollineintersect.cpp index e87b4df57..beb7805da 100644 --- a/src/app/tools/drawTools/vtoollineintersect.cpp +++ b/src/app/tools/drawTools/vtoollineintersect.cpp @@ -193,14 +193,7 @@ VToolLineIntersect* VToolLineIntersect::Create(const quint32 _id, const quint32 */ void VToolLineIntersect::FullUpdateFromFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); - if (domElement.isElement()) - { - p1Line1 = domElement.attribute(AttrP1Line1, "").toUInt(); - p2Line1 = domElement.attribute(AttrP2Line1, "").toUInt(); - p1Line2 = domElement.attribute(AttrP1Line2, "").toUInt(); - p2Line2 = domElement.attribute(AttrP2Line2, "").toUInt(); - } + ReadAttributes(); RefreshPointGeometry(*VAbstractTool::data.GeometricObject(id)); if (vis != nullptr) @@ -291,6 +284,15 @@ void VToolLineIntersect::SaveOptions(QDomElement &tag, QSharedPointer doc->SetAttribute(tag, AttrP2Line2, p2Line2); } +//--------------------------------------------------------------------------------------------------------------------- +void VToolLineIntersect::ReadToolAttributes(const QDomElement &domElement) +{ + p1Line1 = doc->GetParametrUInt(domElement, AttrP1Line1, NULL_ID_STR); + p2Line1 = doc->GetParametrUInt(domElement, AttrP2Line1, NULL_ID_STR); + p1Line2 = doc->GetParametrUInt(domElement, AttrP1Line2, NULL_ID_STR); + p2Line2 = doc->GetParametrUInt(domElement, AttrP2Line2, NULL_ID_STR); +} + //--------------------------------------------------------------------------------------------------------------------- quint32 VToolLineIntersect::GetP2Line2() const { diff --git a/src/app/tools/drawTools/vtoollineintersect.h b/src/app/tools/drawTools/vtoollineintersect.h index 2322ed7f1..414edcf15 100644 --- a/src/app/tools/drawTools/vtoollineintersect.h +++ b/src/app/tools/drawTools/vtoollineintersect.h @@ -73,6 +73,7 @@ protected: virtual void RemoveReferens(); virtual void SaveDialog(QDomElement &domElement); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void ReadToolAttributes(const QDomElement &domElement); private: /** @brief p1Line1 id first point first line. */ quint32 p1Line1; diff --git a/src/app/tools/drawTools/vtoollineintersectaxis.cpp b/src/app/tools/drawTools/vtoollineintersectaxis.cpp index 4290f5007..6d6d37c69 100644 --- a/src/app/tools/drawTools/vtoollineintersectaxis.cpp +++ b/src/app/tools/drawTools/vtoollineintersectaxis.cpp @@ -68,6 +68,7 @@ void VToolLineIntersectAxis::setDialog() SCASSERT(dialogTool != nullptr); const QSharedPointer p = VAbstractTool::data.GeometricObject(id); dialogTool->SetTypeLine(typeLine); + dialogTool->SetLineColor(lineColor); dialogTool->SetAngle(formulaAngle); dialogTool->SetBasePointId(basePointId); dialogTool->SetFirstPointId(firstPointId); @@ -266,15 +267,7 @@ void VToolLineIntersectAxis::ShowVisualization(bool show) //--------------------------------------------------------------------------------------------------------------------- void VToolLineIntersectAxis::FullUpdateFromFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); - if (domElement.isElement()) - { - typeLine = domElement.attribute(AttrTypeLine, ""); - basePointId = domElement.attribute(AttrBasePoint, "").toUInt(); - firstPointId = domElement.attribute(AttrP1Line, "").toUInt(); - secondPointId = domElement.attribute(AttrP2Line, "").toUInt(); - formulaAngle = domElement.attribute(AttrAngle, ""); - } + ReadAttributes(); RefreshGeometry(); if (vis != nullptr) @@ -333,3 +326,14 @@ void VToolLineIntersectAxis::SaveOptions(QDomElement &tag, QSharedPointerSetAttribute(tag, AttrP1Line, firstPointId); doc->SetAttribute(tag, AttrP2Line, secondPointId); } + +//--------------------------------------------------------------------------------------------------------------------- +void VToolLineIntersectAxis::ReadToolAttributes(const QDomElement &domElement) +{ + typeLine = doc->GetParametrString(domElement, AttrTypeLine, TypeLineLine); + lineColor = doc->GetParametrString(domElement, AttrLineColor, ColorBlack); + basePointId = doc->GetParametrUInt(domElement, AttrBasePoint, NULL_ID_STR); + firstPointId = doc->GetParametrUInt(domElement, AttrP1Line, NULL_ID_STR); + secondPointId = doc->GetParametrUInt(domElement, AttrP2Line, NULL_ID_STR); + formulaAngle = doc->GetParametrString(domElement, AttrAngle, ""); +} diff --git a/src/app/tools/drawTools/vtoollineintersectaxis.h b/src/app/tools/drawTools/vtoollineintersectaxis.h index 9de3f38c4..509aff461 100644 --- a/src/app/tools/drawTools/vtoollineintersectaxis.h +++ b/src/app/tools/drawTools/vtoollineintersectaxis.h @@ -72,6 +72,7 @@ protected: virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event ); virtual void SaveDialog(QDomElement &domElement); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void ReadToolAttributes(const QDomElement &domElement); private: Q_DISABLE_COPY(VToolLineIntersectAxis) QString formulaAngle; diff --git a/src/app/tools/drawTools/vtoolnormal.cpp b/src/app/tools/drawTools/vtoolnormal.cpp index c09472e2a..74aee8e78 100644 --- a/src/app/tools/drawTools/vtoolnormal.cpp +++ b/src/app/tools/drawTools/vtoolnormal.cpp @@ -200,15 +200,7 @@ QPointF VToolNormal::FindPoint(const QPointF &firstPoint, const QPointF &secondP */ void VToolNormal::FullUpdateFromFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); - if (domElement.isElement()) - { - typeLine = domElement.attribute(AttrTypeLine, ""); - formulaLength = domElement.attribute(AttrLength, ""); - basePointId = domElement.attribute(AttrFirstPoint, "").toUInt(); - secondPointId = domElement.attribute(AttrSecondPoint, "").toUInt(); - angle = domElement.attribute(AttrAngle, "").toDouble(); - } + ReadAttributes(); RefreshGeometry(); if (vis != nullptr) @@ -300,6 +292,17 @@ void VToolNormal::SaveOptions(QDomElement &tag, QSharedPointer &obj) doc->SetAttribute(tag, AttrSecondPoint, secondPointId); } +//--------------------------------------------------------------------------------------------------------------------- +void VToolNormal::ReadToolAttributes(const QDomElement &domElement) +{ + typeLine = doc->GetParametrString(domElement, AttrTypeLine, TypeLineLine); + lineColor = doc->GetParametrString(domElement, AttrLineColor, ColorBlack); + formulaLength = doc->GetParametrString(domElement, AttrLength, ""); + basePointId = doc->GetParametrUInt(domElement, AttrFirstPoint, NULL_ID_STR); + secondPointId = doc->GetParametrUInt(domElement, AttrSecondPoint, NULL_ID_STR); + angle = doc->GetParametrDouble(domElement, AttrAngle, "0"); +} + //--------------------------------------------------------------------------------------------------------------------- quint32 VToolNormal::GetSecondPointId() const { diff --git a/src/app/tools/drawTools/vtoolnormal.h b/src/app/tools/drawTools/vtoolnormal.h index 02da26909..98ca15d5f 100644 --- a/src/app/tools/drawTools/vtoolnormal.h +++ b/src/app/tools/drawTools/vtoolnormal.h @@ -66,6 +66,7 @@ protected: virtual void RemoveReferens(); virtual void SaveDialog(QDomElement &domElement); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void ReadToolAttributes(const QDomElement &domElement); private: /** @brief secondPointId id second line point. */ quint32 secondPointId; diff --git a/src/app/tools/drawTools/vtoolpointofcontact.cpp b/src/app/tools/drawTools/vtoolpointofcontact.cpp index 9e1575d03..37042dcf6 100644 --- a/src/app/tools/drawTools/vtoolpointofcontact.cpp +++ b/src/app/tools/drawTools/vtoolpointofcontact.cpp @@ -225,14 +225,7 @@ VToolPointOfContact* VToolPointOfContact::Create(const quint32 _id, QString &rad */ void VToolPointOfContact::FullUpdateFromFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); - if (domElement.isElement()) - { - arcRadius = domElement.attribute(AttrRadius, ""); - center = domElement.attribute(AttrCenter, "").toUInt(); - firstPointId = domElement.attribute(AttrFirstPoint, "").toUInt(); - secondPointId = domElement.attribute(AttrSecondPoint, "").toUInt(); - } + ReadAttributes(); RefreshPointGeometry(*VAbstractTool::data.GeometricObject(id)); if (vis != nullptr) @@ -322,6 +315,15 @@ void VToolPointOfContact::SaveOptions(QDomElement &tag, QSharedPointer doc->SetAttribute(tag, AttrSecondPoint, secondPointId); } +//--------------------------------------------------------------------------------------------------------------------- +void VToolPointOfContact::ReadToolAttributes(const QDomElement &domElement) +{ + arcRadius = doc->GetParametrString(domElement, AttrRadius, ""); + center = doc->GetParametrUInt(domElement, AttrCenter, NULL_ID_STR); + firstPointId = doc->GetParametrUInt(domElement, AttrFirstPoint, NULL_ID_STR); + secondPointId = doc->GetParametrUInt(domElement, AttrSecondPoint, NULL_ID_STR); +} + //--------------------------------------------------------------------------------------------------------------------- quint32 VToolPointOfContact::GetSecondPointId() const { diff --git a/src/app/tools/drawTools/vtoolpointofcontact.h b/src/app/tools/drawTools/vtoolpointofcontact.h index 7c58a9ac7..5f4e13053 100644 --- a/src/app/tools/drawTools/vtoolpointofcontact.h +++ b/src/app/tools/drawTools/vtoolpointofcontact.h @@ -78,6 +78,7 @@ protected: virtual void RemoveReferens(); virtual void SaveDialog(QDomElement &domElement); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void ReadToolAttributes(const QDomElement &domElement); private: /** @brief radius string with formula radius arc. */ QString arcRadius; diff --git a/src/app/tools/drawTools/vtoolpointofintersection.cpp b/src/app/tools/drawTools/vtoolpointofintersection.cpp index 3e7efe603..e67ee2110 100644 --- a/src/app/tools/drawTools/vtoolpointofintersection.cpp +++ b/src/app/tools/drawTools/vtoolpointofintersection.cpp @@ -165,12 +165,7 @@ VToolPointOfIntersection *VToolPointOfIntersection::Create(const quint32 _id, co */ void VToolPointOfIntersection::FullUpdateFromFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); - if (domElement.isElement()) - { - firstPointId = domElement.attribute(AttrFirstPoint, "").toUInt(); - secondPointId = domElement.attribute(AttrSecondPoint, "").toUInt(); - } + ReadAttributes(); VToolPoint::RefreshPointGeometry(*VDrawTool::data.GeometricObject(id)); if (vis != nullptr) @@ -242,6 +237,13 @@ void VToolPointOfIntersection::SaveOptions(QDomElement &tag, QSharedPointerSetAttribute(tag, AttrSecondPoint, secondPointId); } +//--------------------------------------------------------------------------------------------------------------------- +void VToolPointOfIntersection::ReadToolAttributes(const QDomElement &domElement) +{ + firstPointId = doc->GetParametrUInt(domElement, AttrFirstPoint, NULL_ID_STR); + secondPointId = doc->GetParametrUInt(domElement, AttrSecondPoint, NULL_ID_STR); +} + //--------------------------------------------------------------------------------------------------------------------- quint32 VToolPointOfIntersection::GetSecondPointId() const { diff --git a/src/app/tools/drawTools/vtoolpointofintersection.h b/src/app/tools/drawTools/vtoolpointofintersection.h index 66cf84872..876c475bf 100644 --- a/src/app/tools/drawTools/vtoolpointofintersection.h +++ b/src/app/tools/drawTools/vtoolpointofintersection.h @@ -67,6 +67,7 @@ protected: virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event ); virtual void SaveDialog(QDomElement &domElement); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void ReadToolAttributes(const QDomElement &domElement); private: Q_DISABLE_COPY(VToolPointOfIntersection) /** @brief firstPointId id first line point. */ diff --git a/src/app/tools/drawTools/vtoolshoulderpoint.cpp b/src/app/tools/drawTools/vtoolshoulderpoint.cpp index bc9e5cbeb..9c926387f 100644 --- a/src/app/tools/drawTools/vtoolshoulderpoint.cpp +++ b/src/app/tools/drawTools/vtoolshoulderpoint.cpp @@ -75,6 +75,7 @@ void VToolShoulderPoint::setDialog() SCASSERT(dialogTool != nullptr); const QSharedPointer p = VAbstractTool::data.GeometricObject(id); dialogTool->SetTypeLine(typeLine); + dialogTool->SetLineColor(lineColor); dialogTool->SetFormula(formulaLength); dialogTool->SetP1Line(basePointId); dialogTool->SetP2Line(p2Line); @@ -225,15 +226,7 @@ VToolShoulderPoint* VToolShoulderPoint::Create(const quint32 _id, QString &formu */ void VToolShoulderPoint::FullUpdateFromFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); - if (domElement.isElement()) - { - typeLine = domElement.attribute(AttrTypeLine, ""); - formulaLength = domElement.attribute(AttrLength, ""); - basePointId = domElement.attribute(AttrP1Line, "").toUInt(); - p2Line = domElement.attribute(AttrP2Line, "").toUInt(); - pShoulder = domElement.attribute(AttrPShoulder, "").toUInt(); - } + ReadAttributes(); RefreshGeometry(); if (vis != nullptr) @@ -326,6 +319,17 @@ void VToolShoulderPoint::SaveOptions(QDomElement &tag, QSharedPointer doc->SetAttribute(tag, AttrPShoulder, pShoulder); } +//--------------------------------------------------------------------------------------------------------------------- +void VToolShoulderPoint::ReadToolAttributes(const QDomElement &domElement) +{ + typeLine = doc->GetParametrString(domElement, AttrTypeLine, TypeLineLine); + lineColor = doc->GetParametrString(domElement, AttrLineColor, ColorBlack); + formulaLength = doc->GetParametrString(domElement, AttrLength, ""); + basePointId = doc->GetParametrUInt(domElement, AttrP1Line, NULL_ID_STR); + p2Line = doc->GetParametrUInt(domElement, AttrP2Line, NULL_ID_STR); + pShoulder = doc->GetParametrUInt(domElement, AttrPShoulder, NULL_ID_STR); +} + //--------------------------------------------------------------------------------------------------------------------- quint32 VToolShoulderPoint::getPShoulder() const { diff --git a/src/app/tools/drawTools/vtoolshoulderpoint.h b/src/app/tools/drawTools/vtoolshoulderpoint.h index 32bdd257c..82da45e33 100644 --- a/src/app/tools/drawTools/vtoolshoulderpoint.h +++ b/src/app/tools/drawTools/vtoolshoulderpoint.h @@ -70,6 +70,7 @@ protected: virtual void RemoveReferens(); virtual void SaveDialog(QDomElement &domElement); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void ReadToolAttributes(const QDomElement &domElement); private: /** @brief p2Line id second line point. */ quint32 p2Line; diff --git a/src/app/tools/drawTools/vtoolsinglepoint.cpp b/src/app/tools/drawTools/vtoolsinglepoint.cpp index bb37898ef..003d7b3a5 100644 --- a/src/app/tools/drawTools/vtoolsinglepoint.cpp +++ b/src/app/tools/drawTools/vtoolsinglepoint.cpp @@ -264,6 +264,13 @@ void VToolSinglePoint::SaveOptions(QDomElement &tag, QSharedPointer &o doc->SetAttribute(tag, AttrMy, qApp->fromPixel(point->my())); } +//--------------------------------------------------------------------------------------------------------------------- +void VToolSinglePoint::ReadToolAttributes(const QDomElement &domElement) +{ + Q_UNUSED(domElement); + // This tool doesn't need read attributes from file. +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief contextMenuEvent handle context menu events. diff --git a/src/app/tools/drawTools/vtoolsinglepoint.h b/src/app/tools/drawTools/vtoolsinglepoint.h index df2727580..833365a9b 100644 --- a/src/app/tools/drawTools/vtoolsinglepoint.h +++ b/src/app/tools/drawTools/vtoolsinglepoint.h @@ -67,6 +67,7 @@ protected: virtual void mousePressEvent( QGraphicsSceneMouseEvent * event ); virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event ); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void ReadToolAttributes(const QDomElement &domElement); private: QString namePP; QString mPath; diff --git a/src/app/tools/drawTools/vtoolspline.cpp b/src/app/tools/drawTools/vtoolspline.cpp index 02e86c7c8..5a28e58dc 100644 --- a/src/app/tools/drawTools/vtoolspline.cpp +++ b/src/app/tools/drawTools/vtoolspline.cpp @@ -105,6 +105,7 @@ void VToolSpline::setDialog() dialogTool->SetKAsm1(spl->GetKasm1()); dialogTool->SetKAsm2(spl->GetKasm2()); dialogTool->SetKCurve(spl->GetKcurve()); + dialogTool->SetColor(lineColor); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/tools/drawTools/vtoolsplinepath.cpp b/src/app/tools/drawTools/vtoolsplinepath.cpp index 601ac96b5..fad8c6745 100644 --- a/src/app/tools/drawTools/vtoolsplinepath.cpp +++ b/src/app/tools/drawTools/vtoolsplinepath.cpp @@ -98,6 +98,7 @@ void VToolSplinePath::setDialog() SCASSERT(dialogTool != nullptr); const QSharedPointer splPath = VAbstractTool::data.GeometricObject(id); dialogTool->SetPath(*splPath); + dialogTool->SetColor(lineColor); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/tools/drawTools/vtooltriangle.cpp b/src/app/tools/drawTools/vtooltriangle.cpp index 5d01d3202..6c674121f 100644 --- a/src/app/tools/drawTools/vtooltriangle.cpp +++ b/src/app/tools/drawTools/vtooltriangle.cpp @@ -220,14 +220,7 @@ QPointF VToolTriangle::FindPoint(const QPointF &axisP1, const QPointF &axisP2, c */ void VToolTriangle::FullUpdateFromFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); - if (domElement.isElement()) - { - axisP1Id = domElement.attribute(AttrAxisP1, "").toUInt(); - axisP2Id = domElement.attribute(AttrAxisP2, "").toUInt(); - firstPointId = domElement.attribute(AttrFirstPoint, "").toUInt(); - secondPointId = domElement.attribute(AttrSecondPoint, "").toUInt(); - } + ReadAttributes(); VToolPoint::RefreshPointGeometry(*VDrawTool::data.GeometricObject(id)); if (vis != nullptr) @@ -307,6 +300,15 @@ void VToolTriangle::SaveOptions(QDomElement &tag, QSharedPointer &obj) doc->SetAttribute(tag, AttrSecondPoint, secondPointId); } +//--------------------------------------------------------------------------------------------------------------------- +void VToolTriangle::ReadToolAttributes(const QDomElement &domElement) +{ + axisP1Id = doc->GetParametrUInt(domElement, AttrAxisP1, NULL_ID_STR); + axisP2Id = doc->GetParametrUInt(domElement, AttrAxisP2, NULL_ID_STR); + firstPointId = doc->GetParametrUInt(domElement, AttrFirstPoint, NULL_ID_STR); + secondPointId = doc->GetParametrUInt(domElement, AttrSecondPoint, NULL_ID_STR); +} + //--------------------------------------------------------------------------------------------------------------------- quint32 VToolTriangle::GetSecondPointId() const { diff --git a/src/app/tools/drawTools/vtooltriangle.h b/src/app/tools/drawTools/vtooltriangle.h index 678f4da40..4e5696727 100644 --- a/src/app/tools/drawTools/vtooltriangle.h +++ b/src/app/tools/drawTools/vtooltriangle.h @@ -75,6 +75,7 @@ protected: virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event ); virtual void SaveDialog(QDomElement &domElement); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void ReadToolAttributes(const QDomElement &domElement); private: Q_DISABLE_COPY(VToolTriangle) /** @brief axisP1Id id first axis point. */ From 1563193662888e5d097334a7cec6f2aaca9a452d Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 6 Feb 2015 19:50:33 +0200 Subject: [PATCH 111/186] Save color from tool option dialog to xml. --HG-- branch : feature --- src/app/tools/drawTools/vtoolalongline.cpp | 1 + src/app/tools/drawTools/vtoolarc.cpp | 1 + src/app/tools/drawTools/vtoolbisector.cpp | 1 + src/app/tools/drawTools/vtoolcurveintersectaxis.cpp | 1 + src/app/tools/drawTools/vtoolheight.cpp | 1 + src/app/tools/drawTools/vtoolline.cpp | 1 + src/app/tools/drawTools/vtoollineintersectaxis.cpp | 1 + src/app/tools/drawTools/vtoolnormal.cpp | 1 + src/app/tools/drawTools/vtoolshoulderpoint.cpp | 1 + src/app/tools/drawTools/vtoolspline.cpp | 1 + src/app/tools/drawTools/vtoolsplinepath.cpp | 1 + 11 files changed, 11 insertions(+) diff --git a/src/app/tools/drawTools/vtoolalongline.cpp b/src/app/tools/drawTools/vtoolalongline.cpp index 27c624a55..1fea80e95 100644 --- a/src/app/tools/drawTools/vtoolalongline.cpp +++ b/src/app/tools/drawTools/vtoolalongline.cpp @@ -138,6 +138,7 @@ void VToolAlongLine::SaveDialog(QDomElement &domElement) SCASSERT(dialogTool != nullptr); doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine()); + doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor()); doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula()); doc->SetAttribute(domElement, AttrFirstPoint, dialogTool->GetFirstPointId()); doc->SetAttribute(domElement, AttrSecondPoint, dialogTool->GetSecondPointId()); diff --git a/src/app/tools/drawTools/vtoolarc.cpp b/src/app/tools/drawTools/vtoolarc.cpp index e4509da86..7e3643941 100644 --- a/src/app/tools/drawTools/vtoolarc.cpp +++ b/src/app/tools/drawTools/vtoolarc.cpp @@ -352,6 +352,7 @@ void VToolArc::SaveDialog(QDomElement &domElement) doc->SetAttribute(domElement, AttrRadius, dialogTool->GetRadius()); doc->SetAttribute(domElement, AttrAngle1, dialogTool->GetF1()); doc->SetAttribute(domElement, AttrAngle2, dialogTool->GetF2()); + doc->SetAttribute(domElement, AttrColor, dialogTool->GetColor()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/tools/drawTools/vtoolbisector.cpp b/src/app/tools/drawTools/vtoolbisector.cpp index 580a84872..eee05465e 100644 --- a/src/app/tools/drawTools/vtoolbisector.cpp +++ b/src/app/tools/drawTools/vtoolbisector.cpp @@ -290,6 +290,7 @@ void VToolBisector::SaveDialog(QDomElement &domElement) SCASSERT(dialogTool != nullptr); doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine()); + doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor()); doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula()); doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->GetFirstPointId())); doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->GetSecondPointId())); diff --git a/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp b/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp index e2953eaf5..bfb0ccc19 100644 --- a/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp +++ b/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp @@ -285,6 +285,7 @@ void VToolCurveIntersectAxis::SaveDialog(QDomElement &domElement) SCASSERT(dialogTool != nullptr); doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine()); + doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor()); doc->SetAttribute(domElement, AttrAngle, dialogTool->GetAngle()); doc->SetAttribute(domElement, AttrBasePoint, QString().setNum(dialogTool->GetBasePointId())); doc->SetAttribute(domElement, AttrCurve, QString().setNum(dialogTool->getCurveId())); diff --git a/src/app/tools/drawTools/vtoolheight.cpp b/src/app/tools/drawTools/vtoolheight.cpp index 29742d1f3..841fd3d6b 100644 --- a/src/app/tools/drawTools/vtoolheight.cpp +++ b/src/app/tools/drawTools/vtoolheight.cpp @@ -239,6 +239,7 @@ void VToolHeight::SaveDialog(QDomElement &domElement) SCASSERT(dialogTool != nullptr); doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine()); + doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor()); doc->SetAttribute(domElement, AttrBasePoint, QString().setNum(dialogTool->GetBasePointId())); doc->SetAttribute(domElement, AttrP1Line, QString().setNum(dialogTool->GetP1LineId())); doc->SetAttribute(domElement, AttrP2Line, QString().setNum(dialogTool->GetP2LineId())); diff --git a/src/app/tools/drawTools/vtoolline.cpp b/src/app/tools/drawTools/vtoolline.cpp index 17f89f14b..4bc7d1f95 100644 --- a/src/app/tools/drawTools/vtoolline.cpp +++ b/src/app/tools/drawTools/vtoolline.cpp @@ -373,6 +373,7 @@ void VToolLine::SaveDialog(QDomElement &domElement) doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->GetFirstPoint())); doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->GetSecondPoint())); doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine()); + doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/tools/drawTools/vtoollineintersectaxis.cpp b/src/app/tools/drawTools/vtoollineintersectaxis.cpp index 6d6d37c69..7393426ad 100644 --- a/src/app/tools/drawTools/vtoollineintersectaxis.cpp +++ b/src/app/tools/drawTools/vtoollineintersectaxis.cpp @@ -302,6 +302,7 @@ void VToolLineIntersectAxis::SaveDialog(QDomElement &domElement) SCASSERT(dialogTool != nullptr); doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine()); + doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor()); doc->SetAttribute(domElement, AttrAngle, dialogTool->GetAngle()); doc->SetAttribute(domElement, AttrBasePoint, QString().setNum(dialogTool->GetBasePointId())); doc->SetAttribute(domElement, AttrP1Line, QString().setNum(dialogTool->GetFirstPointId())); diff --git a/src/app/tools/drawTools/vtoolnormal.cpp b/src/app/tools/drawTools/vtoolnormal.cpp index 74aee8e78..8e051143f 100644 --- a/src/app/tools/drawTools/vtoolnormal.cpp +++ b/src/app/tools/drawTools/vtoolnormal.cpp @@ -267,6 +267,7 @@ void VToolNormal::SaveDialog(QDomElement &domElement) SCASSERT(dialogTool != nullptr); doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine()); + doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor()); doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula()); doc->SetAttribute(domElement, AttrAngle, QString().setNum(dialogTool->GetAngle())); doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->GetFirstPointId())); diff --git a/src/app/tools/drawTools/vtoolshoulderpoint.cpp b/src/app/tools/drawTools/vtoolshoulderpoint.cpp index 9c926387f..7c425afe9 100644 --- a/src/app/tools/drawTools/vtoolshoulderpoint.cpp +++ b/src/app/tools/drawTools/vtoolshoulderpoint.cpp @@ -294,6 +294,7 @@ void VToolShoulderPoint::SaveDialog(QDomElement &domElement) SCASSERT(dialogTool != nullptr); doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine()); + doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor()); doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula()); doc->SetAttribute(domElement, AttrP1Line, QString().setNum(dialogTool->GetP1Line())); doc->SetAttribute(domElement, AttrP2Line, QString().setNum(dialogTool->GetP2Line())); diff --git a/src/app/tools/drawTools/vtoolspline.cpp b/src/app/tools/drawTools/vtoolspline.cpp index 5a28e58dc..1c80cdfd2 100644 --- a/src/app/tools/drawTools/vtoolspline.cpp +++ b/src/app/tools/drawTools/vtoolspline.cpp @@ -332,6 +332,7 @@ void VToolSpline::SaveDialog(QDomElement &domElement) doc->SetAttribute(domElement, AttrKAsm1, spl.GetKasm1()); doc->SetAttribute(domElement, AttrKAsm2, spl.GetKasm2()); doc->SetAttribute(domElement, AttrKCurve, spl.GetKcurve()); + doc->SetAttribute(domElement, AttrColor, dialogTool->GetColor()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/tools/drawTools/vtoolsplinepath.cpp b/src/app/tools/drawTools/vtoolsplinepath.cpp index fad8c6745..6701fe483 100644 --- a/src/app/tools/drawTools/vtoolsplinepath.cpp +++ b/src/app/tools/drawTools/vtoolsplinepath.cpp @@ -390,6 +390,7 @@ void VToolSplinePath::SaveDialog(QDomElement &domElement) VSplinePath splPath = dialogTool->GetPath(); RefreshSplinePath(splPath); doc->SetAttribute(domElement, AttrKCurve, QString().setNum(splPath.GetKCurve())); + doc->SetAttribute(domElement, AttrColor, dialogTool->GetColor()); UpdatePathPoint(doc, domElement, splPath); } From 5da451a5cecb894ebd5fa8a3453f1b2c857c8d94 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 6 Feb 2015 20:05:52 +0200 Subject: [PATCH 112/186] Save tool color attribute to xml. --HG-- branch : feature --- src/app/tools/drawTools/vtoolalongline.cpp | 1 + src/app/tools/drawTools/vtoolarc.cpp | 1 + src/app/tools/drawTools/vtoolbisector.cpp | 1 + src/app/tools/drawTools/vtoolcurveintersectaxis.cpp | 1 + src/app/tools/drawTools/vtoolheight.cpp | 1 + src/app/tools/drawTools/vtoolline.cpp | 1 + src/app/tools/drawTools/vtoollineintersectaxis.cpp | 1 + src/app/tools/drawTools/vtoolnormal.cpp | 1 + src/app/tools/drawTools/vtoolshoulderpoint.cpp | 1 + src/app/tools/drawTools/vtoolspline.cpp | 1 + src/app/tools/drawTools/vtoolsplinepath.cpp | 1 + 11 files changed, 11 insertions(+) diff --git a/src/app/tools/drawTools/vtoolalongline.cpp b/src/app/tools/drawTools/vtoolalongline.cpp index 1fea80e95..7a6c3dd4b 100644 --- a/src/app/tools/drawTools/vtoolalongline.cpp +++ b/src/app/tools/drawTools/vtoolalongline.cpp @@ -157,6 +157,7 @@ void VToolAlongLine::SaveOptions(QDomElement &tag, QSharedPointer &obj doc->SetAttribute(tag, AttrMy, qApp->fromPixel(point->my())); doc->SetAttribute(tag, AttrTypeLine, typeLine); + doc->SetAttribute(tag, AttrLineColor, lineColor); doc->SetAttribute(tag, AttrLength, formulaLength); doc->SetAttribute(tag, AttrFirstPoint, basePointId); doc->SetAttribute(tag, AttrSecondPoint, secondPointId); diff --git a/src/app/tools/drawTools/vtoolarc.cpp b/src/app/tools/drawTools/vtoolarc.cpp index 7e3643941..403ffdf11 100644 --- a/src/app/tools/drawTools/vtoolarc.cpp +++ b/src/app/tools/drawTools/vtoolarc.cpp @@ -367,6 +367,7 @@ void VToolArc::SaveOptions(QDomElement &tag, QSharedPointer &obj) doc->SetAttribute(tag, AttrRadius, arc->GetFormulaRadius()); doc->SetAttribute(tag, AttrAngle1, arc->GetFormulaF1()); doc->SetAttribute(tag, AttrAngle2, arc->GetFormulaF2()); + doc->SetAttribute(tag, AttrColor, lineColor); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/tools/drawTools/vtoolbisector.cpp b/src/app/tools/drawTools/vtoolbisector.cpp index eee05465e..90d8e6f52 100644 --- a/src/app/tools/drawTools/vtoolbisector.cpp +++ b/src/app/tools/drawTools/vtoolbisector.cpp @@ -310,6 +310,7 @@ void VToolBisector::SaveOptions(QDomElement &tag, QSharedPointer &obj) doc->SetAttribute(tag, AttrMy, qApp->fromPixel(point->my())); doc->SetAttribute(tag, AttrTypeLine, typeLine); + doc->SetAttribute(tag, AttrLineColor, lineColor); doc->SetAttribute(tag, AttrLength, formulaLength); doc->SetAttribute(tag, AttrFirstPoint, firstPointId); doc->SetAttribute(tag, AttrSecondPoint, basePointId); diff --git a/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp b/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp index bfb0ccc19..0c45d57c0 100644 --- a/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp +++ b/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp @@ -304,6 +304,7 @@ void VToolCurveIntersectAxis::SaveOptions(QDomElement &tag, QSharedPointerSetAttribute(tag, AttrMy, qApp->fromPixel(point->my())); doc->SetAttribute(tag, AttrTypeLine, typeLine); + doc->SetAttribute(tag, AttrLineColor, lineColor); doc->SetAttribute(tag, AttrAngle, formulaAngle); doc->SetAttribute(tag, AttrBasePoint, basePointId); doc->SetAttribute(tag, AttrCurve, curveId); diff --git a/src/app/tools/drawTools/vtoolheight.cpp b/src/app/tools/drawTools/vtoolheight.cpp index 841fd3d6b..7598b8aa0 100644 --- a/src/app/tools/drawTools/vtoolheight.cpp +++ b/src/app/tools/drawTools/vtoolheight.cpp @@ -258,6 +258,7 @@ void VToolHeight::SaveOptions(QDomElement &tag, QSharedPointer &obj) doc->SetAttribute(tag, AttrMy, qApp->fromPixel(point->my())); doc->SetAttribute(tag, AttrTypeLine, typeLine); + doc->SetAttribute(tag, AttrLineColor, lineColor); doc->SetAttribute(tag, AttrBasePoint, basePointId); doc->SetAttribute(tag, AttrP1Line, p1LineId); doc->SetAttribute(tag, AttrP2Line, p2LineId); diff --git a/src/app/tools/drawTools/vtoolline.cpp b/src/app/tools/drawTools/vtoolline.cpp index 4bc7d1f95..46104b05a 100644 --- a/src/app/tools/drawTools/vtoolline.cpp +++ b/src/app/tools/drawTools/vtoolline.cpp @@ -385,6 +385,7 @@ void VToolLine::SaveOptions(QDomElement &tag, QSharedPointer &obj) doc->SetAttribute(tag, AttrFirstPoint, firstPoint); doc->SetAttribute(tag, AttrSecondPoint, secondPoint); doc->SetAttribute(tag, AttrTypeLine, typeLine); + doc->SetAttribute(tag, AttrLineColor, lineColor); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/tools/drawTools/vtoollineintersectaxis.cpp b/src/app/tools/drawTools/vtoollineintersectaxis.cpp index 7393426ad..cba8df816 100644 --- a/src/app/tools/drawTools/vtoollineintersectaxis.cpp +++ b/src/app/tools/drawTools/vtoollineintersectaxis.cpp @@ -322,6 +322,7 @@ void VToolLineIntersectAxis::SaveOptions(QDomElement &tag, QSharedPointerSetAttribute(tag, AttrMy, qApp->fromPixel(point->my())); doc->SetAttribute(tag, AttrTypeLine, typeLine); + doc->SetAttribute(tag, AttrLineColor, lineColor); doc->SetAttribute(tag, AttrAngle, formulaAngle); doc->SetAttribute(tag, AttrBasePoint, basePointId); doc->SetAttribute(tag, AttrP1Line, firstPointId); diff --git a/src/app/tools/drawTools/vtoolnormal.cpp b/src/app/tools/drawTools/vtoolnormal.cpp index 8e051143f..253482fb8 100644 --- a/src/app/tools/drawTools/vtoolnormal.cpp +++ b/src/app/tools/drawTools/vtoolnormal.cpp @@ -287,6 +287,7 @@ void VToolNormal::SaveOptions(QDomElement &tag, QSharedPointer &obj) doc->SetAttribute(tag, AttrMy, qApp->fromPixel(point->my())); doc->SetAttribute(tag, AttrTypeLine, typeLine); + doc->SetAttribute(tag, AttrLineColor, lineColor); doc->SetAttribute(tag, AttrLength, formulaLength); doc->SetAttribute(tag, AttrAngle, angle); doc->SetAttribute(tag, AttrFirstPoint, basePointId); diff --git a/src/app/tools/drawTools/vtoolshoulderpoint.cpp b/src/app/tools/drawTools/vtoolshoulderpoint.cpp index 7c425afe9..7f5c09764 100644 --- a/src/app/tools/drawTools/vtoolshoulderpoint.cpp +++ b/src/app/tools/drawTools/vtoolshoulderpoint.cpp @@ -314,6 +314,7 @@ void VToolShoulderPoint::SaveOptions(QDomElement &tag, QSharedPointer doc->SetAttribute(tag, AttrMy, qApp->fromPixel(point->my())); doc->SetAttribute(tag, AttrTypeLine, typeLine); + doc->SetAttribute(tag, AttrLineColor, lineColor); doc->SetAttribute(tag, AttrLength, formulaLength); doc->SetAttribute(tag, AttrP1Line, basePointId); doc->SetAttribute(tag, AttrP2Line, p2Line); diff --git a/src/app/tools/drawTools/vtoolspline.cpp b/src/app/tools/drawTools/vtoolspline.cpp index 1c80cdfd2..70e951d32 100644 --- a/src/app/tools/drawTools/vtoolspline.cpp +++ b/src/app/tools/drawTools/vtoolspline.cpp @@ -350,6 +350,7 @@ void VToolSpline::SaveOptions(QDomElement &tag, QSharedPointer &obj) doc->SetAttribute(tag, AttrKAsm1, spl->GetKasm1()); doc->SetAttribute(tag, AttrKAsm2, spl->GetKasm2()); doc->SetAttribute(tag, AttrKCurve, spl->GetKcurve()); + doc->SetAttribute(tag, AttrColor, lineColor); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/tools/drawTools/vtoolsplinepath.cpp b/src/app/tools/drawTools/vtoolsplinepath.cpp index 6701fe483..a45f68163 100644 --- a/src/app/tools/drawTools/vtoolsplinepath.cpp +++ b/src/app/tools/drawTools/vtoolsplinepath.cpp @@ -403,6 +403,7 @@ void VToolSplinePath::SaveOptions(QDomElement &tag, QSharedPointer &ob doc->SetAttribute(tag, VDomDocument::AttrId, id); doc->SetAttribute(tag, AttrType, ToolType); doc->SetAttribute(tag, AttrKCurve, splPath->GetKCurve()); + doc->SetAttribute(tag, AttrColor, lineColor); doc->RemoveAllChild(tag); for (qint32 i = 0; i < splPath->CountPoint(); ++i) From c595df75174461c809a594f730f9f59940174b1f Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 7 Feb 2015 13:17:31 +0200 Subject: [PATCH 113/186] Read attribute color from file. --HG-- branch : feature --- src/app/tools/drawTools/vtoolalongline.cpp | 20 +++--- src/app/tools/drawTools/vtoolalongline.h | 11 ++-- src/app/tools/drawTools/vtoolarc.cpp | 13 ++-- src/app/tools/drawTools/vtoolarc.h | 7 +- src/app/tools/drawTools/vtoolbisector.cpp | 24 +++---- src/app/tools/drawTools/vtoolbisector.h | 10 +-- .../drawTools/vtoolcurveintersectaxis.cpp | 22 ++++--- .../tools/drawTools/vtoolcurveintersectaxis.h | 11 ++-- src/app/tools/drawTools/vtoolendline.cpp | 22 ++++--- src/app/tools/drawTools/vtoolendline.h | 9 +-- src/app/tools/drawTools/vtoolheight.cpp | 18 +++--- src/app/tools/drawTools/vtoolheight.h | 12 ++-- src/app/tools/drawTools/vtoolline.cpp | 16 +++-- src/app/tools/drawTools/vtoolline.h | 7 +- .../drawTools/vtoollineintersectaxis.cpp | 28 ++++---- .../tools/drawTools/vtoollineintersectaxis.h | 7 +- src/app/tools/drawTools/vtoollinepoint.cpp | 8 ++- src/app/tools/drawTools/vtoollinepoint.h | 2 +- src/app/tools/drawTools/vtoolnormal.cpp | 24 +++---- src/app/tools/drawTools/vtoolnormal.h | 11 ++-- .../tools/drawTools/vtoolshoulderpoint.cpp | 16 +++-- src/app/tools/drawTools/vtoolshoulderpoint.h | 11 ++-- src/app/tools/drawTools/vtoolspline.cpp | 12 ++-- src/app/tools/drawTools/vtoolspline.h | 4 +- src/app/tools/drawTools/vtoolsplinepath.cpp | 16 +++-- src/app/tools/drawTools/vtoolsplinepath.h | 7 +- src/app/xml/vpattern.cpp | 64 +++++++++++-------- src/app/xml/vpattern.h | 2 +- 28 files changed, 232 insertions(+), 182 deletions(-) diff --git a/src/app/tools/drawTools/vtoolalongline.cpp b/src/app/tools/drawTools/vtoolalongline.cpp index 7a6c3dd4b..61020f9ea 100644 --- a/src/app/tools/drawTools/vtoolalongline.cpp +++ b/src/app/tools/drawTools/vtoolalongline.cpp @@ -50,9 +50,9 @@ const QString VToolAlongLine::ToolType = QStringLiteral("alongLine"); */ VToolAlongLine::VToolAlongLine(VPattern *doc, VContainer *data, quint32 id, const QString &formula, const quint32 &firstPointId, const quint32 &secondPointId, - const QString &typeLine, const Source &typeCreation, + const QString &typeLine, const QString &lineColor, const Source &typeCreation, QGraphicsItem *parent) - :VToolLinePoint(doc, data, id, typeLine, formula, firstPointId, 0, parent), secondPointId(secondPointId) + :VToolLinePoint(doc, data, id, typeLine, lineColor, formula, firstPointId, 0, parent), secondPointId(secondPointId) { if (typeCreation == Source::FromGui) @@ -261,10 +261,11 @@ VToolAlongLine* VToolAlongLine::Create(DialogTool *dialog, VMainGraphicsScene *s const quint32 firstPointId = dialogTool->GetFirstPointId(); const quint32 secondPointId = dialogTool->GetSecondPointId(); const QString typeLine = dialogTool->GetTypeLine(); + const QString lineColor = dialogTool->GetLineColor(); const QString pointName = dialogTool->getPointName(); VToolAlongLine *point=nullptr; - point = Create(0, pointName, typeLine, formula, firstPointId, secondPointId, 5, 10, scene, doc, data, - Document::FullParse, Source::FromGui); + point = Create(0, pointName, typeLine, lineColor, formula, firstPointId, secondPointId, 5, 10, scene, doc, data, + Document::FullParse, Source::FromGui); if (point != nullptr) { point->dialog=dialogTool; @@ -290,9 +291,10 @@ VToolAlongLine* VToolAlongLine::Create(DialogTool *dialog, VMainGraphicsScene *s * @param typeCreation way we create this tool. */ VToolAlongLine* VToolAlongLine::Create(const quint32 _id, const QString &pointName, const QString &typeLine, - QString &formula, const quint32 &firstPointId, const quint32 &secondPointId, - const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, - VContainer *data, const Document &parse, const Source &typeCreation) + const QString &lineColor, QString &formula, const quint32 &firstPointId, + const quint32 &secondPointId, const qreal &mx, const qreal &my, + VMainGraphicsScene *scene, VPattern *doc, VContainer *data, + const Document &parse, const Source &typeCreation) { const QSharedPointer firstPoint = data->GeometricObject(firstPointId); const QSharedPointer secondPoint = data->GeometricObject(secondPointId); @@ -320,8 +322,8 @@ VToolAlongLine* VToolAlongLine::Create(const quint32 _id, const QString &pointNa VDrawTool::AddRecord(id, Tool::AlongLine, doc); if (parse == Document::FullParse) { - VToolAlongLine *point = new VToolAlongLine(doc, data, id, formula, firstPointId, - secondPointId, typeLine, typeCreation); + VToolAlongLine *point = new VToolAlongLine(doc, data, id, formula, firstPointId, secondPointId, typeLine, + lineColor, typeCreation); scene->addItem(point); connect(point, &VToolAlongLine::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolAlongLine::SetFactor); diff --git a/src/app/tools/drawTools/vtoolalongline.h b/src/app/tools/drawTools/vtoolalongline.h index 1ece5bf76..f3b860cd1 100644 --- a/src/app/tools/drawTools/vtoolalongline.h +++ b/src/app/tools/drawTools/vtoolalongline.h @@ -40,14 +40,15 @@ class VToolAlongLine : public VToolLinePoint public: VToolAlongLine(VPattern *doc, VContainer *data, quint32 id, const QString &formula, const quint32 &firstPointId, - const quint32 &secondPointId, const QString &typeLine, const Source &typeCreation, - QGraphicsItem * parent = nullptr); + const quint32 &secondPointId, const QString &typeLine, const QString &lineColor, + const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual void setDialog(); static VToolAlongLine* Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); static VToolAlongLine* Create(const quint32 _id, const QString &pointName, const QString &typeLine, - QString &formula, const quint32 &firstPointId, const quint32 &secondPointId, - const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, - VContainer *data, const Document &parse, const Source &typeCreation); + const QString &lineColor, QString &formula, const quint32 &firstPointId, + const quint32 &secondPointId, const qreal &mx, const qreal &my, + VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, + const Source &typeCreation); static const QString ToolType; virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::AlongLine)}; diff --git a/src/app/tools/drawTools/vtoolarc.cpp b/src/app/tools/drawTools/vtoolarc.cpp index 403ffdf11..332006ebc 100644 --- a/src/app/tools/drawTools/vtoolarc.cpp +++ b/src/app/tools/drawTools/vtoolarc.cpp @@ -47,10 +47,12 @@ const QString VToolArc::ToolType = QStringLiteral("simple"); * @param typeCreation way we create this tool. * @param parent parent object */ -VToolArc::VToolArc(VPattern *doc, VContainer *data, quint32 id, const Source &typeCreation, QGraphicsItem *parent) +VToolArc::VToolArc(VPattern *doc, VContainer *data, quint32 id, const QString &color, const Source &typeCreation, + QGraphicsItem *parent) :VAbstractSpline(doc, data, id, parent) { sceneType = SceneObject::Arc; + lineColor = color; this->setPath(ToolPath()); this->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine())/factor)); @@ -102,8 +104,9 @@ VToolArc* VToolArc::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPatte QString radius = dialogTool->GetRadius(); QString f1 = dialogTool->GetF1(); QString f2 = dialogTool->GetF2(); + const QString color = dialogTool->GetColor(); VToolArc* point = nullptr; - point=Create(0, center, radius, f1, f2, scene, doc, data, Document::FullParse, Source::FromGui); + point=Create(0, center, radius, f1, f2, color, scene, doc, data, Document::FullParse, Source::FromGui); if (point != nullptr) { point->dialog=dialogTool; @@ -126,8 +129,8 @@ VToolArc* VToolArc::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPatte * @param typeCreation way we create this tool. */ VToolArc* VToolArc::Create(const quint32 _id, const quint32 ¢er, QString &radius, QString &f1, QString &f2, - VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, - const Source &typeCreation) + const QString &color, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, + const Document &parse, const Source &typeCreation) { qreal calcRadius = 0, calcF1 = 0, calcF2 = 0; @@ -156,7 +159,7 @@ VToolArc* VToolArc::Create(const quint32 _id, const quint32 ¢er, QString &ra VDrawTool::AddRecord(id, Tool::Arc, doc); if (parse == Document::FullParse) { - VToolArc *toolArc = new VToolArc(doc, data, id, typeCreation); + VToolArc *toolArc = new VToolArc(doc, data, id, color, typeCreation); scene->addItem(toolArc); connect(toolArc, &VToolArc::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, toolArc, &VToolArc::SetFactor); diff --git a/src/app/tools/drawTools/vtoolarc.h b/src/app/tools/drawTools/vtoolarc.h index d142b06b6..fa4e291b4 100644 --- a/src/app/tools/drawTools/vtoolarc.h +++ b/src/app/tools/drawTools/vtoolarc.h @@ -40,12 +40,13 @@ class VToolArc :public VAbstractSpline { Q_OBJECT public: - VToolArc(VPattern *doc, VContainer *data, quint32 id, const Source &typeCreation, QGraphicsItem * parent = nullptr); + VToolArc(VPattern *doc, VContainer *data, quint32 id, const QString &color, const Source &typeCreation, + QGraphicsItem * parent = nullptr); virtual void setDialog(); static VToolArc* Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); static VToolArc* Create(const quint32 _id, const quint32 ¢er, QString &radius, QString &f1, QString &f2, - VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, - const Source &typeCreation); + const QString &color, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, + const Document &parse, const Source &typeCreation); static const QString TagName; static const QString ToolType; virtual int type() const {return Type;} diff --git a/src/app/tools/drawTools/vtoolbisector.cpp b/src/app/tools/drawTools/vtoolbisector.cpp index 90d8e6f52..e3bb1b9ee 100644 --- a/src/app/tools/drawTools/vtoolbisector.cpp +++ b/src/app/tools/drawTools/vtoolbisector.cpp @@ -49,9 +49,10 @@ const QString VToolBisector::ToolType = QStringLiteral("bisector"); * @param parent parent object. */ VToolBisector::VToolBisector(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, - const QString &formula, const quint32 &firstPointId, const quint32 &secondPointId, - const quint32 &thirdPointId, const Source &typeCreation, QGraphicsItem *parent) - :VToolLinePoint(doc, data, id, typeLine, formula, secondPointId, 0, parent), firstPointId(NULL_ID), + const QString &lineColor, const QString &formula, const quint32 &firstPointId, + const quint32 &secondPointId, const quint32 &thirdPointId, const Source &typeCreation, + QGraphicsItem *parent) + :VToolLinePoint(doc, data, id, typeLine, lineColor, formula, secondPointId, 0, parent), firstPointId(NULL_ID), thirdPointId(NULL_ID) { this->firstPointId = firstPointId; @@ -140,10 +141,11 @@ VToolBisector* VToolBisector::Create(DialogTool *dialog, VMainGraphicsScene *sce const quint32 secondPointId = dialogTool->GetSecondPointId(); const quint32 thirdPointId = dialogTool->GetThirdPointId(); const QString typeLine = dialogTool->GetTypeLine(); + const QString lineColor = dialogTool->GetLineColor(); const QString pointName = dialogTool->getPointName(); VToolBisector *point = nullptr; - point=Create(0, formula, firstPointId, secondPointId, thirdPointId, typeLine, pointName, 5, 10, scene, doc, data, - Document::FullParse, Source::FromGui); + point=Create(0, formula, firstPointId, secondPointId, thirdPointId, typeLine, lineColor, pointName, 5, 10, scene, + doc, data, Document::FullParse, Source::FromGui); if (point != nullptr) { point->dialog=dialogTool; @@ -170,10 +172,10 @@ VToolBisector* VToolBisector::Create(DialogTool *dialog, VMainGraphicsScene *sce * @param typeCreation way we create this tool. */ VToolBisector* VToolBisector::Create(const quint32 _id, QString &formula, const quint32 &firstPointId, - const quint32 &secondPointId, const quint32 &thirdPointId, const QString &typeLine, - const QString &pointName, const qreal &mx, const qreal &my, - VMainGraphicsScene *scene, VPattern *doc, VContainer *data, - const Document &parse, const Source &typeCreation) + const quint32 &secondPointId, const quint32 &thirdPointId, const QString &typeLine, + const QString &lineColor, const QString &pointName, const qreal &mx, + const qreal &my, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, + const Document &parse, const Source &typeCreation) { const QSharedPointer firstPoint = data->GeometricObject(firstPointId); const QSharedPointer secondPoint = data->GeometricObject(secondPointId); @@ -201,8 +203,8 @@ VToolBisector* VToolBisector::Create(const quint32 _id, QString &formula, const VDrawTool::AddRecord(id, Tool::Bisector, doc); if (parse == Document::FullParse) { - VToolBisector *point = new VToolBisector(doc, data, id, typeLine, formula, firstPointId, secondPointId, - thirdPointId, typeCreation); + VToolBisector *point = new VToolBisector(doc, data, id, typeLine, lineColor, formula, firstPointId, + secondPointId, thirdPointId, typeCreation); scene->addItem(point); connect(point, &VToolPoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolBisector::SetFactor); diff --git a/src/app/tools/drawTools/vtoolbisector.h b/src/app/tools/drawTools/vtoolbisector.h index 9d5ab776f..5d8ea8316 100644 --- a/src/app/tools/drawTools/vtoolbisector.h +++ b/src/app/tools/drawTools/vtoolbisector.h @@ -39,9 +39,9 @@ class VToolBisector : public VToolLinePoint Q_OBJECT public: - VToolBisector(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &formula, - const quint32 &firstPointId, const quint32 &secondPointId, const quint32 &thirdPointId, - const Source &typeCreation, QGraphicsItem * parent = nullptr); + VToolBisector(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &lineColor, + const QString &formula, const quint32 &firstPointId, const quint32 &secondPointId, + const quint32 &thirdPointId, const Source &typeCreation, QGraphicsItem * parent = nullptr); static qreal BisectorAngle(const QPointF &firstPoint, const QPointF &secondPoint, const QPointF &thirdPoint); static QPointF FindPoint(const QPointF &firstPoint, const QPointF &secondPoint, const QPointF &thirdPoint, const qreal& length); @@ -49,8 +49,8 @@ public: static VToolBisector* Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); static VToolBisector* Create(const quint32 _id, QString &formula, const quint32 &firstPointId, const quint32 &secondPointId, const quint32 &thirdPointId, const QString &typeLine, - const QString &pointName, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, - VPattern *doc, VContainer *data, const Document &parse, + const QString &lineColor, const QString &pointName, const qreal &mx, const qreal &my, + VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation); static const QString ToolType; virtual int type() const {return Type;} diff --git a/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp b/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp index 0c45d57c0..e5f23ae9d 100644 --- a/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp +++ b/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp @@ -38,10 +38,11 @@ const QString VToolCurveIntersectAxis::ToolType = QStringLiteral("curveIntersect //--------------------------------------------------------------------------------------------------------------------- VToolCurveIntersectAxis::VToolCurveIntersectAxis(VPattern *doc, VContainer *data, const quint32 &id, - const QString &typeLine, const QString &formulaAngle, - const quint32 &basePointId, const quint32 &curveId, - const Source &typeCreation, QGraphicsItem *parent) - :VToolLinePoint(doc, data, id, typeLine, QString(), basePointId, 0, parent), formulaAngle(formulaAngle), + const QString &typeLine, const QString &lineColor, + const QString &formulaAngle, const quint32 &basePointId, + const quint32 &curveId, const Source &typeCreation, + QGraphicsItem *parent) + :VToolLinePoint(doc, data, id, typeLine, lineColor, QString(), basePointId, 0, parent), formulaAngle(formulaAngle), curveId(curveId) { if (typeCreation == Source::FromGui) @@ -83,12 +84,13 @@ VToolCurveIntersectAxis *VToolCurveIntersectAxis::Create(DialogTool *dialog, VMa SCASSERT(dialogTool); const QString pointName = dialogTool->getPointName(); const QString typeLine = dialogTool->GetTypeLine(); + const QString lineColor = dialogTool->GetLineColor(); QString formulaAngle = dialogTool->GetAngle(); const quint32 basePointId = dialogTool->GetBasePointId(); const quint32 curveId = dialogTool->getCurveId(); VToolCurveIntersectAxis *point = nullptr; - point=Create(0, pointName, typeLine, formulaAngle, basePointId, curveId, 5, 10, scene, doc, data, + point=Create(0, pointName, typeLine, lineColor, formulaAngle, basePointId, curveId, 5, 10, scene, doc, data, Document::FullParse, Source::FromGui); if (point != nullptr) { @@ -99,9 +101,9 @@ VToolCurveIntersectAxis *VToolCurveIntersectAxis::Create(DialogTool *dialog, VMa //--------------------------------------------------------------------------------------------------------------------- VToolCurveIntersectAxis *VToolCurveIntersectAxis::Create(const quint32 _id, const QString &pointName, - const QString &typeLine, QString &formulaAngle, - const quint32 &basePointId, const quint32 &curveId, - const qreal &mx, const qreal &my, + const QString &typeLine, const QString &lineColor, + QString &formulaAngle, const quint32 &basePointId, + const quint32 &curveId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) { @@ -128,8 +130,8 @@ VToolCurveIntersectAxis *VToolCurveIntersectAxis::Create(const quint32 _id, cons VDrawTool::AddRecord(id, Tool::CurveIntersectAxis, doc); if (parse == Document::FullParse) { - VToolCurveIntersectAxis *point = new VToolCurveIntersectAxis(doc, data, id, typeLine, formulaAngle, basePointId, - curveId, typeCreation); + VToolCurveIntersectAxis *point = new VToolCurveIntersectAxis(doc, data, id, typeLine, lineColor, formulaAngle, + basePointId, curveId, typeCreation); scene->addItem(point); connect(point, &VToolPoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolCurveIntersectAxis::SetFactor); diff --git a/src/app/tools/drawTools/vtoolcurveintersectaxis.h b/src/app/tools/drawTools/vtoolcurveintersectaxis.h index 768fe5ac1..5dbb7d475 100644 --- a/src/app/tools/drawTools/vtoolcurveintersectaxis.h +++ b/src/app/tools/drawTools/vtoolcurveintersectaxis.h @@ -36,17 +36,18 @@ class VToolCurveIntersectAxis : public VToolLinePoint Q_OBJECT public: VToolCurveIntersectAxis(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, - const QString &formulaAngle, const quint32 &basePointId, const quint32 &curveId, - const Source &typeCreation, QGraphicsItem * parent = nullptr); + const QString &lineColor, const QString &formulaAngle, const quint32 &basePointId, + const quint32 &curveId, const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual ~VToolCurveIntersectAxis(); virtual void setDialog(); static VToolCurveIntersectAxis *Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); static VToolCurveIntersectAxis *Create(const quint32 _id, const QString &pointName, const QString &typeLine, - QString &formulaAngle, const quint32 &basePointId, const quint32 &curveId, - const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, - VContainer *data, const Document &parse, const Source &typeCreation); + const QString &lineColor, QString &formulaAngle, const quint32 &basePointId, + const quint32 &curveId, const qreal &mx, const qreal &my, + VMainGraphicsScene *scene, VPattern *doc, VContainer *data, + const Document &parse, const Source &typeCreation); static QPointF FindPoint(const QPointF &point, qreal angle, const QSharedPointer &curve); diff --git a/src/app/tools/drawTools/vtoolendline.cpp b/src/app/tools/drawTools/vtoolendline.cpp index 76efe667f..0956ef24f 100644 --- a/src/app/tools/drawTools/vtoolendline.cpp +++ b/src/app/tools/drawTools/vtoolendline.cpp @@ -50,9 +50,10 @@ const QString VToolEndLine::ToolType = QStringLiteral("endLine"); * @param parent parent object. */ VToolEndLine::VToolEndLine(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, - const QString &formulaLength, const QString &formulaAngle, const quint32 &basePointId, - const Source &typeCreation, QGraphicsItem *parent) - :VToolLinePoint(doc, data, id, typeLine, formulaLength, basePointId, 0, parent), formulaAngle(formulaAngle) + const QString &lineColor, const QString &formulaLength, const QString &formulaAngle, + const quint32 &basePointId, const Source &typeCreation, QGraphicsItem *parent) + :VToolLinePoint(doc, data, id, typeLine, lineColor, formulaLength, basePointId, 0, parent), + formulaAngle(formulaAngle) { if (typeCreation == Source::FromGui) { @@ -103,12 +104,13 @@ VToolEndLine* VToolEndLine::Create(DialogTool *dialog, VMainGraphicsScene *scene SCASSERT(dialogTool); const QString pointName = dialogTool->getPointName(); const QString typeLine = dialogTool->GetTypeLine(); + const QString lineColor = dialogTool->GetLineColor(); QString formulaLength = dialogTool->GetFormula(); QString formulaAngle = dialogTool->GetAngle(); const quint32 basePointId = dialogTool->GetBasePointId(); VToolEndLine *point = nullptr; - point=Create(0, pointName, typeLine, formulaLength, formulaAngle, basePointId, 5, 10, scene, doc, data, + point=Create(0, pointName, typeLine, lineColor, formulaLength, formulaAngle, basePointId, 5, 10, scene, doc, data, Document::FullParse, Source::FromGui); if (point != nullptr) { @@ -123,6 +125,7 @@ VToolEndLine* VToolEndLine::Create(DialogTool *dialog, VMainGraphicsScene *scene * @param _id tool id, 0 if tool doesn't exist yet. * @param pointName point name. * @param typeLine line type. + * @param lineColor line color. * @param formulaLength string with formula length of line. * @param formulaAngle formula angle of line. * @param basePointId id first point of line. @@ -136,9 +139,10 @@ VToolEndLine* VToolEndLine::Create(DialogTool *dialog, VMainGraphicsScene *scene * @return the created tool */ VToolEndLine* VToolEndLine::Create(const quint32 _id, const QString &pointName, const QString &typeLine, - QString &formulaLength, QString &formulaAngle, const quint32 &basePointId, - const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, - VContainer *data, const Document &parse, const Source &typeCreation) + const QString &lineColor, QString &formulaLength, QString &formulaAngle, + const quint32 &basePointId, const qreal &mx, const qreal &my, + VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, + const Source &typeCreation) { const QSharedPointer basePoint = data->GeometricObject(basePointId); QLineF line = QLineF(basePoint->toQPointF(), QPointF(basePoint->x()+100, basePoint->y())); @@ -163,8 +167,8 @@ VToolEndLine* VToolEndLine::Create(const quint32 _id, const QString &pointName, VDrawTool::AddRecord(id, Tool::EndLine, doc); if (parse == Document::FullParse) { - VToolEndLine *point = new VToolEndLine(doc, data, id, typeLine, formulaLength, formulaAngle, basePointId, - typeCreation); + VToolEndLine *point = new VToolEndLine(doc, data, id, typeLine, lineColor, formulaLength, formulaAngle, + basePointId, typeCreation); scene->addItem(point); connect(point, &VToolPoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolEndLine::SetFactor); diff --git a/src/app/tools/drawTools/vtoolendline.h b/src/app/tools/drawTools/vtoolendline.h index b0529de0a..a2e7327d7 100644 --- a/src/app/tools/drawTools/vtoolendline.h +++ b/src/app/tools/drawTools/vtoolendline.h @@ -39,16 +39,17 @@ class VToolEndLine : public VToolLinePoint Q_OBJECT public: - VToolEndLine(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, + VToolEndLine(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &lineColor, const QString &formulaLength, const QString &formulaAngle, const quint32 &basePointId, const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual ~VToolEndLine(); virtual void setDialog(); static VToolEndLine *Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); static VToolEndLine *Create(const quint32 _id, const QString &pointName, const QString &typeLine, - QString &formulaLength, QString &formulaAngle, const quint32 &basePointId, - const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, - VContainer *data, const Document &parse, const Source &typeCreation); + const QString &lineColor, QString &formulaLength, QString &formulaAngle, + const quint32 &basePointId, const qreal &mx, const qreal &my, + VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, + const Source &typeCreation); static const QString ToolType; virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::EndLine)}; diff --git a/src/app/tools/drawTools/vtoolheight.cpp b/src/app/tools/drawTools/vtoolheight.cpp index 7598b8aa0..ae69149b5 100644 --- a/src/app/tools/drawTools/vtoolheight.cpp +++ b/src/app/tools/drawTools/vtoolheight.cpp @@ -47,9 +47,10 @@ const QString VToolHeight::ToolType = QStringLiteral("height"); * @param parent parent object. */ VToolHeight::VToolHeight(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, - const quint32 &basePointId, const quint32 &p1LineId, const quint32 &p2LineId, - const Source &typeCreation, QGraphicsItem * parent) - :VToolLinePoint(doc, data, id, typeLine, QString(), basePointId, 0, parent), p1LineId(p1LineId), p2LineId(p2LineId) + const QString &lineColor, const quint32 &basePointId, const quint32 &p1LineId, + const quint32 &p2LineId, const Source &typeCreation, QGraphicsItem * parent) + :VToolLinePoint(doc, data, id, typeLine, lineColor, QString(), basePointId, 0, parent), p1LineId(p1LineId), + p2LineId(p2LineId) { ignoreFullUpdate = true; if (typeCreation == Source::FromGui) @@ -97,12 +98,13 @@ VToolHeight* VToolHeight::Create(DialogTool *dialog, VMainGraphicsScene *scene, disconnect(doc, &VPattern::FullUpdateFromFile, dialogTool, &DialogHeight::UpdateList); const QString pointName = dialogTool->getPointName(); const QString typeLine = dialogTool->GetTypeLine(); + const QString lineColor = dialogTool->GetLineColor(); const quint32 basePointId = dialogTool->GetBasePointId(); const quint32 p1LineId = dialogTool->GetP1LineId(); const quint32 p2LineId = dialogTool->GetP2LineId(); VToolHeight *point = nullptr; - point = Create(0, pointName, typeLine, basePointId, p1LineId, p2LineId, 5, 10, scene, doc, data, + point = Create(0, pointName, typeLine, lineColor, basePointId, p1LineId, p2LineId, 5, 10, scene, doc, data, Document::FullParse, Source::FromGui); if (point != nullptr) { @@ -130,9 +132,9 @@ VToolHeight* VToolHeight::Create(DialogTool *dialog, VMainGraphicsScene *scene, * @return the created tool */ VToolHeight* VToolHeight::Create(const quint32 _id, const QString &pointName, const QString &typeLine, - const quint32 &basePointId, const quint32 &p1LineId, const quint32 &p2LineId, - const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, - VContainer *data, const Document &parse, const Source &typeCreation) + const QString &lineColor, const quint32 &basePointId, const quint32 &p1LineId, + const quint32 &p2LineId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, + VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) { const QSharedPointer basePoint = data->GeometricObject(basePointId); const QSharedPointer p1Line = data->GeometricObject(p1LineId); @@ -161,7 +163,7 @@ VToolHeight* VToolHeight::Create(const quint32 _id, const QString &pointName, co VDrawTool::AddRecord(id, Tool::Height, doc); if (parse == Document::FullParse) { - VToolHeight *point = new VToolHeight(doc, data, id, typeLine, basePointId, p1LineId, p2LineId, + VToolHeight *point = new VToolHeight(doc, data, id, typeLine, lineColor, basePointId, p1LineId, p2LineId, typeCreation); scene->addItem(point); connect(point, &VToolPoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); diff --git a/src/app/tools/drawTools/vtoolheight.h b/src/app/tools/drawTools/vtoolheight.h index 846f23ae3..02e77cf0a 100644 --- a/src/app/tools/drawTools/vtoolheight.h +++ b/src/app/tools/drawTools/vtoolheight.h @@ -39,15 +39,15 @@ class VToolHeight: public VToolLinePoint Q_OBJECT public: - VToolHeight(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const quint32 &basePointId, - const quint32 &p1LineId, const quint32 &p2LineId, const Source &typeCreation, - QGraphicsItem * parent = nullptr); + VToolHeight(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &lineColor, + const quint32 &basePointId, const quint32 &p1LineId, const quint32 &p2LineId, + const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual void setDialog(); static VToolHeight *Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); static VToolHeight *Create(const quint32 _id, const QString &pointName, const QString &typeLine, - const quint32 &basePointId, const quint32 &p1LineId, const quint32 &p2LineId, - const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, - VContainer *data, const Document &parse, const Source &typeCreation); + const QString &lineColor, const quint32 &basePointId, const quint32 &p1LineId, + const quint32 &p2LineId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, + VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation); static QPointF FindPoint(const QLineF &line, const QPointF &point); static const QString ToolType; virtual int type() const {return Type;} diff --git a/src/app/tools/drawTools/vtoolline.cpp b/src/app/tools/drawTools/vtoolline.cpp index 46104b05a..b99956279 100644 --- a/src/app/tools/drawTools/vtoolline.cpp +++ b/src/app/tools/drawTools/vtoolline.cpp @@ -48,10 +48,12 @@ const QString VToolLine::TagName = QStringLiteral("line"); * @param parent parent object. */ VToolLine::VToolLine(VPattern *doc, VContainer *data, quint32 id, quint32 firstPoint, quint32 secondPoint, - const QString &typeLine, const Source &typeCreation, QGraphicsItem *parent) + const QString &typeLine, const QString &lineColor, const Source &typeCreation, + QGraphicsItem *parent) :VDrawTool(doc, data, id), QGraphicsLineItem(parent), firstPoint(firstPoint), secondPoint(secondPoint) { this->typeLine = typeLine; + this->lineColor = lineColor; ignoreFullUpdate = true; //Line const QSharedPointer first = data->GeometricObject(firstPoint); @@ -104,9 +106,11 @@ VToolLine *VToolLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPat const quint32 firstPoint = dialogTool->GetFirstPoint(); const quint32 secondPoint = dialogTool->GetSecondPoint(); const QString typeLine = dialogTool->GetTypeLine(); + const QString lineColor = dialogTool->GetLineColor(); VToolLine *line = nullptr; - line = Create(0, firstPoint, secondPoint, typeLine, scene, doc, data, Document::FullParse, Source::FromGui); + line = Create(0, firstPoint, secondPoint, typeLine, lineColor, scene, doc, data, Document::FullParse, + Source::FromGui); if (line != nullptr) { line->dialog=dialogTool; @@ -128,8 +132,8 @@ VToolLine *VToolLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPat * @param typeCreation way we create this tool. */ VToolLine * VToolLine::Create(const quint32 &_id, const quint32 &firstPoint, const quint32 &secondPoint, - const QString &typeLine, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, - const Document &parse, const Source &typeCreation) + const QString &typeLine, const QString &lineColor, VMainGraphicsScene *scene, + VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) { SCASSERT(scene != nullptr); SCASSERT(doc != nullptr); @@ -152,7 +156,7 @@ VToolLine * VToolLine::Create(const quint32 &_id, const quint32 &firstPoint, con VDrawTool::AddRecord(id, Tool::Line, doc); if (parse == Document::FullParse) { - VToolLine *line = new VToolLine(doc, data, id, firstPoint, secondPoint, typeLine, typeCreation); + VToolLine *line = new VToolLine(doc, data, id, firstPoint, secondPoint, typeLine, lineColor, typeCreation); scene->addItem(line); connect(line, &VToolLine::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, line, &VToolLine::SetFactor); @@ -485,6 +489,6 @@ void VToolLine::RefreshGeometry() const QSharedPointer first = VAbstractTool::data.GeometricObject(firstPoint); const QSharedPointer second = VAbstractTool::data.GeometricObject(secondPoint); this->setLine(QLineF(first->toQPointF(), second->toQPointF())); - this->setPen(QPen(CorrectColor(baseColor), qApp->toPixel(qApp->widthHairLine())/factor, + this->setPen(QPen(CorrectColor(lineColor), qApp->toPixel(qApp->widthHairLine())/factor, LineStyleToPenStyle(typeLine))); } diff --git a/src/app/tools/drawTools/vtoolline.h b/src/app/tools/drawTools/vtoolline.h index a98b1766b..1c57029dc 100644 --- a/src/app/tools/drawTools/vtoolline.h +++ b/src/app/tools/drawTools/vtoolline.h @@ -40,12 +40,13 @@ class VToolLine: public VDrawTool, public QGraphicsLineItem Q_OBJECT public: VToolLine(VPattern *doc, VContainer *data, quint32 id, quint32 firstPoint, quint32 secondPoint, - const QString &typeLine, const Source &typeCreation, QGraphicsItem * parent = nullptr); + const QString &typeLine, const QString &lineColor, const Source &typeCreation, + QGraphicsItem * parent = nullptr); virtual void setDialog(); static VToolLine *Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); static VToolLine *Create(const quint32 &_id, const quint32 &firstPoint, const quint32 &secondPoint, - const QString &typeLine, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, - const Document &parse, const Source &typeCreation); + const QString &typeLine, const QString &lineColor, VMainGraphicsScene *scene, + VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation); static const QString TagName; virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0); virtual int type() const {return Type;} diff --git a/src/app/tools/drawTools/vtoollineintersectaxis.cpp b/src/app/tools/drawTools/vtoollineintersectaxis.cpp index cba8df816..0dcfb7605 100644 --- a/src/app/tools/drawTools/vtoollineintersectaxis.cpp +++ b/src/app/tools/drawTools/vtoollineintersectaxis.cpp @@ -38,11 +38,11 @@ const QString VToolLineIntersectAxis::ToolType = QStringLiteral("lineIntersectAx //--------------------------------------------------------------------------------------------------------------------- VToolLineIntersectAxis::VToolLineIntersectAxis(VPattern *doc, VContainer *data, const quint32 &id, - const QString &typeLine, const QString &formulaAngle, - const quint32 &basePointId, const quint32 &firstPointId, - const quint32 &secondPointId, const Source &typeCreation, - QGraphicsItem *parent) - :VToolLinePoint(doc, data, id, typeLine, QString(), basePointId, 0, parent), formulaAngle(formulaAngle), + const QString &typeLine, const QString &lineColor, + const QString &formulaAngle, const quint32 &basePointId, + const quint32 &firstPointId, const quint32 &secondPointId, + const Source &typeCreation, QGraphicsItem *parent) + :VToolLinePoint(doc, data, id, typeLine, lineColor, QString(), basePointId, 0, parent), formulaAngle(formulaAngle), firstPointId(firstPointId), secondPointId(secondPointId) { if (typeCreation == Source::FromGui) @@ -85,14 +85,15 @@ VToolLineIntersectAxis *VToolLineIntersectAxis::Create(DialogTool *dialog, VMain SCASSERT(dialogTool); const QString pointName = dialogTool->getPointName(); const QString typeLine = dialogTool->GetTypeLine(); + const QString lineColor = dialogTool->GetLineColor(); QString formulaAngle = dialogTool->GetAngle(); const quint32 basePointId = dialogTool->GetBasePointId(); const quint32 firstPointId = dialogTool->GetFirstPointId(); const quint32 secondPointId = dialogTool->GetSecondPointId(); VToolLineIntersectAxis *point = nullptr; - point=Create(0, pointName, typeLine, formulaAngle, basePointId, firstPointId, secondPointId, 5, 10, scene, doc, - data, Document::FullParse, Source::FromGui); + point=Create(0, pointName, typeLine, lineColor, formulaAngle, basePointId, firstPointId, secondPointId, 5, 10, + scene, doc, data, Document::FullParse, Source::FromGui); if (point != nullptr) { point->dialog=dialogTool; @@ -102,11 +103,12 @@ VToolLineIntersectAxis *VToolLineIntersectAxis::Create(DialogTool *dialog, VMain //--------------------------------------------------------------------------------------------------------------------- VToolLineIntersectAxis *VToolLineIntersectAxis::Create(const quint32 _id, const QString &pointName, - const QString &typeLine, QString &formulaAngle, - const quint32 &basePointId, const quint32 &firstPointId, - const quint32 &secondPointId, const qreal &mx, const qreal &my, - VMainGraphicsScene *scene, VPattern *doc, VContainer *data, - const Document &parse, const Source &typeCreation) + const QString &typeLine, const QString &lineColor, + QString &formulaAngle, const quint32 &basePointId, + const quint32 &firstPointId, const quint32 &secondPointId, + const qreal &mx, const qreal &my, VMainGraphicsScene *scene, + VPattern *doc, VContainer *data, const Document &parse, + const Source &typeCreation) { const QSharedPointer basePoint = data->GeometricObject(basePointId); QLineF axis = QLineF(basePoint->toQPointF(), QPointF(basePoint->x()+100, basePoint->y())); @@ -139,7 +141,7 @@ VToolLineIntersectAxis *VToolLineIntersectAxis::Create(const quint32 _id, const VDrawTool::AddRecord(id, Tool::LineIntersectAxis, doc); if (parse == Document::FullParse) { - VToolLineIntersectAxis *point = new VToolLineIntersectAxis(doc, data, id, typeLine, formulaAngle, + VToolLineIntersectAxis *point = new VToolLineIntersectAxis(doc, data, id, typeLine, lineColor, formulaAngle, basePointId, firstPointId, secondPointId, typeCreation); scene->addItem(point); diff --git a/src/app/tools/drawTools/vtoollineintersectaxis.h b/src/app/tools/drawTools/vtoollineintersectaxis.h index 509aff461..6a8d0da17 100644 --- a/src/app/tools/drawTools/vtoollineintersectaxis.h +++ b/src/app/tools/drawTools/vtoollineintersectaxis.h @@ -36,15 +36,16 @@ class VToolLineIntersectAxis : public VToolLinePoint Q_OBJECT public: VToolLineIntersectAxis(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, - const QString &formulaAngle, const quint32 &basePointId, const quint32 &firstPointId, - const quint32 &secondPointId, const Source &typeCreation, QGraphicsItem * parent = nullptr); + const QString &lineColor, const QString &formulaAngle, const quint32 &basePointId, + const quint32 &firstPointId, const quint32 &secondPointId, const Source &typeCreation, + QGraphicsItem * parent = nullptr); virtual ~VToolLineIntersectAxis(); virtual void setDialog(); static VToolLineIntersectAxis *Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); static VToolLineIntersectAxis *Create(const quint32 _id, const QString &pointName, const QString &typeLine, - QString &formulaAngle, const quint32 &basePointId, + const QString &lineColor, QString &formulaAngle, const quint32 &basePointId, const quint32 &firstPointId, const quint32 &secondPointId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation); diff --git a/src/app/tools/drawTools/vtoollinepoint.cpp b/src/app/tools/drawTools/vtoollinepoint.cpp index 5862a677e..0de9db82b 100644 --- a/src/app/tools/drawTools/vtoollinepoint.cpp +++ b/src/app/tools/drawTools/vtoollinepoint.cpp @@ -36,18 +36,20 @@ * @param data container with variables. * @param id object id in container. * @param typeLine line type. + * @param lineColor line color. * @param formula string with length formula. * @param basePointId id base line point. * @param angle line angle. * @param parent parent object. */ -VToolLinePoint::VToolLinePoint(VPattern *doc, VContainer *data, const quint32 &id, - const QString &typeLine, const QString &formula, const quint32 &basePointId, +VToolLinePoint::VToolLinePoint(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, + const QString &lineColor, const QString &formula, const quint32 &basePointId, const qreal &angle, QGraphicsItem *parent) - :VToolPoint(doc, data, id, parent), formulaLength(formula), angle(angle), basePointId(basePointId), + :VToolPoint(doc, data, id, parent), formulaLength(formula), angle(angle), basePointId(basePointId), mainLine(nullptr) { this->typeLine = typeLine; + this->lineColor = lineColor; Q_ASSERT_X(basePointId > 0, Q_FUNC_INFO, "basePointId <= 0"); QPointF point1 = data->GeometricObject(basePointId)->toQPointF(); QPointF point2 = data->GeometricObject(id)->toQPointF(); diff --git a/src/app/tools/drawTools/vtoollinepoint.h b/src/app/tools/drawTools/vtoollinepoint.h index 7b57dfbfd..eded33065 100644 --- a/src/app/tools/drawTools/vtoollinepoint.h +++ b/src/app/tools/drawTools/vtoollinepoint.h @@ -39,7 +39,7 @@ class VToolLinePoint : public VToolPoint { Q_OBJECT public: - VToolLinePoint(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &formula, + VToolLinePoint(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &lineColor, const QString &formula, const quint32 &basePointId, const qreal &angle, QGraphicsItem * parent = nullptr); virtual ~VToolLinePoint(); virtual int type() const {return Type;} diff --git a/src/app/tools/drawTools/vtoolnormal.cpp b/src/app/tools/drawTools/vtoolnormal.cpp index 253482fb8..2a083aaa4 100644 --- a/src/app/tools/drawTools/vtoolnormal.cpp +++ b/src/app/tools/drawTools/vtoolnormal.cpp @@ -49,9 +49,10 @@ const QString VToolNormal::ToolType = QStringLiteral("normal"); * @param parent parent object. */ VToolNormal::VToolNormal(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, - const QString &formula, const qreal &angle, const quint32 &firstPointId, - const quint32 &secondPointId, const Source &typeCreation, QGraphicsItem *parent) - :VToolLinePoint(doc, data, id, typeLine, formula, firstPointId, angle, parent), + const QString &lineColor, const QString &formula, const qreal &angle, + const quint32 &firstPointId, const quint32 &secondPointId, const Source &typeCreation, + QGraphicsItem *parent) + :VToolLinePoint(doc, data, id, typeLine, lineColor, formula, firstPointId, angle, parent), secondPointId(secondPointId) { @@ -100,11 +101,12 @@ VToolNormal* VToolNormal::Create(DialogTool *dialog, VMainGraphicsScene *scene, const quint32 firstPointId = dialogTool->GetFirstPointId(); const quint32 secondPointId = dialogTool->GetSecondPointId(); const QString typeLine = dialogTool->GetTypeLine(); + const QString lineColor = dialogTool->GetLineColor(); const QString pointName = dialogTool->getPointName(); const qreal angle = dialogTool->GetAngle(); VToolNormal *point = nullptr; - point=Create(0, formula, firstPointId, secondPointId, typeLine, pointName, angle, 5, 10, scene, doc, data, - Document::FullParse, Source::FromGui); + point=Create(0, formula, firstPointId, secondPointId, typeLine, lineColor, pointName, angle, 5, 10, scene, doc, + data, Document::FullParse, Source::FromGui); if (point != nullptr) { point->dialog=dialogTool; @@ -131,10 +133,10 @@ VToolNormal* VToolNormal::Create(DialogTool *dialog, VMainGraphicsScene *scene, * @param typeCreation way we create this tool. */ VToolNormal* VToolNormal::Create(const quint32 _id, QString &formula, const quint32 &firstPointId, - const quint32 &secondPointId, const QString &typeLine, const QString &pointName, - const qreal angle, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, - VPattern *doc, VContainer *data, const Document &parse, - const Source &typeCreation) + const quint32 &secondPointId, const QString &typeLine, const QString &lineColor, + const QString &pointName, const qreal angle, const qreal &mx, const qreal &my, + VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, + const Source &typeCreation) { const QSharedPointer firstPoint = data->GeometricObject(firstPointId); const QSharedPointer secondPoint = data->GeometricObject(secondPointId); @@ -161,8 +163,8 @@ VToolNormal* VToolNormal::Create(const quint32 _id, QString &formula, const quin VDrawTool::AddRecord(id, Tool::Normal, doc); if (parse == Document::FullParse) { - VToolNormal *point = new VToolNormal(doc, data, id, typeLine, formula, angle, - firstPointId, secondPointId, typeCreation); + VToolNormal *point = new VToolNormal(doc, data, id, typeLine, lineColor, formula, angle, firstPointId, + secondPointId, typeCreation); scene->addItem(point); connect(point, &VToolNormal::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolNormal::SetFactor); diff --git a/src/app/tools/drawTools/vtoolnormal.h b/src/app/tools/drawTools/vtoolnormal.h index 98ca15d5f..6595e895e 100644 --- a/src/app/tools/drawTools/vtoolnormal.h +++ b/src/app/tools/drawTools/vtoolnormal.h @@ -38,15 +38,16 @@ class VToolNormal : public VToolLinePoint { Q_OBJECT public: - VToolNormal(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &formula, - const qreal &angle, const quint32 &firstPointId, const quint32 &secondPointId, + VToolNormal(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &lineColor, + const QString &formula, const qreal &angle, const quint32 &firstPointId, const quint32 &secondPointId, const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual void setDialog(); static VToolNormal* Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); static VToolNormal* Create(const quint32 _id, QString &formula, const quint32 &firstPointId, - const quint32 &secondPointId, const QString &typeLine, const QString &pointName, - const qreal angle, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, - VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation); + const quint32 &secondPointId, const QString &typeLine, const QString &lineColor, + const QString &pointName, const qreal angle, const qreal &mx, const qreal &my, + VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, + const Source &typeCreation); static QPointF FindPoint(const QPointF &firstPoint, const QPointF &secondPoint, const qreal &length, const qreal &angle = 0); static const QString ToolType; diff --git a/src/app/tools/drawTools/vtoolshoulderpoint.cpp b/src/app/tools/drawTools/vtoolshoulderpoint.cpp index 7f5c09764..540f474ea 100644 --- a/src/app/tools/drawTools/vtoolshoulderpoint.cpp +++ b/src/app/tools/drawTools/vtoolshoulderpoint.cpp @@ -49,10 +49,11 @@ const QString VToolShoulderPoint::ToolType = QStringLiteral("shoulder"); * @param parent parent object. */ VToolShoulderPoint::VToolShoulderPoint(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, - const QString &formula, const quint32 &p1Line, const quint32 &p2Line, - const quint32 &pShoulder, const Source &typeCreation, + const QString &lineColor, const QString &formula, const quint32 &p1Line, + const quint32 &p2Line, const quint32 &pShoulder, const Source &typeCreation, QGraphicsItem * parent) - :VToolLinePoint(doc, data, id, typeLine, formula, p1Line, 0, parent), p2Line(p2Line), pShoulder(pShoulder) + :VToolLinePoint(doc, data, id, typeLine, lineColor, formula, p1Line, 0, parent), p2Line(p2Line), + pShoulder(pShoulder) { if (typeCreation == Source::FromGui) { @@ -140,10 +141,11 @@ VToolShoulderPoint* VToolShoulderPoint::Create(DialogTool *dialog, VMainGraphics const quint32 p2Line = dialogTool->GetP2Line(); const quint32 pShoulder = dialogTool->GetP3(); const QString typeLine = dialogTool->GetTypeLine(); + const QString lineColor = dialogTool->GetLineColor(); const QString pointName = dialogTool->getPointName(); VToolShoulderPoint * point = nullptr; - point=Create(0, formula, p1Line, p2Line, pShoulder, typeLine, pointName, 5, 10, scene, doc, data, - Document::FullParse, Source::FromGui); + point=Create(0, formula, p1Line, p2Line, pShoulder, typeLine, lineColor, pointName, 5, 10, scene, doc, data, + Document::FullParse, Source::FromGui); if (point != nullptr) { point->dialog=dialogTool; @@ -171,7 +173,7 @@ VToolShoulderPoint* VToolShoulderPoint::Create(DialogTool *dialog, VMainGraphics * @return the created tool */ VToolShoulderPoint* VToolShoulderPoint::Create(const quint32 _id, QString &formula, const quint32 &p1Line, - const quint32 &p2Line, const quint32 &pShoulder, const QString &typeLine, + const quint32 &p2Line, const quint32 &pShoulder, const QString &typeLine, const QString &lineColor, const QString &pointName, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) @@ -204,7 +206,7 @@ VToolShoulderPoint* VToolShoulderPoint::Create(const quint32 _id, QString &formu VDrawTool::AddRecord(id, Tool::ShoulderPoint, doc); if (parse == Document::FullParse) { - VToolShoulderPoint *point = new VToolShoulderPoint(doc, data, id, typeLine, formula, + VToolShoulderPoint *point = new VToolShoulderPoint(doc, data, id, typeLine, lineColor, formula, p1Line, p2Line, pShoulder, typeCreation); scene->addItem(point); diff --git a/src/app/tools/drawTools/vtoolshoulderpoint.h b/src/app/tools/drawTools/vtoolshoulderpoint.h index 82da45e33..1af8391b4 100644 --- a/src/app/tools/drawTools/vtoolshoulderpoint.h +++ b/src/app/tools/drawTools/vtoolshoulderpoint.h @@ -40,16 +40,17 @@ class VToolShoulderPoint : public VToolLinePoint Q_OBJECT public: VToolShoulderPoint(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, - const QString &formula, const quint32 &p1Line, const quint32 &p2Line, const quint32 &pShoulder, - const Source &typeCreation, QGraphicsItem * parent = nullptr); + const QString &lineColor, const QString &formula, const quint32 &p1Line, const quint32 &p2Line, + const quint32 &pShoulder, const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual void setDialog(); static QPointF FindPoint(const QPointF &p1Line, const QPointF &p2Line, const QPointF &pShoulder, const qreal &length); static VToolShoulderPoint* Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); static VToolShoulderPoint* Create(const quint32 _id, QString &formula, const quint32 &p1Line, const quint32 &p2Line, - const quint32 &pShoulder, const QString &typeLine, const QString &pointName, - const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, - VContainer *data, const Document &parse, const Source &typeCreation); + const quint32 &pShoulder, const QString &typeLine, const QString &lineColor, + const QString &pointName, const qreal &mx, const qreal &my, + VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, + const Source &typeCreation); static const QString ToolType; virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::ShoulderPoint) }; diff --git a/src/app/tools/drawTools/vtoolspline.cpp b/src/app/tools/drawTools/vtoolspline.cpp index 70e951d32..ce50c27a0 100644 --- a/src/app/tools/drawTools/vtoolspline.cpp +++ b/src/app/tools/drawTools/vtoolspline.cpp @@ -43,11 +43,12 @@ const QString VToolSpline::ToolType = QStringLiteral("simple"); * @param typeCreation way we create this tool. * @param parent parent object. */ -VToolSpline::VToolSpline(VPattern *doc, VContainer *data, quint32 id, const Source &typeCreation, +VToolSpline::VToolSpline(VPattern *doc, VContainer *data, quint32 id, const QString color, const Source &typeCreation, QGraphicsItem *parent) :VAbstractSpline(doc, data, id, parent) { sceneType = SceneObject::Spline; + lineColor = color; this->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine())/factor)); this->setFlag(QGraphicsItem::ItemIsSelectable, true); @@ -129,8 +130,9 @@ VToolSpline* VToolSpline::Create(DialogTool *dialog, VMainGraphicsScene *scene, const qreal angle1 = dialogTool->GetAngle1(); const qreal angle2 = dialogTool->GetAngle2(); const qreal kCurve = dialogTool->GetKCurve(); + const QString color = dialogTool->GetColor(); VToolSpline *spl = nullptr; - spl = Create(0, p1, p4, kAsm1, kAsm2, angle1, angle2, kCurve, scene, doc, data, Document::FullParse, + spl = Create(0, p1, p4, kAsm1, kAsm2, angle1, angle2, kCurve, color, scene, doc, data, Document::FullParse, Source::FromGui); if (spl != nullptr) { @@ -159,7 +161,7 @@ VToolSpline* VToolSpline::Create(DialogTool *dialog, VMainGraphicsScene *scene, */ VToolSpline* VToolSpline::Create(const quint32 _id, const quint32 &p1, const quint32 &p4, const qreal &kAsm1, const qreal kAsm2, const qreal &angle1, const qreal &angle2, const qreal &kCurve, - VMainGraphicsScene *scene, VPattern *doc, VContainer *data, + const QString &color, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) { VPointF point1 = *data->GeometricObject(p1); @@ -183,7 +185,7 @@ VToolSpline* VToolSpline::Create(const quint32 _id, const quint32 &p1, const qui VDrawTool::AddRecord(id, Tool::Spline, doc); if (parse == Document::FullParse) { - VToolSpline *spl = new VToolSpline(doc, data, id, typeCreation); + VToolSpline *spl = new VToolSpline(doc, data, id, color, typeCreation); scene->addItem(spl); connect(spl, &VToolSpline::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, spl, &VToolSpline::SetFactor); @@ -359,7 +361,7 @@ void VToolSpline::SaveOptions(QDomElement &tag, QSharedPointer &obj) */ void VToolSpline::RefreshGeometry() { - this->setPen(QPen(CorrectColor(baseColor), qApp->toPixel(qApp->widthHairLine())/factor)); + this->setPen(QPen(CorrectColor(lineColor), qApp->toPixel(qApp->widthHairLine())/factor)); if (isHovered) { this->setPath(ToolPath(PathDirection::Show)); diff --git a/src/app/tools/drawTools/vtoolspline.h b/src/app/tools/drawTools/vtoolspline.h index 214b14687..b10345fd6 100644 --- a/src/app/tools/drawTools/vtoolspline.h +++ b/src/app/tools/drawTools/vtoolspline.h @@ -38,14 +38,14 @@ class VToolSpline:public VAbstractSpline { Q_OBJECT public: - VToolSpline (VPattern *doc, VContainer *data, quint32 id, const Source &typeCreation, + VToolSpline (VPattern *doc, VContainer *data, quint32 id, const QString color, const Source &typeCreation, QGraphicsItem * parent = nullptr ); virtual ~VToolSpline(); virtual void setDialog(); static VToolSpline *Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); static VToolSpline *Create(const quint32 _id, const quint32 &p1, const quint32 &p4, const qreal &kAsm1, const qreal kAsm2, const qreal &angle1, const qreal &angle2, const qreal &kCurve, - VMainGraphicsScene *scene, VPattern *doc, VContainer *data, + const QString &color, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation); static const QString ToolType; virtual int type() const {return Type;} diff --git a/src/app/tools/drawTools/vtoolsplinepath.cpp b/src/app/tools/drawTools/vtoolsplinepath.cpp index a45f68163..7c82241a8 100644 --- a/src/app/tools/drawTools/vtoolsplinepath.cpp +++ b/src/app/tools/drawTools/vtoolsplinepath.cpp @@ -42,8 +42,8 @@ const QString VToolSplinePath::ToolType = QStringLiteral("path"); * @param typeCreation way we create this tool. * @param parent parent object. */ -VToolSplinePath::VToolSplinePath(VPattern *doc, VContainer *data, quint32 id, const Source &typeCreation, - QGraphicsItem *parent) +VToolSplinePath::VToolSplinePath(VPattern *doc, VContainer *data, quint32 id, const QString &color, + const Source &typeCreation, QGraphicsItem *parent) :VAbstractSpline(doc, data, id, parent) { sceneType = SceneObject::SplinePath; @@ -115,12 +115,13 @@ VToolSplinePath* VToolSplinePath::Create(DialogTool *dialog, VMainGraphicsScene DialogSplinePath *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); VSplinePath *path = new VSplinePath(dialogTool->GetPath()); + const QString color = dialogTool->GetColor(); for (qint32 i = 0; i < path->CountPoint(); ++i) { doc->IncrementReferens((*path)[i].P().id()); } VToolSplinePath* spl = nullptr; - spl = Create(0, path, scene, doc, data, Document::FullParse, Source::FromGui); + spl = Create(0, path, color, scene, doc, data, Document::FullParse, Source::FromGui); if (spl != nullptr) { spl->dialog=dialogTool; @@ -139,8 +140,9 @@ VToolSplinePath* VToolSplinePath::Create(DialogTool *dialog, VMainGraphicsScene * @param parse parser file mode. * @param typeCreation way we create this tool. */ -VToolSplinePath* VToolSplinePath::Create(const quint32 _id, VSplinePath *path, VMainGraphicsScene *scene, VPattern *doc, - VContainer *data, const Document &parse, const Source &typeCreation) +VToolSplinePath* VToolSplinePath::Create(const quint32 _id, VSplinePath *path, const QString &color, + VMainGraphicsScene *scene, VPattern *doc, VContainer *data, + const Document &parse, const Source &typeCreation) { quint32 id = _id; if (typeCreation == Source::FromGui) @@ -160,7 +162,7 @@ VToolSplinePath* VToolSplinePath::Create(const quint32 _id, VSplinePath *path, V VDrawTool::AddRecord(id, Tool::SplinePath, doc); if (parse == Document::FullParse) { - VToolSplinePath *spl = new VToolSplinePath(doc, data, id, typeCreation); + VToolSplinePath *spl = new VToolSplinePath(doc, data, id, color, typeCreation); scene->addItem(spl); connect(spl, &VToolSplinePath::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, spl, &VToolSplinePath::SetFactor); @@ -426,7 +428,7 @@ void VToolSplinePath::RefreshGeometry() { this->setPath(ToolPath()); } - + this->setPen(QPen(CorrectColor(lineColor), qApp->toPixel(qApp->widthHairLine())/factor)); const QSharedPointer splPath = VAbstractTool::data.GeometricObject(id); for (qint32 i = 1; i<=splPath->Count(); ++i) { diff --git a/src/app/tools/drawTools/vtoolsplinepath.h b/src/app/tools/drawTools/vtoolsplinepath.h index 75ffbf8ef..9b3dfd3c9 100644 --- a/src/app/tools/drawTools/vtoolsplinepath.h +++ b/src/app/tools/drawTools/vtoolsplinepath.h @@ -38,12 +38,13 @@ class VToolSplinePath:public VAbstractSpline { Q_OBJECT public: - VToolSplinePath(VPattern *doc, VContainer *data, quint32 id, const Source &typeCreation, + VToolSplinePath(VPattern *doc, VContainer *data, quint32 id, const QString &color, const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual void setDialog(); static VToolSplinePath *Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); - static VToolSplinePath *Create(const quint32 _id, VSplinePath *path, VMainGraphicsScene *scene, VPattern *doc, - VContainer *data, const Document &parse, const Source &typeCreation); + static VToolSplinePath *Create(const quint32 _id, VSplinePath *path, const QString &color, + VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, + const Source &typeCreation); static const QString ToolType; static void UpdatePathPoint(VPattern *doc, QDomNode& node, const VSplinePath &path); virtual int type() const {return Type;} diff --git a/src/app/xml/vpattern.cpp b/src/app/xml/vpattern.cpp index a163d7653..358c16176 100644 --- a/src/app/xml/vpattern.cpp +++ b/src/app/xml/vpattern.cpp @@ -1088,10 +1088,11 @@ void VPattern::ParseDetails(const QDomElement &domElement, const Document &parse //--------------------------------------------------------------------------------------------------------------------- void VPattern::PointsCommonAttributes(const QDomElement &domElement, quint32 &id, QString &name, qreal &mx, qreal &my, - QString &typeLine) + QString &typeLine, QString &lineColor) { PointsCommonAttributes(domElement, id, name, mx, my); typeLine = GetParametrString(domElement, VAbstractTool::AttrTypeLine, VAbstractTool::TypeLineLine); + lineColor = GetParametrString(domElement, VAbstractTool::AttrLineColor, VAbstractTool::ColorBlack); } //--------------------------------------------------------------------------------------------------------------------- @@ -1129,6 +1130,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem qreal mx = 0; qreal my = 0; QString typeLine; + QString lineColor; QStringList points = QStringList() << VToolSinglePoint::ToolType << VToolEndLine::ToolType << VToolAlongLine::ToolType << VToolShoulderPoint::ToolType @@ -1178,7 +1180,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem case 1: //VToolEndLine::ToolType try { - PointsCommonAttributes(domElement, id, name, mx, my, typeLine); + PointsCommonAttributes(domElement, id, name, mx, my, typeLine, lineColor); const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "100.0"); QString f = formula;//need for saving fixed formula; @@ -1188,8 +1190,8 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem const QString angle = GetParametrString(domElement, VAbstractTool::AttrAngle, "0.0"); QString angleFix = angle; - VToolEndLine::Create(id, name, typeLine, f, angleFix, basePointId, mx, my, scene, this, data, parse, - Source::FromFile); + VToolEndLine::Create(id, name, typeLine, lineColor, f, angleFix, basePointId, mx, my, scene, this, data, + parse, Source::FromFile); //Rewrite attribute formula. Need for situation when we have wrong formula. if (f != formula || angleFix != angle) { @@ -1214,14 +1216,14 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem case 2: //VToolAlongLine::ToolType try { - PointsCommonAttributes(domElement, id, name, mx, my, typeLine); + PointsCommonAttributes(domElement, id, name, mx, my, typeLine, lineColor); const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "100.0"); QString f = formula;//need for saving fixed formula; const quint32 firstPointId = GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, NULL_ID_STR); const quint32 secondPointId = GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, NULL_ID_STR); - VToolAlongLine::Create(id, name, typeLine, f, firstPointId, secondPointId, mx, my, scene, this, - data, parse, Source::FromFile); + VToolAlongLine::Create(id, name, typeLine, lineColor, f, firstPointId, secondPointId, mx, my, scene, + this, data, parse, Source::FromFile); //Rewrite attribute formula. Need for situation when we have wrong formula. if (f != formula) { @@ -1245,15 +1247,15 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem case 3: //VToolShoulderPoint::ToolType try { - PointsCommonAttributes(domElement, id, name, mx, my, typeLine); + PointsCommonAttributes(domElement, id, name, mx, my, typeLine, lineColor); const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "100.0"); QString f = formula;//need for saving fixed formula; const quint32 p1Line = GetParametrUInt(domElement, VAbstractTool::AttrP1Line, NULL_ID_STR); const quint32 p2Line = GetParametrUInt(domElement, VAbstractTool::AttrP2Line, NULL_ID_STR); const quint32 pShoulder = GetParametrUInt(domElement, VAbstractTool::AttrPShoulder, NULL_ID_STR); - VToolShoulderPoint::Create(id, f, p1Line, p2Line, pShoulder, typeLine, name, mx, my, scene, this, - data, parse, Source::FromFile); + VToolShoulderPoint::Create(id, f, p1Line, p2Line, pShoulder, typeLine, lineColor, name, mx, my, scene, + this, data, parse, Source::FromFile); //Rewrite attribute formula. Need for situation when we have wrong formula. if (f != formula) { @@ -1277,14 +1279,14 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem case 4: //VToolNormal::ToolType try { - PointsCommonAttributes(domElement, id, name, mx, my, typeLine); + PointsCommonAttributes(domElement, id, name, mx, my, typeLine, lineColor); const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "100.0"); QString f = formula;//need for saving fixed formula; const quint32 firstPointId = GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, NULL_ID_STR); const quint32 secondPointId = GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, NULL_ID_STR); const qreal angle = GetParametrDouble(domElement, VAbstractTool::AttrAngle, "0.0"); - VToolNormal::Create(id, f, firstPointId, secondPointId, typeLine, name, angle, mx, my, scene, + VToolNormal::Create(id, f, firstPointId, secondPointId, typeLine, lineColor, name, angle, mx, my, scene, this, data, parse, Source::FromFile); //Rewrite attribute formula. Need for situation when we have wrong formula. if (f != formula) @@ -1309,7 +1311,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem case 5: //VToolBisector::ToolType try { - PointsCommonAttributes(domElement, id, name, mx, my, typeLine); + PointsCommonAttributes(domElement, id, name, mx, my, typeLine, lineColor); const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "100.0"); QString f = formula;//need for saving fixed formula; const quint32 firstPointId = GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, NULL_ID_STR); @@ -1317,7 +1319,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem const quint32 thirdPointId = GetParametrUInt(domElement, VAbstractTool::AttrThirdPoint, NULL_ID_STR); VToolBisector::Create(id, f, firstPointId, secondPointId, thirdPointId, - typeLine, name, mx, my, scene, this, data, parse, Source::FromFile); + typeLine, lineColor, name, mx, my, scene, this, data, parse, Source::FromFile); //Rewrite attribute formula. Need for situation when we have wrong formula. if (f != formula) { @@ -1410,12 +1412,12 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem case 9: //VToolHeight::ToolType try { - PointsCommonAttributes(domElement, id, name, mx, my, typeLine); + PointsCommonAttributes(domElement, id, name, mx, my, typeLine, lineColor); const quint32 basePointId = GetParametrUInt(domElement, VAbstractTool::AttrBasePoint, NULL_ID_STR); const quint32 p1LineId = GetParametrUInt(domElement, VAbstractTool::AttrP1Line, NULL_ID_STR); const quint32 p2LineId = GetParametrUInt(domElement, VAbstractTool::AttrP2Line, NULL_ID_STR); - VToolHeight::Create(id, name, typeLine, basePointId, p1LineId, p2LineId, + VToolHeight::Create(id, name, typeLine, lineColor, basePointId, p1LineId, p2LineId, mx, my, scene, this, data, parse, Source::FromFile); } catch (const VExceptionBadId &e) @@ -1553,7 +1555,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem case 15: //VToolLineIntersectAxis::ToolType try { - PointsCommonAttributes(domElement, id, name, mx, my, typeLine); + PointsCommonAttributes(domElement, id, name, mx, my, typeLine, lineColor); const quint32 basePointId = GetParametrUInt(domElement, VAbstractTool::AttrBasePoint, NULL_ID_STR); const quint32 firstPointId = GetParametrUInt(domElement, VAbstractTool::AttrP1Line, NULL_ID_STR); @@ -1562,8 +1564,8 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem const QString angle = GetParametrString(domElement, VAbstractTool::AttrAngle, "0.0"); QString angleFix = angle; - VToolLineIntersectAxis::Create(id, name, typeLine, angleFix, basePointId, firstPointId, secondPointId, - mx, my, scene, this, data, parse, Source::FromFile); + VToolLineIntersectAxis::Create(id, name, typeLine, lineColor, angleFix, basePointId, firstPointId, + secondPointId, mx, my, scene, this, data, parse, Source::FromFile); //Rewrite attribute formula. Need for situation when we have wrong formula. if (angleFix != angle) { @@ -1589,15 +1591,15 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem case 16: //VToolCurveIntersectAxis::ToolType try { - PointsCommonAttributes(domElement, id, name, mx, my, typeLine); + PointsCommonAttributes(domElement, id, name, mx, my, typeLine, lineColor); const quint32 basePointId = GetParametrUInt(domElement, VAbstractTool::AttrBasePoint, NULL_ID_STR); const quint32 curveId = GetParametrUInt(domElement, VAbstractTool::AttrCurve, NULL_ID_STR); const QString angle = GetParametrString(domElement, VAbstractTool::AttrAngle, "0.0"); QString angleFix = angle; - VToolCurveIntersectAxis::Create(id, name, typeLine, angleFix, basePointId, curveId, mx, my, scene, this, - data, parse, Source::FromFile); + VToolCurveIntersectAxis::Create(id, name, typeLine, lineColor, angleFix, basePointId, curveId, mx, my, + scene, this, data, parse, Source::FromFile); //Rewrite attribute formula. Need for situation when we have wrong formula. if (angleFix != angle) { @@ -1646,8 +1648,10 @@ void VPattern::ParseLineElement(VMainGraphicsScene *scene, const QDomElement &do const quint32 secondPoint = GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, NULL_ID_STR); const QString typeLine = GetParametrString(domElement, VAbstractTool::AttrTypeLine, VAbstractTool::TypeLineLine); + const QString lineColor = GetParametrString(domElement, VAbstractTool::AttrLineColor, + VAbstractTool::ColorBlack); - VToolLine::Create(id, firstPoint, secondPoint, typeLine, scene, this, data, parse, Source::FromFile); + VToolLine::Create(id, firstPoint, secondPoint, typeLine, lineColor, scene, this, data, parse, Source::FromFile); } catch (const VExceptionBadId &e) { @@ -1855,9 +1859,11 @@ void VPattern::ParseSplineElement(VMainGraphicsScene *scene, const QDomElement & const qreal kAsm1 = GetParametrDouble(domElement, VAbstractTool::AttrKAsm1, "1.0"); const qreal kAsm2 = GetParametrDouble(domElement, VAbstractTool::AttrKAsm2, "1.0"); const qreal kCurve = GetParametrDouble(domElement, VAbstractTool::AttrKCurve, "1.0"); + const QString color = GetParametrString(domElement, VAbstractTool::AttrColor, + VAbstractTool::ColorBlack); - VToolSpline::Create(id, point1, point4, kAsm1, kAsm2, angle1, angle2, kCurve, scene, this, data, parse, - Source::FromFile); + VToolSpline::Create(id, point1, point4, kAsm1, kAsm2, angle1, angle2, kCurve, color, scene, this, data, + parse, Source::FromFile); } catch (const VExceptionBadId &e) { @@ -1872,6 +1878,8 @@ void VPattern::ParseSplineElement(VMainGraphicsScene *scene, const QDomElement & { ToolsCommonAttributes(domElement, id); const qreal kCurve = GetParametrDouble(domElement, VAbstractTool::AttrKCurve, "1.0"); + const QString color = GetParametrString(domElement, VAbstractTool::AttrColor, + VAbstractTool::ColorBlack); VSplinePath *path = new VSplinePath(kCurve); const QDomNodeList nodeList = domElement.childNodes(); @@ -1902,7 +1910,7 @@ void VPattern::ParseSplineElement(VMainGraphicsScene *scene, const QDomElement & } } - VToolSplinePath::Create(id, path, scene, this, data, parse, Source::FromFile); + VToolSplinePath::Create(id, path, color, scene, this, data, parse, Source::FromFile); } catch (const VExceptionBadId &e) { @@ -1984,8 +1992,10 @@ void VPattern::ParseArcElement(VMainGraphicsScene *scene, QDomElement &domElemen QString f1Fix = f1;//need for saving fixed formula; const QString f2 = GetParametrString(domElement, VAbstractTool::AttrAngle2, "270"); QString f2Fix = f2;//need for saving fixed formula; + const QString color = GetParametrString(domElement, VAbstractTool::AttrColor, + VAbstractTool::ColorBlack); - VToolArc::Create(id, center, r, f1Fix, f2Fix, scene, this, data, parse, Source::FromFile); + VToolArc::Create(id, center, r, f1Fix, f2Fix, color, scene, this, data, parse, Source::FromFile); //Rewrite attribute formula. Need for situation when we have wrong formula. if (r != radius || f1Fix != f1 || f2Fix != f2) { diff --git a/src/app/xml/vpattern.h b/src/app/xml/vpattern.h index 439d5c0be..5642d2366 100644 --- a/src/app/xml/vpattern.h +++ b/src/app/xml/vpattern.h @@ -267,7 +267,7 @@ private: void UpdateMeasurements(); void ToolsCommonAttributes(const QDomElement &domElement, quint32 &id); void PointsCommonAttributes(const QDomElement &domElement, quint32 &id, QString &name, qreal &mx, - qreal &my, QString &typeLine); + qreal &my, QString &typeLine, QString &lineColor); void PointsCommonAttributes(const QDomElement &domElement, quint32 &id, QString &name, qreal &mx, qreal &my); void PointsCommonAttributes(const QDomElement &domElement, quint32 &id, qreal &mx, qreal &my); From 805100ec0f1d127cf913edf656db6e8355ae5b39 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 7 Feb 2015 14:31:10 +0200 Subject: [PATCH 114/186] Generate translated color names list. Need for property browser. --HG-- branch : feature --- src/app/dialogs/tools/dialogtool.cpp | 40 ++++---------------------- src/app/tools/vabstracttool.cpp | 42 ++++++++++++++++++++++++++++ src/app/tools/vabstracttool.h | 3 +- 3 files changed, 50 insertions(+), 35 deletions(-) diff --git a/src/app/dialogs/tools/dialogtool.cpp b/src/app/dialogs/tools/dialogtool.cpp index 3a12c7f50..5a2e56623 100644 --- a/src/app/dialogs/tools/dialogtool.cpp +++ b/src/app/dialogs/tools/dialogtool.cpp @@ -306,42 +306,14 @@ void DialogTool::FillComboBoxLineColors(QComboBox *box) const { SCASSERT(box != nullptr); - const QStringList colorNames = VAbstractTool::Colors(); - - for (int i = 0; i < colorNames.size(); ++i) + const QMap map = VAbstractTool::ColorsList(); + QMap::const_iterator i = map.constBegin(); + while (i != map.constEnd()) { - QString name; - switch (i) - { - case 0: // ColorBlack - name = tr("black"); - break; - case 1: // ColorGreen - name = tr("green"); - break; - case 2: // ColorBlue - name = tr("blue"); - break; - case 3: // ColorDarkRed - name = tr("dark red"); - break; - case 4: // ColorDarkGreen - name = tr("dark green"); - break; - case 5: // ColorDarkBlue - name = tr("dark blue"); - break; - case 6: // ColorYellow - name = tr("yellow"); - break; - default: - name = tr("black"); - break; - } - QPixmap pix(16, 16); - pix.fill(QColor(colorNames.at(i))); - box->insertItem(i, QIcon(pix), name, QVariant(colorNames.at(i))); + pix.fill(QColor(i.key())); + box->addItem(QIcon(pix), i.value(), QVariant(i.key())); + ++i; } } diff --git a/src/app/tools/vabstracttool.cpp b/src/app/tools/vabstracttool.cpp index 216803dc1..194c5b5c7 100644 --- a/src/app/tools/vabstracttool.cpp +++ b/src/app/tools/vabstracttool.cpp @@ -231,6 +231,48 @@ const QStringList VAbstractTool::Colors() return colors; } +//--------------------------------------------------------------------------------------------------------------------- +QMap VAbstractTool::ColorsList() +{ + QMap map; + + const QStringList colorNames = Colors(); + for (int i = 0; i < colorNames.size(); ++i) + { + QString name; + switch (i) + { + case 0: // ColorBlack + name = tr("black"); + break; + case 1: // ColorGreen + name = tr("green"); + break; + case 2: // ColorBlue + name = tr("blue"); + break; + case 3: // ColorDarkRed + name = tr("dark red"); + break; + case 4: // ColorDarkGreen + name = tr("dark green"); + break; + case 5: // ColorDarkBlue + name = tr("dark blue"); + break; + case 6: // ColorYellow + name = tr("yellow"); + break; + default: + name = tr("black"); + break; + } + + map.insert(colorNames.at(i), name); + } + return map; +} + //--------------------------------------------------------------------------------------------------------------------- QMap VAbstractTool::PointsList() const { diff --git a/src/app/tools/vabstracttool.h b/src/app/tools/vabstracttool.h index 406bf57c8..0212b5692 100644 --- a/src/app/tools/vabstracttool.h +++ b/src/app/tools/vabstracttool.h @@ -108,7 +108,8 @@ public: static Qt::PenStyle LineStyleToPenStyle(const QString &typeLine); static QMap LineStylesPics(); - static const QStringList Colors(); + static const QStringList Colors(); + static QMap ColorsList(); static void AddRecord(const quint32 id, const Tool &toolType, VPattern *doc); From 6d638a30805b82bf2109affa823751560ead0fa0 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 7 Feb 2015 15:18:08 +0200 Subject: [PATCH 115/186] Class that show line colors. --HG-- branch : feature --- .../plugins/vlinecolorproperty.cpp | 170 ++++++++++++++++++ .../plugins/vlinecolorproperty.h | 100 +++++++++++ .../vpropertyexplorer/vpropertyexplorer.pri | 6 +- 3 files changed, 274 insertions(+), 2 deletions(-) create mode 100644 src/libs/vpropertyexplorer/plugins/vlinecolorproperty.cpp create mode 100644 src/libs/vpropertyexplorer/plugins/vlinecolorproperty.h diff --git a/src/libs/vpropertyexplorer/plugins/vlinecolorproperty.cpp b/src/libs/vpropertyexplorer/plugins/vlinecolorproperty.cpp new file mode 100644 index 000000000..f4fce1de4 --- /dev/null +++ b/src/libs/vpropertyexplorer/plugins/vlinecolorproperty.cpp @@ -0,0 +1,170 @@ +/************************************************************************ + ** + ** @file vlinecolorproperty.cpp + ** @author Roman Telezhynskyi + ** @date 7 2, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#include "vlinecolorproperty.h" +#include "../vproperty_p.h" + +#include +#include + +using namespace VPE; + +VLineColorProperty::VLineColorProperty(const QString &name) + : VProperty(name, QVariant::Int), colors(), indexList() +{ + VProperty::d_ptr->VariantValue = 0; + VProperty::d_ptr->VariantValue.convert(QVariant::Int); +} + +QVariant VLineColorProperty::data(int column, int role) const +{ + if (colors.empty()) + { + return QVariant(); + } + + int tmpIndex = VProperty::d_ptr->VariantValue.toInt(); + + if (tmpIndex < 0 || tmpIndex >= indexList.count()) + { + tmpIndex = 0; + } + + if (column == DPC_Data && Qt::DisplayRole == role) + { + return indexList.at(tmpIndex); + } + else if (column == DPC_Data && Qt::EditRole == role) + { + return tmpIndex; + } + else + { + return VProperty::data(column, role); + } +} + +QWidget *VLineColorProperty::createEditor(QWidget *parent, const QStyleOptionViewItem &options, + const QAbstractItemDelegate *delegate) +{ + Q_UNUSED(options); + Q_UNUSED(delegate); + QComboBox* tmpEditor = new QComboBox(parent); + tmpEditor->clear(); + + QMap::const_iterator i = colors.constBegin(); + while (i != colors.constEnd()) + { + QPixmap pix(16, 16); + pix.fill(QColor(i.key())); + tmpEditor->addItem(QIcon(pix), i.value(), QVariant(i.key())); + ++i; + } + + tmpEditor->setCurrentIndex(VProperty::d_ptr->VariantValue.toInt()); + connect(tmpEditor, static_cast(&QComboBox::currentIndexChanged), this, + &VLineColorProperty::currentIndexChanged); + + VProperty::d_ptr->editor = tmpEditor; + return VProperty::d_ptr->editor; +} + +QVariant VLineColorProperty::getEditorData(const QWidget *editor) const +{ + const QComboBox* tmpEditor = qobject_cast(editor); + if (tmpEditor) + { + return tmpEditor->currentIndex(); + } + + return QVariant(0); +} + +void VLineColorProperty::setColors(const QMap &colors) +{ + this->colors = colors; + indexList.clear(); + QMap::const_iterator i = colors.constBegin(); + while (i != colors.constEnd()) + { + indexList.append(i.key()); + ++i; + } +} + +QMap VLineColorProperty::getColors() const +{ + return colors; +} + +void VLineColorProperty::setValue(const QVariant &value) +{ + int tmpIndex = value.toInt(); + + if (tmpIndex < 0 || tmpIndex >= indexList.count()) + { + tmpIndex = 0; + } + + VProperty::d_ptr->VariantValue = tmpIndex; + VProperty::d_ptr->VariantValue.convert(QVariant::Int); + + if (VProperty::d_ptr->editor != nullptr) + { + setEditorData(VProperty::d_ptr->editor); + } +} + +QString VLineColorProperty::type() const +{ + return QStringLiteral("lineColor"); +} + +VProperty *VLineColorProperty::clone(bool include_children, VProperty *container) const +{ + return VProperty::clone(include_children, container ? container : new VLineColorProperty(getName())); +} + +int VLineColorProperty::IndexOfColor(const QMap &colors, const QString &color) +{ + QVector indexList; + QMap::const_iterator i = colors.constBegin(); + while (i != colors.constEnd()) + { + indexList.append(i.key()); + ++i; + } + return indexList.indexOf(color); +} + +void VLineColorProperty::currentIndexChanged(int index) +{ + Q_UNUSED(index) + UserChangeEvent *event = new UserChangeEvent(); + QCoreApplication::postEvent ( VProperty::d_ptr->editor, event ); +} diff --git a/src/libs/vpropertyexplorer/plugins/vlinecolorproperty.h b/src/libs/vpropertyexplorer/plugins/vlinecolorproperty.h new file mode 100644 index 000000000..416b2a1d3 --- /dev/null +++ b/src/libs/vpropertyexplorer/plugins/vlinecolorproperty.h @@ -0,0 +1,100 @@ +/************************************************************************ + ** + ** @file vlinecolorproperty.h + ** @author Roman Telezhynskyi + ** @date 7 2, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef VLINECOLORPROPERTY_H +#define VLINECOLORPROPERTY_H + +#include "../vproperty.h" + +#include +#include + +namespace VPE +{ + +class VPROPERTYEXPLORERSHARED_EXPORT VLineColorProperty : public VProperty +{ + Q_OBJECT +public: + //! Constructor + VLineColorProperty(const QString& name); + + //! Destructor + ~VLineColorProperty() {} + + //! Get the data how it should be displayed + virtual QVariant data (int column = DPC_Name, int role = Qt::DisplayRole) const; + + //! Returns an editor widget, or NULL if it doesn't supply one + //! \param parent The widget to which the editor will be added as a child + //! \options Render options + //! \delegate A pointer to the QAbstractItemDelegate requesting the editor. This can be used to connect signals and + //! slots. + virtual QWidget *createEditor(QWidget* parent, const QStyleOptionViewItem& options, + const QAbstractItemDelegate* delegate); + + //! Gets the data from the widget + virtual QVariant getEditorData(const QWidget* editor) const; + + //! Sets the colors + virtual void setColors(const QMap &colors); + + //! Get the settings. This function has to be implemented in a subclass in order to have an effect + virtual QMap getColors() const; + + //! Sets the value of the property + virtual void setValue(const QVariant& value); + + //! Returns a string containing the type of the property + virtual QString type() const; + + //! Clones this property + //! \param include_children Indicates whether to also clone the children + //! \param container If a property is being passed here, no new VProperty is being created but instead it is tried + //! to fill all the data into container. This can also be used when subclassing this function. + //! \return Returns the newly created property (or container, if it was not NULL) + virtual VProperty* clone(bool include_children = true, VProperty* container = nullptr) const; + + static int IndexOfColor(const QMap &colors, const QString &color); + +public slots: + void currentIndexChanged(int index); + +protected: + //! The list of possible options to choose from + QMap colors; + QVector indexList; + // No use of d-pointer in this case, because it is unlikely this will change. If it does, we can still add other + //members by reimplementing the VPropertyPrivate class without touching this header file. +private: + Q_DISABLE_COPY(VLineColorProperty) +}; + +} + +#endif // VLINECOLORPROPERTY_H diff --git a/src/libs/vpropertyexplorer/vpropertyexplorer.pri b/src/libs/vpropertyexplorer/vpropertyexplorer.pri index 871cff6d3..6f11c2705 100644 --- a/src/libs/vpropertyexplorer/vpropertyexplorer.pri +++ b/src/libs/vpropertyexplorer/vpropertyexplorer.pri @@ -28,7 +28,8 @@ SOURCES += \ $$PWD/plugins/vpointfproperty.cpp \ $$PWD/plugins/vobjectproperty.cpp \ $$PWD/stable.cpp \ - $$PWD/plugins/vlinetypeproperty.cpp + $$PWD/plugins/vlinetypeproperty.cpp \ + $$PWD/plugins/vlinecolorproperty.cpp HEADERS +=\ $$PWD/vpropertyexplorer_global.h \ @@ -69,4 +70,5 @@ HEADERS +=\ $$PWD/plugins/vobjectproperty.h \ $$PWD/vproperties.h \ $$PWD/stable.h \ - $$PWD/plugins/vlinetypeproperty.h + $$PWD/plugins/vlinetypeproperty.h \ + $$PWD/plugins/vlinecolorproperty.h From 619a303e9b4ba78919b7fbbc4e7336938b432255 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 7 Feb 2015 16:42:49 +0200 Subject: [PATCH 116/186] Property explorer now show color combobox. --HG-- branch : feature --- src/app/tools/drawTools/vdrawtool.h | 2 +- src/app/tools/drawTools/vtoolline.cpp | 9 ++ src/app/tools/drawTools/vtoolline.h | 2 + .../widgets/vtooloptionspropertybrowser.cpp | 140 +++++++++++++++++- src/app/widgets/vtooloptionspropertybrowser.h | 4 + src/libs/vpropertyexplorer/vproperties.h | 1 + 6 files changed, 156 insertions(+), 2 deletions(-) diff --git a/src/app/tools/drawTools/vdrawtool.h b/src/app/tools/drawTools/vdrawtool.h index 1e4025f70..8a412a7b3 100644 --- a/src/app/tools/drawTools/vdrawtool.h +++ b/src/app/tools/drawTools/vdrawtool.h @@ -60,7 +60,7 @@ public: virtual void SetTypeLine(const QString &value); QString GetLineColor() const; - void SetLineColor(const QString &value); + virtual void SetLineColor(const QString &value); public slots: virtual void ShowTool(quint32 id, Qt::GlobalColor color, bool enable); diff --git a/src/app/tools/drawTools/vtoolline.cpp b/src/app/tools/drawTools/vtoolline.cpp index b99956279..0f072e580 100644 --- a/src/app/tools/drawTools/vtoolline.cpp +++ b/src/app/tools/drawTools/vtoolline.cpp @@ -462,6 +462,15 @@ void VToolLine::SetTypeLine(const QString &value) SaveOption(obj); } +//--------------------------------------------------------------------------------------------------------------------- +void VToolLine::SetLineColor(const QString &value) +{ + lineColor = value; + + QSharedPointer obj;//We don't have object for line in data container. Just will send empty object. + SaveOption(obj); +} + //--------------------------------------------------------------------------------------------------------------------- quint32 VToolLine::GetFirstPoint() const { diff --git a/src/app/tools/drawTools/vtoolline.h b/src/app/tools/drawTools/vtoolline.h index 1c57029dc..7b53530e4 100644 --- a/src/app/tools/drawTools/vtoolline.h +++ b/src/app/tools/drawTools/vtoolline.h @@ -59,7 +59,9 @@ public: void SetSecondPoint(const quint32 &value); virtual void ShowVisualization(bool show); + virtual void SetTypeLine(const QString &value); + virtual void SetLineColor(const QString &value); public slots: virtual void FullUpdateFromFile(); virtual void ChangedActivDraw(const QString &newName); diff --git a/src/app/widgets/vtooloptionspropertybrowser.cpp b/src/app/widgets/vtooloptionspropertybrowser.cpp index 3c030e12c..26178cdb3 100644 --- a/src/app/widgets/vtooloptionspropertybrowser.cpp +++ b/src/app/widgets/vtooloptionspropertybrowser.cpp @@ -396,6 +396,22 @@ void VToolOptionsPropertyBrowser::AddPropertyLineType(Tool *i, const QString &pr AddProperty(lineTypeProperty, VAbstractTool::AttrTypeLine); } +//--------------------------------------------------------------------------------------------------------------------- +template +void VToolOptionsPropertyBrowser::AddPropertyLineColor(Tool *i, const QString &propertyName, + const QMap &colors, const QString &id) +{ + VLineColorProperty *lineColorProperty = new VLineColorProperty(propertyName); + lineColorProperty->setColors(colors); + const qint32 index = VLineColorProperty::IndexOfColor(colors, i->GetLineColor()); + if (index == -1) + { + qWarning()<<"Can't find line style" << i->GetLineColor()<<"in list"; + } + lineColorProperty->setValue(index); + AddProperty(lineColorProperty, id); +} + //--------------------------------------------------------------------------------------------------------------------- template void VToolOptionsPropertyBrowser::SetPointName(const QString &name) @@ -471,6 +487,9 @@ void VToolOptionsPropertyBrowser::ChangeDataToolEndLine(VProperty *property) case 3: // VAbstractTool::AttrTypeLine i->SetTypeLine(value.toString()); break; + case 26: // VAbstractTool::AttrTypeLineColor + i->SetLineColor(value.toString()); + break; case 4: // VAbstractTool::AttrLength i->SetFormulaLength(value.value()); break; @@ -501,6 +520,9 @@ void VToolOptionsPropertyBrowser::ChangeDataToolAlongLine(VProperty *property) case 3: // VAbstractTool::AttrTypeLine i->SetTypeLine(value.toString()); break; + case 26: // VAbstractTool::AttrTypeLineColor + i->SetLineColor(value.toString()); + break; case 4: // VAbstractTool::AttrLength i->SetFormulaLength(value.value()); break; @@ -531,6 +553,9 @@ void VToolOptionsPropertyBrowser::ChangeDataToolArc(VProperty *property) case 10: // VAbstractTool::AttrAngle2 i->SetFormulaF2(value.value()); break; + case 27: // VAbstractTool::AttrTypeColor + i->SetLineColor(value.toString()); + break; default: qWarning()<<"Unknown property type. id = "<SetTypeLine(value.toString()); break; + case 26: // VAbstractTool::AttrTypeLineColor + i->SetLineColor(value.toString()); + break; default: qWarning()<<"Unknown property type. id = "<SetTypeLine(value.toString()); break; + case 26: // VAbstractTool::AttrTypeLineColor + i->SetLineColor(value.toString()); + break; default: qWarning()<<"Unknown property type. id = "<SetTypeLine(value.toString()); break; + case 26: // VAbstractTool::AttrTypeLineColor + i->SetLineColor(value.toString()); + break; default: qWarning()<<"Unknown property type. id = "<SetTypeLine(value.toString()); break; + case 26: // VAbstractTool::AttrTypeLineColor + i->SetLineColor(value.toString()); + break; default: qWarning()<<"Unknown property type. id = "<SetTypeLine(value.toString()); break; + case 26: // VAbstractTool::AttrTypeLineColor + i->SetLineColor(value.toString()); + break; default: qWarning()<<"Unknown property type. id = "<setSpline(spl); break; } + case 27: // VAbstractTool::AttrTypeColor + i->SetLineColor(value.toString()); + break; default: qWarning()<<"Unknown property type. id = "<setSplinePath(splPath); break; } + case 27: // VAbstractTool::AttrTypeColor + i->SetLineColor(value.toString()); + break; default: qWarning()<<"Unknown property type. id = "<SetTypeLine(value.toString()); break; + case 26: // VAbstractTool::AttrTypeLineColor + i->SetLineColor(value.toString()); + break; case 5: // VAbstractTool::AttrAngle i->SetFormulaAngle(value.value()); break; @@ -914,6 +963,9 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCurveIntersectAxis(VProperty *pr case 3: // VAbstractTool::AttrTypeLine i->SetTypeLine(value.toString()); break; + case 26: // VAbstractTool::AttrTypeLineColor + i->SetLineColor(value.toString()); + break; case 5: // VAbstractTool::AttrAngle i->SetFormulaAngle(value.value()); break; @@ -946,6 +998,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolEndLine(QGraphicsItem *item) AddPropertyPointName(i, tr("Point label")); AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); + AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), VAbstractTool::AttrLineColor); AddPropertyFormula(tr("Length"), i->GetFormulaLength(), VAbstractTool::AttrLength); AddPropertyFormula(tr("Angle"), i->GetFormulaAngle(), VAbstractTool::AttrAngle); } @@ -959,6 +1012,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolAlongLine(QGraphicsItem *item) AddPropertyPointName(i, tr("Point label")); AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); + AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), VAbstractTool::AttrLineColor); AddPropertyFormula(tr("Length"), i->GetFormulaLength(), VAbstractTool::AttrLength); } @@ -972,6 +1026,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolArc(QGraphicsItem *item) AddPropertyFormula(tr("Radius"), i->GetFormulaRadius(), VAbstractTool::AttrRadius); AddPropertyFormula(tr("First angle"), i->GetFormulaF1(), VAbstractTool::AttrAngle1); AddPropertyFormula(tr("Second angle"), i->GetFormulaF2(), VAbstractTool::AttrAngle2); + AddPropertyLineColor(i, tr("Color"), VAbstractTool::ColorsList(), VAbstractTool::AttrColor); } //--------------------------------------------------------------------------------------------------------------------- @@ -983,6 +1038,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolBisector(QGraphicsItem *item) AddPropertyPointName(i, tr("Point label")); AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); + AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), VAbstractTool::AttrLineColor); AddPropertyFormula(tr("Length"), i->GetFormulaLength(), VAbstractTool::AttrLength); } @@ -1028,6 +1084,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolHeight(QGraphicsItem *item) AddPropertyPointName(i, tr("Point label")); AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); + AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), VAbstractTool::AttrLineColor); } //--------------------------------------------------------------------------------------------------------------------- @@ -1040,6 +1097,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolLine(QGraphicsItem *item) QMap styles = VAbstractTool::LineStylesPics(); styles.remove(VAbstractTool::TypeLineNone); AddPropertyLineType(i, tr("Line type"), styles); + AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), VAbstractTool::AttrLineColor); } //--------------------------------------------------------------------------------------------------------------------- @@ -1062,6 +1120,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolNormal(QGraphicsItem *item) AddPropertyFormula(tr("Length"), i->GetFormulaLength(), VAbstractTool::AttrLength); AddPropertyPointName(i, tr("Point label")); AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); + AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), VAbstractTool::AttrLineColor); VDoubleProperty* itemAngle = new VDoubleProperty(tr("Additional angle degrees")); itemAngle->setValue(i->GetAngle()); @@ -1101,6 +1160,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolShoulderPoint(QGraphicsItem *it AddPropertyPointName(i, tr("Point label")); AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); + AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), VAbstractTool::AttrLineColor); AddPropertyFormula(tr("Length"), i->GetFormulaLength(), VAbstractTool::AttrLength); } @@ -1119,6 +1179,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolSpline(QGraphicsItem *item) itemFactor->setSetting("Precision", 3); itemFactor->setValue(spl.GetKcurve()); AddProperty(itemFactor, VAbstractTool::AttrKCurve); + AddPropertyLineColor(i, tr("Color"), VAbstractTool::ColorsList(), VAbstractTool::AttrColor); } //--------------------------------------------------------------------------------------------------------------------- @@ -1136,6 +1197,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolSplinePath(QGraphicsItem *item) itemFactor->setSetting("Precision", 3); itemFactor->setValue(splPath.GetKCurve()); AddProperty(itemFactor, VAbstractTool::AttrKCurve); + AddPropertyLineColor(i, tr("Color"), VAbstractTool::ColorsList(), VAbstractTool::AttrColor); } //--------------------------------------------------------------------------------------------------------------------- @@ -1157,6 +1219,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolLineIntersectAxis(QGraphicsItem AddPropertyPointName(i, tr("Point label")); AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); + AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), VAbstractTool::AttrLineColor); AddPropertyFormula(tr("Angle"), i->GetFormulaAngle(), VAbstractTool::AttrAngle); } @@ -1169,6 +1232,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolCurveIntersectAxis(QGraphicsIte AddPropertyPointName(i, tr("Point label")); AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); + AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), VAbstractTool::AttrLineColor); AddPropertyFormula(tr("Angle"), i->GetFormulaAngle(), VAbstractTool::AttrAngle); } @@ -1186,8 +1250,15 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolEndLine() VToolEndLine *i = qgraphicsitem_cast(currentItem); idToProperty[VAbstractTool::AttrName]->setValue(i->name()); + { const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); + } + + { + const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + idToProperty[VAbstractTool::AttrLineColor]->setValue(index); + } QVariant valueFormula; valueFormula.setValue(i->GetFormulaLength()); @@ -1204,8 +1275,15 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolAlongLine() VToolAlongLine *i = qgraphicsitem_cast(currentItem); idToProperty[VAbstractTool::AttrName]->setValue(i->name()); + { const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); + } + + { + const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + idToProperty[VAbstractTool::AttrLineColor]->setValue(index); + } QVariant valueFormula; valueFormula.setValue(i->GetFormulaLength()); @@ -1229,6 +1307,9 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolArc() QVariant valueSecondAngle; valueSecondAngle.setValue(i->GetFormulaF2()); idToProperty[VAbstractTool::AttrAngle2]->setValue(valueSecondAngle); + + const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + idToProperty[VAbstractTool::AttrColor]->setValue(index); } //--------------------------------------------------------------------------------------------------------------------- @@ -1242,8 +1323,15 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolBisector() valueFormula.setValue(i->GetFormulaLength()); idToProperty[VAbstractTool::AttrLength]->setValue(valueFormula); + { const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); + } + + { + const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + idToProperty[VAbstractTool::AttrLineColor]->setValue(index); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -1289,8 +1377,15 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolHeight() idToProperty[VAbstractTool::AttrName]->setValue(i->name()); + { const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); + } + + { + const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + idToProperty[VAbstractTool::AttrLineColor]->setValue(index); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -1298,8 +1393,15 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolLine() { VToolLine *i = qgraphicsitem_cast(currentItem); + { const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); + } + + { + const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + idToProperty[VAbstractTool::AttrLineColor]->setValue(index); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -1323,8 +1425,15 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolNormal() idToProperty[VAbstractTool::AttrAngle]->setValue( i->GetAngle()); + { const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); + } + + { + const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + idToProperty[VAbstractTool::AttrLineColor]->setValue(index); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -1358,8 +1467,15 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolShoulderPoint() idToProperty[VAbstractTool::AttrName]->setValue(i->name()); + { const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); + } + + { + const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + idToProperty[VAbstractTool::AttrLineColor]->setValue(index); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -1369,6 +1485,9 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolSpline() VSpline spl = i->getSpline(); idToProperty[VAbstractTool::AttrKCurve]->setValue(spl.GetKcurve()); + + const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + idToProperty[VAbstractTool::AttrColor]->setValue(index); } //--------------------------------------------------------------------------------------------------------------------- @@ -1378,6 +1497,9 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolSplinePath() VSplinePath splPath = i->getSplinePath(); idToProperty[VAbstractTool::AttrKCurve]->setValue(splPath.GetKCurve()); + + const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + idToProperty[VAbstractTool::AttrColor]->setValue(index); } //--------------------------------------------------------------------------------------------------------------------- @@ -1394,8 +1516,15 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolLineIntersectAxis() VToolLineIntersectAxis *i = qgraphicsitem_cast(currentItem); idToProperty[VAbstractTool::AttrName]->setValue(i->name()); + { const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); + } + + { + const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + idToProperty[VAbstractTool::AttrLineColor]->setValue(index); + } QVariant valueAngle; valueAngle.setValue(i->GetFormulaAngle()); @@ -1408,8 +1537,15 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolCurveIntersectAxis() VToolCurveIntersectAxis *i = qgraphicsitem_cast(currentItem); idToProperty[VAbstractTool::AttrName]->setValue(i->name()); + { const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); + } + + { + const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + idToProperty[VAbstractTool::AttrLineColor]->setValue(index); + } QVariant valueAngle; valueAngle.setValue(i->GetFormulaAngle()); @@ -1444,6 +1580,8 @@ QStringList VToolOptionsPropertyBrowser::PropertiesList() const << VAbstractTool::AttrPShoulder /* 22 */ << VAbstractTool::AttrAxisP1 /* 23 */ << VAbstractTool::AttrAxisP2 /* 24 */ - << VAbstractTool::AttrKCurve; /* 25 */ + << VAbstractTool::AttrKCurve /* 25 */ + << VAbstractTool::AttrLineColor /* 26 */ + << VAbstractTool::AttrColor; /* 27 */ return attr; } diff --git a/src/app/widgets/vtooloptionspropertybrowser.h b/src/app/widgets/vtooloptionspropertybrowser.h index b2b918e99..50a4d9ed8 100644 --- a/src/app/widgets/vtooloptionspropertybrowser.h +++ b/src/app/widgets/vtooloptionspropertybrowser.h @@ -73,6 +73,10 @@ private: template void AddPropertyLineType(Tool *i, const QString &propertyName, const QMap &styles); + template + void AddPropertyLineColor(Tool *i, const QString &propertyName, const QMap &colors, + const QString &id); + void AddPropertyFormula(const QString &propertyName, const VFormula &formula, const QString &attrName); QStringList PropertiesList() const; diff --git a/src/libs/vpropertyexplorer/vproperties.h b/src/libs/vpropertyexplorer/vproperties.h index 0c8467d4d..a86299421 100644 --- a/src/libs/vpropertyexplorer/vproperties.h +++ b/src/libs/vpropertyexplorer/vproperties.h @@ -35,5 +35,6 @@ #include "plugins/vshortcutproperty.h" #include "plugins/vstringproperty.h" #include "plugins/vwidgetproperty.h" +#include "plugins/vlinecolorproperty.h" #endif // VPROPERTIES_H From ff5c6dbb17d6a5ae53879d47592b915f06940a17 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 7 Feb 2015 16:48:48 +0200 Subject: [PATCH 117/186] Fixed bug. We don't have object for line in data container. Just will send empty object. --HG-- branch : feature --- src/app/tools/drawTools/vtoolline.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/tools/drawTools/vtoolline.cpp b/src/app/tools/drawTools/vtoolline.cpp index 0f072e580..44806774d 100644 --- a/src/app/tools/drawTools/vtoolline.cpp +++ b/src/app/tools/drawTools/vtoolline.cpp @@ -414,7 +414,7 @@ void VToolLine::SetSecondPoint(const quint32 &value) { secondPoint = value; - QSharedPointer obj = VAbstractTool::data.GetGObject(id); + QSharedPointer obj;//We don't have object for line in data container. Just will send empty object. SaveOption(obj); } } @@ -484,7 +484,7 @@ void VToolLine::SetFirstPoint(const quint32 &value) { firstPoint = value; - QSharedPointer obj = VAbstractTool::data.GetGObject(id); + QSharedPointer obj;//We don't have object for line in data container. Just will send empty object. SaveOption(obj); } } From aa7b2a411267c566b3d17bdb6d0a753bff2e534a Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 7 Feb 2015 17:18:18 +0200 Subject: [PATCH 118/186] Use visualization for highlighting tool. --HG-- branch : feature --- src/app/dialogs/app/dialoghistory.cpp | 10 +++++----- src/app/dialogs/app/dialoghistory.h | 3 +-- src/app/tools/drawTools/vabstractspline.cpp | 5 ++--- src/app/tools/drawTools/vabstractspline.h | 2 +- src/app/tools/drawTools/vdrawtool.cpp | 4 +--- src/app/tools/drawTools/vdrawtool.h | 21 ++++++--------------- src/app/tools/drawTools/vtoolline.cpp | 5 ++--- src/app/tools/drawTools/vtoolline.h | 2 +- src/app/tools/drawTools/vtoolpoint.cpp | 5 ++--- src/app/tools/drawTools/vtoolpoint.h | 2 +- src/app/xml/vpattern.cpp | 5 ++--- src/app/xml/vpattern.h | 5 ++--- 12 files changed, 26 insertions(+), 43 deletions(-) diff --git a/src/app/dialogs/app/dialoghistory.cpp b/src/app/dialogs/app/dialoghistory.cpp index 78b7c6d96..6e70e1b97 100644 --- a/src/app/dialogs/app/dialoghistory.cpp +++ b/src/app/dialogs/app/dialoghistory.cpp @@ -74,7 +74,7 @@ void DialogHistory::DialogAccepted() { QTableWidgetItem *item = ui->tableWidget->item(cursorToolRecordRow, 0); quint32 id = qvariant_cast(item->data(Qt::UserRole)); - emit ShowHistoryTool(id, Qt::green, false); + emit ShowHistoryTool(id, false); emit DialogClosed(QDialog::Accepted); } @@ -103,12 +103,12 @@ void DialogHistory::cellClicked(int row, int column) { QTableWidgetItem *item = ui->tableWidget->item(cursorToolRecordRow, 0); quint32 id = qvariant_cast(item->data(Qt::UserRole)); - emit ShowHistoryTool(id, Qt::green, false); + emit ShowHistoryTool(id, false); cursorToolRecordRow = row; item = ui->tableWidget->item(cursorToolRecordRow, 0); id = qvariant_cast(item->data(Qt::UserRole)); - emit ShowHistoryTool(id, Qt::green, true); + emit ShowHistoryTool(id, true); } } @@ -434,7 +434,7 @@ void DialogHistory::ShowPoint() cursorToolRecordRow = 0; item = ui->tableWidget->item(0, 0); quint32 id = qvariant_cast(item->data(Qt::UserRole)); - emit ShowHistoryTool(id, Qt::green, true); + emit ShowHistoryTool(id, true); } } @@ -466,6 +466,6 @@ void DialogHistory::closeEvent(QCloseEvent *event) { QTableWidgetItem *item = ui->tableWidget->item(cursorToolRecordRow, 0); quint32 id = qvariant_cast(item->data(Qt::UserRole)); - emit ShowHistoryTool(id, Qt::green, false); + emit ShowHistoryTool(id, false); DialogTool::closeEvent(event); } diff --git a/src/app/dialogs/app/dialoghistory.h b/src/app/dialogs/app/dialoghistory.h index 20b18e6b6..c6d085bf2 100644 --- a/src/app/dialogs/app/dialoghistory.h +++ b/src/app/dialogs/app/dialoghistory.h @@ -63,10 +63,9 @@ signals: /** * @brief ShowHistoryTool signal change color of selected in records tool * @param id id of tool - * @param color new color of tool * @param enable true enable selection, false disable selection */ - void ShowHistoryTool(quint32 id, Qt::GlobalColor color, bool enable); + void ShowHistoryTool(quint32 id, bool enable); protected: virtual void closeEvent ( QCloseEvent * event ); private: diff --git a/src/app/tools/drawTools/vabstractspline.cpp b/src/app/tools/drawTools/vabstractspline.cpp index 385622c0c..f0d04dcab 100644 --- a/src/app/tools/drawTools/vabstractspline.cpp +++ b/src/app/tools/drawTools/vabstractspline.cpp @@ -96,12 +96,11 @@ void VAbstractSpline::ChangedActivDraw(const QString &newName) /** * @brief ShowTool highlight tool. * @param id object id in container - * @param color highlight color. * @param enable enable or disable highlight. */ -void VAbstractSpline::ShowTool(quint32 id, Qt::GlobalColor color, bool enable) +void VAbstractSpline::ShowTool(quint32 id, bool enable) { - ShowItem(this, id, color, enable); + ShowItem(this, id, enable); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/tools/drawTools/vabstractspline.h b/src/app/tools/drawTools/vabstractspline.h index b1e5cdd05..f9b314b73 100644 --- a/src/app/tools/drawTools/vabstractspline.h +++ b/src/app/tools/drawTools/vabstractspline.h @@ -78,7 +78,7 @@ protected: */ virtual void RefreshGeometry ()=0; virtual void ChangedActivDraw ( const QString &newName ); - virtual void ShowTool(quint32 id, Qt::GlobalColor color, bool enable); + virtual void ShowTool(quint32 id, bool enable); virtual void SetFactor(qreal factor); virtual void hoverEnterEvent ( QGraphicsSceneHoverEvent * event ); virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event ); diff --git a/src/app/tools/drawTools/vdrawtool.cpp b/src/app/tools/drawTools/vdrawtool.cpp index 70b538e86..597399843 100644 --- a/src/app/tools/drawTools/vdrawtool.cpp +++ b/src/app/tools/drawTools/vdrawtool.cpp @@ -64,13 +64,11 @@ VDrawTool::~VDrawTool() /** * @brief ShowTool highlight tool. * @param id object id in container. - * @param color highlight color. * @param enable enable or disable highlight. */ -void VDrawTool::ShowTool(quint32 id, Qt::GlobalColor color, bool enable) +void VDrawTool::ShowTool(quint32 id, bool enable) { Q_UNUSED(id); - Q_UNUSED(color); Q_UNUSED(enable); } diff --git a/src/app/tools/drawTools/vdrawtool.h b/src/app/tools/drawTools/vdrawtool.h index 8a412a7b3..021387e20 100644 --- a/src/app/tools/drawTools/vdrawtool.h +++ b/src/app/tools/drawTools/vdrawtool.h @@ -63,7 +63,7 @@ public: virtual void SetLineColor(const QString &value); public slots: - virtual void ShowTool(quint32 id, Qt::GlobalColor color, bool enable); + virtual void ShowTool(quint32 id, bool enable); virtual void ChangedActivDraw(const QString &newName) = 0; void ChangedNameDraw(const QString &oldName, const QString &newName); virtual void FullUpdateFromGuiOk(int result); @@ -161,24 +161,15 @@ protected: * @brief ShowItem highlight tool. * @param item tool. * @param id object id in container. - * @param color highlight color. * @param enable enable or disable highlight. */ - void ShowItem(Item *item, quint32 id, Qt::GlobalColor color, bool enable) + void ShowItem(Item *item, quint32 id, bool enable) { SCASSERT(item != nullptr); -// if (id == item->id) -// { -// if (enable == false) -// { -// currentColor = baseColor; -// } -// else -// { -// currentColor = color; -// } -// item->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor)); -// } + if (id == item->id) + { + ShowVisualization(enable); + } } private: Q_DISABLE_COPY(VDrawTool) diff --git a/src/app/tools/drawTools/vtoolline.cpp b/src/app/tools/drawTools/vtoolline.cpp index 44806774d..797005bae 100644 --- a/src/app/tools/drawTools/vtoolline.cpp +++ b/src/app/tools/drawTools/vtoolline.cpp @@ -211,12 +211,11 @@ void VToolLine::FullUpdateFromFile() /** * @brief ShowTool highlight tool. * @param id object id in container - * @param color highlight color. * @param enable enable or disable highlight. */ -void VToolLine::ShowTool(quint32 id, Qt::GlobalColor color, bool enable) +void VToolLine::ShowTool(quint32 id, bool enable) { - ShowItem(this, id, color, enable); + ShowItem(this, id, enable); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/tools/drawTools/vtoolline.h b/src/app/tools/drawTools/vtoolline.h index 7b53530e4..17be7b9b4 100644 --- a/src/app/tools/drawTools/vtoolline.h +++ b/src/app/tools/drawTools/vtoolline.h @@ -65,7 +65,7 @@ public: public slots: virtual void FullUpdateFromFile(); virtual void ChangedActivDraw(const QString &newName); - virtual void ShowTool(quint32 id, Qt::GlobalColor color, bool enable); + virtual void ShowTool(quint32 id, bool enable); virtual void SetFactor(qreal factor); void Disable(bool disable); protected: diff --git a/src/app/tools/drawTools/vtoolpoint.cpp b/src/app/tools/drawTools/vtoolpoint.cpp index 94e3a6abd..d082ddd20 100644 --- a/src/app/tools/drawTools/vtoolpoint.cpp +++ b/src/app/tools/drawTools/vtoolpoint.cpp @@ -139,12 +139,11 @@ void VToolPoint::ChangedActivDraw(const QString &newName) /** * @brief ShowTool highlight tool. * @param id object id in container. - * @param color highlight color. * @param enable enable or disable highlight. */ -void VToolPoint::ShowTool(quint32 id, Qt::GlobalColor color, bool enable) +void VToolPoint::ShowTool(quint32 id, bool enable) { - ShowItem(this, id, color, enable); + ShowItem(this, id, enable); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/tools/drawTools/vtoolpoint.h b/src/app/tools/drawTools/vtoolpoint.h index 8601e6c47..e0c0c52d5 100644 --- a/src/app/tools/drawTools/vtoolpoint.h +++ b/src/app/tools/drawTools/vtoolpoint.h @@ -54,7 +54,7 @@ public: public slots: void NameChangePosition(const QPointF &pos); virtual void ChangedActivDraw(const QString &newName); - virtual void ShowTool(quint32 id, Qt::GlobalColor color, bool enable); + virtual void ShowTool(quint32 id, bool enable); virtual void SetFactor(qreal factor); virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event); void Disable(bool disable); diff --git a/src/app/xml/vpattern.cpp b/src/app/xml/vpattern.cpp index 358c16176..a009a1ec3 100644 --- a/src/app/xml/vpattern.cpp +++ b/src/app/xml/vpattern.cpp @@ -857,12 +857,11 @@ void VPattern::haveLiteChange() /** * @brief ShowHistoryTool hightlight tool. * @param id tool id. - * @param color hightlight color. * @param enable enable or diasable hightlight. */ -void VPattern::ShowHistoryTool(quint32 id, Qt::GlobalColor color, bool enable) +void VPattern::ShowHistoryTool(quint32 id, bool enable) { - emit ShowTool(id, color, enable); + emit ShowTool(id, enable); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/xml/vpattern.h b/src/app/xml/vpattern.h index 5642d2366..ea4db3e0b 100644 --- a/src/app/xml/vpattern.h +++ b/src/app/xml/vpattern.h @@ -197,10 +197,9 @@ signals: /** * @brief ShowTool highlight tool. * @param id tool id. - * @param color highlight color. * @param enable enable or disable highlight. */ - void ShowTool(quint32 id, Qt::GlobalColor color, bool enable); + void ShowTool(quint32 id, bool enable); /** * @brief ChangedCursor change cursor position. * @param id tool id. @@ -214,7 +213,7 @@ signals: public slots: void LiteParseTree(const Document &parse); void haveLiteChange(); - void ShowHistoryTool(quint32 id, Qt::GlobalColor color, bool enable); + void ShowHistoryTool(quint32 id, bool enable); void NeedFullParsing(); void ClearScene(); protected: From eb56288d136339dfcaae6fe0ea3e32167e149c5a Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sun, 8 Feb 2015 12:23:26 +0200 Subject: [PATCH 119/186] Color property also for cut tools: cut arc, cut spline, cut spline path. --HG-- branch : feature --- src/app/dialogs/tools/dialogcutarc.cpp | 13 +++++++++++ src/app/dialogs/tools/dialogcutarc.h | 3 +++ src/app/dialogs/tools/dialogcutarc.ui | 12 +++++++++- src/app/dialogs/tools/dialogcutspline.cpp | 13 +++++++++++ src/app/dialogs/tools/dialogcutspline.h | 3 +++ src/app/dialogs/tools/dialogcutspline.ui | 16 +++++++++++--- src/app/dialogs/tools/dialogcutsplinepath.cpp | 13 +++++++++++ src/app/dialogs/tools/dialogcutsplinepath.h | 3 +++ src/app/dialogs/tools/dialogcutsplinepath.ui | 22 ++++++++++++++++--- src/app/tools/drawTools/vtoolcut.cpp | 4 +++- src/app/tools/drawTools/vtoolcut.h | 2 +- src/app/tools/drawTools/vtoolcutarc.cpp | 17 +++++++++----- src/app/tools/drawTools/vtoolcutarc.h | 6 ++--- src/app/tools/drawTools/vtoolcutspline.cpp | 17 +++++++++----- src/app/tools/drawTools/vtoolcutspline.h | 7 +++--- .../tools/drawTools/vtoolcutsplinepath.cpp | 18 ++++++++++----- src/app/tools/drawTools/vtoolcutsplinepath.h | 4 ++-- .../widgets/vtooloptionspropertybrowser.cpp | 21 ++++++++++++++++++ src/app/xml/vpattern.cpp | 13 ++++++++--- 19 files changed, 170 insertions(+), 37 deletions(-) diff --git a/src/app/dialogs/tools/dialogcutarc.cpp b/src/app/dialogs/tools/dialogcutarc.cpp index 935642187..6650a4751 100644 --- a/src/app/dialogs/tools/dialogcutarc.cpp +++ b/src/app/dialogs/tools/dialogcutarc.cpp @@ -58,6 +58,7 @@ DialogCutArc::DialogCutArc(const VContainer *data, const quint32 &toolId, QWidge CheckState(); FillComboBoxArcs(ui->comboBoxArc); + FillComboBoxLineColors(ui->comboBoxColor); connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogCutArc::PutHere); connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogCutArc::PutVal); @@ -157,6 +158,18 @@ void DialogCutArc::setArcId(const quint32 &value) path->setPoint1Id(value); } +//--------------------------------------------------------------------------------------------------------------------- +QString DialogCutArc::GetColor() const +{ + return GetComboBoxCurrentData(ui->comboBoxColor); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogCutArc::SetColor(const QString &value) +{ + ChangeCurrentData(ui->comboBoxColor, value); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief SetFormula set string with formula length diff --git a/src/app/dialogs/tools/dialogcutarc.h b/src/app/dialogs/tools/dialogcutarc.h index 91f8dec79..f9ba4aa07 100644 --- a/src/app/dialogs/tools/dialogcutarc.h +++ b/src/app/dialogs/tools/dialogcutarc.h @@ -56,6 +56,9 @@ public: quint32 getArcId() const; void setArcId(const quint32 &value); + + QString GetColor() const; + void SetColor(const QString &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); /** diff --git a/src/app/dialogs/tools/dialogcutarc.ui b/src/app/dialogs/tools/dialogcutarc.ui index 8313e5784..498309600 100644 --- a/src/app/dialogs/tools/dialogcutarc.ui +++ b/src/app/dialogs/tools/dialogcutarc.ui @@ -7,7 +7,7 @@ 0 0 412 - 433 + 466 @@ -250,6 +250,16 @@ + + + + Color + + + + + + diff --git a/src/app/dialogs/tools/dialogcutspline.cpp b/src/app/dialogs/tools/dialogcutspline.cpp index 2c386cbd3..13a55e935 100644 --- a/src/app/dialogs/tools/dialogcutspline.cpp +++ b/src/app/dialogs/tools/dialogcutspline.cpp @@ -57,6 +57,7 @@ DialogCutSpline::DialogCutSpline(const VContainer *data, const quint32 &toolId, CheckState(); FillComboBoxSplines(ui->comboBoxSpline); + FillComboBoxLineColors(ui->comboBoxColor); connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogCutSpline::PutHere); connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogCutSpline::PutVal); @@ -119,6 +120,18 @@ void DialogCutSpline::setSplineId(const quint32 &value) path->setPoint1Id(value); } +//--------------------------------------------------------------------------------------------------------------------- +QString DialogCutSpline::GetColor() const +{ + return GetComboBoxCurrentData(ui->comboBoxColor); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogCutSpline::SetColor(const QString &value) +{ + ChangeCurrentData(ui->comboBoxColor, value); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong. diff --git a/src/app/dialogs/tools/dialogcutspline.h b/src/app/dialogs/tools/dialogcutspline.h index 886860aab..12665a998 100644 --- a/src/app/dialogs/tools/dialogcutspline.h +++ b/src/app/dialogs/tools/dialogcutspline.h @@ -55,6 +55,9 @@ public: quint32 getSplineId() const; void setSplineId(const quint32 &value); + + QString GetColor() const; + void SetColor(const QString &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); /** diff --git a/src/app/dialogs/tools/dialogcutspline.ui b/src/app/dialogs/tools/dialogcutspline.ui index 3107db846..c7df135dc 100644 --- a/src/app/dialogs/tools/dialogcutspline.ui +++ b/src/app/dialogs/tools/dialogcutspline.ui @@ -7,7 +7,7 @@ 0 0 412 - 433 + 466 @@ -217,7 +217,7 @@ - + 0 0 @@ -237,7 +237,7 @@ - + 0 0 @@ -250,6 +250,16 @@ + + + + Color + + + + + + diff --git a/src/app/dialogs/tools/dialogcutsplinepath.cpp b/src/app/dialogs/tools/dialogcutsplinepath.cpp index 90178bd55..507d53a3e 100644 --- a/src/app/dialogs/tools/dialogcutsplinepath.cpp +++ b/src/app/dialogs/tools/dialogcutsplinepath.cpp @@ -57,6 +57,7 @@ DialogCutSplinePath::DialogCutSplinePath(const VContainer *data, const quint32 & CheckState(); FillComboBoxSplinesPath(ui->comboBoxSplinePath); + FillComboBoxLineColors(ui->comboBoxColor); connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogCutSplinePath::PutHere); connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogCutSplinePath::PutVal); @@ -119,6 +120,18 @@ void DialogCutSplinePath::setSplinePathId(const quint32 &value) path->setPoint1Id(value); } +//--------------------------------------------------------------------------------------------------------------------- +QString DialogCutSplinePath::GetColor() const +{ + return GetComboBoxCurrentData(ui->comboBoxColor); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogCutSplinePath::SetColor(const QString &value) +{ + ChangeCurrentData(ui->comboBoxColor, value); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong. diff --git a/src/app/dialogs/tools/dialogcutsplinepath.h b/src/app/dialogs/tools/dialogcutsplinepath.h index 8de2c016e..340c91fbb 100644 --- a/src/app/dialogs/tools/dialogcutsplinepath.h +++ b/src/app/dialogs/tools/dialogcutsplinepath.h @@ -55,6 +55,9 @@ public: quint32 getSplinePathId() const; void setSplinePathId(const quint32 &value); + + QString GetColor() const; + void SetColor(const QString &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); /** diff --git a/src/app/dialogs/tools/dialogcutsplinepath.ui b/src/app/dialogs/tools/dialogcutsplinepath.ui index f5d497074..2312d2eed 100644 --- a/src/app/dialogs/tools/dialogcutsplinepath.ui +++ b/src/app/dialogs/tools/dialogcutsplinepath.ui @@ -7,7 +7,7 @@ 0 0 412 - 433 + 466 @@ -217,7 +217,7 @@ - + 0 0 @@ -237,7 +237,7 @@ - + 0 0 @@ -250,6 +250,22 @@ + + + + + 0 + 0 + + + + Color + + + + + + diff --git a/src/app/tools/drawTools/vtoolcut.cpp b/src/app/tools/drawTools/vtoolcut.cpp index a7ab6c27a..192fc1e69 100644 --- a/src/app/tools/drawTools/vtoolcut.cpp +++ b/src/app/tools/drawTools/vtoolcut.cpp @@ -32,7 +32,7 @@ //--------------------------------------------------------------------------------------------------------------------- VToolCut::VToolCut(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula, - const quint32 &curveCutId, const quint32 &curve1id, const quint32 &curve2id, + const quint32 &curveCutId, const quint32 &curve1id, const quint32 &curve2id, const QString &color, QGraphicsItem *parent) :VToolPoint(doc, data, id, parent), formula(formula), firstCurve(nullptr), secondCurve(nullptr), curveCutId(curveCutId), curve1id(curve1id), curve2id(curve2id) @@ -41,6 +41,8 @@ VToolCut::VToolCut(VPattern *doc, VContainer *data, const quint32 &id, const QSt Q_ASSERT_X(curve1id > 0, Q_FUNC_INFO, "curve1id <= 0"); Q_ASSERT_X(curve2id > 0, Q_FUNC_INFO, "curve2id <= 0"); + lineColor = color; + firstCurve = new VSimpleCurve(curve1id, QColor(lineColor), SimpleCurvePoint::ForthPoint, &factor); firstCurve->setParentItem(this); connect(firstCurve, &VSimpleCurve::Choosed, this, &VToolCut::CurveChoosed); diff --git a/src/app/tools/drawTools/vtoolcut.h b/src/app/tools/drawTools/vtoolcut.h index c203cc9d3..a815b3017 100644 --- a/src/app/tools/drawTools/vtoolcut.h +++ b/src/app/tools/drawTools/vtoolcut.h @@ -39,7 +39,7 @@ class VToolCut : public VToolPoint Q_OBJECT public: VToolCut(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula, const quint32 &curveCutId, - const quint32 &curve1id, const quint32 &curve2id, QGraphicsItem * parent = nullptr); + const quint32 &curve1id, const quint32 &curve2id, const QString &color, QGraphicsItem * parent = nullptr); virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::Cut)}; diff --git a/src/app/tools/drawTools/vtoolcutarc.cpp b/src/app/tools/drawTools/vtoolcutarc.cpp index fe3c0731e..a2b00da2f 100644 --- a/src/app/tools/drawTools/vtoolcutarc.cpp +++ b/src/app/tools/drawTools/vtoolcutarc.cpp @@ -50,9 +50,9 @@ const QString VToolCutArc::AttrArc = QStringLiteral("arc"); * @param parent parent object. */ VToolCutArc::VToolCutArc(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula, - const quint32 &arcId, const quint32 &arc1id, const quint32 &arc2id, + const quint32 &arcId, const quint32 &arc1id, const quint32 &arc2id, const QString &color, const Source &typeCreation, QGraphicsItem * parent) - :VToolCut(doc, data, id, formula, arcId, arc1id, arc2id, parent) + :VToolCut(doc, data, id, formula, arcId, arc1id, arc2id, color, parent) { RefreshCurve(firstCurve, curve1id, SimpleCurvePoint::ForthPoint); RefreshCurve(secondCurve, curve2id, SimpleCurvePoint::FirstPoint); @@ -80,6 +80,7 @@ void VToolCutArc::setDialog() dialogTool->SetFormula(formula); dialogTool->setArcId(curveCutId); dialogTool->SetPointName(point->name()); + dialogTool->SetColor(lineColor); } //--------------------------------------------------------------------------------------------------------------------- @@ -98,8 +99,9 @@ VToolCutArc* VToolCutArc::Create(DialogTool *dialog, VMainGraphicsScene *scene, const QString pointName = dialogTool->getPointName(); QString formula = dialogTool->GetFormula(); const quint32 arcId = dialogTool->getArcId(); + const QString color = dialogTool->GetColor(); VToolCutArc* point = nullptr; - point=Create(0, pointName, formula, arcId, 5, 10, scene, doc, data, Document::FullParse, Source::FromGui); + point=Create(0, pointName, formula, arcId, 5, 10, color, scene, doc, data, Document::FullParse, Source::FromGui); if (point != nullptr) { point->dialog=dialogTool; @@ -123,8 +125,8 @@ VToolCutArc* VToolCutArc::Create(DialogTool *dialog, VMainGraphicsScene *scene, * @param typeCreation way we create this tool. */ VToolCutArc* VToolCutArc::Create(const quint32 _id, const QString &pointName, QString &formula, const quint32 &arcId, - const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, - VContainer *data, const Document &parse, const Source &typeCreation) + const qreal &mx, const qreal &my, const QString &color, VMainGraphicsScene *scene, + VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) { const QSharedPointer arc = data->GeometricObject(arcId); @@ -167,7 +169,7 @@ VToolCutArc* VToolCutArc::Create(const quint32 _id, const QString &pointName, QS VDrawTool::AddRecord(id, Tool::CutArc, doc); if (parse == Document::FullParse) { - VToolCutArc *point = new VToolCutArc(doc, data, id, formula, arcId, arc1id, arc2id, typeCreation); + VToolCutArc *point = new VToolCutArc(doc, data, id, formula, arcId, arc1id, arc2id, color, typeCreation); scene->addItem(point); connect(point, &VToolPoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolCutArc::SetFactor); @@ -274,6 +276,7 @@ void VToolCutArc::SaveDialog(QDomElement &domElement) doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula()); doc->SetAttribute(domElement, AttrArc, QString().setNum(dialogTool->getArcId())); + doc->SetAttribute(domElement, AttrColor, dialogTool->GetColor()); } //--------------------------------------------------------------------------------------------------------------------- @@ -312,6 +315,7 @@ void VToolCutArc::SaveOptions(QDomElement &tag, QSharedPointer &obj) doc->SetAttribute(tag, AttrName, point->name()); doc->SetAttribute(tag, AttrMx, qApp->fromPixel(point->mx())); doc->SetAttribute(tag, AttrMy, qApp->fromPixel(point->my())); + doc->SetAttribute(tag, AttrColor, lineColor); doc->SetAttribute(tag, AttrLength, formula); doc->SetAttribute(tag, AttrArc, curveCutId); @@ -322,4 +326,5 @@ void VToolCutArc::ReadToolAttributes(const QDomElement &domElement) { formula = doc->GetParametrString(domElement, AttrLength, ""); curveCutId = doc->GetParametrUInt(domElement, AttrArc, NULL_ID_STR); + lineColor = doc->GetParametrString(domElement, AttrColor, ColorBlack); } diff --git a/src/app/tools/drawTools/vtoolcutarc.h b/src/app/tools/drawTools/vtoolcutarc.h index e8a5cf75f..5a731a43d 100644 --- a/src/app/tools/drawTools/vtoolcutarc.h +++ b/src/app/tools/drawTools/vtoolcutarc.h @@ -39,13 +39,13 @@ class VToolCutArc : public VToolCut Q_OBJECT public: VToolCutArc(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula, const quint32 &arcId, - const quint32 &arc1id, const quint32 &arc2id, const Source &typeCreation, + const quint32 &arc1id, const quint32 &arc2id, const QString &color, const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual void setDialog(); static VToolCutArc* Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); static VToolCutArc* Create(const quint32 _id, const QString &pointName, QString &formula, const quint32 &arcId, - const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, - VContainer *data, const Document &parse, const Source &typeCreation); + const qreal &mx, const qreal &my, const QString &color, VMainGraphicsScene *scene, + VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation); static const QString ToolType; static const QString AttrArc; virtual int type() const {return Type;} diff --git a/src/app/tools/drawTools/vtoolcutspline.cpp b/src/app/tools/drawTools/vtoolcutspline.cpp index f8ced20b6..24fe69975 100644 --- a/src/app/tools/drawTools/vtoolcutspline.cpp +++ b/src/app/tools/drawTools/vtoolcutspline.cpp @@ -50,8 +50,8 @@ const QString VToolCutSpline::AttrSpline = QStringLiteral("spline"); */ VToolCutSpline::VToolCutSpline(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula, const quint32 &splineId, const quint32 &spl1id, const quint32 &spl2id, - const Source &typeCreation, QGraphicsItem *parent) - :VToolCut(doc, data, id, formula, splineId, spl1id, spl2id, parent) + const QString &color, const Source &typeCreation, QGraphicsItem *parent) + :VToolCut(doc, data, id, formula, splineId, spl1id, spl2id, color, parent) { RefreshCurve(firstCurve, curve1id, SimpleCurvePoint::ForthPoint); RefreshCurve(secondCurve, curve2id, SimpleCurvePoint::FirstPoint); @@ -79,6 +79,7 @@ void VToolCutSpline::setDialog() dialogTool->SetFormula(formula); dialogTool->setSplineId(curveCutId); dialogTool->SetPointName(point->name()); + dialogTool->SetColor(lineColor); } //--------------------------------------------------------------------------------------------------------------------- @@ -98,8 +99,10 @@ VToolCutSpline* VToolCutSpline::Create(DialogTool *dialog, VMainGraphicsScene *s const QString pointName = dialogTool->getPointName(); QString formula = dialogTool->GetFormula(); const quint32 splineId = dialogTool->getSplineId(); + const QString color = dialogTool->GetColor(); VToolCutSpline* point = nullptr; - point = Create(0, pointName, formula, splineId, 5, 10, scene, doc, data, Document::FullParse, Source::FromGui); + point = Create(0, pointName, formula, splineId, 5, 10, color, scene, doc, data, Document::FullParse, + Source::FromGui); if (point != nullptr) { point->dialog=dialogTool; @@ -123,7 +126,7 @@ VToolCutSpline* VToolCutSpline::Create(DialogTool *dialog, VMainGraphicsScene *s * @param typeCreation way we create this tool. */ VToolCutSpline* VToolCutSpline::Create(const quint32 _id, const QString &pointName, QString &formula, - const quint32 &splineId, const qreal &mx, const qreal &my, + const quint32 &splineId, const qreal &mx, const qreal &my, const QString &color, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) { @@ -174,7 +177,8 @@ VToolCutSpline* VToolCutSpline::Create(const quint32 _id, const QString &pointNa VDrawTool::AddRecord(id, Tool::CutSpline, doc); if (parse == Document::FullParse) { - VToolCutSpline *point = new VToolCutSpline(doc, data, id, formula, splineId, spl1id, spl2id, typeCreation); + VToolCutSpline *point = new VToolCutSpline(doc, data, id, formula, splineId, spl1id, spl2id, color, + typeCreation); scene->addItem(point); connect(point, &VToolPoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolCutSpline::SetFactor); @@ -285,6 +289,7 @@ void VToolCutSpline::SaveDialog(QDomElement &domElement) doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula()); doc->SetAttribute(domElement, AttrSpline, QString().setNum(dialogTool->getSplineId())); + doc->SetAttribute(domElement, AttrColor, dialogTool->GetColor()); } //--------------------------------------------------------------------------------------------------------------------- @@ -323,6 +328,7 @@ void VToolCutSpline::SaveOptions(QDomElement &tag, QSharedPointer &obj doc->SetAttribute(tag, AttrName, point->name()); doc->SetAttribute(tag, AttrMx, qApp->fromPixel(point->mx())); doc->SetAttribute(tag, AttrMy, qApp->fromPixel(point->my())); + doc->SetAttribute(tag, AttrColor, lineColor); doc->SetAttribute(tag, AttrLength, formula); doc->SetAttribute(tag, AttrSpline, curveCutId); @@ -333,4 +339,5 @@ void VToolCutSpline::ReadToolAttributes(const QDomElement &domElement) { formula = doc->GetParametrString(domElement, AttrLength, ""); curveCutId = doc->GetParametrUInt(domElement, AttrSpline, NULL_ID_STR); + lineColor = doc->GetParametrString(domElement, AttrColor, ColorBlack); } diff --git a/src/app/tools/drawTools/vtoolcutspline.h b/src/app/tools/drawTools/vtoolcutspline.h index 90e576009..94799aa4c 100644 --- a/src/app/tools/drawTools/vtoolcutspline.h +++ b/src/app/tools/drawTools/vtoolcutspline.h @@ -40,13 +40,14 @@ class VToolCutSpline : public VToolCut public: VToolCutSpline(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula, - const quint32 &splineId, const quint32 &spl1id, const quint32 &spl2id, + const quint32 &splineId, const quint32 &spl1id, const quint32 &spl2id, const QString &color, const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual void setDialog(); static VToolCutSpline *Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); static VToolCutSpline *Create(const quint32 _id, const QString &pointName, QString &formula, - const quint32 &splineId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, - VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation); + const quint32 &splineId, const qreal &mx, const qreal &my, const QString &color, + VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, + const Source &typeCreation); static const QString ToolType; static const QString AttrSpline; virtual int type() const {return Type;} diff --git a/src/app/tools/drawTools/vtoolcutsplinepath.cpp b/src/app/tools/drawTools/vtoolcutsplinepath.cpp index 605e33f17..f93ae346b 100644 --- a/src/app/tools/drawTools/vtoolcutsplinepath.cpp +++ b/src/app/tools/drawTools/vtoolcutsplinepath.cpp @@ -53,9 +53,9 @@ const QString VToolCutSplinePath::AttrSplinePath = QStringLiteral("splinePath"); */ VToolCutSplinePath::VToolCutSplinePath(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula, const quint32 &splinePathId, - const quint32 &splPath1id, const quint32 &splPath2id, + const quint32 &splPath1id, const quint32 &splPath2id, const QString &color, const Source &typeCreation, QGraphicsItem *parent) - :VToolCut(doc, data, id, formula, splinePathId, splPath1id, splPath2id, parent) + :VToolCut(doc, data, id, formula, splinePathId, splPath1id, splPath2id, color, parent) { RefreshCurve(firstCurve, curve1id, SimpleCurvePoint::ForthPoint); RefreshCurve(secondCurve, curve2id, SimpleCurvePoint::FirstPoint); @@ -83,6 +83,7 @@ void VToolCutSplinePath::setDialog() dialogTool->SetFormula(formula); dialogTool->setSplinePathId(curveCutId); dialogTool->SetPointName(point->name()); + dialogTool->SetColor(lineColor); } //--------------------------------------------------------------------------------------------------------------------- @@ -102,8 +103,10 @@ VToolCutSplinePath* VToolCutSplinePath::Create(DialogTool *dialog, VMainGraphics const QString pointName = dialogTool->getPointName(); QString formula = dialogTool->GetFormula(); const quint32 splinePathId = dialogTool->getSplinePathId(); + const QString color = dialogTool->GetColor(); VToolCutSplinePath* point = nullptr; - point = Create(0, pointName, formula, splinePathId, 5, 10, scene, doc, data, Document::FullParse, Source::FromGui); + point = Create(0, pointName, formula, splinePathId, 5, 10, color, scene, doc, data, Document::FullParse, + Source::FromGui); if (point != nullptr) { point->dialog=dialogTool; @@ -128,8 +131,8 @@ VToolCutSplinePath* VToolCutSplinePath::Create(DialogTool *dialog, VMainGraphics */ VToolCutSplinePath* VToolCutSplinePath::Create(const quint32 _id, const QString &pointName, QString &formula, const quint32 &splinePathId, const qreal &mx, const qreal &my, - VMainGraphicsScene *scene, VPattern *doc, VContainer *data, - const Document &parse, const Source &typeCreation) + const QString &color, VMainGraphicsScene *scene, VPattern *doc, + VContainer *data, const Document &parse, const Source &typeCreation) { const QSharedPointer splPath = data->GeometricObject(splinePathId); SCASSERT(splPath != nullptr); @@ -223,7 +226,7 @@ VToolCutSplinePath* VToolCutSplinePath::Create(const quint32 _id, const QString if (parse == Document::FullParse) { VToolCutSplinePath *point = new VToolCutSplinePath(doc, data, id, formula, splinePathId, splPath1id, - splPath2id, typeCreation); + splPath2id, color, typeCreation); scene->addItem(point); connect(point, &VToolPoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolCutSplinePath::SetFactor); @@ -334,6 +337,7 @@ void VToolCutSplinePath::SaveDialog(QDomElement &domElement) doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula()); doc->SetAttribute(domElement, AttrSplinePath, QString().setNum(dialogTool->getSplinePathId())); + doc->SetAttribute(domElement, AttrColor, dialogTool->GetColor()); } //--------------------------------------------------------------------------------------------------------------------- @@ -374,6 +378,7 @@ void VToolCutSplinePath::SaveOptions(QDomElement &tag, QSharedPointer doc->SetAttribute(tag, AttrName, point->name()); doc->SetAttribute(tag, AttrMx, qApp->fromPixel(point->mx())); doc->SetAttribute(tag, AttrMy, qApp->fromPixel(point->my())); + doc->SetAttribute(tag, AttrColor, lineColor); doc->SetAttribute(tag, AttrLength, formula); doc->SetAttribute(tag, AttrSplinePath, curveCutId); @@ -384,4 +389,5 @@ void VToolCutSplinePath::ReadToolAttributes(const QDomElement &domElement) { formula = doc->GetParametrString(domElement, AttrLength, ""); curveCutId = doc->GetParametrUInt(domElement, AttrSplinePath, NULL_ID_STR); + lineColor = doc->GetParametrString(domElement, AttrColor, ColorBlack); } diff --git a/src/app/tools/drawTools/vtoolcutsplinepath.h b/src/app/tools/drawTools/vtoolcutsplinepath.h index 05cdf22df..1de640cfe 100644 --- a/src/app/tools/drawTools/vtoolcutsplinepath.h +++ b/src/app/tools/drawTools/vtoolcutsplinepath.h @@ -42,12 +42,12 @@ public: VToolCutSplinePath(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula, const quint32 &splinePathId, const quint32 &splPath1id, const quint32 &splPath2id, - const Source &typeCreation, QGraphicsItem * parent = nullptr); + const QString &color, const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual void setDialog(); static VToolCutSplinePath *Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); static VToolCutSplinePath *Create(const quint32 _id, const QString &pointName, QString &formula, const quint32 &splinePathId, const qreal &mx, const qreal &my, - VMainGraphicsScene *scene, VPattern *doc, VContainer *data, + const QString &color, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation); static const QString ToolType; static const QString AttrSplinePath; diff --git a/src/app/widgets/vtooloptionspropertybrowser.cpp b/src/app/widgets/vtooloptionspropertybrowser.cpp index 26178cdb3..78fd8d27b 100644 --- a/src/app/widgets/vtooloptionspropertybrowser.cpp +++ b/src/app/widgets/vtooloptionspropertybrowser.cpp @@ -610,6 +610,9 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCutArc(VProperty *property) case 4: // VAbstractTool::AttrLength i->SetFormula(value.value()); break; + case 27: // VAbstractTool::AttrTypeColor + i->SetLineColor(value.toString()); + break; default: qWarning()<<"Unknown property type. id = "<SetFormula(value.value()); break; + case 27: // VAbstractTool::AttrTypeColor + i->SetLineColor(value.toString()); + break; default: qWarning()<<"Unknown property type. id = "<SetFormula(value.value()); break; + case 27: // VAbstractTool::AttrTypeColor + i->SetLineColor(value.toString()); + break; default: qWarning()<<"Unknown property type. id = "<GetFormula(), VAbstractTool::AttrLength); + AddPropertyLineColor(i, tr("Color"), VAbstractTool::ColorsList(), VAbstractTool::AttrColor); } //--------------------------------------------------------------------------------------------------------------------- @@ -1062,6 +1072,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolCutSpline(QGraphicsItem *item) AddPropertyPointName(i, tr("Point label")); AddPropertyFormula(tr("Length"), i->GetFormula(), VAbstractTool::AttrLength); + AddPropertyLineColor(i, tr("Color"), VAbstractTool::ColorsList(), VAbstractTool::AttrColor); } //--------------------------------------------------------------------------------------------------------------------- @@ -1073,6 +1084,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolCutSplinePath(QGraphicsItem *it AddPropertyPointName(i, tr("Point label")); AddPropertyFormula(tr("Length"), i->GetFormula(), VAbstractTool::AttrLength); + AddPropertyLineColor(i, tr("Color"), VAbstractTool::ColorsList(), VAbstractTool::AttrColor); } //--------------------------------------------------------------------------------------------------------------------- @@ -1344,6 +1356,9 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolCutArc() QVariant valueFormula; valueFormula.setValue(i->GetFormula()); idToProperty[VAbstractTool::AttrLength]->setValue(valueFormula); + + const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + idToProperty[VAbstractTool::AttrColor]->setValue(index); } //--------------------------------------------------------------------------------------------------------------------- @@ -1356,6 +1371,9 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolCutSpline() QVariant valueFormula; valueFormula.setValue(i->GetFormula()); idToProperty[VAbstractTool::AttrLength]->setValue(valueFormula); + + const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + idToProperty[VAbstractTool::AttrColor]->setValue(index); } //--------------------------------------------------------------------------------------------------------------------- @@ -1368,6 +1386,9 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolCutSplinePath() QVariant valueFormula; valueFormula.setValue(i->GetFormula()); idToProperty[VAbstractTool::AttrLength]->setValue(valueFormula); + + const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + idToProperty[VAbstractTool::AttrColor]->setValue(index); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/xml/vpattern.cpp b/src/app/xml/vpattern.cpp index a009a1ec3..5b5d3b4f9 100644 --- a/src/app/xml/vpattern.cpp +++ b/src/app/xml/vpattern.cpp @@ -1469,8 +1469,11 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "0"); QString f = formula;//need for saving fixed formula; const quint32 splineId = GetParametrUInt(domElement, VToolCutSpline::AttrSpline, NULL_ID_STR); + const QString color = GetParametrString(domElement, VAbstractTool::AttrColor, + VAbstractTool::ColorBlack); - VToolCutSpline::Create(id, name, f, splineId, mx, my, scene, this, data, parse, Source::FromFile); + VToolCutSpline::Create(id, name, f, splineId, mx, my, color, scene, this, data, parse, + Source::FromFile); //Rewrite attribute formula. Need for situation when we have wrong formula. if (f != formula) { @@ -1499,8 +1502,10 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem QString f = formula;//need for saving fixed formula; const quint32 splinePathId = GetParametrUInt(domElement, VToolCutSplinePath::AttrSplinePath, NULL_ID_STR); + const QString color = GetParametrString(domElement, VAbstractTool::AttrColor, + VAbstractTool::ColorBlack); - VToolCutSplinePath::Create(id, name, f, splinePathId, mx, my, scene, this, data, parse, + VToolCutSplinePath::Create(id, name, f, splinePathId, mx, my, color, scene, this, data, parse, Source::FromFile); //Rewrite attribute formula. Need for situation when we have wrong formula. if (f != formula) @@ -1529,8 +1534,10 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "0"); QString f = formula;//need for saving fixed formula; const quint32 arcId = GetParametrUInt(domElement, VToolCutArc::AttrArc, NULL_ID_STR); + const QString color = GetParametrString(domElement, VAbstractTool::AttrColor, + VAbstractTool::ColorBlack); - VToolCutArc::Create(id, name, f, arcId, mx, my, scene, this, data, parse, Source::FromFile); + VToolCutArc::Create(id, name, f, arcId, mx, my, color, scene, this, data, parse, Source::FromFile); //Rewrite attribute formula. Need for situation when we have wrong formula. if (f != formula) { From 401e6ea5341d7616d17d0ef98fa9adb50c3822a0 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sun, 8 Feb 2015 12:56:32 +0200 Subject: [PATCH 120/186] Leave line thick if tool was selected. --HG-- branch : feature --- src/app/tools/drawTools/vtoolline.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/app/tools/drawTools/vtoolline.cpp b/src/app/tools/drawTools/vtoolline.cpp index 797005bae..1f879afb9 100644 --- a/src/app/tools/drawTools/vtoolline.cpp +++ b/src/app/tools/drawTools/vtoolline.cpp @@ -307,8 +307,11 @@ void VToolLine::hoverEnterEvent(QGraphicsSceneHoverEvent *event) void VToolLine::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); - this->setPen(QPen(CorrectColor(lineColor), qApp->toPixel(qApp->widthHairLine())/factor, - LineStyleToPenStyle(typeLine))); + if (vis == nullptr) + { + this->setPen(QPen(CorrectColor(lineColor), qApp->toPixel(qApp->widthHairLine())/factor, + LineStyleToPenStyle(typeLine))); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -449,6 +452,7 @@ void VToolLine::ShowVisualization(bool show) { delete vis; vis = nullptr; + hoverLeaveEvent(nullptr); } } @@ -497,6 +501,5 @@ void VToolLine::RefreshGeometry() const QSharedPointer first = VAbstractTool::data.GeometricObject(firstPoint); const QSharedPointer second = VAbstractTool::data.GeometricObject(secondPoint); this->setLine(QLineF(first->toQPointF(), second->toQPointF())); - this->setPen(QPen(CorrectColor(lineColor), qApp->toPixel(qApp->widthHairLine())/factor, - LineStyleToPenStyle(typeLine))); + this->setPen(QPen(CorrectColor(lineColor), pen().widthF(), LineStyleToPenStyle(typeLine))); } From 074ca3a4e0df85a8006b530fc7359619d99a05c9 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sun, 8 Feb 2015 13:48:27 +0200 Subject: [PATCH 121/186] Improving documantation and little refactoring changes in class Calculator. --HG-- branch : develop --- src/app/container/calculator.cpp | 64 +++++++++++++++++++++++--------- 1 file changed, 47 insertions(+), 17 deletions(-) diff --git a/src/app/container/calculator.cpp b/src/app/container/calculator.cpp index 175ec14a3..0e984658b 100644 --- a/src/app/container/calculator.cpp +++ b/src/app/container/calculator.cpp @@ -37,7 +37,7 @@ using namespace qmu; //--------------------------------------------------------------------------------------------------------------------- /** - * @brief Calculator class constructor. Make easy initialization math parser. + * @brief Calculator class wraper for QMuParser. Make easy initialization math parser. * * This constructor hide initialization variables, operators, character sets. * Use this constuctor for evaluation formula. All formulas must be converted to internal look. @@ -99,11 +99,17 @@ Calculator::~Calculator() //--------------------------------------------------------------------------------------------------------------------- /** * @brief eval calculate formula. + * + * First we try eval expression without adding variables. If it fail, we take tokens from expression and add variables + * to parser and try again. + * * @param formula string of formula. * @return value of formula. */ qreal Calculator::EvalFormula(const QString &formula) { + // Parser doesn't know any variable on this stage. So, we just use variable factory that for each unknown variable + // set value to 0. SetVarFactory(AddVariable, this); SetSepForEval();//Reset separators options @@ -119,20 +125,29 @@ qreal Calculator::EvalFormula(const QString &formula) if (tokens.isEmpty()) { - return result; + return result; // We have found only numbers in expression. } - // Add variables + // Add variables to parser because we have deal with expression with variables. InitVariables(data, tokens, formula); return Eval(); } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief Calculator::InitVariables add variables to parser. + * + * For optimization purpose we try don't add variables that we don't need. + * + * @param data pointer to a variable container. Hold all informations about variables. + * @param tokens all tokens (measurements names, variables with lengths) that parser have found in expression. + * @param formula expression, need for throwing better error message. + */ void Calculator::InitVariables(const VContainer *data, const QMap &tokens, const QString &formula) { if (qApp->patternType() == MeasurementsType::Standard) { - vVarVal = new qreal[2]; + vVarVal = new qreal[2]; //stabdard measurements table have two additional variables } SCASSERT(data != nullptr) @@ -173,7 +188,7 @@ void Calculator::InitVariables(const VContainer *data, const QMap } if (builInFunctions.contains(i.value())) - {// We found built-in function + {// We have found built-in function found = true; } @@ -186,6 +201,13 @@ void Calculator::InitVariables(const VContainer *data, const QMap } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief Calculator::InitCharacterSets init character set for parser. + * + * QMuParser require setting character set for legal characters. Because we try make our expresion language independent + * we set all posible unique characters from all alphabets. + * + */ void Calculator::InitCharacterSets() { //String with all unique symbols for supported alpabets. @@ -218,6 +240,9 @@ qreal* Calculator::AddVariable(const QString &a_szName, void *a_pUserData) } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief Calculator::SetSepForEval set separators for eval. Each expression eval in internal (C) locale. + */ void Calculator::SetSepForEval() { SetArgSep(','); @@ -225,6 +250,10 @@ void Calculator::SetSepForEval() } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief Calculator::SetSepForTr set separators for translation expression. + * @param fromUser true if expression come from user (from dialog). + */ void Calculator::SetSepForTr(bool fromUser) { if (fromUser) @@ -233,29 +262,30 @@ void Calculator::SetSepForTr(bool fromUser) if (osSeparatorValue) { - QLocale loc = QLocale::system(); + const QLocale loc = QLocale::system(); SetDecSep(loc.decimalPoint().toLatin1()); SetThousandsSep(loc.groupSeparator().toLatin1()); SetArgSep(';'); - } - else - { - SetArgSep(','); - SetDecSep('.'); + return; } } - else - { - SetArgSep(','); - SetDecSep('.'); - } + SetSepForEval();//Same separators (internal) as for eval. } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief Calculator::RemoveAll remove token from token list. + * + * Standard Qt class QMap doesn't have method RemoveAll. + * Example: remove "-" from tokens list if exist. If don't do that unary minus operation will broken. + * + * @param map map with tokens + * @param val token that need delete + */ void Calculator::RemoveAll(QMap &map, const QString &val) { - QList listKeys = map.keys(val); + const QList listKeys = map.keys(val);//Take all keys that contain token. if (listKeys.size() > 0) { for (int i = 0; i < listKeys.size(); ++i) From 7064dbfaa20050fcd961a968fceacc025dddaf5c Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sun, 8 Feb 2015 15:43:30 +0200 Subject: [PATCH 122/186] Improwing documentation. --HG-- branch : develop --- src/app/core/vapplication.cpp | 141 ++++++++++++++++++++------- src/app/dialogs/tools/dialogtool.cpp | 14 +-- 2 files changed, 113 insertions(+), 42 deletions(-) diff --git a/src/app/core/vapplication.cpp b/src/app/core/vapplication.cpp index c23c427c4..34b5f0ad7 100644 --- a/src/app/core/vapplication.cpp +++ b/src/app/core/vapplication.cpp @@ -1505,6 +1505,14 @@ void VApplication::InitSTDescriptions() } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VApplication::MeasurementsFromUser translate measurement to internal look. + * @param newFormula [in|out] expression to translate + * @param position token position + * @param token token to translate + * @param bias hold change of length between translated and origin token string + * @return true if was found measurement with same name. + */ bool VApplication::MeasurementsFromUser(QString &newFormula, int position, const QString &token, int &bias) const { QMap::const_iterator i = measurements.constBegin(); @@ -1522,6 +1530,14 @@ bool VApplication::MeasurementsFromUser(QString &newFormula, int position, const } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VApplication::VariablesFromUser translate variable to internal look. + * @param newFormula [in|out] expression to translate + * @param position token position + * @param token token to translate + * @param bias hold change of length between translated and origin token string + * @return true if was found variable with same name. + */ bool VApplication::VariablesFromUser(QString &newFormula, int position, const QString &token, int &bias) const { QMap::const_iterator i = variables.constBegin(); @@ -1541,6 +1557,14 @@ bool VApplication::VariablesFromUser(QString &newFormula, int position, const QS } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VApplication::PostfixOperatorsFromUser translate postfix operator to internal look. + * @param newFormula [in|out] expression to translate + * @param position token position + * @param token token to translate + * @param bias hold change of length between translated and origin token string + * @return true if was found postfix operator with same name. + */ bool VApplication::PostfixOperatorsFromUser(QString &newFormula, int position, const QString &token, int &bias) const { QMap::const_iterator i = postfixOperators.constBegin(); @@ -1558,6 +1582,14 @@ bool VApplication::PostfixOperatorsFromUser(QString &newFormula, int position, c } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VApplication::FunctionsFromUser translate function name to internal look. + * @param newFormula [in|out] expression to translate + * @param position token position + * @param token token to translate + * @param bias hold change of length between translated and origin token string + * @return true if was found function with same name. + */ bool VApplication::FunctionsFromUser(QString &newFormula, int position, const QString &token, int &bias) const { QMap::const_iterator i = functions.constBegin(); @@ -1575,6 +1607,14 @@ bool VApplication::FunctionsFromUser(QString &newFormula, int position, const QS } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VApplication::VariablesToUser translate variable name to user. + * @param newFormula [in|out] expression to translate + * @param position token position + * @param token token to translate + * @param bias hold change of length between translated and origin token string + * @return true if was found variable with same name. + */ bool VApplication::VariablesToUser(QString &newFormula, int position, const QString &token, int &bias) const { QMap::const_iterator i = variables.constBegin(); @@ -1594,18 +1634,37 @@ bool VApplication::VariablesToUser(QString &newFormula, int position, const QStr return false; } +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VApplication::CorrectionsPositions correct position tokens in expression after token translation. + * + * Because translated string can have different length compare to original need make correction after each translation. + * If bias = 0 correction will not happens. + * + * @param position position currecnt token in expression + * @param bias difference between original token length and translated + * @param tokens all tokens + * @param numbers all numbers + */ void VApplication::CorrectionsPositions(int position, int bias, QMap &tokens, QMap &numbers) { if (bias == 0) { - return; + return;// Nothing to correct; } BiasTokens(position, bias, tokens); BiasTokens(position, bias, numbers); } +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VApplication::BiasTokens change position for each token that have position more then "position". + * @param position token position + * @param bias difference between original token length and translated + * @param tokens all tokens + */ void VApplication::BiasTokens(int position, int bias, QMap &tokens) const { QMap newTokens; @@ -1613,7 +1672,7 @@ void VApplication::BiasTokens(int position, int bias, QMap &tokens while (i != tokens.constEnd()) { if (i.key()<= position) - { + { // Tokens before position "position" did not change his positions. newTokens.insert(i.key(), i.value()); } else @@ -1705,16 +1764,22 @@ QString VApplication::PostfixOperator(const QString &name) const } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VApplication::FormulaFromUser replace all known tokens in formula to internal look. Also change decimal + * separator in numbers. + * @param formula expression that need translate + * @return translated expression + */ QString VApplication::FormulaFromUser(const QString &formula) { - QString newFormula = formula; + QString newFormula = formula;// Local copy for making changes - Calculator *cal = new Calculator(formula); - QMap tokens = cal->GetTokens(); - QMap numbers = cal->GetNumbers(); + Calculator *cal = new Calculator(formula);// Eval formula + QMap tokens = cal->GetTokens();// Tokens (variables, measurements) + QMap numbers = cal->GetNumbers();// All numbers in expression for changing decimal separator delete cal; - QList tKeys = tokens.keys(); + QList tKeys = tokens.keys();// Take all tokens positions QList tValues = tokens.values(); for (int i = 0; i < tKeys.size(); ++i) { @@ -1722,7 +1787,7 @@ QString VApplication::FormulaFromUser(const QString &formula) if (MeasurementsFromUser(newFormula, tKeys.at(i), tValues.at(i), bias)) { if (bias != 0) - { + {// Translated token has different length than original. Position next tokens need to be corrected. CorrectionsPositions(tKeys.at(i), bias, tokens, numbers); tKeys = tokens.keys(); tValues = tokens.values(); @@ -1733,7 +1798,7 @@ QString VApplication::FormulaFromUser(const QString &formula) if (VariablesFromUser(newFormula, tKeys.at(i), tValues.at(i), bias)) { if (bias != 0) - { + {// Translated token has different length than original. Position next tokens need to be corrected. CorrectionsPositions(tKeys.at(i), bias, tokens, numbers); tKeys = tokens.keys(); tValues = tokens.values(); @@ -1744,7 +1809,7 @@ QString VApplication::FormulaFromUser(const QString &formula) if (PostfixOperatorsFromUser(newFormula, tKeys.at(i), tValues.at(i), bias)) { if (bias != 0) - { + {// Translated token has different length than original. Position next tokens need to be corrected. CorrectionsPositions(tKeys.at(i), bias, tokens, numbers); tKeys = tokens.keys(); tValues = tokens.values(); @@ -1755,7 +1820,7 @@ QString VApplication::FormulaFromUser(const QString &formula) if (FunctionsFromUser(newFormula, tKeys.at(i), tValues.at(i), bias)) { if (bias != 0) - { + {// Translated token has different length than original. Position next tokens need to be corrected. CorrectionsPositions(tKeys.at(i), bias, tokens, numbers); tKeys = tokens.keys(); tValues = tokens.values(); @@ -1764,28 +1829,28 @@ QString VApplication::FormulaFromUser(const QString &formula) } } - QLocale loc = QLocale::system(); + QLocale loc = QLocale::system(); // User locale if (loc != QLocale(QLocale::C) && getSettings()->GetOsSeparator()) - { - QList nKeys = numbers.keys(); + {// User want use Os separator + QList nKeys = numbers.keys();// Positions for all numbers in expression QList nValues = numbers.values(); for (int i = 0; i < nKeys.size(); ++i) { - loc = QLocale::system(); + loc = QLocale::system();// From system locale bool ok = false; const qreal d = loc.toDouble(nValues.at(i), &ok); if (ok == false) { qDebug()<<"Can't convert to double token"< tokens; QMap numbers; try { - Calculator *cal = new Calculator(formula, false); - tokens = cal->GetTokens(); - numbers = cal->GetNumbers(); + Calculator *cal = new Calculator(formula, false);// Eval formula + tokens = cal->GetTokens();// Tokens (variables, measurements) + numbers = cal->GetNumbers();// All numbers in expression for changing decimal separator delete cal; } catch (qmu::QmuParserError &e) @@ -1829,7 +1900,7 @@ QString VApplication::FormulaToUser(const QString &formula) newFormula.replace(tKeys.at(i), tValues.at(i).length(), measurements.value(tValues.at(i)).translate()); int bias = tValues.at(i).length() - measurements.value(tValues.at(i)).translate().length(); if (bias != 0) - { + {// Translated token has different length than original. Position next tokens need to be corrected. CorrectionsPositions(tKeys.at(i), bias, tokens, numbers); tKeys = tokens.keys(); tValues = tokens.values(); @@ -1842,7 +1913,7 @@ QString VApplication::FormulaToUser(const QString &formula) newFormula.replace(tKeys.at(i), tValues.at(i).length(), functions.value(tValues.at(i)).translate()); int bias = tValues.at(i).length() - functions.value(tValues.at(i)).translate().length(); if (bias != 0) - { + {// Translated token has different length than original. Position next tokens need to be corrected. CorrectionsPositions(tKeys.at(i), bias, tokens, numbers); tKeys = tokens.keys(); tValues = tokens.values(); @@ -1855,7 +1926,7 @@ QString VApplication::FormulaToUser(const QString &formula) newFormula.replace(tKeys.at(i), tValues.at(i).length(), postfixOperators.value(tValues.at(i)).translate()); int bias = tValues.at(i).length() - postfixOperators.value(tValues.at(i)).translate().length(); if (bias != 0) - { + {// Translated token has different length than original. Position next tokens need to be corrected. CorrectionsPositions(tKeys.at(i), bias, tokens, numbers); tKeys = tokens.keys(); tValues = tokens.values(); @@ -1867,7 +1938,7 @@ QString VApplication::FormulaToUser(const QString &formula) if (VariablesToUser(newFormula, tKeys.at(i), tValues.at(i), bias)) { if (bias != 0) - { + {// Translated token has different length than original. Position next tokens need to be corrected. CorrectionsPositions(tKeys.at(i), bias, tokens, numbers); tKeys = tokens.keys(); tValues = tokens.values(); @@ -1876,28 +1947,28 @@ QString VApplication::FormulaToUser(const QString &formula) } } - QLocale loc = QLocale::system(); + QLocale loc = QLocale::system();// User locale if (loc != QLocale::C && getSettings()->GetOsSeparator()) - { - QList nKeys = numbers.keys(); + {// User want use Os separator + QList nKeys = numbers.keys();// Positions for all numbers in expression QList nValues = numbers.values(); for (int i = 0; i < nKeys.size(); ++i) { - loc = QLocale(QLocale::C); + loc = QLocale(QLocale::C);// From pattern locale bool ok = false; const qreal d = loc.toDouble(nValues.at(i), &ok); if (ok == false) { qDebug()<<"Can't convert to double token"<FormulaFromUser(formula); + formula = qApp->FormulaFromUser(formula);// Translate to internal look. Calculator *cal = new Calculator(data); result = cal->EvalFormula(formula); delete cal; @@ -511,7 +511,7 @@ qreal DialogTool::Eval(const QString &text, bool &flag, QLabel *label, const QSt { loc = QLocale(QLocale::C); } - label->setText(loc.toString(result) + postfix); + label->setText(loc.toString(result) + " " +postfix); flag = true; ChangeColor(labelEditFormula, okColor); label->setToolTip(tr("Value")); @@ -532,7 +532,7 @@ qreal DialogTool::Eval(const QString &text, bool &flag, QLabel *label, const QSt << "--------------------------------------"; } } - CheckState(); + CheckState(); // Disable Ok and Apply buttons if something wrong. return result; } @@ -886,7 +886,7 @@ void DialogTool::EvalFormula() { SCASSERT(plainTextEditFormula != nullptr); SCASSERT(labelResultCalculation != nullptr); - const QString postfix = VDomDocument::UnitsToStr(qApp->patternUnit()); + const QString postfix = VDomDocument::UnitsToStr(qApp->patternUnit());//Show unit in dialog lable (cm, mm or inch) Eval(plainTextEditFormula->toPlainText(), flagFormula, labelResultCalculation, postfix, false); } From 1f51d0122f39fca3b1170463e18394faa586dbec Mon Sep 17 00:00:00 2001 From: Felix Ulber Date: Sun, 8 Feb 2015 20:16:13 +0100 Subject: [PATCH 123/186] arc tool dialog: tab changes focus for angle values, tab order --HG-- branch : develop --- src/app/dialogs/tools/dialogarc.ui | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/app/dialogs/tools/dialogarc.ui b/src/app/dialogs/tools/dialogarc.ui index 84ccc7856..1926f3291 100644 --- a/src/app/dialogs/tools/dialogarc.ui +++ b/src/app/dialogs/tools/dialogarc.ui @@ -354,6 +354,9 @@ 24 + + true + @@ -539,6 +542,9 @@ 24 + + true + @@ -790,8 +796,10 @@ toolButtonPutHereF1 toolButtonEqualF1 pushButtonGrowLengthF1 + plainTextEditF2 toolButtonPutHereF2 toolButtonEqualF2 + pushButtonGrowLengthF2 radioButtonSizeGrowth radioButtonStandardTable radioButtonIncrements @@ -801,7 +809,8 @@ radioButtonAngleLine checkBoxHideEmpty listWidget - buttonBox + comboBoxBasePoint + comboBoxColor @@ -814,8 +823,8 @@ accept() - 248 - 254 + 257 + 567 157 @@ -830,8 +839,8 @@ reject() - 316 - 260 + 325 + 567 286 From 77a24bba0bb6d9587ca3c2f7067049b1a79cf09c Mon Sep 17 00:00:00 2001 From: Felix Ulber Date: Sun, 8 Feb 2015 20:23:01 +0100 Subject: [PATCH 124/186] Tool dialog: disable "Hide Empty Measurements" checkbox when input data is "Size and height" --HG-- branch : develop --- src/app/dialogs/tools/dialogtool.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/app/dialogs/tools/dialogtool.cpp b/src/app/dialogs/tools/dialogtool.cpp index f81fc8cee..0a8d8d1b2 100644 --- a/src/app/dialogs/tools/dialogtool.cpp +++ b/src/app/dialogs/tools/dialogtool.cpp @@ -896,6 +896,9 @@ void DialogTool::EvalFormula() */ void DialogTool::SizeHeight() { + SCASSERT(checkBoxHideEmpty != nullptr); + checkBoxHideEmpty->setEnabled(false); + SCASSERT(listWidget != nullptr); listWidget->blockSignals(true); listWidget->clear(); From ba5e218ff465bf6d5244d7878cae0dbae7c4de4a Mon Sep 17 00:00:00 2001 From: Felix Ulber Date: Sun, 8 Feb 2015 20:58:03 +0100 Subject: [PATCH 125/186] DialogTool: Line Angle property not considered in ValChenged slot --HG-- branch : develop --- src/app/dialogs/tools/dialogtool.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/app/dialogs/tools/dialogtool.cpp b/src/app/dialogs/tools/dialogtool.cpp index 0a8d8d1b2..0f433af34 100644 --- a/src/app/dialogs/tools/dialogtool.cpp +++ b/src/app/dialogs/tools/dialogtool.cpp @@ -1078,6 +1078,15 @@ void DialogTool::ValChenged(int row) labelDescription->setText(desc); return; } + + if (radioButtonAngleLine->isChecked()) + { + QString desc = QString("%1(%2) - %3").arg(item->text()) + .arg(*data->GetVariable(qApp->VarFromUser(item->text()))->GetValue()) + .arg(tr("Line Angle")); + labelDescription->setText(desc); + return; + } } //--------------------------------------------------------------------------------------------------------------------- From 2885abb5a1100938b2d2e16104e0c38d417443ae Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sun, 8 Feb 2015 23:55:24 +0200 Subject: [PATCH 126/186] Fixed issue #242. Tool Dialogs: Label at bottom doesn't update for empty lists. --HG-- branch : develop --- src/app/dialogs/tools/dialogarc.cpp | 22 ------------------- src/app/dialogs/tools/dialogarc.h | 1 - .../dialogs/tools/dialogpointofcontact.cpp | 1 - src/app/dialogs/tools/dialogtool.cpp | 3 ++- 4 files changed, 2 insertions(+), 25 deletions(-) diff --git a/src/app/dialogs/tools/dialogarc.cpp b/src/app/dialogs/tools/dialogarc.cpp index 92a78cf4d..726a05d27 100644 --- a/src/app/dialogs/tools/dialogarc.cpp +++ b/src/app/dialogs/tools/dialogarc.cpp @@ -263,28 +263,6 @@ void DialogArc::closeEvent(QCloseEvent *event) DialogTool::closeEvent(event); } -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief ValChenged show description angles of lines - * @param row number of row - */ -void DialogArc::ValChenged(int row) -{ - if (ui->listWidget->count() == 0) - { - return; - } - QListWidgetItem *item = ui->listWidget->item( row ); - if (ui->radioButtonAngleLine->isChecked()) - { - qreal angle = *data->GetVariable(item->text())->GetValue(); - QString desc = QString("%1(%2) - %3").arg(item->text()).arg(angle).arg(tr("Value of angle of line.")); - ui->labelDescription->setText(desc); - return; - } - DialogTool::ValChenged(row); -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief PutRadius put variable into formula of radius diff --git a/src/app/dialogs/tools/dialogarc.h b/src/app/dialogs/tools/dialogarc.h index 40de32e27..35c5e46db 100644 --- a/src/app/dialogs/tools/dialogarc.h +++ b/src/app/dialogs/tools/dialogarc.h @@ -70,7 +70,6 @@ public slots: void DeployFormulaTextEdit(); void DeployF1TextEdit(); void DeployF2TextEdit(); - virtual void ValChenged(int row); void PutRadius(); void PutF1(); void PutF2(); diff --git a/src/app/dialogs/tools/dialogpointofcontact.cpp b/src/app/dialogs/tools/dialogpointofcontact.cpp index d01773ffb..94046df76 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.cpp +++ b/src/app/dialogs/tools/dialogpointofcontact.cpp @@ -62,7 +62,6 @@ DialogPointOfContact::DialogPointOfContact(const VContainer *data, const quint32 connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogPointOfContact::PutHere); connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogPointOfContact::PutVal); - connect(ui->listWidget, &QListWidget::currentRowChanged, this, &DialogPointOfContact::ValChenged); if (qApp->patternType() == MeasurementsType::Standard) { diff --git a/src/app/dialogs/tools/dialogtool.cpp b/src/app/dialogs/tools/dialogtool.cpp index 0f433af34..4605dff65 100644 --- a/src/app/dialogs/tools/dialogtool.cpp +++ b/src/app/dialogs/tools/dialogtool.cpp @@ -1020,6 +1020,7 @@ void DialogTool::ValChenged(int row) SCASSERT(radioButtonLengthCurve != nullptr); if (listWidget->count() == 0) { + labelDescription->setText(""); return; } QListWidgetItem *item = listWidget->item( row ); @@ -1078,7 +1079,6 @@ void DialogTool::ValChenged(int row) labelDescription->setText(desc); return; } - if (radioButtonAngleLine->isChecked()) { QString desc = QString("%1(%2) - %3").arg(item->text()) @@ -1158,6 +1158,7 @@ void DialogTool::ShowVariable(const QMap var) SCASSERT(checkBoxHideEmpty != nullptr); listWidget->blockSignals(true); listWidget->clear(); + labelDescription->setText(""); QMapIterator iMap(var); while (iMap.hasNext()) From c2191dd8d0b296df79041c7814b27593b2e7f1e9 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 9 Feb 2015 11:54:19 +0200 Subject: [PATCH 127/186] Fixed issue #217. Bug with mouse cursor. --HG-- branch : develop --- src/app/mainwindow.cpp | 49 ++++---------------- src/app/mainwindow.h | 1 + src/app/tools/drawTools/vdrawtool.cpp | 7 +++ src/app/tools/drawTools/vdrawtool.h | 1 + src/app/tools/drawTools/vtoolpoint.cpp | 1 + src/app/tools/drawTools/vtoolsinglepoint.cpp | 34 ++++++++++---- src/app/tools/drawTools/vtoolsinglepoint.h | 1 + src/app/widgets/vmaingraphicsscene.cpp | 6 +++ src/app/widgets/vmaingraphicsscene.h | 2 + src/app/xml/vpattern.cpp | 1 + 10 files changed, 54 insertions(+), 49 deletions(-) diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index e13907407..de93e055c 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -92,6 +92,7 @@ MainWindow::MainWindow(QWidget *parent) sceneDraw = new VMainGraphicsScene(); currentScene = sceneDraw; qApp->setCurrentScene(currentScene); + connect(this, &MainWindow::EnableItemMove, sceneDraw, &VMainGraphicsScene::EnableItemMove); connect(sceneDraw, &VMainGraphicsScene::mouseMove, this, &MainWindow::mouseMove); sceneDetails = new VMainGraphicsScene(); connect(sceneDetails, &VMainGraphicsScene::mouseMove, this, &MainWindow::mouseMove); @@ -244,7 +245,9 @@ void MainWindow::ActionNewPP() sceneDraw->addItem(spoint); ui->view->itemClicked(spoint); connect(spoint, &VToolPoint::ChoosedTool, sceneDraw, &VMainGraphicsScene::ChoosedItem); + connect(sceneDraw, &VMainGraphicsScene::DisableItem, spoint, &VToolSinglePoint::Disable); connect(sceneDraw, &VMainGraphicsScene::NewFactor, spoint, &VToolSinglePoint::SetFactor); + connect(sceneDraw, &VMainGraphicsScene::EnableToolMove, spoint, &VToolSinglePoint::EnableToolMove); QHash* tools = doc->getTools(); SCASSERT(tools != nullptr); tools->insert(id, spoint); @@ -1046,114 +1049,75 @@ void MainWindow::CancelTool() ui->actionArrowTool->setChecked(false); helpLabel->setText(""); ui->actionStopTool->setEnabled(true); - break; + emit EnableItemMove(false); + return; case Tool::SinglePoint: Q_UNREACHABLE(); //Nothing to do here because we can't create this tool from main window. break; case Tool::EndLine: ui->toolButtonEndLine->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::Line: ui->toolButtonLine->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearFocus(); break; case Tool::AlongLine: ui->toolButtonAlongLine->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::ShoulderPoint: ui->toolButtonShoulderPoint->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::Normal: ui->toolButtonNormal->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::Bisector: ui->toolButtonBisector->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::LineIntersect: ui->toolButtonLineIntersect->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::Spline: ui->toolButtonSpline->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::Arc: ui->toolButtonArc->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::SplinePath: ui->toolButtonSplinePath->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::PointOfContact: ui->toolButtonPointOfContact->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::Detail: ui->toolButtonNewDetail->setChecked(false); break; case Tool::Height: ui->toolButtonHeight->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::Triangle: ui->toolButtonTriangle->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::PointOfIntersection: ui->toolButtonPointOfIntersection->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::CutSpline: ui->toolButtonSplineCutPoint->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::CutSplinePath: ui->toolButtonSplinePathCutPoint->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::UnionDetails: ui->toolButtonUnionDetails->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::CutArc: ui->toolButtonArcCutPoint->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::LineIntersectAxis: ui->toolButtonLineIntersectAxis->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::CurveIntersectAxis: ui->toolButtonCurveIntersectAxis->setChecked(false); ui->toolButtonArcIntersectAxis->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::NodePoint: case Tool::NodeArc: @@ -1163,6 +1127,9 @@ void MainWindow::CancelTool() qDebug()<<"Got wrong tool type. Ignored."; break; } + currentScene->setFocus(Qt::OtherFocusReason); + currentScene->clearSelection(); + emit EnableItemMove(true); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/mainwindow.h b/src/app/mainwindow.h index 20f1dc927..3e1a2c210 100644 --- a/src/app/mainwindow.h +++ b/src/app/mainwindow.h @@ -139,6 +139,7 @@ signals: void ModelChosen(QVector listDetails, const QString &curFile, const QString &description); void RefreshHistory(); + void EnableItemMove(bool move); protected: virtual void keyPressEvent(QKeyEvent *event); virtual void showEvent(QShowEvent *event); diff --git a/src/app/tools/drawTools/vdrawtool.cpp b/src/app/tools/drawTools/vdrawtool.cpp index 597399843..608599c1d 100644 --- a/src/app/tools/drawTools/vdrawtool.cpp +++ b/src/app/tools/drawTools/vdrawtool.cpp @@ -206,6 +206,13 @@ void VDrawTool::SetFactor(qreal factor) VApplication::CheckFactor(this->factor, factor); } +//--------------------------------------------------------------------------------------------------------------------- +void VDrawTool::EnableToolMove(bool move) +{ + Q_UNUSED(move) + // Do nothing. +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief CheckFormula check formula. diff --git a/src/app/tools/drawTools/vdrawtool.h b/src/app/tools/drawTools/vdrawtool.h index 021387e20..d76e5c99f 100644 --- a/src/app/tools/drawTools/vdrawtool.h +++ b/src/app/tools/drawTools/vdrawtool.h @@ -69,6 +69,7 @@ public slots: virtual void FullUpdateFromGuiOk(int result); virtual void FullUpdateFromGuiApply(); virtual void SetFactor(qreal factor); + virtual void EnableToolMove(bool move); protected: /** @brief ignoreFullUpdate ignore or not full updates. */ diff --git a/src/app/tools/drawTools/vtoolpoint.cpp b/src/app/tools/drawTools/vtoolpoint.cpp index d082ddd20..28753d1a2 100644 --- a/src/app/tools/drawTools/vtoolpoint.cpp +++ b/src/app/tools/drawTools/vtoolpoint.cpp @@ -216,6 +216,7 @@ void VToolPoint::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); this->setPen(QPen(CorrectColor(baseColor), qApp->toPixel(qApp->widthHairLine())/factor)); + QGraphicsEllipseItem::hoverLeaveEvent(event); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/tools/drawTools/vtoolsinglepoint.cpp b/src/app/tools/drawTools/vtoolsinglepoint.cpp index 003d7b3a5..0948cecc1 100644 --- a/src/app/tools/drawTools/vtoolsinglepoint.cpp +++ b/src/app/tools/drawTools/vtoolsinglepoint.cpp @@ -205,7 +205,10 @@ void VToolSinglePoint::hoverEnterEvent(QGraphicsSceneHoverEvent *event) { VToolPoint::hoverEnterEvent(event); - VApplication::setOverrideCursor(QStringLiteral("://cursor/cursor-arrow-openhand.png"), 1, 1); + if (flags() & QGraphicsItem::ItemIsMovable) + { + VApplication::setOverrideCursor(QStringLiteral("://cursor/cursor-arrow-openhand.png"), 1, 1); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -213,16 +216,22 @@ void VToolSinglePoint::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { VToolPoint::hoverLeaveEvent(event); - //Disable cursor-arrow-openhand - VApplication::restoreOverrideCursor(QStringLiteral("://cursor/cursor-arrow-openhand.png")); + if (flags() & QGraphicsItem::ItemIsMovable) + { + //Disable cursor-arrow-openhand + VApplication::restoreOverrideCursor(QStringLiteral("://cursor/cursor-arrow-openhand.png")); + } } //--------------------------------------------------------------------------------------------------------------------- void VToolSinglePoint::mousePressEvent(QGraphicsSceneMouseEvent *event) { - if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) + if (flags() & QGraphicsItem::ItemIsMovable) { - VApplication::setOverrideCursor(QStringLiteral("://cursor/cursor-arrow-closehand.png"), 1, 1); + if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) + { + VApplication::setOverrideCursor(QStringLiteral("://cursor/cursor-arrow-closehand.png"), 1, 1); + } } VToolPoint::mousePressEvent(event); } @@ -230,10 +239,13 @@ void VToolSinglePoint::mousePressEvent(QGraphicsSceneMouseEvent *event) //--------------------------------------------------------------------------------------------------------------------- void VToolSinglePoint::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { - if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) + if (flags() & QGraphicsItem::ItemIsMovable) { - //Disable cursor-arrow-closehand - VApplication::restoreOverrideCursor(QStringLiteral("://cursor/cursor-arrow-closehand.png")); + if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) + { + //Disable cursor-arrow-closehand + VApplication::restoreOverrideCursor(QStringLiteral("://cursor/cursor-arrow-closehand.png")); + } } VToolPoint::mouseReleaseEvent(event); } @@ -332,3 +344,9 @@ void VToolSinglePoint::ShowContextMenu(QGraphicsSceneContextMenuEvent *event) ContextMenu(this, event, false); } } + +//--------------------------------------------------------------------------------------------------------------------- +void VToolSinglePoint::EnableToolMove(bool move) +{ + this->setFlag(QGraphicsItem::ItemIsMovable, move); +} diff --git a/src/app/tools/drawTools/vtoolsinglepoint.h b/src/app/tools/drawTools/vtoolsinglepoint.h index 833365a9b..9ecdf2c28 100644 --- a/src/app/tools/drawTools/vtoolsinglepoint.h +++ b/src/app/tools/drawTools/vtoolsinglepoint.h @@ -50,6 +50,7 @@ public slots: virtual void FullUpdateFromFile(); virtual void SetFactor(qreal factor); virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event); + virtual void EnableToolMove(bool move); signals: /** * @brief FullUpdateTree handle if need update pattern file. diff --git a/src/app/widgets/vmaingraphicsscene.cpp b/src/app/widgets/vmaingraphicsscene.cpp index 7ecad701f..0d4b77150 100644 --- a/src/app/widgets/vmaingraphicsscene.cpp +++ b/src/app/widgets/vmaingraphicsscene.cpp @@ -126,3 +126,9 @@ void VMainGraphicsScene::SetFactor(qreal factor) scaleFactor=scaleFactor*factor; emit NewFactor(scaleFactor); } + +//--------------------------------------------------------------------------------------------------------------------- +void VMainGraphicsScene::EnableItemMove(bool move) +{ + emit EnableToolMove(move); +} diff --git a/src/app/widgets/vmaingraphicsscene.h b/src/app/widgets/vmaingraphicsscene.h index 96288c0ca..06f2cd5b6 100644 --- a/src/app/widgets/vmaingraphicsscene.h +++ b/src/app/widgets/vmaingraphicsscene.h @@ -52,6 +52,7 @@ public: public slots: void ChoosedItem(quint32 id, const SceneObject &type); void SetFactor(qreal factor); + void EnableItemMove(bool move); protected: virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event); virtual void mousePressEvent(QGraphicsSceneMouseEvent *event); @@ -78,6 +79,7 @@ signals: */ void NewFactor(qreal factor); void DisableItem(bool disable); + void EnableToolMove(bool move); private: /** @brief horScrollBar value horizontal scroll bar. */ qint32 horScrollBar; diff --git a/src/app/xml/vpattern.cpp b/src/app/xml/vpattern.cpp index 5b5d3b4f9..df52079ec 100644 --- a/src/app/xml/vpattern.cpp +++ b/src/app/xml/vpattern.cpp @@ -1163,6 +1163,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem connect(spoint, &VToolSinglePoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, spoint, &VToolSinglePoint::SetFactor); connect(scene, &VMainGraphicsScene::DisableItem, spoint, &VToolSinglePoint::Disable); + connect(scene, &VMainGraphicsScene::EnableToolMove, spoint, &VToolSinglePoint::EnableToolMove); tools[id] = spoint; } } From cc65f00e2fe1b708e9f7e8aae7e2c05249129224 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 9 Feb 2015 18:34:50 +0200 Subject: [PATCH 128/186] Windows build. --HG-- branch : develop --- src/app/dialogs/app/dialoglayoutprogress.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/dialogs/app/dialoglayoutprogress.cpp b/src/app/dialogs/app/dialoglayoutprogress.cpp index a32c83a6e..d7d5fb620 100644 --- a/src/app/dialogs/app/dialoglayoutprogress.cpp +++ b/src/app/dialogs/app/dialoglayoutprogress.cpp @@ -31,6 +31,7 @@ #include "../options.h" #include +#include //--------------------------------------------------------------------------------------------------------------------- DialogLayoutProgress::DialogLayoutProgress(int count, QWidget *parent) From 8c0bdcc612cb63e78c1af70fcdce12fc58779633 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 10 Feb 2015 13:39:31 +0200 Subject: [PATCH 129/186] Make parser static locale variable local for each parser instance. --HG-- branch : feature --- src/libs/qmuparser/qmuparser.cpp | 4 +-- src/libs/qmuparser/qmuparser.h | 2 +- src/libs/qmuparser/qmuparserbase.cpp | 27 +++++++++++++++------ src/libs/qmuparser/qmuparserbase.h | 5 +++- src/libs/qmuparser/qmuparserdef.h | 2 +- src/libs/qmuparser/qmuparsertest.cpp | 3 ++- src/libs/qmuparser/qmuparsertest.h | 2 +- src/libs/qmuparser/qmuparsertokenreader.cpp | 8 +++--- src/libs/qmuparser/qmuparsertokenreader.h | 4 +-- 9 files changed, 37 insertions(+), 20 deletions(-) diff --git a/src/libs/qmuparser/qmuparser.cpp b/src/libs/qmuparser/qmuparser.cpp index 799c6c8ca..bac0ecf00 100644 --- a/src/libs/qmuparser/qmuparser.cpp +++ b/src/libs/qmuparser/qmuparser.cpp @@ -199,14 +199,14 @@ qreal QmuParser::Max(const qreal *a_afArg, int a_iArgc) * @param [out] a_fVal Pointer where the value should be stored in case one is found. * @return 1 if a value was found 0 otherwise. */ -int QmuParser::IsVal(const QString &a_szExpr, int *a_iPos, qreal *a_fVal) +int QmuParser::IsVal(const QString &a_szExpr, int *a_iPos, qreal *a_fVal, const std::locale &s_locale) { qreal fVal(0); std::wstring a_szExprStd = a_szExpr.toStdWString(); stringstream_type stream(a_szExprStd); stream.seekg(0); // todo: check if this really is necessary - stream.imbue(QmuParser::s_locale); + stream.imbue(s_locale); stream >> fVal; stringstream_type::pos_type iEnd = stream.tellg(); // Position after reading diff --git a/src/libs/qmuparser/qmuparser.h b/src/libs/qmuparser/qmuparser.h index e65bdfa40..f35f545cc 100644 --- a/src/libs/qmuparser/qmuparser.h +++ b/src/libs/qmuparser/qmuparser.h @@ -54,7 +54,7 @@ namespace qmu virtual void OnDetectVar(const QString &pExpr, int &nStart, int &nEnd); qreal Diff(qreal *a_Var, qreal a_fPos, qreal a_fEpsilon = 0) const; protected: - static int IsVal(const QString &a_szExpr, int *a_iPos, qreal *a_fVal); + static int IsVal(const QString &a_szExpr, int *a_iPos, qreal *a_fVal, const std::locale &s_locale); // Trigonometric functions static qreal Tan2(qreal, qreal); // hyperbolic functions diff --git a/src/libs/qmuparser/qmuparserbase.cpp b/src/libs/qmuparser/qmuparserbase.cpp index c627e1f80..7455d3046 100644 --- a/src/libs/qmuparser/qmuparserbase.cpp +++ b/src/libs/qmuparser/qmuparserbase.cpp @@ -37,7 +37,6 @@ using namespace std; namespace qmu { -std::locale QmuParserBase::s_locale = std::locale(std::locale::classic(), new change_dec_sep('.')); bool QmuParserBase::g_DbgDumpCmdCode = false; bool QmuParserBase::g_DbgDumpStack = false; @@ -57,7 +56,8 @@ const QStringList QmuParserBase::c_DefaultOprt = QStringList()<< "<=" << ">=" << * @brief Constructor. */ QmuParserBase::QmuParserBase() - :m_pParseFormula(&QmuParserBase::ParseString), m_vRPN(), m_vStringBuf(), m_vStringVarBuf(), m_pTokenReader(), + :s_locale(std::locale(std::locale::classic(), new change_dec_sep('.'))), + m_pParseFormula(&QmuParserBase::ParseString), m_vRPN(), m_vStringBuf(), m_vStringVarBuf(), m_pTokenReader(), m_FunDef(), m_PostOprtDef(), m_InfixOprtDef(), m_OprtDef(), m_ConstDef(), m_StrVarDef(), m_VarDef(), m_bBuiltInOp(true), m_sNameChars(), m_sOprtChars(), m_sInfixOprtChars(), m_nIfElseCounter(0), m_vStackBuffer(), m_nFinalResultIdx(0), m_Tokens(QMap()), m_Numbers(QMap()), allowSubexpressions(true) @@ -72,10 +72,11 @@ QmuParserBase::QmuParserBase() * Tha parser can be safely copy constructed but the bytecode is reset during copy construction. */ QmuParserBase::QmuParserBase(const QmuParserBase &a_Parser) - :m_pParseFormula(&QmuParserBase::ParseString), m_vRPN(), m_vStringBuf(), m_vStringVarBuf(), m_pTokenReader(), - m_FunDef(), m_PostOprtDef(), m_InfixOprtDef(), m_OprtDef(), m_ConstDef(), m_StrVarDef(), m_VarDef(), - m_bBuiltInOp(true), m_sNameChars(), m_sOprtChars(), m_sInfixOprtChars(), m_nIfElseCounter(0), m_vStackBuffer(), - m_nFinalResultIdx(0), m_Tokens(QMap()), m_Numbers(QMap()), allowSubexpressions(true) + :s_locale(a_Parser.getLocale()), m_pParseFormula(&QmuParserBase::ParseString), m_vRPN(), m_vStringBuf(), + m_vStringVarBuf(), m_pTokenReader(), m_FunDef(), m_PostOprtDef(), m_InfixOprtDef(), m_OprtDef(), m_ConstDef(), + m_StrVarDef(), m_VarDef(), m_bBuiltInOp(true), m_sNameChars(), m_sOprtChars(), m_sInfixOprtChars(), + m_nIfElseCounter(0), m_vStackBuffer(), m_nFinalResultIdx(0), m_Tokens(QMap()), + m_Numbers(QMap()), allowSubexpressions(true) { m_pTokenReader.reset(new token_reader_type(this)); Assign(a_Parser); @@ -220,6 +221,18 @@ void QmuParserBase::setAllowSubexpressions(bool value) allowSubexpressions = value; } +//--------------------------------------------------------------------------------------------------------------------- +std::locale QmuParserBase::getLocale() const +{ + return s_locale; +} + +//--------------------------------------------------------------------------------------------------------------------- +void QmuParserBase::setLocale(const std::locale &value) +{ + s_locale = value; +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief Returns the version of muparser. @@ -1300,7 +1313,7 @@ void QmuParserBase::CreateRPN() const for (;;) { - opt = m_pTokenReader->ReadNextToken(); + opt = m_pTokenReader->ReadNextToken(s_locale); switch (opt.GetCode()) { diff --git a/src/libs/qmuparser/qmuparserbase.h b/src/libs/qmuparser/qmuparserbase.h index 59d8b7c59..dc9a36385 100644 --- a/src/libs/qmuparser/qmuparserbase.h +++ b/src/libs/qmuparser/qmuparserbase.h @@ -122,9 +122,12 @@ public: } void setAllowSubexpressions(bool value); + std::locale getLocale() const; + void setLocale(const std::locale &value); + protected: static const QStringList c_DefaultOprt; - static std::locale s_locale; ///< The locale used by the parser + std::locale s_locale; ///< The locale used by the parser static bool g_DbgDumpCmdCode; static bool g_DbgDumpStack; void Init(); diff --git a/src/libs/qmuparser/qmuparserdef.h b/src/libs/qmuparser/qmuparserdef.h index cf6ce2652..a74d29d00 100644 --- a/src/libs/qmuparser/qmuparserdef.h +++ b/src/libs/qmuparser/qmuparserdef.h @@ -275,7 +275,7 @@ typedef qreal ( *strfun_type2 ) ( const QString &, qreal ); typedef qreal ( *strfun_type3 ) ( const QString &, qreal, qreal ); /** @brief Callback used for functions that identify values in a string. */ -typedef int ( *identfun_type ) ( const QString &sExpr, int *nPos, qreal *fVal ); +typedef int ( *identfun_type ) ( const QString &sExpr, int *nPos, qreal *fVal, const std::locale &s_locale ); /** @brief Callback used for variable creation factory functions. */ typedef qreal* ( *facfun_type ) ( const QString &, void* ); diff --git a/src/libs/qmuparser/qmuparsertest.cpp b/src/libs/qmuparser/qmuparsertest.cpp index 1d11cef83..a5ffb9dac 100644 --- a/src/libs/qmuparser/qmuparsertest.cpp +++ b/src/libs/qmuparser/qmuparsertest.cpp @@ -62,8 +62,9 @@ QmuParserTester::QmuParserTester() } //--------------------------------------------------------------------------------------------------------------------- -int QmuParserTester::IsHexVal ( const QString &a_szExpr, int *a_iPos, qreal *a_fVal ) +int QmuParserTester::IsHexVal ( const QString &a_szExpr, int *a_iPos, qreal *a_fVal, const std::locale &s_locale ) { + Q_UNUSED(s_locale) if ( a_szExpr.data()[1] == 0 || ( a_szExpr.data()[0] != '0' || a_szExpr.data()[1] != 'x' ) ) { return 0; diff --git a/src/libs/qmuparser/qmuparsertest.h b/src/libs/qmuparser/qmuparsertest.h index d2ae906ef..d1ffe91a8 100644 --- a/src/libs/qmuparser/qmuparsertest.h +++ b/src/libs/qmuparser/qmuparsertest.h @@ -276,7 +276,7 @@ private: } // Custom value recognition - static int IsHexVal ( const QString &a_szExpr, int *a_iPos, qreal *a_fVal ); + static int IsHexVal (const QString &a_szExpr, int *a_iPos, qreal *a_fVal , const std::locale &s_locale); // cppcheck-suppress functionStatic int TestNames(); diff --git a/src/libs/qmuparser/qmuparsertokenreader.cpp b/src/libs/qmuparser/qmuparsertokenreader.cpp index 9475308cc..d5515eb94 100644 --- a/src/libs/qmuparser/qmuparsertokenreader.cpp +++ b/src/libs/qmuparser/qmuparsertokenreader.cpp @@ -204,7 +204,7 @@ void QmuParserTokenReader::ReInit() /** * @brief Read the next token from the string. */ -QmuParserTokenReader::token_type QmuParserTokenReader::ReadNextToken() +QmuParserTokenReader::token_type QmuParserTokenReader::ReadNextToken(const std::locale &s_locale) { assert ( m_pParser ); @@ -236,7 +236,7 @@ QmuParserTokenReader::token_type QmuParserTokenReader::ReadNextToken() { return SaveBeforeReturn ( tok ); // Check for function argument separators } - if ( IsValTok ( tok ) ) + if ( IsValTok ( tok, s_locale ) ) { return SaveBeforeReturn ( tok ); // Check for values / constant tokens } @@ -766,7 +766,7 @@ bool QmuParserTokenReader::IsPostOpTok ( token_type &a_Tok ) * @param a_Tok [out] If a value token is found it will be placed here. * @return true if a value token has been found. */ -bool QmuParserTokenReader::IsValTok ( token_type &a_Tok ) +bool QmuParserTokenReader::IsValTok ( token_type &a_Tok, const std::locale &s_locale ) { assert ( m_pConstDef ); assert ( m_pParser ); @@ -802,7 +802,7 @@ bool QmuParserTokenReader::IsValTok ( token_type &a_Tok ) for ( item = m_vIdentFun.begin(); item != m_vIdentFun.end(); ++item ) { int iStart = m_iPos; - if ( ( *item ) ( m_strFormula.mid ( m_iPos ), &m_iPos, &fVal ) == 1 ) + if ( ( *item ) ( m_strFormula.mid ( m_iPos ), &m_iPos, &fVal, s_locale ) == 1 ) { // 2013-11-27 Issue 2: https://code.google.com/p/muparser/issues/detail?id=2 strTok = m_strFormula.mid ( iStart, m_iPos-iStart ); diff --git a/src/libs/qmuparser/qmuparsertokenreader.h b/src/libs/qmuparser/qmuparsertokenreader.h index 43d08106e..5a28e5136 100644 --- a/src/libs/qmuparser/qmuparsertokenreader.h +++ b/src/libs/qmuparser/qmuparsertokenreader.h @@ -58,7 +58,7 @@ public: QChar GetArgSep() const; void IgnoreUndefVar(bool bIgnore); void ReInit(); - token_type ReadNextToken(); + token_type ReadNextToken(const std::locale &s_locale); private: /** @@ -103,7 +103,7 @@ private: bool IsFunTok(token_type &a_Tok); bool IsPostOpTok(token_type &a_Tok); bool IsOprt(token_type &a_Tok); - bool IsValTok(token_type &a_Tok); + bool IsValTok(token_type &a_Tok, const std::locale &s_locale); bool IsVarTok(token_type &a_Tok); bool IsStrVarTok(token_type &a_Tok); bool IsUndefVarTok(token_type &a_Tok); From 7176bd0668f9fb0f7d3d81b1a757969639329fdf Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 10 Feb 2015 13:51:51 +0200 Subject: [PATCH 130/186] Bug in VFormula class. SetFormula was broken. --HG-- branch : feature --- src/app/container/vformula.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/container/vformula.cpp b/src/app/container/vformula.cpp index fa345e4a5..247ed1ab7 100644 --- a/src/app/container/vformula.cpp +++ b/src/app/container/vformula.cpp @@ -113,11 +113,11 @@ void VFormula::SetFormula(const QString &value, FormulaType type) { if (type == FormulaType::ToUser) { - formula = value; + formula = qApp->FormulaToUser(value); } else { - formula = qApp->FormulaToUser(value); + formula = value; } formula.replace("\n", " ");// Replace line return with spaces for calc if exist Eval(); From 420f2e1da7a7a84f7e051ff53fc04d5c90ee6f46 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 10 Feb 2015 14:46:11 +0200 Subject: [PATCH 131/186] "," can't be argument separator in C locale. Parser will return error for big numbers. --HG-- branch : feature --- src/app/container/calculator.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/container/calculator.cpp b/src/app/container/calculator.cpp index 0e984658b..dc0796c7d 100644 --- a/src/app/container/calculator.cpp +++ b/src/app/container/calculator.cpp @@ -245,7 +245,8 @@ qreal* Calculator::AddVariable(const QString &a_szName, void *a_pUserData) */ void Calculator::SetSepForEval() { - SetArgSep(','); + SetArgSep(';'); + SetThousandsSep(','); SetDecSep('.'); } From cfc2b187f6366672204f99811f613a6e562ed9cc Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 10 Feb 2015 15:17:18 +0200 Subject: [PATCH 132/186] Dialogs don't return correct formulas. --HG-- branch : feature --- src/app/dialogs/tools/dialogarc.cpp | 8 ++++---- src/app/dialogs/tools/dialogpointofcontact.cpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/dialogs/tools/dialogarc.cpp b/src/app/dialogs/tools/dialogarc.cpp index 726a05d27..778f64c9e 100644 --- a/src/app/dialogs/tools/dialogarc.cpp +++ b/src/app/dialogs/tools/dialogarc.cpp @@ -191,7 +191,7 @@ void DialogArc::SetF1(const QString &value) */ void DialogArc::SetRadius(const QString &value) { - radius = value; + radius = qApp->FormulaToUser(value); // increase height if needed. if (radius.length() > 80) { @@ -443,7 +443,7 @@ quint32 DialogArc::GetCenter() const */ QString DialogArc::GetRadius() const { - return radius; + return qApp->FormulaFromUser(radius); } //--------------------------------------------------------------------------------------------------------------------- @@ -453,7 +453,7 @@ QString DialogArc::GetRadius() const */ QString DialogArc::GetF1() const { - return f1; + return qApp->FormulaFromUser(f1); } //--------------------------------------------------------------------------------------------------------------------- @@ -463,5 +463,5 @@ QString DialogArc::GetF1() const */ QString DialogArc::GetF2() const { - return f2; + return qApp->FormulaFromUser(f2); } diff --git a/src/app/dialogs/tools/dialogpointofcontact.cpp b/src/app/dialogs/tools/dialogpointofcontact.cpp index 94046df76..84328c2f3 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.cpp +++ b/src/app/dialogs/tools/dialogpointofcontact.cpp @@ -271,7 +271,7 @@ void DialogPointOfContact::setCenter(const quint32 &value) */ void DialogPointOfContact::setRadius(const QString &value) { - radius = value; + radius = qApp->FormulaToUser(value); // increase height if needed. if (radius.length() > 80) { @@ -300,7 +300,7 @@ void DialogPointOfContact::SetPointName(const QString &value) */ QString DialogPointOfContact::getRadius() const { - return radius; + return qApp->FormulaFromUser(radius); } //--------------------------------------------------------------------------------------------------------------------- From abca716d7bf97f5a05d55512462bf877f4f48439 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 10 Feb 2015 16:27:16 +0200 Subject: [PATCH 133/186] DebugBreak() exist only for MSVC compiler. --HG-- branch : develop --- src/libs/ifc/ifcdef.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libs/ifc/ifcdef.h b/src/libs/ifc/ifcdef.h index 4ca03fff6..3426f76ef 100644 --- a/src/libs/ifc/ifcdef.h +++ b/src/libs/ifc/ifcdef.h @@ -72,7 +72,7 @@ static const quint32 null_id = 0; } \ } \ -#else +#else // GCC (Windows) #define SCASSERT(cond) \ { \ @@ -80,12 +80,12 @@ static const quint32 null_id = 0; { \ qDebug("ASSERT: %s in %s (%s:%u)", \ #cond, __PRETTY_FUNCTION__, __FILE__, __LINE__);\ - DebugBreak(); \ + std::raise(SIGTRAP); \ } \ } \ #endif /*Q_CC_MSVC*/ -#else +#else // UNIX #define SCASSERT(cond) \ { \ if (!(cond)) \ @@ -99,7 +99,7 @@ static const quint32 null_id = 0; #endif /* Q_OS_WIN32 */ #else // define but disable this function if debugging is not set #define SCASSERT(cond) qt_noop(); -#endif /* QT_NO_DEBUG */ +#endif /* V_NO_ASSERT */ // Detect whether the compiler supports C++11 noexcept exception specifications. # if defined(__clang__) From a12eb73bece76440747c127b6ca92f609bb7410a Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 10 Feb 2015 19:50:47 +0200 Subject: [PATCH 134/186] Dynamic update tool property browser after applying options changes. --HG-- branch : feature --- src/app/dialogs/app/configdialog.cpp | 1 + src/app/dialogs/app/configdialog.h | 2 ++ src/app/mainwindow.cpp | 1 + 3 files changed, 4 insertions(+) diff --git a/src/app/dialogs/app/configdialog.cpp b/src/app/dialogs/app/configdialog.cpp index 52bc5d5f0..c210cdf12 100644 --- a/src/app/dialogs/app/configdialog.cpp +++ b/src/app/dialogs/app/configdialog.cpp @@ -156,6 +156,7 @@ void ConfigDialog::Apply() default: break; } + emit UpdateProperties(); setResult(QDialog::Accepted); } diff --git a/src/app/dialogs/app/configdialog.h b/src/app/dialogs/app/configdialog.h index 8045a33d2..1c93a6ab6 100644 --- a/src/app/dialogs/app/configdialog.h +++ b/src/app/dialogs/app/configdialog.h @@ -43,6 +43,8 @@ public: explicit ConfigDialog(QWidget *parent = nullptr); public slots: void changePage(QListWidgetItem *current, QListWidgetItem *previous); +signals: + void UpdateProperties(); protected: virtual void closeEvent(QCloseEvent *event); private: diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index de93e055c..56b43ca2b 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -1402,6 +1402,7 @@ void MainWindow::Open() void MainWindow::Preferences() { ConfigDialog dlg(this); + connect(&dlg, &ConfigDialog::UpdateProperties, toolOptions, &VToolOptionsPropertyBrowser::UpdateOptions); if (dlg.exec() == QDialog::Accepted) { InitAutoSave(); From 0056ec49e03412e3fbf99adcc1e5c880d4da6979 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 10 Feb 2015 21:27:11 +0200 Subject: [PATCH 135/186] Set locale according to global options. --HG-- branch : feature --- src/app/core/vapplication.cpp | 1 - src/app/core/vapplication.h | 2 +- src/app/dialogs/app/configdialog.cpp | 3 +++ src/app/dialogs/app/dialogaboutapp.cpp | 3 +++ src/app/dialogs/app/dialoghistory.cpp | 3 +++ src/app/dialogs/app/dialogincrements.cpp | 2 ++ src/app/dialogs/app/dialogindividualmeasurements.cpp | 2 ++ src/app/dialogs/app/dialoglayoutprogress.cpp | 4 ++++ src/app/dialogs/app/dialoglayoutsettings.cpp | 3 +++ src/app/dialogs/app/dialogmeasurements.cpp | 4 ++++ src/app/dialogs/app/dialogpatternproperties.cpp | 2 ++ src/app/dialogs/app/dialogpatternxmledit.cpp | 4 +++- src/app/dialogs/app/dialogsavelayout.cpp | 2 ++ src/app/dialogs/app/dialogstandardmeasurements.cpp | 2 ++ src/app/dialogs/app/dialogundo.cpp | 2 ++ src/app/dialogs/tools/dialogtool.cpp | 2 -- src/app/dialogs/tools/dialogtool.h | 2 ++ src/app/mainwindow.cpp | 8 ++++++++ src/app/mainwindow.h | 1 + src/app/tablewindow.cpp | 3 +++ 20 files changed, 50 insertions(+), 5 deletions(-) diff --git a/src/app/core/vapplication.cpp b/src/app/core/vapplication.cpp index 34b5f0ad7..fc4256c2c 100644 --- a/src/app/core/vapplication.cpp +++ b/src/app/core/vapplication.cpp @@ -35,7 +35,6 @@ #include "vmaingraphicsview.h" #include "../container/calculator.h" #include "../version.h" -#include "vsettings.h" #include #include diff --git a/src/app/core/vapplication.h b/src/app/core/vapplication.h index b3e944d05..25f44bf36 100644 --- a/src/app/core/vapplication.h +++ b/src/app/core/vapplication.h @@ -33,6 +33,7 @@ #include "../options.h" #include "../widgets/vmaingraphicsview.h" #include "../../libs/qmuparser/qmutranslation.h" +#include "vsettings.h" class VApplication;// used in define class QUndoStack; @@ -40,7 +41,6 @@ class VMainGraphicsView; class VMainGraphicsScene; class VPattern; class QFile; -class VSettings; class QLockFile; #if defined(qApp) diff --git a/src/app/dialogs/app/configdialog.cpp b/src/app/dialogs/app/configdialog.cpp index c210cdf12..181b2006a 100644 --- a/src/app/dialogs/app/configdialog.cpp +++ b/src/app/dialogs/app/configdialog.cpp @@ -33,6 +33,7 @@ #include #include #include +#include "../core/vapplication.h" //--------------------------------------------------------------------------------------------------------------------- ConfigDialog::ConfigDialog(QWidget *parent) : @@ -93,6 +94,7 @@ ConfigDialog::ConfigDialog(QWidget *parent) : this->setFixedSize(QSize(750, 550)); this->setWindowFlags(Qt::Tool | Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::CustomizeWindowHint); + qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); } //--------------------------------------------------------------------------------------------------------------------- @@ -156,6 +158,7 @@ void ConfigDialog::Apply() default: break; } + qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); emit UpdateProperties(); setResult(QDialog::Accepted); } diff --git a/src/app/dialogs/app/dialogaboutapp.cpp b/src/app/dialogs/app/dialogaboutapp.cpp index 1961177c9..11d8ec5dc 100644 --- a/src/app/dialogs/app/dialogaboutapp.cpp +++ b/src/app/dialogs/app/dialogaboutapp.cpp @@ -33,6 +33,7 @@ #include #include #include "../../options.h" +#include "../core/vapplication.h" //--------------------------------------------------------------------------------------------------------------------- DialogAboutApp::DialogAboutApp(QWidget *parent) : @@ -41,6 +42,8 @@ DialogAboutApp::DialogAboutApp(QWidget *parent) : { ui->setupUi(this); + qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + ui->label_Valentina_Version->setText(QString("Valentina %1").arg(APP_VERSION)); ui->labelBuildRevision->setText(QString("Build revision: %1").arg(BUILD_REVISION)); ui->label_QT_Version->setText(buildCompatibilityString()); diff --git a/src/app/dialogs/app/dialoghistory.cpp b/src/app/dialogs/app/dialoghistory.cpp index 6e70e1b97..b284365ad 100644 --- a/src/app/dialogs/app/dialoghistory.cpp +++ b/src/app/dialogs/app/dialoghistory.cpp @@ -49,6 +49,9 @@ DialogHistory::DialogHistory(VContainer *data, VPattern *doc, QWidget *parent) cursorToolRecordRow(0) { ui->setupUi(this); + + qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + bOk = ui->buttonBox->button(QDialogButtonBox::Ok); connect(bOk, &QPushButton::clicked, this, &DialogHistory::DialogAccepted); FillTable(); diff --git a/src/app/dialogs/app/dialogincrements.cpp b/src/app/dialogs/app/dialogincrements.cpp index 62f5d47fb..809bbce06 100644 --- a/src/app/dialogs/app/dialogincrements.cpp +++ b/src/app/dialogs/app/dialogincrements.cpp @@ -55,6 +55,8 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par { ui->setupUi(this); + qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + qCDebug(vDialog)<<"Showing variables."; if (qApp->patternType() == MeasurementsType::Individual) { diff --git a/src/app/dialogs/app/dialogindividualmeasurements.cpp b/src/app/dialogs/app/dialogindividualmeasurements.cpp index 8fedf9f43..f85925557 100644 --- a/src/app/dialogs/app/dialogindividualmeasurements.cpp +++ b/src/app/dialogs/app/dialogindividualmeasurements.cpp @@ -47,6 +47,8 @@ DialogIndividualMeasurements::DialogIndividualMeasurements(VContainer *data, con { ui->setupUi(this); + qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + QRect position = this->frameGeometry(); position.moveCenter(QDesktopWidget().availableGeometry().center()); move(position.topLeft()); diff --git a/src/app/dialogs/app/dialoglayoutprogress.cpp b/src/app/dialogs/app/dialoglayoutprogress.cpp index d7d5fb620..7244cdbb5 100644 --- a/src/app/dialogs/app/dialoglayoutprogress.cpp +++ b/src/app/dialogs/app/dialoglayoutprogress.cpp @@ -29,6 +29,7 @@ #include "dialoglayoutprogress.h" #include "ui_dialoglayoutprogress.h" #include "../options.h" +#include "../core/vapplication.h" #include #include @@ -38,6 +39,9 @@ DialogLayoutProgress::DialogLayoutProgress(int count, QWidget *parent) :QDialog(parent), ui(new Ui::DialogLayoutProgress) { ui->setupUi(this); + + qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + ui->progressBar->setMaximum(count); ui->progressBar->setValue(0); diff --git a/src/app/dialogs/app/dialoglayoutsettings.cpp b/src/app/dialogs/app/dialoglayoutsettings.cpp index a96b4a30f..2d81b2d33 100644 --- a/src/app/dialogs/app/dialoglayoutsettings.cpp +++ b/src/app/dialogs/app/dialoglayoutsettings.cpp @@ -42,6 +42,9 @@ DialogLayoutSettings::DialogLayoutSettings(QWidget *parent) : QDialog(parent), ui(new Ui::DialogLayoutSettings), oldPaperUnit(Unit::Mm), oldLayoutUnit(Unit::Mm) { ui->setupUi(this); + + qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + InitPaperUnits(); InitLayoutUnits(); InitTemplates(); diff --git a/src/app/dialogs/app/dialogmeasurements.cpp b/src/app/dialogs/app/dialogmeasurements.cpp index af84fc440..f58ed626f 100644 --- a/src/app/dialogs/app/dialogmeasurements.cpp +++ b/src/app/dialogs/app/dialogmeasurements.cpp @@ -28,12 +28,16 @@ #include "dialogmeasurements.h" #include "ui_dialogmeasurements.h" +#include "../core/vapplication.h" //--------------------------------------------------------------------------------------------------------------------- DialogMeasurements::DialogMeasurements(QWidget *parent) : QDialog(parent), ui(new Ui::DialogMeasurements), result(MeasurementsType::Individual) { ui->setupUi(this); + + qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + connect(ui->toolButtonStandard, &QToolButton::clicked, this, &DialogMeasurements::StandardMeasurements); connect(ui->toolButtonIndividual, &QToolButton::clicked, this, &DialogMeasurements::IndividualMeasurements); } diff --git a/src/app/dialogs/app/dialogpatternproperties.cpp b/src/app/dialogs/app/dialogpatternproperties.cpp index 51e68a418..3229aceda 100644 --- a/src/app/dialogs/app/dialogpatternproperties.cpp +++ b/src/app/dialogs/app/dialogpatternproperties.cpp @@ -45,6 +45,8 @@ DialogPatternProperties::DialogPatternProperties(VPattern *doc, QWidget *parent) SCASSERT(doc != nullptr); + qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + ui->lineEditAuthor->setText(doc->GetAuthor()); connect(ui->lineEditAuthor, &QLineEdit::editingFinished, this, &DialogPatternProperties::DescEdited); diff --git a/src/app/dialogs/app/dialogpatternxmledit.cpp b/src/app/dialogs/app/dialogpatternxmledit.cpp index 6339ff47c..2e4701137 100644 --- a/src/app/dialogs/app/dialogpatternxmledit.cpp +++ b/src/app/dialogs/app/dialogpatternxmledit.cpp @@ -28,6 +28,7 @@ #include "dialogpatternxmledit.h" #include "ui_dialogpatternxmledit.h" +#include "../core/vapplication.h" #include #include @@ -36,7 +37,6 @@ const short int DialogPatternXmlEdit::ChangeTypeDelete=1; const short int DialogPatternXmlEdit::ChangeTypeAdd=2; const short int DialogPatternXmlEdit::ChangeTypeModify=3; - //--------------------------------------------------------------------------------------------------------------------- DialogPatternXmlEdit::DialogPatternXmlEdit(QWidget *parent, VPattern *xmldoc) :QDialog(parent), treeChange(false), currentNodeEdited(nullptr), currentNodeEditedStatus(0), @@ -46,6 +46,8 @@ DialogPatternXmlEdit::DialogPatternXmlEdit(QWidget *parent, VPattern *xmldoc) { ui->setupUi(this); + qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + this->xmlmodel = new VXMLTreeView(); this->doc=xmldoc; this->root = this->doc->documentElement(); diff --git a/src/app/dialogs/app/dialogsavelayout.cpp b/src/app/dialogs/app/dialogsavelayout.cpp index 3a427a76b..94b3c55ab 100644 --- a/src/app/dialogs/app/dialogsavelayout.cpp +++ b/src/app/dialogs/app/dialogsavelayout.cpp @@ -43,6 +43,8 @@ DialogSaveLayout::DialogSaveLayout(const QMap &formates, int c { ui->setupUi(this); + qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + QPushButton *bOk = ui->buttonBox->button(QDialogButtonBox::Ok); SCASSERT(bOk != nullptr); bOk->setEnabled(false); diff --git a/src/app/dialogs/app/dialogstandardmeasurements.cpp b/src/app/dialogs/app/dialogstandardmeasurements.cpp index f3a8fc4f1..5b4bc433b 100644 --- a/src/app/dialogs/app/dialogstandardmeasurements.cpp +++ b/src/app/dialogs/app/dialogstandardmeasurements.cpp @@ -46,6 +46,8 @@ DialogStandardMeasurements::DialogStandardMeasurements(VContainer *data, const Q { ui->setupUi(this); + qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + QRect position = this->frameGeometry(); position.moveCenter(QDesktopWidget().availableGeometry().center()); move(position.topLeft()); diff --git a/src/app/dialogs/app/dialogundo.cpp b/src/app/dialogs/app/dialogundo.cpp index 705adee55..a26fff415 100644 --- a/src/app/dialogs/app/dialogundo.cpp +++ b/src/app/dialogs/app/dialogundo.cpp @@ -39,6 +39,8 @@ DialogUndo::DialogUndo(QWidget *parent) { ui->setupUi(this); + qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + bool opening = qApp->getOpeningPattern(); if (opening) { diff --git a/src/app/dialogs/tools/dialogtool.cpp b/src/app/dialogs/tools/dialogtool.cpp index 4605dff65..043c49042 100644 --- a/src/app/dialogs/tools/dialogtool.cpp +++ b/src/app/dialogs/tools/dialogtool.cpp @@ -34,8 +34,6 @@ #include "../../geometry/vsplinepath.h" #include "../../tools/vabstracttool.h" #include "../../../libs/qmuparser/qmuparsererror.h" -#include "../../core/vapplication.h" -#include "../../core/vsettings.h" #include "../../libs/ifc/xml/vdomdocument.h" #include #include diff --git a/src/app/dialogs/tools/dialogtool.h b/src/app/dialogs/tools/dialogtool.h index 8cd7cece1..191195b6d 100644 --- a/src/app/dialogs/tools/dialogtool.h +++ b/src/app/dialogs/tools/dialogtool.h @@ -321,6 +321,8 @@ protected: QPushButton *bCancel = ui->buttonBox->button(QDialogButtonBox::Cancel); SCASSERT(bCancel != nullptr); connect(bCancel, &QPushButton::clicked, this, &DialogTool::DialogRejected); + + qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); } template /** diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index 56b43ca2b..b06ca4732 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -84,6 +84,7 @@ MainWindow::MainWindow(QWidget *parent) recentFileActs[i] = nullptr; } + WindowsLocale(); CreateActions(); CreateMenus(); ToolBarDraws(); @@ -1403,6 +1404,7 @@ void MainWindow::Preferences() { ConfigDialog dlg(this); connect(&dlg, &ConfigDialog::UpdateProperties, toolOptions, &VToolOptionsPropertyBrowser::UpdateOptions); + connect(&dlg, &ConfigDialog::UpdateProperties, this, &MainWindow::WindowsLocale); if (dlg.exec() == QDialog::Accepted) { InitAutoSave(); @@ -2474,6 +2476,12 @@ QStringList MainWindow::GetUnlokedRestoreFileList() const return restoreFiles; } +//--------------------------------------------------------------------------------------------------------------------- +void MainWindow::WindowsLocale() +{ + qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); +} + //--------------------------------------------------------------------------------------------------------------------- void MainWindow::ReopenFilesAfterCrash(QStringList &args) { diff --git a/src/app/mainwindow.h b/src/app/mainwindow.h index 3e1a2c210..8cb40ce60 100644 --- a/src/app/mainwindow.h +++ b/src/app/mainwindow.h @@ -130,6 +130,7 @@ public slots: void Layout(); void UpdateGradation(); void GlobalChangePP(const QString &patternPiece); + void WindowsLocale(); signals: /** * @brief ModelChosen emit after calculation all details. diff --git a/src/app/tablewindow.cpp b/src/app/tablewindow.cpp index 30649add5..c2fa61c10 100644 --- a/src/app/tablewindow.cpp +++ b/src/app/tablewindow.cpp @@ -60,6 +60,9 @@ TableWindow::TableWindow(QWidget *parent) description(QString()), tempScene(nullptr) { ui->setupUi(this); + + qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + tempScene = new QGraphicsScene(QRectF(0, 0, qApp->toPixel(823, Unit::Mm), qApp->toPixel(1171, Unit::Mm))); QBrush brush; brush.setStyle( Qt::SolidPattern ); From 0459fccee0614cd2811d6a47a02da37ca34e047f Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 10 Feb 2015 22:09:44 +0200 Subject: [PATCH 136/186] Convert number to string according to locale options. --HG-- branch : feature --- src/app/container/vformula.cpp | 11 +---------- src/app/core/vapplication.h | 10 ++++++++++ src/app/dialogs/tools/dialogtool.cpp | 11 +---------- 3 files changed, 12 insertions(+), 20 deletions(-) diff --git a/src/app/container/vformula.cpp b/src/app/container/vformula.cpp index 247ed1ab7..5b846bbad 100644 --- a/src/app/container/vformula.cpp +++ b/src/app/container/vformula.cpp @@ -239,17 +239,8 @@ void VFormula::Eval() } else { - QLocale loc; - if (qApp->getSettings()->GetOsSeparator()) - { - loc = QLocale::system(); - } - else - { - loc = QLocale(QLocale::C); - } dValue = result; - value = QString(loc.toString(result) + " " + postfix); + value = QString(qApp->LocaleToString(result) + " " + postfix); _error = false; } } diff --git a/src/app/core/vapplication.h b/src/app/core/vapplication.h index 25f44bf36..6ddbd683f 100644 --- a/src/app/core/vapplication.h +++ b/src/app/core/vapplication.h @@ -81,8 +81,18 @@ public: QString GuiText(const QString &measurement) const; QString Description(const QString &measurement) const; QString PostfixOperator(const QString &name) const; + QString FormulaFromUser(const QString &formula); QString FormulaToUser(const QString &formula); + + template + QString LocaleToString(const T &value) + { + QLocale loc; + qApp->getSettings()->GetOsSeparator() ? loc = QLocale::system() : loc = QLocale(QLocale::C); + return loc.toString(value); + } + QUndoStack *getUndoStack() const; VMainGraphicsView *getSceneView() const; void setSceneView(VMainGraphicsView *value); diff --git a/src/app/dialogs/tools/dialogtool.cpp b/src/app/dialogs/tools/dialogtool.cpp index 043c49042..41be6369c 100644 --- a/src/app/dialogs/tools/dialogtool.cpp +++ b/src/app/dialogs/tools/dialogtool.cpp @@ -500,16 +500,7 @@ qreal DialogTool::Eval(const QString &text, bool &flag, QLabel *label, const QSt } else { - QLocale loc; - if (qApp->getSettings()->GetOsSeparator()) - { - loc = QLocale::system(); - } - else - { - loc = QLocale(QLocale::C); - } - label->setText(loc.toString(result) + " " +postfix); + label->setText(qApp->LocaleToString(result) + " " +postfix); flag = true; ChangeColor(labelEditFormula, okColor); label->setToolTip(tr("Value")); From 2726bd4eb6e70bb8714e80458161083008888a43 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 11 Feb 2015 11:11:49 +0200 Subject: [PATCH 137/186] Global locale settings in dialog increments. --HG-- branch : feature --- src/app/dialogs/app/dialogincrements.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/app/dialogs/app/dialogincrements.cpp b/src/app/dialogs/app/dialogincrements.cpp index 809bbce06..e3f68a768 100644 --- a/src/app/dialogs/app/dialogincrements.cpp +++ b/src/app/dialogs/app/dialogincrements.cpp @@ -179,14 +179,14 @@ void DialogIncrements::FillMeasurements() if (qApp->patternType() == MeasurementsType::Standard) { - QTableWidgetItem *item = new QTableWidgetItem(QString() - .setNum(data->GetTableValue(qApp->VarFromUser(iMap.key())))); + QTableWidgetItem *item = new QTableWidgetItem(qApp->LocaleToString( + data->GetTableValue(qApp->VarFromUser(iMap.key())))); item->setTextAlignment(Qt::AlignHCenter); SetItemViewOnly(item); ui->tableWidgetMeasurements->setItem(currentRow, 1, item);// calculated value } - item = new QTableWidgetItem(QString().setNum(m->GetBase())); + item = new QTableWidgetItem(qApp->LocaleToString(m->GetBase())); item->setTextAlignment(Qt::AlignHCenter); if (qApp->patternType() == MeasurementsType::Standard) { @@ -196,12 +196,12 @@ void DialogIncrements::FillMeasurements() if (qApp->patternType() == MeasurementsType::Standard) { - QTableWidgetItem *item = new QTableWidgetItem(QString().setNum(m->GetKsize())); + QTableWidgetItem *item = new QTableWidgetItem(qApp->LocaleToString(m->GetKsize())); item->setTextAlignment(Qt::AlignHCenter); SetItemViewOnly(item); ui->tableWidgetMeasurements->setItem(currentRow, 3, item);// in sizes - item = new QTableWidgetItem(QString().setNum(m->GetKheight())); + item = new QTableWidgetItem(qApp->LocaleToString(m->GetKheight())); item->setTextAlignment(Qt::AlignHCenter); SetItemViewOnly(item); ui->tableWidgetMeasurements->setItem(currentRow, 4, item);// in heights @@ -252,23 +252,23 @@ void DialogIncrements::FillIncrements() if (qApp->patternType() == MeasurementsType::Standard) { - item = new QTableWidgetItem(QString().setNum(data->GetTableValue(iMap.value()))); + item = new QTableWidgetItem(qApp->LocaleToString(data->GetTableValue(iMap.value()))); item->setTextAlignment(Qt::AlignHCenter); SetItemViewOnly(item); ui->tableWidgetIncrement->setItem(currentRow, 1, item); } - item = new QTableWidgetItem(QString().setNum(incr->GetBase())); + item = new QTableWidgetItem(qApp->LocaleToString(incr->GetBase())); item->setTextAlignment(Qt::AlignHCenter); ui->tableWidgetIncrement->setItem(currentRow, 2, item); if (qApp->patternType() == MeasurementsType::Standard) { - item = new QTableWidgetItem(QString().setNum(incr->GetKsize())); + item = new QTableWidgetItem(qApp->LocaleToString(incr->GetKsize())); item->setTextAlignment(Qt::AlignHCenter); ui->tableWidgetIncrement->setItem(currentRow, 3, item); - item = new QTableWidgetItem(QString().setNum(incr->GetKheight())); + item = new QTableWidgetItem(qApp->LocaleToString(incr->GetKheight())); item->setTextAlignment(Qt::AlignHCenter); ui->tableWidgetIncrement->setItem(currentRow, 4, item); } @@ -307,7 +307,7 @@ void DialogIncrements::FillTable(const QMap varTable, QTableWidget * item->setFont(QFont("Times", 12, QFont::Bold)); table->setItem(currentRow, 0, item); - item = new QTableWidgetItem(QString().setNum(length)); + item = new QTableWidgetItem(qApp->LocaleToString(length)); item->setTextAlignment(Qt::AlignHCenter); table->setItem(currentRow, 1, item); } From f6e511e43c8a3d8742c309bd14d6b05fc28d8747 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 11 Feb 2015 12:33:13 +0200 Subject: [PATCH 138/186] Set and dynamically refresh locale settings for tool property browser. --HG-- branch : feature --- src/app/mainwindow.cpp | 7 ++++--- src/app/widgets/doubledelegate.cpp | 1 + src/app/widgets/textdelegate.cpp | 1 + src/app/widgets/vformulaproperty.cpp | 2 +- src/app/widgets/vtooloptionspropertybrowser.cpp | 8 ++++++++ src/app/widgets/vtooloptionspropertybrowser.h | 1 + src/libs/vpropertyexplorer/plugins/vcolorproperty.cpp | 1 + src/libs/vpropertyexplorer/plugins/venumproperty.cpp | 1 + src/libs/vpropertyexplorer/plugins/vfileproperty.cpp | 1 + src/libs/vpropertyexplorer/plugins/vlinecolorproperty.cpp | 1 + src/libs/vpropertyexplorer/plugins/vlinetypeproperty.cpp | 1 + src/libs/vpropertyexplorer/plugins/vnumberproperty.cpp | 2 ++ src/libs/vpropertyexplorer/plugins/vobjectproperty.cpp | 1 + src/libs/vpropertyexplorer/plugins/vshortcutproperty.cpp | 2 +- src/libs/vpropertyexplorer/plugins/vstringproperty.cpp | 1 + 15 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index b06ca4732..9e35e4b2d 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -84,7 +84,6 @@ MainWindow::MainWindow(QWidget *parent) recentFileActs[i] = nullptr; } - WindowsLocale(); CreateActions(); CreateMenus(); ToolBarDraws(); @@ -135,6 +134,7 @@ MainWindow::MainWindow(QWidget *parent) PropertyBrowser(); setCurrentFile(""); + WindowsLocale(); } //--------------------------------------------------------------------------------------------------------------------- @@ -1144,6 +1144,7 @@ void MainWindow::ArrowTool() ui->actionArrowTool->setChecked(true); ui->actionStopTool->setEnabled(false); tool = Tool::Arrow; + emit EnableItemMove(true); QCursor cur(Qt::ArrowCursor); ui->view->setCursor(cur); helpLabel->setText(""); @@ -1403,8 +1404,8 @@ void MainWindow::Open() void MainWindow::Preferences() { ConfigDialog dlg(this); - connect(&dlg, &ConfigDialog::UpdateProperties, toolOptions, &VToolOptionsPropertyBrowser::UpdateOptions); - connect(&dlg, &ConfigDialog::UpdateProperties, this, &MainWindow::WindowsLocale); + connect(&dlg, &ConfigDialog::UpdateProperties, this, &MainWindow::WindowsLocale); // Must be first + connect(&dlg, &ConfigDialog::UpdateProperties, toolOptions, &VToolOptionsPropertyBrowser::RefreshOptions); if (dlg.exec() == QDialog::Accepted) { InitAutoSave(); diff --git a/src/app/widgets/doubledelegate.cpp b/src/app/widgets/doubledelegate.cpp index 981ad3d0d..f375376a6 100644 --- a/src/app/widgets/doubledelegate.cpp +++ b/src/app/widgets/doubledelegate.cpp @@ -53,6 +53,7 @@ QWidget *DoubleSpinBoxDelegate::createEditor(QWidget *parent, const QStyleOption Q_UNUSED(index); emit NewLastValue(-10001.0);//Here need reset value to default because we begin work with new item QDoubleSpinBox *editor = new QDoubleSpinBox(parent); + editor->setLocale(parent->locale()); editor->setMinimum(-10000.0); editor->setMaximum(10000.0); connect(editor, &QDoubleSpinBox::editingFinished, this, &DoubleSpinBoxDelegate::commitAndCloseEditor); diff --git a/src/app/widgets/textdelegate.cpp b/src/app/widgets/textdelegate.cpp index 296dd1507..a02fadece 100644 --- a/src/app/widgets/textdelegate.cpp +++ b/src/app/widgets/textdelegate.cpp @@ -58,6 +58,7 @@ QWidget *TextDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem Q_UNUSED(option); Q_UNUSED(index); QLineEdit *editor = new QLineEdit(parent); + editor->setLocale(parent->locale()); //Same regex pattern in xsd file editor->setValidator( new QRegExpValidator(QRegExp(regex)) ); connect(editor, &QLineEdit::editingFinished, this, &TextDelegate::commitAndCloseEditor); diff --git a/src/app/widgets/vformulaproperty.cpp b/src/app/widgets/vformulaproperty.cpp index 09fbd2057..4e32e8bf9 100644 --- a/src/app/widgets/vformulaproperty.cpp +++ b/src/app/widgets/vformulaproperty.cpp @@ -94,7 +94,7 @@ QWidget* VFormulaProperty::createEditor(QWidget* parent, const QStyleOptionViewI VFormula formula = VProperty::d_ptr->VariantValue.value(); VFormulaPropertyEditor* tmpEditor = new VFormulaPropertyEditor(parent); - + tmpEditor->setLocale(parent->locale()); tmpEditor->SetFormula(formula); VProperty::d_ptr->editor = tmpEditor; return VProperty::d_ptr->editor; diff --git a/src/app/widgets/vtooloptionspropertybrowser.cpp b/src/app/widgets/vtooloptionspropertybrowser.cpp index d565d45e5..63dff0c6c 100644 --- a/src/app/widgets/vtooloptionspropertybrowser.cpp +++ b/src/app/widgets/vtooloptionspropertybrowser.cpp @@ -232,6 +232,14 @@ void VToolOptionsPropertyBrowser::UpdateOptions() } } +//--------------------------------------------------------------------------------------------------------------------- +void VToolOptionsPropertyBrowser::RefreshOptions() +{ + QGraphicsItem *item = currentItem; + itemClicked(nullptr);//close options + itemClicked(item);//reopen options +} + //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::userChangedData(VProperty *property) { diff --git a/src/app/widgets/vtooloptionspropertybrowser.h b/src/app/widgets/vtooloptionspropertybrowser.h index 50a4d9ed8..4e28e7a5f 100644 --- a/src/app/widgets/vtooloptionspropertybrowser.h +++ b/src/app/widgets/vtooloptionspropertybrowser.h @@ -51,6 +51,7 @@ public slots: void itemClicked(QGraphicsItem *item); void userChangedData(VPE::VProperty* property); void UpdateOptions(); + void RefreshOptions(); private: Q_DISABLE_COPY(VToolOptionsPropertyBrowser) diff --git a/src/libs/vpropertyexplorer/plugins/vcolorproperty.cpp b/src/libs/vpropertyexplorer/plugins/vcolorproperty.cpp index 38a1791a9..fc27d18f2 100644 --- a/src/libs/vpropertyexplorer/plugins/vcolorproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vcolorproperty.cpp @@ -58,6 +58,7 @@ QWidget* VColorProperty::createEditor(QWidget* parent, const QStyleOptionViewIte Q_UNUSED(delegate); VColorPropertyEditor* tmpWidget = new VColorPropertyEditor(parent); + tmpWidget->setLocale(parent->locale()); tmpWidget->SetColor(d_ptr->VariantValue.value()); return tmpWidget; } diff --git a/src/libs/vpropertyexplorer/plugins/venumproperty.cpp b/src/libs/vpropertyexplorer/plugins/venumproperty.cpp index 30330044d..14d3d5ea7 100644 --- a/src/libs/vpropertyexplorer/plugins/venumproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/venumproperty.cpp @@ -70,6 +70,7 @@ QWidget* VEnumProperty::createEditor(QWidget * parent, const QStyleOptionViewIte Q_UNUSED(delegate); QComboBox* tmpEditor = new QComboBox(parent); tmpEditor->clear(); + tmpEditor->setLocale(parent->locale()); tmpEditor->addItems(EnumerationLiterals); tmpEditor->setCurrentIndex(VProperty::d_ptr->VariantValue.toInt()); connect(tmpEditor, static_cast(&QComboBox::currentIndexChanged), this, diff --git a/src/libs/vpropertyexplorer/plugins/vfileproperty.cpp b/src/libs/vpropertyexplorer/plugins/vfileproperty.cpp index 4434675d0..8e965fabf 100644 --- a/src/libs/vpropertyexplorer/plugins/vfileproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vfileproperty.cpp @@ -87,6 +87,7 @@ QWidget* VFileProperty::createEditor(QWidget * parent, const QStyleOptionViewIte VFileEditWidget::connect(tmpWidget, SIGNAL(commitData(QWidget*)), delegate, SIGNAL(commitData(QWidget*))); } + tmpWidget->setLocale(parent->locale()); tmpWidget->setFilter(static_cast(d_ptr)->FileFilters); // todo: parse this string tmpWidget->setFile(d_ptr->VariantValue.toString()); tmpWidget->setDirectory(static_cast(d_ptr)->Directory); diff --git a/src/libs/vpropertyexplorer/plugins/vlinecolorproperty.cpp b/src/libs/vpropertyexplorer/plugins/vlinecolorproperty.cpp index f4fce1de4..58c03b877 100644 --- a/src/libs/vpropertyexplorer/plugins/vlinecolorproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vlinecolorproperty.cpp @@ -86,6 +86,7 @@ QWidget *VLineColorProperty::createEditor(QWidget *parent, const QStyleOptionVie ++i; } + tmpEditor->setLocale(parent->locale()); tmpEditor->setCurrentIndex(VProperty::d_ptr->VariantValue.toInt()); connect(tmpEditor, static_cast(&QComboBox::currentIndexChanged), this, &VLineColorProperty::currentIndexChanged); diff --git a/src/libs/vpropertyexplorer/plugins/vlinetypeproperty.cpp b/src/libs/vpropertyexplorer/plugins/vlinetypeproperty.cpp index a5305dbee..c449096fd 100644 --- a/src/libs/vpropertyexplorer/plugins/vlinetypeproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vlinetypeproperty.cpp @@ -76,6 +76,7 @@ QWidget *VLineTypeProperty::createEditor(QWidget *parent, const QStyleOptionView Q_UNUSED(delegate); QComboBox* tmpEditor = new QComboBox(parent); tmpEditor->clear(); + tmpEditor->setLocale(parent->locale()); tmpEditor->setIconSize(QSize(80, 14)); tmpEditor->setMinimumWidth(80); tmpEditor->setMaximumWidth(110); diff --git a/src/libs/vpropertyexplorer/plugins/vnumberproperty.cpp b/src/libs/vpropertyexplorer/plugins/vnumberproperty.cpp index b86def022..65ee10a1a 100644 --- a/src/libs/vpropertyexplorer/plugins/vnumberproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vnumberproperty.cpp @@ -56,6 +56,7 @@ QWidget* VIntegerProperty::createEditor(QWidget * parent, const QStyleOptionView Q_UNUSED(delegate); QSpinBox* tmpEditor = new QSpinBox(parent); + tmpEditor->setLocale(parent->locale()); tmpEditor->setMinimum(static_cast(minValue)); tmpEditor->setMaximum(static_cast(maxValue)); tmpEditor->setSingleStep(static_cast(singleStep)); @@ -162,6 +163,7 @@ QWidget* VDoubleProperty::createEditor(QWidget * parent, const QStyleOptionViewI Q_UNUSED(options); Q_UNUSED(delegate); QDoubleSpinBox* tmpEditor = new QDoubleSpinBox(parent); + tmpEditor->setLocale(parent->locale()); tmpEditor->setMinimum(minValue); tmpEditor->setMaximum(maxValue); tmpEditor->setDecimals(Precision); diff --git a/src/libs/vpropertyexplorer/plugins/vobjectproperty.cpp b/src/libs/vpropertyexplorer/plugins/vobjectproperty.cpp index 513d8d812..d117e764e 100644 --- a/src/libs/vpropertyexplorer/plugins/vobjectproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vobjectproperty.cpp @@ -64,6 +64,7 @@ QWidget* VObjectProperty::createEditor(QWidget * parent, const QStyleOptionViewI Q_UNUSED(delegate); QComboBox* tmpEditor = new QComboBox(parent); tmpEditor->clear(); + tmpEditor->setLocale(parent->locale()); FillList(tmpEditor, objects); tmpEditor->setCurrentIndex(tmpEditor->findData(VProperty::d_ptr->VariantValue.toUInt())); connect(tmpEditor, static_cast(&QComboBox::currentIndexChanged), this, diff --git a/src/libs/vpropertyexplorer/plugins/vshortcutproperty.cpp b/src/libs/vpropertyexplorer/plugins/vshortcutproperty.cpp index f51346d54..6d10a23f2 100644 --- a/src/libs/vpropertyexplorer/plugins/vshortcutproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vshortcutproperty.cpp @@ -61,7 +61,7 @@ QWidget* VShortcutProperty::createEditor(QWidget * parent, const QStyleOptionVie { VShortcutEditWidget::connect(tmpWidget, SIGNAL(commitData(QWidget*)), delegate, SIGNAL(commitData(QWidget*))); } - + tmpWidget->setLocale(parent->locale()); return tmpWidget; } diff --git a/src/libs/vpropertyexplorer/plugins/vstringproperty.cpp b/src/libs/vpropertyexplorer/plugins/vstringproperty.cpp index d4bac678c..08341ded4 100644 --- a/src/libs/vpropertyexplorer/plugins/vstringproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vstringproperty.cpp @@ -50,6 +50,7 @@ QWidget *VPE::VStringProperty::createEditor(QWidget *parent, const QStyleOptionV Q_UNUSED(delegate); QLineEdit* tmpEditor = new QLineEdit(parent); + tmpEditor->setLocale(parent->locale()); tmpEditor->setReadOnly(readOnly); tmpEditor->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); tmpEditor->setText(d_ptr->VariantValue.toString()); From 28f806a77908a59c317ddd9aa754dfb8e7541c08 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 11 Feb 2015 12:43:50 +0200 Subject: [PATCH 139/186] Refactoring. More good looking code. --HG-- branch : feature --- src/app/dialogs/app/dialoghistory.cpp | 2 +- src/app/dialogs/app/dialogincrements.cpp | 4 ++-- src/app/tools/drawTools/vdrawtool.cpp | 6 +++--- src/app/tools/drawTools/vtoolcut.cpp | 2 +- src/app/tools/drawTools/vtoolline.cpp | 2 +- src/app/tools/drawTools/vtoolsplinepath.cpp | 2 +- src/app/tools/nodeDetails/vabstractnode.cpp | 2 +- src/app/tools/nodeDetails/vnodearc.cpp | 2 +- src/app/tools/nodeDetails/vnodepoint.cpp | 4 ++-- src/app/tools/nodeDetails/vnodespline.cpp | 2 +- src/app/tools/nodeDetails/vnodesplinepath.cpp | 2 +- src/app/tools/vabstracttool.cpp | 2 +- src/app/tools/vtooldetail.cpp | 2 +- src/app/tools/vtooluniondetails.cpp | 2 +- src/app/undocommands/adddet.cpp | 2 +- src/app/undocommands/adddetnode.cpp | 2 +- src/app/undocommands/addtocalc.cpp | 4 ++-- src/app/undocommands/adduniondetails.cpp | 2 +- src/app/undocommands/deletedetail.cpp | 4 ++-- src/app/undocommands/movedetail.cpp | 6 +++--- src/app/undocommands/movelabel.cpp | 4 ++-- src/app/undocommands/movespline.cpp | 2 +- src/app/undocommands/movesplinepath.cpp | 2 +- src/app/undocommands/movespoint.cpp | 4 ++-- src/app/undocommands/savedetailoptions.cpp | 4 ++-- src/app/undocommands/savetooloptions.cpp | 4 ++-- src/libs/ifc/xml/vdomdocument.cpp | 6 ++++++ src/libs/ifc/xml/vdomdocument.h | 1 + 28 files changed, 45 insertions(+), 38 deletions(-) diff --git a/src/app/dialogs/app/dialoghistory.cpp b/src/app/dialogs/app/dialoghistory.cpp index b284365ad..e906cd494 100644 --- a/src/app/dialogs/app/dialoghistory.cpp +++ b/src/app/dialogs/app/dialoghistory.cpp @@ -200,7 +200,7 @@ void DialogHistory::FillTable() */ QString DialogHistory::Record(const VToolRecord &tool) { - const QDomElement domElem = doc->elementById(QString().setNum(tool.getId())); + const QDomElement domElem = doc->elementById(tool.getId()); if (domElem.isElement() == false) { qDebug()<<"Can't find element by id"<RemoveIncrement(itemName->text()); quint32 id = qvariant_cast(itemName->data(Qt::UserRole)); - QDomElement domElement = doc->elementById(QString().setNum(id)); + QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { QDomNodeList list = doc->elementsByTagName(VPattern::TagIncrements); @@ -750,7 +750,7 @@ void DialogIncrements::IncrementChanged ( qint32 row, qint32 column ) const QTableWidgetItem *itemName = ui->tableWidgetIncrement->item(row, 0); const QTableWidgetItem *item = ui->tableWidgetIncrement->item(row, column); const quint32 id = qvariant_cast(itemName->data(Qt::UserRole)); - QDomElement domElement = doc->elementById(QString().setNum(id)); + QDomElement domElement = doc->elementById(id); if (domElement.isElement() == false) { qCDebug(vDialog)<<"Cant't find increment with id = "<elementById(QString().setNum(id)); + QDomElement oldDomElement = doc->elementById(id); if (oldDomElement.isElement()) { QDomElement newDomElement = oldDomElement.cloneNode().toElement(); @@ -148,7 +148,7 @@ void VDrawTool::AddToFile() */ void VDrawTool::RefreshDataInFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); + QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { QSharedPointer obj = VAbstractTool::data.GetGObject(id); @@ -176,7 +176,7 @@ QColor VDrawTool::CorrectColor(const QColor &color) const //--------------------------------------------------------------------------------------------------------------------- void VDrawTool::ReadAttributes() { - const QDomElement domElement = doc->elementById(QString().setNum(id)); + const QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { ReadToolAttributes(domElement); diff --git a/src/app/tools/drawTools/vtoolcut.cpp b/src/app/tools/drawTools/vtoolcut.cpp index 192fc1e69..7eefbc110 100644 --- a/src/app/tools/drawTools/vtoolcut.cpp +++ b/src/app/tools/drawTools/vtoolcut.cpp @@ -146,7 +146,7 @@ void VToolCut::FullUpdateCurveFromFile(const QString &attrCurve) { Q_ASSERT_X(attrCurve.isEmpty() == false, Q_FUNC_INFO, "attribute name is empty"); - QDomElement domElement = doc->elementById(QString().setNum(id)); + QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { formula = domElement.attribute(AttrLength, ""); diff --git a/src/app/tools/drawTools/vtoolline.cpp b/src/app/tools/drawTools/vtoolline.cpp index 1f879afb9..8f9f8003e 100644 --- a/src/app/tools/drawTools/vtoolline.cpp +++ b/src/app/tools/drawTools/vtoolline.cpp @@ -275,7 +275,7 @@ void VToolLine::AddToFile() */ void VToolLine::RefreshDataInFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); + QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { QSharedPointer obj = QSharedPointer (); diff --git a/src/app/tools/drawTools/vtoolsplinepath.cpp b/src/app/tools/drawTools/vtoolsplinepath.cpp index 7c82241a8..9c7b4157f 100644 --- a/src/app/tools/drawTools/vtoolsplinepath.cpp +++ b/src/app/tools/drawTools/vtoolsplinepath.cpp @@ -335,7 +335,7 @@ void VToolSplinePath::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) */ void VToolSplinePath::RefreshDataInFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); + QDomElement domElement = doc->elementById(id); if (domElement.isElement() == false) { qDebug()<<"Can't find element with id="<DecrementReferens(idNode); - QDomElement domElement = doc->elementById(QString().setNum(id)); + QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { QDomNode element = domElement.parentNode(); diff --git a/src/app/tools/nodeDetails/vnodearc.cpp b/src/app/tools/nodeDetails/vnodearc.cpp index d7c0aeb68..865671106 100644 --- a/src/app/tools/nodeDetails/vnodearc.cpp +++ b/src/app/tools/nodeDetails/vnodearc.cpp @@ -164,7 +164,7 @@ void VNodeArc::AddToFile() */ void VNodeArc::RefreshDataInFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); + QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { doc->SetAttribute(domElement, AttrIdObject, idNode); diff --git a/src/app/tools/nodeDetails/vnodepoint.cpp b/src/app/tools/nodeDetails/vnodepoint.cpp index 952d1e4e6..638ef3277 100644 --- a/src/app/tools/nodeDetails/vnodepoint.cpp +++ b/src/app/tools/nodeDetails/vnodepoint.cpp @@ -180,7 +180,7 @@ void VNodePoint::AddToFile() void VNodePoint::RefreshDataInFile() { const QSharedPointer point = VAbstractTool::data.GeometricObject(id); - QDomElement domElement = doc->elementById(QString().setNum(id)); + QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { doc->SetAttribute(domElement, AttrIdObject, idNode); @@ -253,7 +253,7 @@ void VNodePoint::NameChangePosition(const QPointF &pos) */ void VNodePoint::UpdateNamePosition(qreal mx, qreal my) { - QDomElement domElement = doc->elementById(QString().setNum(id)); + QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { doc->SetAttribute(domElement, AttrMx, QString().setNum(qApp->fromPixel(mx))); diff --git a/src/app/tools/nodeDetails/vnodespline.cpp b/src/app/tools/nodeDetails/vnodespline.cpp index a83545287..0982190d7 100644 --- a/src/app/tools/nodeDetails/vnodespline.cpp +++ b/src/app/tools/nodeDetails/vnodespline.cpp @@ -167,7 +167,7 @@ void VNodeSpline::AddToFile() */ void VNodeSpline::RefreshDataInFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); + QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { doc->SetAttribute(domElement, AttrIdObject, QString().setNum(idNode)); diff --git a/src/app/tools/nodeDetails/vnodesplinepath.cpp b/src/app/tools/nodeDetails/vnodesplinepath.cpp index a2654e473..7b8c3f5da 100644 --- a/src/app/tools/nodeDetails/vnodesplinepath.cpp +++ b/src/app/tools/nodeDetails/vnodesplinepath.cpp @@ -170,7 +170,7 @@ void VNodeSplinePath::AddToFile() */ void VNodeSplinePath::RefreshDataInFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); + QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { doc->SetAttribute(domElement, AttrIdObject, QString().setNum(idNode)); diff --git a/src/app/tools/vabstracttool.cpp b/src/app/tools/vabstracttool.cpp index 194c5b5c7..d01708581 100644 --- a/src/app/tools/vabstracttool.cpp +++ b/src/app/tools/vabstracttool.cpp @@ -310,7 +310,7 @@ int VAbstractTool::ConfirmDeletion() void VAbstractTool::SaveOption(QSharedPointer &obj) { qCDebug(vTool)<<"Saving tool options"; - QDomElement oldDomElement = doc->elementById(QString().setNum(id)); + QDomElement oldDomElement = doc->elementById(id); if (oldDomElement.isElement()) { QDomElement newDomElement = oldDomElement.cloneNode().toElement(); diff --git a/src/app/tools/vtooldetail.cpp b/src/app/tools/vtooldetail.cpp index 744f8a8a1..cab1ed4b5 100644 --- a/src/app/tools/vtooldetail.cpp +++ b/src/app/tools/vtooldetail.cpp @@ -304,7 +304,7 @@ void VToolDetail::AddToFile() */ void VToolDetail::RefreshDataInFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); + QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { VDetail det = VAbstractTool::data.GetDetail(id); diff --git a/src/app/tools/vtooluniondetails.cpp b/src/app/tools/vtooluniondetails.cpp index 32350ad1d..087afa9f3 100644 --- a/src/app/tools/vtooluniondetails.cpp +++ b/src/app/tools/vtooluniondetails.cpp @@ -750,7 +750,7 @@ void VToolUnionDetails::AddToFile() */ void VToolUnionDetails::RefreshDataInFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); + QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { doc->SetAttribute(domElement, AttrIndexD1, indexD1); diff --git a/src/app/undocommands/adddet.cpp b/src/app/undocommands/adddet.cpp index de773f50d..8641c05c5 100644 --- a/src/app/undocommands/adddet.cpp +++ b/src/app/undocommands/adddet.cpp @@ -50,7 +50,7 @@ void AddDet::undo() QDomElement element; if (doc->GetActivNodeElement(VPattern::TagDetails, element)) { - QDomElement domElement = doc->elementById(QString().setNum(nodeId)); + QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) { if (element.removeChild(domElement).isNull()) diff --git a/src/app/undocommands/adddetnode.cpp b/src/app/undocommands/adddetnode.cpp index fc483ed0c..993c7a00a 100644 --- a/src/app/undocommands/adddetnode.cpp +++ b/src/app/undocommands/adddetnode.cpp @@ -49,7 +49,7 @@ void AddDetNode::undo() QDomElement modelingElement; if (doc->GetActivNodeElement(VPattern::TagModeling, modelingElement)) { - QDomElement domElement = doc->elementById(QString().setNum(nodeId)); + QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) { if (modelingElement.removeChild(domElement).isNull()) diff --git a/src/app/undocommands/addtocalc.cpp b/src/app/undocommands/addtocalc.cpp index 87f205c1f..30cbb631a 100644 --- a/src/app/undocommands/addtocalc.cpp +++ b/src/app/undocommands/addtocalc.cpp @@ -56,7 +56,7 @@ void AddToCalc::undo() QDomElement calcElement; if (doc->GetActivNodeElement(VPattern::TagCalculation, calcElement)) { - QDomElement domElement = doc->elementById(QString().setNum(nodeId)); + QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) { if (calcElement.removeChild(domElement).isNull()) @@ -102,7 +102,7 @@ void AddToCalc::redo() } else { - QDomElement refElement = doc->elementById(QString().setNum(cursor)); + QDomElement refElement = doc->elementById(cursor); if (refElement.isElement()) { calcElement.insertAfter(xml, refElement); diff --git a/src/app/undocommands/adduniondetails.cpp b/src/app/undocommands/adduniondetails.cpp index 9f5a8549e..e5ed9f1e3 100644 --- a/src/app/undocommands/adduniondetails.cpp +++ b/src/app/undocommands/adduniondetails.cpp @@ -49,7 +49,7 @@ void AddUnionDetails::undo() QDomElement modelingElement; if (doc->GetActivNodeElement(VPattern::TagModeling, modelingElement)) { - QDomElement domElement = doc->elementById(QString().setNum(nodeId)); + QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) { if (modelingElement.removeChild(domElement).isNull()) diff --git a/src/app/undocommands/deletedetail.cpp b/src/app/undocommands/deletedetail.cpp index a67794df3..fd7fecac7 100644 --- a/src/app/undocommands/deletedetail.cpp +++ b/src/app/undocommands/deletedetail.cpp @@ -36,7 +36,7 @@ DeleteDetail::DeleteDetail(VPattern *doc, quint32 id, QUndoCommand *parent) { setText(tr("Delete tool")); nodeId = id; - QDomElement domElement = doc->elementById(QString().setNum(id)); + QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { xml = domElement.cloneNode().toElement(); @@ -77,7 +77,7 @@ void DeleteDetail::redo() { qCDebug(vUndo)<<"Redo."; - QDomElement domElement = doc->elementById(QString().setNum(nodeId)); + QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) { parentNode.removeChild(domElement); diff --git a/src/app/undocommands/movedetail.cpp b/src/app/undocommands/movedetail.cpp index 8d5b42b16..025457337 100644 --- a/src/app/undocommands/movedetail.cpp +++ b/src/app/undocommands/movedetail.cpp @@ -42,7 +42,7 @@ MoveDetail::MoveDetail(VPattern *doc, const double &x, const double &y, const qu nodeId = id; SCASSERT(scene != nullptr); - QDomElement domElement = doc->elementById(QString().setNum(id)); + QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { oldX = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrMx, "0.0")); @@ -64,7 +64,7 @@ void MoveDetail::undo() { qCDebug(vUndo)<<"Undo."; - QDomElement domElement = doc->elementById(QString().setNum(nodeId)); + QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) { SaveCoordinates(domElement, oldX, oldY); @@ -86,7 +86,7 @@ void MoveDetail::redo() { qCDebug(vUndo)<<"Redo."; - QDomElement domElement = doc->elementById(QString().setNum(nodeId)); + QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) { SaveCoordinates(domElement, newX, newY); diff --git a/src/app/undocommands/movelabel.cpp b/src/app/undocommands/movelabel.cpp index eaada78e2..1d7d3858e 100644 --- a/src/app/undocommands/movelabel.cpp +++ b/src/app/undocommands/movelabel.cpp @@ -46,7 +46,7 @@ MoveLabel::MoveLabel(VPattern *doc, const double &x, const double &y, const quin qCDebug(vUndo)<<"Label new My"<elementById(QString().setNum(id)); + QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { oldMx = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrMx, "0.0")); @@ -114,7 +114,7 @@ void MoveLabel::Do(double mx, double my) qCDebug(vUndo)<<"New mx"<elementById(QString().setNum(nodeId)); + QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) { doc->SetAttribute(domElement, VAbstractTool::AttrMx, QString().setNum(qApp->fromPixel(mx))); diff --git a/src/app/undocommands/movespline.cpp b/src/app/undocommands/movespline.cpp index a59ac23c8..2b1eddfe4 100644 --- a/src/app/undocommands/movespline.cpp +++ b/src/app/undocommands/movespline.cpp @@ -88,7 +88,7 @@ int MoveSpline::id() const //--------------------------------------------------------------------------------------------------------------------- void MoveSpline::Do(const VSpline &spl) { - QDomElement domElement = doc->elementById(QString().setNum(nodeId)); + QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) { doc->SetAttribute(domElement, VAbstractTool::AttrAngle1, QString().setNum(spl.GetAngle1())); diff --git a/src/app/undocommands/movesplinepath.cpp b/src/app/undocommands/movesplinepath.cpp index 86f72b5a3..44a4e53e9 100644 --- a/src/app/undocommands/movesplinepath.cpp +++ b/src/app/undocommands/movesplinepath.cpp @@ -86,7 +86,7 @@ int MoveSplinePath::id() const //--------------------------------------------------------------------------------------------------------------------- void MoveSplinePath::Do(const VSplinePath &splPath) { - QDomElement domElement = doc->elementById(QString().setNum(nodeId)); + QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) { doc->SetAttribute(domElement, VToolSplinePath::AttrKCurve, QString().setNum(splPath.GetKCurve())); diff --git a/src/app/undocommands/movespoint.cpp b/src/app/undocommands/movespoint.cpp index dbc04eaf6..668594e90 100644 --- a/src/app/undocommands/movespoint.cpp +++ b/src/app/undocommands/movespoint.cpp @@ -46,7 +46,7 @@ MoveSPoint::MoveSPoint(VPattern *doc, const double &x, const double &y, const qu qCDebug(vUndo)<<"SPoint newY"<elementById(QString().setNum(id)); + QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { oldX = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrX, "0.0")); @@ -114,7 +114,7 @@ void MoveSPoint::Do(double x, double y) qCDebug(vUndo)<<"Move to x"<elementById(QString().setNum(nodeId)); + QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) { doc->SetAttribute(domElement, VAbstractTool::AttrX, QString().setNum(qApp->fromPixel(x))); diff --git a/src/app/undocommands/savedetailoptions.cpp b/src/app/undocommands/savedetailoptions.cpp index 4dcb7d8d7..5caa88a8a 100644 --- a/src/app/undocommands/savedetailoptions.cpp +++ b/src/app/undocommands/savedetailoptions.cpp @@ -48,7 +48,7 @@ void SaveDetailOptions::undo() { qCDebug(vUndo)<<"Undo."; - QDomElement domElement = doc->elementById(QString().setNum(nodeId)); + QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) { SaveDet(domElement, oldDet); @@ -85,7 +85,7 @@ void SaveDetailOptions::redo() { qCDebug(vUndo)<<"Redo."; - QDomElement domElement = doc->elementById(QString().setNum(nodeId)); + QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) { SaveDet(domElement, newDet); diff --git a/src/app/undocommands/savetooloptions.cpp b/src/app/undocommands/savetooloptions.cpp index a57416c3e..2e9d98dda 100644 --- a/src/app/undocommands/savetooloptions.cpp +++ b/src/app/undocommands/savetooloptions.cpp @@ -48,7 +48,7 @@ void SaveToolOptions::undo() { qCDebug(vUndo)<<"Undo."; - QDomElement domElement = doc->elementById(QString().setNum(nodeId)); + QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) { domElement.parentNode().replaceChild(oldXml, domElement); @@ -67,7 +67,7 @@ void SaveToolOptions::redo() { qCDebug(vUndo)<<"Redo."; - QDomElement domElement = doc->elementById(QString().setNum(nodeId)); + QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) { domElement.parentNode().replaceChild(newXml, domElement); diff --git a/src/libs/ifc/xml/vdomdocument.cpp b/src/libs/ifc/xml/vdomdocument.cpp index 40480bf0f..b48d4abbe 100644 --- a/src/libs/ifc/xml/vdomdocument.cpp +++ b/src/libs/ifc/xml/vdomdocument.cpp @@ -134,6 +134,12 @@ QDomElement VDomDocument::elementById(const QString& id) return QDomElement(); } +//--------------------------------------------------------------------------------------------------------------------- +QDomElement VDomDocument::elementById(quint32 id) +{ + return elementById(QString().setNum(id)); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief Removes all children of a given element tag. RENAME: removeAllChildren diff --git a/src/libs/ifc/xml/vdomdocument.h b/src/libs/ifc/xml/vdomdocument.h index 633c33b74..00fba6c8f 100644 --- a/src/libs/ifc/xml/vdomdocument.h +++ b/src/libs/ifc/xml/vdomdocument.h @@ -81,6 +81,7 @@ public: VDomDocument(); virtual ~VDomDocument(); QDomElement elementById(const QString& id); + QDomElement elementById(quint32 id); void removeAllChilds(QDomElement &element); template /** From c4c03e1d3e16f487bef004027a80dde0b2dbfaf1 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 11 Feb 2015 13:04:12 +0200 Subject: [PATCH 140/186] Don't show asterisk (*) near file name if file saved. --HG-- branch : develop --- src/app/mainwindow.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index 9e35e4b2d..852d1ee03 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -2004,6 +2004,7 @@ bool MainWindow::SavePattern(const QString &fileName, QString &error) { qCDebug(vMainWindow)<<"Could not save file"< Date: Wed, 11 Feb 2015 15:13:17 +0200 Subject: [PATCH 141/186] Fixed setting f1 and f2 angles for arc visualization. --HG-- branch : develop --- src/app/tools/drawTools/vtoolarc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/tools/drawTools/vtoolarc.cpp b/src/app/tools/drawTools/vtoolarc.cpp index 332006ebc..d672b6561 100644 --- a/src/app/tools/drawTools/vtoolarc.cpp +++ b/src/app/tools/drawTools/vtoolarc.cpp @@ -301,8 +301,8 @@ void VToolArc::ShowVisualization(bool show) visual->setPoint1Id(arc->GetCenter().id()); visual->setRadius(qApp->FormulaToUser(arc->GetFormulaRadius())); - visual->setF1(arc->GetFormulaF1()); - visual->setF2(arc->GetFormulaF2()); + visual->setF1(qApp->FormulaToUser(arc->GetFormulaF1())); + visual->setF2(qApp->FormulaToUser(arc->GetFormulaF2())); visual->RefreshGeometry(); vis = visual; } From fb8dca84529bd5863afd437a48c8705979471a50 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 11 Feb 2015 16:45:35 +0200 Subject: [PATCH 142/186] After refreshing arc visualization get wrong f1 and f2 angels. --HG-- branch : develop --- src/app/tools/drawTools/vtoolarc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/tools/drawTools/vtoolarc.cpp b/src/app/tools/drawTools/vtoolarc.cpp index d672b6561..deef670a0 100644 --- a/src/app/tools/drawTools/vtoolarc.cpp +++ b/src/app/tools/drawTools/vtoolarc.cpp @@ -389,8 +389,8 @@ void VToolArc::RefreshGeometry() visual->setPoint1Id(arc->GetCenter().id()); visual->setRadius(qApp->FormulaToUser(arc->GetFormulaRadius())); - visual->setF1(arc->GetFormulaF1()); - visual->setF2(arc->GetFormulaF2()); + visual->setF1(qApp->FormulaToUser(arc->GetFormulaF1())); + visual->setF2(qApp->FormulaToUser(arc->GetFormulaF2())); visual->RefreshGeometry(); } } From 254d9b7b7ad96641325fe801c6f0fd7858274d12 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 12 Feb 2015 12:55:09 +0200 Subject: [PATCH 143/186] Now spline can move by mouse. --HG-- branch : feature --- src/app/geometry/vspline.cpp | 131 ++++++++++++++++++++++++ src/app/geometry/vspline.h | 5 + src/app/tools/drawTools/vtoolspline.cpp | 70 ++++++++++++- src/app/tools/drawTools/vtoolspline.h | 3 + 4 files changed, 208 insertions(+), 1 deletion(-) diff --git a/src/app/geometry/vspline.cpp b/src/app/geometry/vspline.cpp index 00e7ca219..8985f9c56 100644 --- a/src/app/geometry/vspline.cpp +++ b/src/app/geometry/vspline.cpp @@ -744,3 +744,134 @@ void VSpline::SetKcurve(qreal factor) d->kCurve = factor; } } + +//--------------------------------------------------------------------------------------------------------------------- +int VSpline::Sign(long double ld) const +{ + if(qAbs(ld)<0.00000000001) + { + return 0; + } + return (ld>0) ? 1 : -1; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief Cubic Cubic equation solution. Real coefficients case. + * + * This method use method Vieta-Cardano for eval cubic equations. + * Cubic equation write in form x3+a*x2+b*x+c=0. + * + * Output: + * 3 real roots -> then x is filled with them; + * 1 real + 2 complex -> x[0] is real, x[1] is real part of complex roots, x[2] - non-negative imaginary part. + * + * @param x solution array (size 3). + * @param a coefficient + * @param b coefficient + * @param c coefficient + * @return 3 - 3 real roots; + * 1 - 1 real root + 2 complex; + * 2 - 1 real root + complex roots imaginary part is zero (i.e. 2 real roots). + */ +qint32 VSpline::Cubic(QVector &x, qreal a, qreal b, qreal c) const +{ + //To find cubic equation roots in the case of real coefficients, calculated at the beginning + const qreal q = (pow(a, 2) - 3*b)/9.; + const qreal r = (2*pow(a, 3) - 9*a*b + 27.*c)/54.; + if (pow(r, 2) < pow(q, 3)) + { // equation has three real roots, use formula Vieta + const qreal t = acos(r/sqrt(pow(q, 3)))/3.; + x.insert(0, -2.*sqrt(q)*cos(t)-a/3); + x.insert(1, -2.*sqrt(q)*cos(t + (2*M_2PI/3.)) - a/3.); + x.insert(2, -2.*sqrt(q)*cos(t - (2*M_2PI/3.)) - a/3.); + return(3); + } + else + { // 1 real root + 2 complex + //Formula Cardano + const qreal aa = -Sign(r)*pow(fabs(r)+sqrt(pow(r, 2)-pow(q, 3)), 1./3.); + const qreal bb = Sign(aa) == 0 ? 0 : q/aa; + + x.insert(0, aa+bb-a/3.); // Real root + x.insert(1, (-0.5)*(aa+bb)-a/3.); //Complex root + x.insert(2, (sqrt(3.)*0.5)*fabs(aa-bb)); // Complex root + if (qFuzzyCompare(x.at(2) + 1, 0. + 1)) + { + return(2); + } + return(1); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +QVector VSpline::CalcT (qreal curveCoord1, qreal curveCoord2, qreal curveCoord3, + qreal curveCoord4, qreal pointCoord) const +{ + const qreal a = -curveCoord1 + 3*curveCoord2 - 3*curveCoord3 + curveCoord4; + const qreal b = 3*curveCoord1 - 6*curveCoord2 + 3*curveCoord3; + const qreal c = -3*curveCoord1 + 3*curveCoord2; + const qreal d = -pointCoord + curveCoord1; + + QVector t = QVector(3, -1); + Cubic(t, b/a, c/a, d/a); + + QVector retT; + for (int i=0; i < t.size(); ++i) + { + if ( t.at(i) >= 0 && t.at(i) <= 1 ) + { + retT.append(t.at(i)); + } + } + + return retT; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VSpline::ParamT calculate t coeffient that reprezent point on curve. + * + * Each point that belongs to Cubic Bézier curve can be shown by coefficient in interval [0; 1]. + * + * @param pBt point on curve + * @return t coeffient that reprezent this point on curve. Return -1 if point doesn't belongs to curve. + */ +qreal VSpline::ParamT (const QPointF &pBt) const +{ + QVector ts; + // Calculate t coefficient for each axis + ts += CalcT (GetP1().toQPointF().x(), d->p2.x(), d->p3.x(), GetP4().toQPointF().x(), pBt.x()); + ts += CalcT (GetP1().toQPointF().y(), d->p2.y(), d->p3.y(), GetP4().toQPointF().y(), pBt.y()); + + if(ts.isEmpty()) + { + return -1; // We don't have candidates + } + + qreal tx = -1; + qreal eps = 3; // Error calculation + + // In morst case we will have 6 result in interval [0; 1]. + // Here we try find closest to our point. + for (int i=0; i< ts.size(); ++i) + { + const qreal t = ts.at(i); + const QPointF p0 = GetP1().toQPointF(); + const QPointF p1 = d->p2; + const QPointF p2 = d->p3; + const QPointF p3 = GetP4().toQPointF(); + //The explicit form of the Cubic Bézier curve + const qreal pointX = pow(1-t, 3)*p0.x() + 3*pow(1-t, 2)*t*p1.x() + 3*(1-t)*pow(t, 2)*p2.x() + pow(t, 3)*p3.x(); + const qreal pointY = pow(1-t, 3)*p0.y() + 3*pow(1-t, 2)*t*p1.y() + 3*(1-t)*pow(t, 2)*p2.y() + pow(t, 3)*p3.y(); + + const QLineF line(pBt, QPointF(pointX, pointY)); + if (line.length() <= eps) + { + tx = t; + eps = line.length(); //Next point should be even closest + } + } + + return tx; +} diff --git a/src/app/geometry/vspline.h b/src/app/geometry/vspline.h index d363f8b0f..c01be8c88 100644 --- a/src/app/geometry/vspline.h +++ b/src/app/geometry/vspline.h @@ -71,6 +71,7 @@ public: // cppcheck-suppress unusedFunction static QVector SplinePoints(const QPointF &p1, const QPointF &p4, qreal angle1, qreal angle2, qreal kAsm1, qreal kAsm2, qreal kCurve); + qreal ParamT(const QPointF &pBt) const; protected: static QVector GetPoints (const QPointF &p1, const QPointF &p2, const QPointF &p3, const QPointF &p4 ); private: @@ -80,6 +81,10 @@ private: qint16 level, QVector &px, QVector &py); static qreal CalcSqDistance ( qreal x1, qreal y1, qreal x2, qreal y2); void CreateName(); + QVector CalcT(qreal curveCoord1, qreal curveCoord2, qreal curveCoord3, qreal curveCoord4, + qreal pointCoord) const; + qint32 Cubic(QVector &x, qreal a, qreal b, qreal c) const; + int Sign(long double ld) const; }; #endif // VSPLINE_H diff --git a/src/app/tools/drawTools/vtoolspline.cpp b/src/app/tools/drawTools/vtoolspline.cpp index ce50c27a0..99415a3ae 100644 --- a/src/app/tools/drawTools/vtoolspline.cpp +++ b/src/app/tools/drawTools/vtoolspline.cpp @@ -31,6 +31,7 @@ #include "../../dialogs/tools/dialogspline.h" #include "../../undocommands/movespline.h" #include "../../visualization/vistoolspline.h" +#include const QString VToolSpline::ToolType = QStringLiteral("simple"); @@ -45,7 +46,7 @@ const QString VToolSpline::ToolType = QStringLiteral("simple"); */ VToolSpline::VToolSpline(VPattern *doc, VContainer *data, quint32 id, const QString color, const Source &typeCreation, QGraphicsItem *parent) - :VAbstractSpline(doc, data, id, parent) + :VAbstractSpline(doc, data, id, parent), oldPosition() { sceneType = SceneObject::Spline; lineColor = color; @@ -53,6 +54,8 @@ VToolSpline::VToolSpline(VPattern *doc, VContainer *data, quint32 id, const QStr this->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine())/factor)); this->setFlag(QGraphicsItem::ItemIsSelectable, true); this->setFlag(QGraphicsItem::ItemIsFocusable, true); + this->setFlag(QGraphicsItem::ItemIsMovable, true); + //this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); this->setAcceptHoverEvents(true); this->setPath(ToolPath()); @@ -355,6 +358,71 @@ void VToolSpline::SaveOptions(QDomElement &tag, QSharedPointer &obj) doc->SetAttribute(tag, AttrColor, lineColor); } +//--------------------------------------------------------------------------------------------------------------------- +void VToolSpline::mousePressEvent(QGraphicsSceneMouseEvent *event) +{ + if (event->button() == Qt::LeftButton) + { + oldPosition = event->scenePos(); + event->accept(); + } + VAbstractSpline::mousePressEvent(event); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VToolSpline::mouseMoveEvent(QGraphicsSceneMouseEvent *event) +{ + // Don't need check if left mouse button was pressed. According to the Qt documentation "If you do receive this + // event, you can be certain that this item also received a mouse press event, and that this item is the current + // mouse grabber.". + + // Magic Bezier Drag Equations follow! + // "weight" describes how the influence of the drag should be distributed + // among the handles; 0 = front handle only, 1 = back handle only. + + const QSharedPointer spline = VAbstractTool::data.GeometricObject(id); + const qreal t = spline->ParamT(oldPosition); + + if (qFloor(t) == -1) + { + return; + } + + double weight; + if (t <= 1.0 / 6.0) + { + weight = 0; + } + else if (t <= 0.5) + { + weight = (pow((6 * t - 1) / 2.0, 3)) / 2; + } + else if (t <= 5.0 / 6.0) + { + weight = (1 - pow((6 * (1-t) - 1) / 2.0, 3)) / 2 + 0.5; + } + else + { + weight = 1; + } + + const QPointF delta = event->scenePos() - oldPosition; + const QPointF offset0 = ((1-weight)/(3*t*(1-t)*(1-t))) * delta; + const QPointF offset1 = (weight/(3*t*t*(1-t))) * delta; + + const QPointF p2 = spline->GetP2() + offset0; + const QPointF p3 = spline->GetP3() + offset1; + + oldPosition = event->scenePos(); // Now mouse here + + VSpline spl = VSpline(spline->GetP1(), p2, p3, spline->GetP4(), spline->GetKcurve()); + + MoveSpline *moveSpl = new MoveSpline(doc, spline.data(), spl, id, this->scene()); + connect(moveSpl, &MoveSpline::NeedLiteParsing, doc, &VPattern::LiteParseTree); + qApp->getUndoStack()->push(moveSpl); + +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief RefreshGeometry refresh item on scene. diff --git a/src/app/tools/drawTools/vtoolspline.h b/src/app/tools/drawTools/vtoolspline.h index b10345fd6..ba17cc7cc 100644 --- a/src/app/tools/drawTools/vtoolspline.h +++ b/src/app/tools/drawTools/vtoolspline.h @@ -63,9 +63,12 @@ protected: virtual void RemoveReferens(); virtual void SaveDialog(QDomElement &domElement); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void mousePressEvent(QGraphicsSceneMouseEvent * event); + virtual void mouseMoveEvent(QGraphicsSceneMouseEvent * event); private: Q_DISABLE_COPY(VToolSpline) void RefreshGeometry (); + QPointF oldPosition; }; #endif // VTOOLSPLINE_H From d5eded4eda2f468fab4ad1c24478bdfa2c10c484 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 12 Feb 2015 13:43:38 +0200 Subject: [PATCH 144/186] Show "move cursor". --HG-- branch : feature --- src/app/mainwindow.cpp | 4 +- src/app/tools/drawTools/vtoolspline.cpp | 54 +++++++++++++++++++++++-- src/app/tools/drawTools/vtoolspline.h | 4 ++ 3 files changed, 56 insertions(+), 6 deletions(-) diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index 852d1ee03..8162572cf 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -300,6 +300,7 @@ void MainWindow::SetToolButton(bool checked, Tool t, const QString &cursor, cons if (checked) { CancelTool(); + emit EnableItemMove(true); tool = t; QPixmap pixmap(cursor); QCursor cur(pixmap, 2, 3); @@ -340,6 +341,7 @@ void MainWindow::SetToolButtonWithApply(bool checked, Tool t, const QString &cur if (checked) { CancelTool(); + emit EnableItemMove(false); tool = t; QPixmap pixmap(cursor); QCursor cur(pixmap, 2, 3); @@ -1050,7 +1052,6 @@ void MainWindow::CancelTool() ui->actionArrowTool->setChecked(false); helpLabel->setText(""); ui->actionStopTool->setEnabled(true); - emit EnableItemMove(false); return; case Tool::SinglePoint: Q_UNREACHABLE(); @@ -1130,7 +1131,6 @@ void MainWindow::CancelTool() } currentScene->setFocus(Qt::OtherFocusReason); currentScene->clearSelection(); - emit EnableItemMove(true); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/tools/drawTools/vtoolspline.cpp b/src/app/tools/drawTools/vtoolspline.cpp index 99415a3ae..f6f4c6b71 100644 --- a/src/app/tools/drawTools/vtoolspline.cpp +++ b/src/app/tools/drawTools/vtoolspline.cpp @@ -55,7 +55,6 @@ VToolSpline::VToolSpline(VPattern *doc, VContainer *data, quint32 id, const QStr this->setFlag(QGraphicsItem::ItemIsSelectable, true); this->setFlag(QGraphicsItem::ItemIsFocusable, true); this->setFlag(QGraphicsItem::ItemIsMovable, true); - //this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); this->setAcceptHoverEvents(true); this->setPath(ToolPath()); @@ -193,6 +192,7 @@ VToolSpline* VToolSpline::Create(const quint32 _id, const quint32 &p1, const qui connect(spl, &VToolSpline::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, spl, &VToolSpline::SetFactor); connect(scene, &VMainGraphicsScene::DisableItem, spl, &VToolSpline::Disable); + connect(scene, &VMainGraphicsScene::EnableToolMove, spl, &VToolSpline::EnableToolMove); doc->AddTool(id, spl); doc->IncrementReferens(p1); doc->IncrementReferens(p4); @@ -283,6 +283,12 @@ void VToolSpline::ControlPointChangePosition(const qint32 &indexSpline, const Sp qApp->getUndoStack()->push(moveSpl); } +//--------------------------------------------------------------------------------------------------------------------- +void VToolSpline::EnableToolMove(bool move) +{ + this->setFlag(QGraphicsItem::ItemIsMovable, move); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief contextMenuEvent handle context menu events. @@ -361,14 +367,32 @@ void VToolSpline::SaveOptions(QDomElement &tag, QSharedPointer &obj) //--------------------------------------------------------------------------------------------------------------------- void VToolSpline::mousePressEvent(QGraphicsSceneMouseEvent *event) { - if (event->button() == Qt::LeftButton) + if (flags() & QGraphicsItem::ItemIsMovable) { - oldPosition = event->scenePos(); - event->accept(); + if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) + { + VApplication::setOverrideCursor(QStringLiteral("://cursor/cursor-arrow-closehand.png"), 1, 1); + oldPosition = event->scenePos(); + event->accept(); + } } VAbstractSpline::mousePressEvent(event); } +//--------------------------------------------------------------------------------------------------------------------- +void VToolSpline::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) +{ + if (flags() & QGraphicsItem::ItemIsMovable) + { + if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) + { + //Disable cursor-arrow-closehand + VApplication::restoreOverrideCursor(QStringLiteral("://cursor/cursor-arrow-closehand.png")); + } + } + VAbstractSpline::mouseReleaseEvent(event); +} + //--------------------------------------------------------------------------------------------------------------------- void VToolSpline::mouseMoveEvent(QGraphicsSceneMouseEvent *event) { @@ -420,7 +444,29 @@ void VToolSpline::mouseMoveEvent(QGraphicsSceneMouseEvent *event) MoveSpline *moveSpl = new MoveSpline(doc, spline.data(), spl, id, this->scene()); connect(moveSpl, &MoveSpline::NeedLiteParsing, doc, &VPattern::LiteParseTree); qApp->getUndoStack()->push(moveSpl); +} +//--------------------------------------------------------------------------------------------------------------------- +void VToolSpline::hoverEnterEvent(QGraphicsSceneHoverEvent *event) +{ + if (flags() & QGraphicsItem::ItemIsMovable) + { + VApplication::setOverrideCursor(QStringLiteral("://cursor/cursor-arrow-openhand.png"), 1, 1); + } + + VAbstractSpline::hoverEnterEvent(event); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VToolSpline::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) +{ + if (flags() & QGraphicsItem::ItemIsMovable) + { + //Disable cursor-arrow-openhand + VApplication::restoreOverrideCursor(QStringLiteral("://cursor/cursor-arrow-openhand.png")); + } + + VAbstractSpline::hoverLeaveEvent(event); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/tools/drawTools/vtoolspline.h b/src/app/tools/drawTools/vtoolspline.h index ba17cc7cc..fa1f95d51 100644 --- a/src/app/tools/drawTools/vtoolspline.h +++ b/src/app/tools/drawTools/vtoolspline.h @@ -58,13 +58,17 @@ public: public slots: void ControlPointChangePosition (const qint32 &indexSpline, const SplinePointPosition &position, const QPointF &pos); + virtual void EnableToolMove(bool move); protected: virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event ); virtual void RemoveReferens(); virtual void SaveDialog(QDomElement &domElement); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); virtual void mousePressEvent(QGraphicsSceneMouseEvent * event); + virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event ); virtual void mouseMoveEvent(QGraphicsSceneMouseEvent * event); + virtual void hoverEnterEvent ( QGraphicsSceneHoverEvent * event ); + virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event ); private: Q_DISABLE_COPY(VToolSpline) void RefreshGeometry (); From d6069c920112426a65a45b070fc845a63eb4e32f Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 12 Feb 2015 13:55:35 +0200 Subject: [PATCH 145/186] Avoid declaring the same literal in multiple places. --HG-- branch : feature --- src/app/options.cpp | 3 +++ src/app/options.h | 3 +++ src/app/tools/drawTools/vtoolsinglepoint.cpp | 9 +++++---- src/app/tools/drawTools/vtoolspline.cpp | 9 +++++---- src/app/visualization/vcontrolpointspline.cpp | 8 ++++---- src/app/visualization/vgraphicssimpletextitem.cpp | 8 ++++---- 6 files changed, 24 insertions(+), 16 deletions(-) diff --git a/src/app/options.cpp b/src/app/options.cpp index 0f102247f..6d5b8fa53 100644 --- a/src/app/options.cpp +++ b/src/app/options.cpp @@ -37,6 +37,9 @@ const QString nameRegExp = QStringLiteral("^([^0-9-*/^+=\\s\\(\\)%:;!.,`'\"]){1, // furthermore blows up the binary sizes. const QString degreeSymbol = QStringLiteral("°"); +const QString cursorArrowOpenHand = QStringLiteral("://cursor/cursor-arrow-openhand.png"); +const QString cursorArrowCloseHand = QStringLiteral("://cursor/cursor-arrow-closehand.png"); + // Keep synchronize all names with initialization in VApllication class!!!!! //measurements //head and neck diff --git a/src/app/options.h b/src/app/options.h index 2a4e72fa0..6024d2d09 100644 --- a/src/app/options.h +++ b/src/app/options.h @@ -50,6 +50,9 @@ class QStringList; extern const QString nameRegExp; extern const QString degreeSymbol; +extern const QString cursorArrowOpenHand; +extern const QString cursorArrowCloseHand; + enum class SceneObject : char { Point, Line, Spline, Arc, SplinePath, Detail, Unknown }; enum class Tool : unsigned char { diff --git a/src/app/tools/drawTools/vtoolsinglepoint.cpp b/src/app/tools/drawTools/vtoolsinglepoint.cpp index 0948cecc1..dde2a162c 100644 --- a/src/app/tools/drawTools/vtoolsinglepoint.cpp +++ b/src/app/tools/drawTools/vtoolsinglepoint.cpp @@ -33,6 +33,7 @@ #include "../../undocommands/addpatternpiece.h" #include "../../undocommands/deletepatternpiece.h" #include "../../geometry/vpointf.h" +#include "../../options.h" #include @@ -207,7 +208,7 @@ void VToolSinglePoint::hoverEnterEvent(QGraphicsSceneHoverEvent *event) if (flags() & QGraphicsItem::ItemIsMovable) { - VApplication::setOverrideCursor(QStringLiteral("://cursor/cursor-arrow-openhand.png"), 1, 1); + VApplication::setOverrideCursor(cursorArrowOpenHand, 1, 1); } } @@ -219,7 +220,7 @@ void VToolSinglePoint::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) if (flags() & QGraphicsItem::ItemIsMovable) { //Disable cursor-arrow-openhand - VApplication::restoreOverrideCursor(QStringLiteral("://cursor/cursor-arrow-openhand.png")); + VApplication::restoreOverrideCursor(cursorArrowOpenHand); } } @@ -230,7 +231,7 @@ void VToolSinglePoint::mousePressEvent(QGraphicsSceneMouseEvent *event) { if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) { - VApplication::setOverrideCursor(QStringLiteral("://cursor/cursor-arrow-closehand.png"), 1, 1); + VApplication::setOverrideCursor(cursorArrowCloseHand, 1, 1); } } VToolPoint::mousePressEvent(event); @@ -244,7 +245,7 @@ void VToolSinglePoint::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) { //Disable cursor-arrow-closehand - VApplication::restoreOverrideCursor(QStringLiteral("://cursor/cursor-arrow-closehand.png")); + VApplication::restoreOverrideCursor(cursorArrowCloseHand); } } VToolPoint::mouseReleaseEvent(event); diff --git a/src/app/tools/drawTools/vtoolspline.cpp b/src/app/tools/drawTools/vtoolspline.cpp index f6f4c6b71..847077453 100644 --- a/src/app/tools/drawTools/vtoolspline.cpp +++ b/src/app/tools/drawTools/vtoolspline.cpp @@ -31,6 +31,7 @@ #include "../../dialogs/tools/dialogspline.h" #include "../../undocommands/movespline.h" #include "../../visualization/vistoolspline.h" +#include "../../options.h" #include const QString VToolSpline::ToolType = QStringLiteral("simple"); @@ -371,7 +372,7 @@ void VToolSpline::mousePressEvent(QGraphicsSceneMouseEvent *event) { if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) { - VApplication::setOverrideCursor(QStringLiteral("://cursor/cursor-arrow-closehand.png"), 1, 1); + VApplication::setOverrideCursor(cursorArrowCloseHand, 1, 1); oldPosition = event->scenePos(); event->accept(); } @@ -387,7 +388,7 @@ void VToolSpline::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) { //Disable cursor-arrow-closehand - VApplication::restoreOverrideCursor(QStringLiteral("://cursor/cursor-arrow-closehand.png")); + VApplication::restoreOverrideCursor(cursorArrowCloseHand); } } VAbstractSpline::mouseReleaseEvent(event); @@ -451,7 +452,7 @@ void VToolSpline::hoverEnterEvent(QGraphicsSceneHoverEvent *event) { if (flags() & QGraphicsItem::ItemIsMovable) { - VApplication::setOverrideCursor(QStringLiteral("://cursor/cursor-arrow-openhand.png"), 1, 1); + VApplication::setOverrideCursor(cursorArrowOpenHand, 1, 1); } VAbstractSpline::hoverEnterEvent(event); @@ -463,7 +464,7 @@ void VToolSpline::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) if (flags() & QGraphicsItem::ItemIsMovable) { //Disable cursor-arrow-openhand - VApplication::restoreOverrideCursor(QStringLiteral("://cursor/cursor-arrow-openhand.png")); + VApplication::restoreOverrideCursor(cursorArrowOpenHand); } VAbstractSpline::hoverLeaveEvent(event); diff --git a/src/app/visualization/vcontrolpointspline.cpp b/src/app/visualization/vcontrolpointspline.cpp index 31c22d7aa..5fb35504a 100644 --- a/src/app/visualization/vcontrolpointspline.cpp +++ b/src/app/visualization/vcontrolpointspline.cpp @@ -90,7 +90,7 @@ void VControlPointSpline::paint(QPainter *painter, const QStyleOptionGraphicsIte void VControlPointSpline::hoverEnterEvent(QGraphicsSceneHoverEvent *event) { this->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()))); - VApplication::setOverrideCursor(QStringLiteral("://cursor/cursor-arrow-openhand.png"), 1, 1); + VApplication::setOverrideCursor(cursorArrowOpenHand, 1, 1); QGraphicsEllipseItem::hoverEnterEvent(event); } @@ -99,7 +99,7 @@ void VControlPointSpline::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { this->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine()))); //Disable cursor-arrow-openhand - VApplication::restoreOverrideCursor(QStringLiteral("://cursor/cursor-arrow-openhand.png")); + VApplication::restoreOverrideCursor(cursorArrowOpenHand); QGraphicsEllipseItem::hoverLeaveEvent(event); } @@ -126,7 +126,7 @@ void VControlPointSpline::mousePressEvent(QGraphicsSceneMouseEvent *event) { if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) { - VApplication::setOverrideCursor(QStringLiteral("://cursor/cursor-arrow-closehand.png"), 1, 1); + VApplication::setOverrideCursor(cursorArrowCloseHand, 1, 1); } QGraphicsEllipseItem::mousePressEvent(event); } @@ -137,7 +137,7 @@ void VControlPointSpline::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) { //Disable cursor-arrow-closehand - VApplication::restoreOverrideCursor(QStringLiteral("://cursor/cursor-arrow-closehand.png")); + VApplication::restoreOverrideCursor(cursorArrowCloseHand); } QGraphicsEllipseItem::mouseReleaseEvent(event); } diff --git a/src/app/visualization/vgraphicssimpletextitem.cpp b/src/app/visualization/vgraphicssimpletextitem.cpp index 85f07a71d..c937519fd 100644 --- a/src/app/visualization/vgraphicssimpletextitem.cpp +++ b/src/app/visualization/vgraphicssimpletextitem.cpp @@ -124,7 +124,7 @@ void VGraphicsSimpleTextItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event) { this->setBrush(Qt::green); - VApplication::setOverrideCursor(QStringLiteral("://cursor/cursor-arrow-openhand.png"), 1, 1); + VApplication::setOverrideCursor(cursorArrowOpenHand, 1, 1); QGraphicsSimpleTextItem::hoverEnterEvent(event); } @@ -139,7 +139,7 @@ void VGraphicsSimpleTextItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) this->setBrush(Qt::black); //Disable cursor-arrow-openhand - VApplication::restoreOverrideCursor(QStringLiteral("://cursor/cursor-arrow-openhand.png")); + VApplication::restoreOverrideCursor(cursorArrowOpenHand); QGraphicsSimpleTextItem::hoverLeaveEvent(event); } @@ -158,7 +158,7 @@ void VGraphicsSimpleTextItem::mousePressEvent(QGraphicsSceneMouseEvent *event) { if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) { - VApplication::setOverrideCursor(QStringLiteral("://cursor/cursor-arrow-closehand.png"), 1, 1); + VApplication::setOverrideCursor(cursorArrowCloseHand, 1, 1); } QGraphicsSimpleTextItem::mousePressEvent(event); } @@ -169,7 +169,7 @@ void VGraphicsSimpleTextItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) { //Disable cursor-arrow-closehand - VApplication::restoreOverrideCursor(QStringLiteral("://cursor/cursor-arrow-closehand.png")); + VApplication::restoreOverrideCursor(cursorArrowCloseHand); } QGraphicsSimpleTextItem::mouseReleaseEvent(event); } From f16cccd89fecb179c2fe1651bbdad9e04a0e3eeb Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 12 Feb 2015 17:42:44 +0200 Subject: [PATCH 146/186] Curved path can move by mouse. --HG-- branch : feature --- src/app/geometry/vsplinepath.cpp | 24 ++++ src/app/geometry/vsplinepath.h | 2 + src/app/tools/drawTools/vtoolsplinepath.cpp | 119 +++++++++++++++++++- src/app/tools/drawTools/vtoolsplinepath.h | 7 ++ 4 files changed, 151 insertions(+), 1 deletion(-) diff --git a/src/app/geometry/vsplinepath.cpp b/src/app/geometry/vsplinepath.cpp index 068c910cb..635653333 100644 --- a/src/app/geometry/vsplinepath.cpp +++ b/src/app/geometry/vsplinepath.cpp @@ -236,6 +236,30 @@ void VSplinePath::setMaxCountPoints(const qint32 &value) d->maxCountPoints = value; } +//--------------------------------------------------------------------------------------------------------------------- +int VSplinePath::Segment(const QPointF &p) const +{ + int index = -1; + for (qint32 i = 1; i <= Count(); ++i) + { + VSpline spl = VSpline(d->path.at(i-1).P(), d->path.at(i).P(), d->path.at(i-1).Angle2(), d->path.at(i).Angle1(), + d->path.at(i-1).KAsm2(), d->path.at(i).KAsm1(), d->kCurve); + + const qreal t = spl.ParamT(p); + + if (qFloor(t) == -1) + { + continue; + } + else + { + index = i; + break; + } + } + return index; +} + //--------------------------------------------------------------------------------------------------------------------- qint32 VSplinePath::CountPoint() const { diff --git a/src/app/geometry/vsplinepath.h b/src/app/geometry/vsplinepath.h index b3de10941..eec37a532 100644 --- a/src/app/geometry/vsplinepath.h +++ b/src/app/geometry/vsplinepath.h @@ -185,6 +185,8 @@ public: * @param value max count. */ void setMaxCountPoints(const qint32 &value); + + int Segment(const QPointF &p) const; private: QSharedDataPointer d; }; diff --git a/src/app/tools/drawTools/vtoolsplinepath.cpp b/src/app/tools/drawTools/vtoolsplinepath.cpp index 9c7b4157f..d40c258bf 100644 --- a/src/app/tools/drawTools/vtoolsplinepath.cpp +++ b/src/app/tools/drawTools/vtoolsplinepath.cpp @@ -44,7 +44,7 @@ const QString VToolSplinePath::ToolType = QStringLiteral("path"); */ VToolSplinePath::VToolSplinePath(VPattern *doc, VContainer *data, quint32 id, const QString &color, const Source &typeCreation, QGraphicsItem *parent) - :VAbstractSpline(doc, data, id, parent) + :VAbstractSpline(doc, data, id, parent), oldPosition() { sceneType = SceneObject::SplinePath; @@ -52,6 +52,7 @@ VToolSplinePath::VToolSplinePath(VPattern *doc, VContainer *data, quint32 id, co this->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine())/factor)); this->setFlag(QGraphicsItem::ItemIsSelectable, true); this->setFlag(QGraphicsItem::ItemIsFocusable, true); + this->setFlag(QGraphicsItem::ItemIsMovable, true); this->setAcceptHoverEvents(true); const QSharedPointer splPath = data->GeometricObject(id); @@ -167,6 +168,7 @@ VToolSplinePath* VToolSplinePath::Create(const quint32 _id, VSplinePath *path, c connect(spl, &VToolSplinePath::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, spl, &VToolSplinePath::SetFactor); connect(scene, &VMainGraphicsScene::DisableItem, spl, &VToolSplinePath::Disable); + connect(scene, &VMainGraphicsScene::EnableToolMove, spl, &VToolSplinePath::EnableToolMove); doc->AddTool(id, spl); return spl; } @@ -414,6 +416,121 @@ void VToolSplinePath::SaveOptions(QDomElement &tag, QSharedPointer &ob } } +//--------------------------------------------------------------------------------------------------------------------- +void VToolSplinePath::mousePressEvent(QGraphicsSceneMouseEvent *event) +{ + if (flags() & QGraphicsItem::ItemIsMovable) + { + if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) + { + VApplication::setOverrideCursor(cursorArrowCloseHand, 1, 1); + oldPosition = event->scenePos(); + event->accept(); + } + } + VAbstractSpline::mousePressEvent(event); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VToolSplinePath::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) +{ + if (flags() & QGraphicsItem::ItemIsMovable) + { + if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) + { + //Disable cursor-arrow-closehand + VApplication::restoreOverrideCursor(cursorArrowCloseHand); + } + } + VAbstractSpline::mouseReleaseEvent(event); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VToolSplinePath::mouseMoveEvent(QGraphicsSceneMouseEvent *event) +{ + // Don't need check if left mouse button was pressed. According to the Qt documentation "If you do receive this + // event, you can be certain that this item also received a mouse press event, and that this item is the current + // mouse grabber.". + + VSplinePath oldSplPath = *VAbstractTool::data.GeometricObject(id); + VSplinePath newSplPath = oldSplPath; + int indexSpline = oldSplPath.Segment(oldPosition); + if (indexSpline == -1) + { + return; + } + + VSpline spline = newSplPath.GetSpline(indexSpline); + const qreal t = spline.ParamT(oldPosition); + + if (qFloor(t) == -1) + { + return; + } + + // Magic Bezier Drag Equations follow! + // "weight" describes how the influence of the drag should be distributed + // among the handles; 0 = front handle only, 1 = back handle only. + + double weight; + if (t <= 1.0 / 6.0) + { + weight = 0; + } + else if (t <= 0.5) + { + weight = (pow((6 * t - 1) / 2.0, 3)) / 2; + } + else if (t <= 5.0 / 6.0) + { + weight = (1 - pow((6 * (1-t) - 1) / 2.0, 3)) / 2 + 0.5; + } + else + { + weight = 1; + } + + const QPointF delta = event->scenePos() - oldPosition; + const QPointF offset0 = ((1-weight)/(3*t*(1-t)*(1-t))) * delta; + const QPointF offset1 = (weight/(3*t*t*(1-t))) * delta; + + const QPointF p2 = spline.GetP2() + offset0; + const QPointF p3 = spline.GetP3() + offset1; + + oldPosition = event->scenePos(); // Now mouse here + + const VSpline spl = VSpline(spline.GetP1(), p2, p3, spline.GetP4(), spline.GetKcurve()); + + UpdateControlPoints(spl, newSplPath, indexSpline); + + MoveSplinePath *moveSplPath = new MoveSplinePath(doc, oldSplPath, newSplPath, id, this->scene()); + connect(moveSplPath, &VUndoCommand::NeedLiteParsing, doc, &VPattern::LiteParseTree); + qApp->getUndoStack()->push(moveSplPath); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VToolSplinePath::hoverEnterEvent(QGraphicsSceneHoverEvent *event) +{ + if (flags() & QGraphicsItem::ItemIsMovable) + { + VApplication::setOverrideCursor(cursorArrowOpenHand, 1, 1); + } + + VAbstractSpline::hoverEnterEvent(event); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VToolSplinePath::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) +{ + if (flags() & QGraphicsItem::ItemIsMovable) + { + //Disable cursor-arrow-openhand + VApplication::restoreOverrideCursor(cursorArrowOpenHand); + } + + VAbstractSpline::hoverLeaveEvent(event); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief RefreshGeometry refresh item on scene. diff --git a/src/app/tools/drawTools/vtoolsplinepath.h b/src/app/tools/drawTools/vtoolsplinepath.h index 9b3dfd3c9..52fb849db 100644 --- a/src/app/tools/drawTools/vtoolsplinepath.h +++ b/src/app/tools/drawTools/vtoolsplinepath.h @@ -79,7 +79,14 @@ protected: virtual void RemoveReferens(); virtual void SaveDialog(QDomElement &domElement); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void mousePressEvent(QGraphicsSceneMouseEvent * event); + virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event ); + virtual void mouseMoveEvent(QGraphicsSceneMouseEvent * event); + virtual void hoverEnterEvent ( QGraphicsSceneHoverEvent * event ); + virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event ); private: + QPointF oldPosition; + void RefreshGeometry(); static void AddPathPoint(VPattern *doc, QDomElement &domElement, const VSplinePoint &splPoint); void UpdateControlPoints(const VSpline &spl, VSplinePath &splPath, const qint32 &indexSpline) const; From ee0f8d51be1213e5ed9d4474de5307203ac80c9f Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 12 Feb 2015 17:47:53 +0200 Subject: [PATCH 147/186] Auto save should not change "was modefied" sign (*). --HG-- branch : feature --- src/app/mainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index 8162572cf..4684e8abd 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -1998,13 +1998,13 @@ bool MainWindow::SavePattern(const QString &fileName, QString &error) setCurrentFile(fileName); helpLabel->setText(tr("File saved")); qCDebug(vMainWindow)<<"File"< Date: Thu, 12 Feb 2015 18:02:23 +0200 Subject: [PATCH 148/186] Cut tools use attribute "color" instead "lineColor". --HG-- branch : feature --- src/libs/ifc/schema/pattern/v0.1.3.xsd | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libs/ifc/schema/pattern/v0.1.3.xsd b/src/libs/ifc/schema/pattern/v0.1.3.xsd index 18cf62b78..6d72527c3 100644 --- a/src/libs/ifc/schema/pattern/v0.1.3.xsd +++ b/src/libs/ifc/schema/pattern/v0.1.3.xsd @@ -122,6 +122,7 @@ + From 99ebbc3ed9f150b1ccd2c9cc54ed105bf47ddb2f Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 12 Feb 2015 18:10:47 +0200 Subject: [PATCH 149/186] Simple curve ignore press event and allow move curve by mouse. --HG-- branch : feature --- src/app/tools/drawTools/vtoolsplinepath.cpp | 6 ++++++ src/app/tools/drawTools/vtoolsplinepath.h | 1 + src/app/visualization/vsimplecurve.cpp | 6 ++++++ src/app/visualization/vsimplecurve.h | 1 + 4 files changed, 14 insertions(+) diff --git a/src/app/tools/drawTools/vtoolsplinepath.cpp b/src/app/tools/drawTools/vtoolsplinepath.cpp index d40c258bf..6ca030ff5 100644 --- a/src/app/tools/drawTools/vtoolsplinepath.cpp +++ b/src/app/tools/drawTools/vtoolsplinepath.cpp @@ -204,6 +204,12 @@ void VToolSplinePath::ControlPointChangePosition(const qint32 &indexSpline, cons qApp->getUndoStack()->push(moveSplPath); } +//--------------------------------------------------------------------------------------------------------------------- +void VToolSplinePath::EnableToolMove(bool move) +{ + this->setFlag(QGraphicsItem::ItemIsMovable, move); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief UpdateControlPoints update position points control points in file. diff --git a/src/app/tools/drawTools/vtoolsplinepath.h b/src/app/tools/drawTools/vtoolsplinepath.h index 52fb849db..1566149c0 100644 --- a/src/app/tools/drawTools/vtoolsplinepath.h +++ b/src/app/tools/drawTools/vtoolsplinepath.h @@ -73,6 +73,7 @@ public slots: void ControlPointChangePosition(const qint32 &indexSpline, const SplinePointPosition &position, const QPointF &pos); + virtual void EnableToolMove(bool move); protected: virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event ); virtual void RefreshDataInFile(); diff --git a/src/app/visualization/vsimplecurve.cpp b/src/app/visualization/vsimplecurve.cpp index 33031f3eb..095f6c2db 100644 --- a/src/app/visualization/vsimplecurve.cpp +++ b/src/app/visualization/vsimplecurve.cpp @@ -144,6 +144,12 @@ void VSimpleCurve::SetCurrentColor(const QColor &value) setPen(QPen(CorrectColor(currentColor), pen().widthF())); } +//--------------------------------------------------------------------------------------------------------------------- +void VSimpleCurve::mousePressEvent(QGraphicsSceneMouseEvent *event) +{ + event->ignore(); +} + //--------------------------------------------------------------------------------------------------------------------- QColor VSimpleCurve::CorrectColor(const QColor &color) const { diff --git a/src/app/visualization/vsimplecurve.h b/src/app/visualization/vsimplecurve.h index a013727c2..96cefdca2 100644 --- a/src/app/visualization/vsimplecurve.h +++ b/src/app/visualization/vsimplecurve.h @@ -60,6 +60,7 @@ signals: void Choosed(quint32 id); void HoverPath(quint32 id, SimpleCurvePoint curvePosition, PathDirection direction); protected: + virtual void mousePressEvent(QGraphicsSceneMouseEvent * event); virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event ); virtual void hoverMoveEvent ( QGraphicsSceneHoverEvent * event ); virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event ); From 7db74d4f20143ccbaeb82be160ee1370cdf0c053 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 13 Feb 2015 11:26:02 +0200 Subject: [PATCH 150/186] We don't need anymore simple curves. First step just hide them. --HG-- branch : feature --- src/app/tools/drawTools/vtoolcut.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/app/tools/drawTools/vtoolcut.cpp b/src/app/tools/drawTools/vtoolcut.cpp index 7eefbc110..dabc5deb3 100644 --- a/src/app/tools/drawTools/vtoolcut.cpp +++ b/src/app/tools/drawTools/vtoolcut.cpp @@ -47,11 +47,14 @@ VToolCut::VToolCut(VPattern *doc, VContainer *data, const quint32 &id, const QSt firstCurve->setParentItem(this); connect(firstCurve, &VSimpleCurve::Choosed, this, &VToolCut::CurveChoosed); connect(firstCurve, &VSimpleCurve::HoverPath, this, &VToolCut::HoverPath); + // TODO: Now we only hide simple curves, but in future need totally delete them all. + firstCurve->setVisible(false); secondCurve = new VSimpleCurve(curve2id, QColor(lineColor), SimpleCurvePoint::FirstPoint, &factor); secondCurve->setParentItem(this); connect(secondCurve, &VSimpleCurve::Choosed, this, &VToolCut::CurveChoosed); connect(secondCurve, &VSimpleCurve::HoverPath, this, &VToolCut::HoverPath); + secondCurve->setVisible(false); } //--------------------------------------------------------------------------------------------------------------------- From 0ec27482935a5767b425167c9ed64e4374a5b916 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 13 Feb 2015 11:33:20 +0200 Subject: [PATCH 151/186] Don't allow move if we use tool. --HG-- branch : develop --- src/app/mainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index 4684e8abd..80dd7f7fa 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -300,7 +300,7 @@ void MainWindow::SetToolButton(bool checked, Tool t, const QString &cursor, cons if (checked) { CancelTool(); - emit EnableItemMove(true); + emit EnableItemMove(false); tool = t; QPixmap pixmap(cursor); QCursor cur(pixmap, 2, 3); From 0db66e1946d3ed689895ee40949a3967cf538998 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sun, 15 Feb 2015 09:14:02 +0200 Subject: [PATCH 152/186] Update layout save path when show dialog first time. --HG-- branch : develop --- src/app/dialogs/app/dialogsavelayout.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/app/dialogs/app/dialogsavelayout.cpp b/src/app/dialogs/app/dialogsavelayout.cpp index 94b3c55ab..8205d015e 100644 --- a/src/app/dialogs/app/dialogsavelayout.cpp +++ b/src/app/dialogs/app/dialogsavelayout.cpp @@ -53,8 +53,6 @@ DialogSaveLayout::DialogSaveLayout(const QMap &formates, int c ui->lineEditFileName->setValidator(validator); ui->lineEditFileName->setText(fileName); - ui->lineEditPath->setText(qApp->getSettings()->GetPathLayout()); - QMap::const_iterator i = formates.constBegin(); while (i != formates.constEnd()) { @@ -70,6 +68,7 @@ DialogSaveLayout::DialogSaveLayout(const QMap &formates, int c connect(ui->lineEditPath, &QLineEdit::textChanged, this, &DialogSaveLayout::PathChanged); ui->comboBoxFormat->setCurrentIndex(4);//svg + ui->lineEditPath->setText(qApp->getSettings()->GetPathLayout()); } //--------------------------------------------------------------------------------------------------------------------- From bac1baf59fcafba2fd8b14240e181318c522ddf3 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 16 Feb 2015 15:54:56 +0200 Subject: [PATCH 153/186] Fixed issue #184. Delete button "Equal" in dialogs. --HG-- branch : develop --- src/app/dialogs/tools/dialogalongline.cpp | 1 - src/app/dialogs/tools/dialogalongline.ui | 19 ++----- src/app/dialogs/tools/dialogarc.cpp | 4 -- src/app/dialogs/tools/dialogarc.ui | 57 ++++--------------- src/app/dialogs/tools/dialogbisector.cpp | 1 - src/app/dialogs/tools/dialogbisector.ui | 19 ++----- .../tools/dialogcurveintersectaxis.cpp | 1 - .../dialogs/tools/dialogcurveintersectaxis.ui | 19 ++----- src/app/dialogs/tools/dialogcutarc.cpp | 1 - src/app/dialogs/tools/dialogcutarc.ui | 19 ++----- src/app/dialogs/tools/dialogcutspline.cpp | 1 - src/app/dialogs/tools/dialogcutspline.ui | 19 ++----- src/app/dialogs/tools/dialogcutsplinepath.cpp | 1 - src/app/dialogs/tools/dialogcutsplinepath.ui | 19 ++----- .../dialogs/tools/dialogeditwrongformula.cpp | 1 - .../dialogs/tools/dialogeditwrongformula.ui | 19 ++----- src/app/dialogs/tools/dialogendline.cpp | 3 - src/app/dialogs/tools/dialogendline.ui | 40 +++---------- .../dialogs/tools/dialoglineintersectaxis.cpp | 1 - .../dialogs/tools/dialoglineintersectaxis.ui | 19 ++----- src/app/dialogs/tools/dialognormal.cpp | 1 - src/app/dialogs/tools/dialognormal.ui | 19 ++----- .../dialogs/tools/dialogpointofcontact.cpp | 1 - src/app/dialogs/tools/dialogpointofcontact.ui | 19 ++----- src/app/dialogs/tools/dialogshoulderpoint.cpp | 1 - src/app/dialogs/tools/dialogshoulderpoint.ui | 19 ++----- 26 files changed, 65 insertions(+), 259 deletions(-) diff --git a/src/app/dialogs/tools/dialogalongline.cpp b/src/app/dialogs/tools/dialogalongline.cpp index 46463ff6e..ff9f3d641 100644 --- a/src/app/dialogs/tools/dialogalongline.cpp +++ b/src/app/dialogs/tools/dialogalongline.cpp @@ -64,7 +64,6 @@ DialogAlongLine::DialogAlongLine(const VContainer *data, const quint32 &toolId, connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogAlongLine::PutHere); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogAlongLine::NamePointChanged); - connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogAlongLine::EvalFormula); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogAlongLine::FormulaTextChanged); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogAlongLine::DeployFormulaTextEdit); connect(listWidget, &QListWidget::itemDoubleClicked, this, &DialogTool::PutVal); diff --git a/src/app/dialogs/tools/dialogalongline.ui b/src/app/dialogs/tools/dialogalongline.ui index 3dec6c83a..075d80cd0 100644 --- a/src/app/dialogs/tools/dialogalongline.ui +++ b/src/app/dialogs/tools/dialogalongline.ui @@ -107,22 +107,12 @@ - - - Calculate value - + - ... + - - - :/icon/24x24/equal.png:/icon/24x24/equal.png - - - - 24 - 24 - + + :/icon/24x24/equal.png @@ -476,7 +466,6 @@ plainTextEditFormula toolButtonPutHere - toolButtonEqual pushButtonGrowLength lineEditNamePoint comboBoxFirstPoint diff --git a/src/app/dialogs/tools/dialogarc.cpp b/src/app/dialogs/tools/dialogarc.cpp index 778f64c9e..728ead1ac 100644 --- a/src/app/dialogs/tools/dialogarc.cpp +++ b/src/app/dialogs/tools/dialogarc.cpp @@ -82,10 +82,6 @@ DialogArc::DialogArc(const VContainer *data, const quint32 &toolId, QWidget *par connect(ui->toolButtonPutHereF1, &QPushButton::clicked, this, &DialogArc::PutF1); connect(ui->toolButtonPutHereF2, &QPushButton::clicked, this, &DialogArc::PutF2); - connect(ui->toolButtonEqualRadius, &QPushButton::clicked, this, &DialogArc::EvalRadius); - connect(ui->toolButtonEqualF1, &QPushButton::clicked, this, &DialogArc::EvalF); - connect(ui->toolButtonEqualF2, &QPushButton::clicked, this, &DialogArc::EvalF); - connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogArc::RadiusChanged); connect(ui->plainTextEditF1, &QPlainTextEdit::textChanged, this, &DialogArc::F1Changed); connect(ui->plainTextEditF2, &QPlainTextEdit::textChanged, this, &DialogArc::F2Changed); diff --git a/src/app/dialogs/tools/dialogarc.ui b/src/app/dialogs/tools/dialogarc.ui index 1926f3291..74bb663a3 100644 --- a/src/app/dialogs/tools/dialogarc.ui +++ b/src/app/dialogs/tools/dialogarc.ui @@ -107,22 +107,12 @@ - - - Calculate value - + - ... + - - - :/icon/24x24/equal.png:/icon/24x24/equal.png - - - - 24 - 24 - + + :/icon/24x24/equal.png @@ -295,22 +285,12 @@ - - - Calculate value - + - ... + - - - :/icon/24x24/equal.png:/icon/24x24/equal.png - - - - 24 - 24 - + + :/icon/24x24/equal.png @@ -483,22 +463,12 @@ - - - Calculate value - + - ... + - - - :/icon/24x24/equal.png:/icon/24x24/equal.png - - - - 24 - 24 - + + :/icon/24x24/equal.png @@ -790,15 +760,12 @@ plainTextEditFormula toolButtonPutHereRadius - toolButtonEqualRadius pushButtonGrowLength plainTextEditF1 toolButtonPutHereF1 - toolButtonEqualF1 pushButtonGrowLengthF1 plainTextEditF2 toolButtonPutHereF2 - toolButtonEqualF2 pushButtonGrowLengthF2 radioButtonSizeGrowth radioButtonStandardTable diff --git a/src/app/dialogs/tools/dialogbisector.cpp b/src/app/dialogs/tools/dialogbisector.cpp index 98e68ab91..d5fc72190 100644 --- a/src/app/dialogs/tools/dialogbisector.cpp +++ b/src/app/dialogs/tools/dialogbisector.cpp @@ -66,7 +66,6 @@ DialogBisector::DialogBisector(const VContainer *data, const quint32 &toolId, QW connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogBisector::PutHere); connect(listWidget, &QListWidget::itemDoubleClicked, this, &DialogBisector::PutVal); - connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogBisector::EvalFormula); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogBisector::NamePointChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogBisector::FormulaTextChanged); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogBisector::DeployFormulaTextEdit); diff --git a/src/app/dialogs/tools/dialogbisector.ui b/src/app/dialogs/tools/dialogbisector.ui index 40d359b8b..5ff3ab60a 100644 --- a/src/app/dialogs/tools/dialogbisector.ui +++ b/src/app/dialogs/tools/dialogbisector.ui @@ -104,22 +104,12 @@ - - - Calculate value - + - ... + - - - :/icon/24x24/equal.png:/icon/24x24/equal.png - - - - 24 - 24 - + + :/icon/24x24/equal.png @@ -505,7 +495,6 @@ plainTextEditFormula toolButtonPutHere - toolButtonEqual pushButtonGrowLength lineEditNamePoint comboBoxFirstPoint diff --git a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp b/src/app/dialogs/tools/dialogcurveintersectaxis.cpp index 839fb5dc5..43b79a5cb 100644 --- a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp +++ b/src/app/dialogs/tools/dialogcurveintersectaxis.cpp @@ -61,7 +61,6 @@ DialogCurveIntersectAxis::DialogCurveIntersectAxis(const VContainer *data, const connect(ui->toolButtonPutHereAngle, &QPushButton::clicked, this, &DialogCurveIntersectAxis::PutAngle); connect(listWidget, &QListWidget::itemDoubleClicked, this, &DialogCurveIntersectAxis::PutVal); - connect(ui->toolButtonEqualAngle, &QPushButton::clicked, this, &DialogCurveIntersectAxis::EvalAngle); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogCurveIntersectAxis::NamePointChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogCurveIntersectAxis::AngleTextChanged); connect(ui->pushButtonGrowLengthAngle, &QPushButton::clicked, this, &DialogCurveIntersectAxis::DeployAngleTextEdit); diff --git a/src/app/dialogs/tools/dialogcurveintersectaxis.ui b/src/app/dialogs/tools/dialogcurveintersectaxis.ui index c947ba329..55721a6b1 100644 --- a/src/app/dialogs/tools/dialogcurveintersectaxis.ui +++ b/src/app/dialogs/tools/dialogcurveintersectaxis.ui @@ -97,22 +97,12 @@ - - - Calculate value - + - ... + - - - :/icon/24x24/equal.png:/icon/24x24/equal.png - - - - 24 - 24 - + + :/icon/24x24/equal.png @@ -491,7 +481,6 @@ plainTextEditFormula toolButtonPutHereAngle - toolButtonEqualAngle pushButtonGrowLengthAngle comboBoxAxisPoint comboBoxCurve diff --git a/src/app/dialogs/tools/dialogcutarc.cpp b/src/app/dialogs/tools/dialogcutarc.cpp index 6650a4751..c9ce1d94c 100644 --- a/src/app/dialogs/tools/dialogcutarc.cpp +++ b/src/app/dialogs/tools/dialogcutarc.cpp @@ -63,7 +63,6 @@ DialogCutArc::DialogCutArc(const VContainer *data, const quint32 &toolId, QWidge connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogCutArc::PutHere); connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogCutArc::PutVal); - connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogCutArc::EvalFormula); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogCutArc::NamePointChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogCutArc::FormulaTextChanged); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogCutArc::DeployFormulaTextEdit); diff --git a/src/app/dialogs/tools/dialogcutarc.ui b/src/app/dialogs/tools/dialogcutarc.ui index 3ee9722f0..2889981d6 100644 --- a/src/app/dialogs/tools/dialogcutarc.ui +++ b/src/app/dialogs/tools/dialogcutarc.ui @@ -101,22 +101,12 @@ - - - Calculate value - + - ... + - - - :/icon/24x24/equal.png:/icon/24x24/equal.png - - - - 24 - 24 - + + :/icon/24x24/equal.png @@ -427,7 +417,6 @@ plainTextEditFormula toolButtonPutHere - toolButtonEqual pushButtonGrowLength comboBoxArc lineEditNamePoint diff --git a/src/app/dialogs/tools/dialogcutspline.cpp b/src/app/dialogs/tools/dialogcutspline.cpp index 13a55e935..2130e25f7 100644 --- a/src/app/dialogs/tools/dialogcutspline.cpp +++ b/src/app/dialogs/tools/dialogcutspline.cpp @@ -61,7 +61,6 @@ DialogCutSpline::DialogCutSpline(const VContainer *data, const quint32 &toolId, connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogCutSpline::PutHere); connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogCutSpline::PutVal); - connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogCutSpline::EvalFormula); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogCutSpline::NamePointChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogCutSpline::FormulaChanged); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogCutSpline::DeployFormulaTextEdit); diff --git a/src/app/dialogs/tools/dialogcutspline.ui b/src/app/dialogs/tools/dialogcutspline.ui index c7df135dc..ef19baea9 100644 --- a/src/app/dialogs/tools/dialogcutspline.ui +++ b/src/app/dialogs/tools/dialogcutspline.ui @@ -101,22 +101,12 @@ - - - Calculate value - + - ... + - - - :/icon/24x24/equal.png:/icon/24x24/equal.png - - - - 24 - 24 - + + :/icon/24x24/equal.png @@ -427,7 +417,6 @@ plainTextEditFormula toolButtonPutHere - toolButtonEqual pushButtonGrowLength comboBoxSpline lineEditNamePoint diff --git a/src/app/dialogs/tools/dialogcutsplinepath.cpp b/src/app/dialogs/tools/dialogcutsplinepath.cpp index 507d53a3e..9351c4102 100644 --- a/src/app/dialogs/tools/dialogcutsplinepath.cpp +++ b/src/app/dialogs/tools/dialogcutsplinepath.cpp @@ -61,7 +61,6 @@ DialogCutSplinePath::DialogCutSplinePath(const VContainer *data, const quint32 & connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogCutSplinePath::PutHere); connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogCutSplinePath::PutVal); - connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogCutSplinePath::EvalFormula); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogCutSplinePath::NamePointChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogCutSplinePath::FormulaChanged); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogCutSplinePath::DeployFormulaTextEdit); diff --git a/src/app/dialogs/tools/dialogcutsplinepath.ui b/src/app/dialogs/tools/dialogcutsplinepath.ui index 2312d2eed..a2fdc21da 100644 --- a/src/app/dialogs/tools/dialogcutsplinepath.ui +++ b/src/app/dialogs/tools/dialogcutsplinepath.ui @@ -101,22 +101,12 @@ - - - Calculate value - + - ... + - - - :/icon/24x24/equal.png:/icon/24x24/equal.png - - - - 24 - 24 - + + :/icon/24x24/equal.png @@ -433,7 +423,6 @@ plainTextEditFormula toolButtonPutHere - toolButtonEqual pushButtonGrowLength comboBoxSplinePath lineEditNamePoint diff --git a/src/app/dialogs/tools/dialogeditwrongformula.cpp b/src/app/dialogs/tools/dialogeditwrongformula.cpp index 804a78ff6..7800625c0 100644 --- a/src/app/dialogs/tools/dialogeditwrongformula.cpp +++ b/src/app/dialogs/tools/dialogeditwrongformula.cpp @@ -47,7 +47,6 @@ DialogEditWrongFormula::DialogEditWrongFormula(const VContainer *data, const qui connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogEditWrongFormula::PutHere); connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogEditWrongFormula::PutVal); - connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogEditWrongFormula::EvalFormula); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogEditWrongFormula::FormulaChanged); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogEditWrongFormula::DeployFormulaTextEdit); diff --git a/src/app/dialogs/tools/dialogeditwrongformula.ui b/src/app/dialogs/tools/dialogeditwrongformula.ui index 47d43dd6a..0c84e4d32 100644 --- a/src/app/dialogs/tools/dialogeditwrongformula.ui +++ b/src/app/dialogs/tools/dialogeditwrongformula.ui @@ -110,22 +110,12 @@ - - - Calculate value - + - ... + - - - :/icon/24x24/equal.png:/icon/24x24/equal.png - - - - 24 - 24 - + + :/icon/24x24/equal.png @@ -392,7 +382,6 @@ plainTextEditFormula toolButtonPutHere - toolButtonEqual pushButtonGrowLength radioButtonSizeGrowth radioButtonStandardTable diff --git a/src/app/dialogs/tools/dialogendline.cpp b/src/app/dialogs/tools/dialogendline.cpp index 3ecb0651d..87ab2e9ca 100644 --- a/src/app/dialogs/tools/dialogendline.cpp +++ b/src/app/dialogs/tools/dialogendline.cpp @@ -68,9 +68,6 @@ DialogEndLine::DialogEndLine(const VContainer *data, const quint32 &toolId, QWid connect(ui->toolButtonPutHereLength, &QPushButton::clicked, this, &DialogEndLine::PutHere); connect(ui->toolButtonPutHereAngle, &QPushButton::clicked, this, &DialogEndLine::PutAngle); - connect(ui->toolButtonEqualLength, &QPushButton::clicked, this, &DialogEndLine::EvalFormula); - connect(ui->toolButtonEqualAngle, &QPushButton::clicked, this, &DialogEndLine::EvalAngle); - connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogEndLine::NamePointChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogEndLine::FormulaTextChanged); diff --git a/src/app/dialogs/tools/dialogendline.ui b/src/app/dialogs/tools/dialogendline.ui index 93dbd3f8f..6ddd69fcd 100644 --- a/src/app/dialogs/tools/dialogendline.ui +++ b/src/app/dialogs/tools/dialogendline.ui @@ -7,7 +7,7 @@ 0 0 417 - 538 + 571 @@ -110,22 +110,12 @@ - - - Calculate value - + - ... + - - - :/icon/24x24/equal.png:/icon/24x24/equal.png - - - - 24 - 24 - + + :/icon/24x24/equal.png @@ -298,22 +288,12 @@ - - - Calculate value - + - ... + - - - :/icon/24x24/equal.png:/icon/24x24/equal.png - - - - 24 - 24 - + + :/icon/24x24/equal.png @@ -665,11 +645,9 @@ plainTextEditFormula toolButtonPutHereLength - toolButtonEqualLength pushButtonGrowLength plainTextEditAngle toolButtonPutHereAngle - toolButtonEqualAngle pushButtonGrowLengthAngle comboBoxBasePoint lineEditNamePoint diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.cpp b/src/app/dialogs/tools/dialoglineintersectaxis.cpp index 39e12c91b..ee14ccc22 100644 --- a/src/app/dialogs/tools/dialoglineintersectaxis.cpp +++ b/src/app/dialogs/tools/dialoglineintersectaxis.cpp @@ -61,7 +61,6 @@ DialogLineIntersectAxis::DialogLineIntersectAxis(const VContainer *data, const q connect(ui->toolButtonPutHereAngle, &QPushButton::clicked, this, &DialogLineIntersectAxis::PutAngle); connect(listWidget, &QListWidget::itemDoubleClicked, this, &DialogLineIntersectAxis::PutVal); - connect(ui->toolButtonEqualAngle, &QPushButton::clicked, this, &DialogLineIntersectAxis::EvalAngle); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogLineIntersectAxis::NamePointChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogLineIntersectAxis::AngleTextChanged); connect(ui->pushButtonGrowLengthAngle, &QPushButton::clicked, this, &DialogLineIntersectAxis::DeployAngleTextEdit); diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.ui b/src/app/dialogs/tools/dialoglineintersectaxis.ui index 93bb92747..235d515c9 100644 --- a/src/app/dialogs/tools/dialoglineintersectaxis.ui +++ b/src/app/dialogs/tools/dialoglineintersectaxis.ui @@ -97,22 +97,12 @@ - - - Calculate value - + - ... + - - - :/icon/24x24/equal.png:/icon/24x24/equal.png - - - - 24 - 24 - + + :/icon/24x24/equal.png @@ -508,7 +498,6 @@ plainTextEditFormula toolButtonPutHereAngle - toolButtonEqualAngle pushButtonGrowLengthAngle comboBoxAxisPoint comboBoxFirstLinePoint diff --git a/src/app/dialogs/tools/dialognormal.cpp b/src/app/dialogs/tools/dialognormal.cpp index 0d6ae44a6..0c456e781 100644 --- a/src/app/dialogs/tools/dialognormal.cpp +++ b/src/app/dialogs/tools/dialognormal.cpp @@ -63,7 +63,6 @@ DialogNormal::DialogNormal(const VContainer *data, const quint32 &toolId, QWidge connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogNormal::PutHere); connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogNormal::PutVal); - connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogNormal::EvalFormula); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogNormal::NamePointChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogNormal::FormulaTextChanged); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogNormal::DeployFormulaTextEdit); diff --git a/src/app/dialogs/tools/dialognormal.ui b/src/app/dialogs/tools/dialognormal.ui index b5fb9541a..ce49c22ef 100644 --- a/src/app/dialogs/tools/dialognormal.ui +++ b/src/app/dialogs/tools/dialognormal.ui @@ -107,22 +107,12 @@ - - - Calculate value - + - ... + - - - :/icon/24x24/equal.png:/icon/24x24/equal.png - - - - 24 - 24 - + + :/icon/24x24/equal.png @@ -693,7 +683,6 @@ plainTextEditFormula toolButtonPutHere - toolButtonEqual pushButtonGrowLength lineEditNamePoint comboBoxFirstPoint diff --git a/src/app/dialogs/tools/dialogpointofcontact.cpp b/src/app/dialogs/tools/dialogpointofcontact.cpp index 84328c2f3..31581734c 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.cpp +++ b/src/app/dialogs/tools/dialogpointofcontact.cpp @@ -78,7 +78,6 @@ DialogPointOfContact::DialogPointOfContact(const VContainer *data, const quint32 connect(ui->radioButtonLengthLine, &QRadioButton::clicked, this, &DialogPointOfContact::LengthLines); connect(ui->radioButtonLengthArc, &QRadioButton::clicked, this, &DialogPointOfContact::LengthArcs); connect(ui->radioButtonLengthSpline, &QRadioButton::clicked, this, &DialogPointOfContact::LengthCurves); - connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogPointOfContact::EvalFormula); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogPointOfContact::NamePointChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogPointOfContact::FormulaTextChanged); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogPointOfContact::DeployFormulaTextEdit); diff --git a/src/app/dialogs/tools/dialogpointofcontact.ui b/src/app/dialogs/tools/dialogpointofcontact.ui index 3b5b1c350..cd0d23b27 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.ui +++ b/src/app/dialogs/tools/dialogpointofcontact.ui @@ -107,22 +107,12 @@ - - - Calculate value - + - ... + - - - :/icon/24x24/equal.png:/icon/24x24/equal.png - - - - 24 - 24 - + + :/icon/24x24/equal.png @@ -502,7 +492,6 @@ plainTextEditFormula toolButtonPutHere - toolButtonEqual pushButtonGrowLength lineEditNamePoint comboBoxCenter diff --git a/src/app/dialogs/tools/dialogshoulderpoint.cpp b/src/app/dialogs/tools/dialogshoulderpoint.cpp index ad92e20c8..0fa24a2b5 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.cpp +++ b/src/app/dialogs/tools/dialogshoulderpoint.cpp @@ -65,7 +65,6 @@ DialogShoulderPoint::DialogShoulderPoint(const VContainer *data, const quint32 & connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogShoulderPoint::PutHere); connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogShoulderPoint::PutVal); - connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogShoulderPoint::EvalFormula); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogShoulderPoint::NamePointChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogShoulderPoint::FormulaTextChanged); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogShoulderPoint::DeployFormulaTextEdit); diff --git a/src/app/dialogs/tools/dialogshoulderpoint.ui b/src/app/dialogs/tools/dialogshoulderpoint.ui index c63a6d001..f39cd5281 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.ui +++ b/src/app/dialogs/tools/dialogshoulderpoint.ui @@ -107,22 +107,12 @@ - - - Calculate value - + - ... + - - - :/icon/24x24/equal.png:/icon/24x24/equal.png - - - - 24 - 24 - + + :/icon/24x24/equal.png @@ -541,7 +531,6 @@ plainTextEditFormula toolButtonPutHere - toolButtonEqual pushButtonGrowLength lineEditNamePoint comboBoxP1Line From 352637a40a4bd37b7d77da0f6fcfda8709b8c3b4 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 16 Feb 2015 16:02:52 +0200 Subject: [PATCH 154/186] Fixed issue #210. Rename Point of intersection line and axis. --HG-- branch : develop --- src/app/dialogs/tools/dialoglineintersectaxis.ui | 2 +- src/app/mainwindow.ui | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.ui b/src/app/dialogs/tools/dialoglineintersectaxis.ui index 235d515c9..f12ab4175 100644 --- a/src/app/dialogs/tools/dialoglineintersectaxis.ui +++ b/src/app/dialogs/tools/dialoglineintersectaxis.ui @@ -11,7 +11,7 @@ - Line intersect axis + Intersect Line and Axis diff --git a/src/app/mainwindow.ui b/src/app/mainwindow.ui index 9f65e49c2..d534fe617 100644 --- a/src/app/mainwindow.ui +++ b/src/app/mainwindow.ui @@ -40,7 +40,7 @@ - 3 + 0 @@ -307,7 +307,7 @@ false - Point of intersection line and axis + Intersect Line and Axis ... @@ -334,7 +334,7 @@ 0 0 - 105 + 100 58 @@ -410,7 +410,7 @@ 0 0 - 105 + 100 156 @@ -660,7 +660,7 @@ 0 0 - 105 + 100 58 From 734efb414591dbd6b54038fd0df8ec02ff201793 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 16 Feb 2015 16:38:37 +0200 Subject: [PATCH 155/186] Fixed issue #219. Rename 'Tool new detail' to 'Seam Allowance tool'. Fixed issue #220. Rename 'Tool for union two details' to 'Union tool'. --HG-- branch : develop --- src/app/dialogs/tools/dialogalongline.ui | 2 +- src/app/dialogs/tools/dialogbisector.ui | 2 +- .../dialogs/tools/dialogcurveintersectaxis.ui | 2 +- src/app/dialogs/tools/dialogcutarc.ui | 2 +- src/app/dialogs/tools/dialogcutspline.ui | 2 +- src/app/dialogs/tools/dialogcutsplinepath.ui | 2 +- src/app/dialogs/tools/dialogdetail.ui | 2 +- src/app/dialogs/tools/dialogendline.ui | 2 +- src/app/dialogs/tools/dialogline.ui | 2 +- src/app/dialogs/tools/dialoglineintersect.ui | 2 +- .../dialogs/tools/dialoglineintersectaxis.ui | 2 +- src/app/dialogs/tools/dialognormal.ui | 2 +- src/app/dialogs/tools/dialogpointofcontact.ui | 2 +- .../tools/dialogpointofintersection.ui | 2 +- src/app/dialogs/tools/dialogshoulderpoint.ui | 2 +- src/app/dialogs/tools/dialogspline.ui | 2 +- src/app/dialogs/tools/dialogtriangle.ui | 2 +- src/app/dialogs/tools/dialoguniondetails.ui | 2 +- src/app/mainwindow.ui | 40 +++++++++++-------- 19 files changed, 41 insertions(+), 35 deletions(-) diff --git a/src/app/dialogs/tools/dialogalongline.ui b/src/app/dialogs/tools/dialogalongline.ui index 075d80cd0..ee68fb65e 100644 --- a/src/app/dialogs/tools/dialogalongline.ui +++ b/src/app/dialogs/tools/dialogalongline.ui @@ -11,7 +11,7 @@ - Point along line + Point at distance along line diff --git a/src/app/dialogs/tools/dialogbisector.ui b/src/app/dialogs/tools/dialogbisector.ui index 5ff3ab60a..ad16c980b 100644 --- a/src/app/dialogs/tools/dialogbisector.ui +++ b/src/app/dialogs/tools/dialogbisector.ui @@ -11,7 +11,7 @@ - Bisector + Point along bisector diff --git a/src/app/dialogs/tools/dialogcurveintersectaxis.ui b/src/app/dialogs/tools/dialogcurveintersectaxis.ui index 55721a6b1..f8fb02023 100644 --- a/src/app/dialogs/tools/dialogcurveintersectaxis.ui +++ b/src/app/dialogs/tools/dialogcurveintersectaxis.ui @@ -11,7 +11,7 @@ - Curve intersect axis + Point intersect curve and axis diff --git a/src/app/dialogs/tools/dialogcutarc.ui b/src/app/dialogs/tools/dialogcutarc.ui index 2889981d6..16732646b 100644 --- a/src/app/dialogs/tools/dialogcutarc.ui +++ b/src/app/dialogs/tools/dialogcutarc.ui @@ -11,7 +11,7 @@ - Cut arc + Segment an arc diff --git a/src/app/dialogs/tools/dialogcutspline.ui b/src/app/dialogs/tools/dialogcutspline.ui index ef19baea9..04eb98776 100644 --- a/src/app/dialogs/tools/dialogcutspline.ui +++ b/src/app/dialogs/tools/dialogcutspline.ui @@ -11,7 +11,7 @@ - Cut curve + Segmenting a simple curve diff --git a/src/app/dialogs/tools/dialogcutsplinepath.ui b/src/app/dialogs/tools/dialogcutsplinepath.ui index a2fdc21da..9638d9f63 100644 --- a/src/app/dialogs/tools/dialogcutsplinepath.ui +++ b/src/app/dialogs/tools/dialogcutsplinepath.ui @@ -11,7 +11,7 @@ - Cut curve path + Segment a curved path diff --git a/src/app/dialogs/tools/dialogdetail.ui b/src/app/dialogs/tools/dialogdetail.ui index 212625aef..b64e0807c 100644 --- a/src/app/dialogs/tools/dialogdetail.ui +++ b/src/app/dialogs/tools/dialogdetail.ui @@ -11,7 +11,7 @@ - Detail + Seam allowance tool diff --git a/src/app/dialogs/tools/dialogendline.ui b/src/app/dialogs/tools/dialogendline.ui index 6ddd69fcd..0b67d0a75 100644 --- a/src/app/dialogs/tools/dialogendline.ui +++ b/src/app/dialogs/tools/dialogendline.ui @@ -17,7 +17,7 @@ - Point in the end of a line + Point at distance and angle diff --git a/src/app/dialogs/tools/dialogline.ui b/src/app/dialogs/tools/dialogline.ui index e57621c42..755c770b2 100644 --- a/src/app/dialogs/tools/dialogline.ui +++ b/src/app/dialogs/tools/dialogline.ui @@ -26,7 +26,7 @@ - Line + Line between points diff --git a/src/app/dialogs/tools/dialoglineintersect.ui b/src/app/dialogs/tools/dialoglineintersect.ui index 53e5d3f89..6d2a44ffb 100644 --- a/src/app/dialogs/tools/dialoglineintersect.ui +++ b/src/app/dialogs/tools/dialoglineintersect.ui @@ -11,7 +11,7 @@ - Intersection of lines + Point at line intersection diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.ui b/src/app/dialogs/tools/dialoglineintersectaxis.ui index f12ab4175..1e4d9bc4a 100644 --- a/src/app/dialogs/tools/dialoglineintersectaxis.ui +++ b/src/app/dialogs/tools/dialoglineintersectaxis.ui @@ -11,7 +11,7 @@ - Intersect Line and Axis + Point intersect line and axis diff --git a/src/app/dialogs/tools/dialognormal.ui b/src/app/dialogs/tools/dialognormal.ui index ce49c22ef..42ae2e583 100644 --- a/src/app/dialogs/tools/dialognormal.ui +++ b/src/app/dialogs/tools/dialognormal.ui @@ -11,7 +11,7 @@ - Normal + Point along perpendicular diff --git a/src/app/dialogs/tools/dialogpointofcontact.ui b/src/app/dialogs/tools/dialogpointofcontact.ui index cd0d23b27..8dee56fac 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.ui +++ b/src/app/dialogs/tools/dialogpointofcontact.ui @@ -11,7 +11,7 @@ - Point from intersection of line and arc + Point at intersection of arc and line diff --git a/src/app/dialogs/tools/dialogpointofintersection.ui b/src/app/dialogs/tools/dialogpointofintersection.ui index a63c1a653..26f11dbbf 100644 --- a/src/app/dialogs/tools/dialogpointofintersection.ui +++ b/src/app/dialogs/tools/dialogpointofintersection.ui @@ -11,7 +11,7 @@ - Point of intersection + Point from X and Y of two other points diff --git a/src/app/dialogs/tools/dialogshoulderpoint.ui b/src/app/dialogs/tools/dialogshoulderpoint.ui index f39cd5281..0bc344bb6 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.ui +++ b/src/app/dialogs/tools/dialogshoulderpoint.ui @@ -11,7 +11,7 @@ - Point of shoulder + Special point on shoulder diff --git a/src/app/dialogs/tools/dialogspline.ui b/src/app/dialogs/tools/dialogspline.ui index 10238a584..8fabe0e2f 100644 --- a/src/app/dialogs/tools/dialogspline.ui +++ b/src/app/dialogs/tools/dialogspline.ui @@ -11,7 +11,7 @@ - Curve + Simple curve diff --git a/src/app/dialogs/tools/dialogtriangle.ui b/src/app/dialogs/tools/dialogtriangle.ui index f962903f9..533f33928 100644 --- a/src/app/dialogs/tools/dialogtriangle.ui +++ b/src/app/dialogs/tools/dialogtriangle.ui @@ -11,7 +11,7 @@ - Triangle + Triangle tool diff --git a/src/app/dialogs/tools/dialoguniondetails.ui b/src/app/dialogs/tools/dialoguniondetails.ui index 4729a4b5a..efe54a7b2 100644 --- a/src/app/dialogs/tools/dialoguniondetails.ui +++ b/src/app/dialogs/tools/dialoguniondetails.ui @@ -26,7 +26,7 @@ - Union details + Union tool diff --git a/src/app/mainwindow.ui b/src/app/mainwindow.ui index d534fe617..4fbddb57f 100644 --- a/src/app/mainwindow.ui +++ b/src/app/mainwindow.ui @@ -40,7 +40,7 @@ - 0 + 4 @@ -99,7 +99,7 @@ false - Special point on shoulder. + Special point on shoulder ... @@ -125,7 +125,7 @@ false - Triangle tool. + Triangle tool ... @@ -203,7 +203,7 @@ false - Point at intersection of arc and line. + Point at intersection of arc and line ... @@ -229,7 +229,7 @@ false - 'Point from X and Y of two other points. + Point from X and Y of two other points ... @@ -307,7 +307,7 @@ false - Intersect Line and Axis + Point intersect line and axis ... @@ -334,7 +334,7 @@ 0 0 - 100 + 105 58 @@ -410,7 +410,7 @@ 0 0 - 100 + 105 156 @@ -433,7 +433,7 @@ false - Curve tool. + Simple curve ... @@ -459,7 +459,7 @@ false - Tool for path curve. + Curved path ... @@ -485,7 +485,7 @@ false - Tool for segmenting a curve. + Segmenting a simple curve ... @@ -511,7 +511,7 @@ false - Tool segment a pathed curve. + Segment a curved path ... @@ -536,6 +536,9 @@ false + + Point intersect curve and axis + ... @@ -584,7 +587,7 @@ false - Arc tool. + Arc ... @@ -610,7 +613,7 @@ false - Cut arc tool. + Segment an arc ... @@ -635,6 +638,9 @@ false + + Point intersect arc and axis + ... @@ -660,7 +666,7 @@ 0 0 - 100 + 105 58 @@ -680,7 +686,7 @@ - Tool new detail. + Seam allowance tool ... @@ -706,7 +712,7 @@ false - Tool for union two details. + Union tool ... From b05266b78e501a5f4d2cdd7a1a261752cc56a429 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 16 Feb 2015 21:05:44 +0200 Subject: [PATCH 156/186] Deleted needless class. --HG-- branch : develop --- src/app/widgets/vitem.cpp | 135 ------------------------------------ src/app/widgets/vitem.h | 92 ------------------------ src/app/widgets/widgets.pri | 2 - 3 files changed, 229 deletions(-) delete mode 100644 src/app/widgets/vitem.cpp delete mode 100644 src/app/widgets/vitem.h diff --git a/src/app/widgets/vitem.cpp b/src/app/widgets/vitem.cpp deleted file mode 100644 index b70c06833..000000000 --- a/src/app/widgets/vitem.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/************************************************************************ - ** - ** @file vitem.cpp - ** @author Roman Telezhynskyi - ** @date November 15, 2013 - ** - ** @brief - ** @copyright - ** This source code is part of the Valentine project, a pattern making - ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project - ** All Rights Reserved. - ** - ** Valentina is free software: you can redistribute it and/or modify - ** it under the terms of the GNU General Public License as published by - ** the Free Software Foundation, either version 3 of the License, or - ** (at your option) any later version. - ** - ** Valentina is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with Valentina. If not, see . - ** - *************************************************************************/ - -#include "vitem.h" - -#include -#include -#include "../core/vapplication.h" - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief VItem constructor. - * @param path detail path. - * @param numInList index in list of details. - * @param parent parent object. - */ -VItem::VItem (const QPainterPath & path, int numInList, QGraphicsItem * parent ) - :QGraphicsPathItem ( path, parent ), numInOutList(numInList), paper(nullptr) -{} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief VItem default constructor. - */ -VItem::VItem():numInOutList(0), paper(nullptr) -{} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief VItem constructor. - * @param numInList index in list of details. - * @param parent parent object. - */ -VItem::VItem(int numInList, QGraphicsItem *parent):QGraphicsPathItem (parent), numInOutList(numInList), - paper(nullptr) -{} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief checkItemChange check item change. If detail create colission or moved out paper emit signal. - */ -void VItem::checkItemChange() -{ - QRectF rect; - if (paper == nullptr) - { - qDebug()<<"Don't set paper for detail!!!!"; - rect = this->scene()->sceneRect(); - } - else - { - rect = paper->sceneBoundingRect(); - } - QRectF myrect = sceneBoundingRect(); - if ( rect.contains( myrect )==true ) - { - setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()))); - emit itemOut( numInOutList, false ); - } - else - { - setPen(QPen(Qt::red, qApp->toPixel(qApp->widthMainLine()))); - emit itemOut( numInOutList, true ); - } - QList list = QGraphicsItem::collidingItems (); - if ( list.size() - 2 > 0 ) - { - list.append( this ); - setPen(QPen(Qt::red, qApp->toPixel(qApp->widthMainLine()))); - emit itemColliding( list, 1 );//Detail intersect with other details. - } - else - { - QList itemList; - itemList.append( this ); - emit itemColliding( itemList, 0 );//Detail doesn't intersect more with other details. - } - //qDebug()<<"list="< - ** @date November 15, 2013 - ** - ** @brief - ** @copyright - ** This source code is part of the Valentine project, a pattern making - ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project - ** All Rights Reserved. - ** - ** Valentina is free software: you can redistribute it and/or modify - ** it under the terms of the GNU General Public License as published by - ** the Free Software Foundation, either version 3 of the License, or - ** (at your option) any later version. - ** - ** Valentina is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with Valentina. If not, see . - ** - *************************************************************************/ - -#ifndef VITEM_H -#define VITEM_H - -#include -#include - -/** - * @brief VItem class detail on layout table. - */ -class VItem : public QObject, public QGraphicsPathItem -{ - Q_OBJECT -public: - VItem (); - VItem (int numInList, QGraphicsItem * parent = nullptr); - VItem ( const QPainterPath & path, int numInList, QGraphicsItem * parent = nullptr ); - /** - * @brief getPaper return pointer to paper sheet. - * @return pointer to paper sheet. - */ - QGraphicsRectItem *getPaper() const {return paper;} - /** - * @brief setPaper set pointer to paper sheet. - * @param value pointer to paper sheet. - */ - void setPaper(QGraphicsRectItem *value) {paper = value;} -public slots: - void LengthChanged(); - void SetIndexInList( qint32 index ); -protected: - QVariant itemChange ( GraphicsItemChange change, const QVariant &value ); - void checkItemChange (); -private: - Q_DISABLE_COPY(VItem) - /** @brief numInOutList index in list. */ - qint32 numInOutList; - - /** @brief paper pointer to paper item. */ - QGraphicsRectItem* paper; -signals: - /** - * @brief itemOut emit if detail moved out paper. Detail send this signal each time when was moved. - * @param numInOutList index in list. - * @param flag true if moved out. false if not. - */ - void itemOut ( int numInOutList, bool flag ); - /** - * @brief itemColliding emit if change create colission. - * @param list list with all colission detalis. - * @param number 1 - colission exist, 0 - colission doesn't exist. - */ - void itemColliding ( QList list, int number ); -}; - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief SetIndexInList set detail index in list. - * @param index index in list. - */ -inline void VItem::SetIndexInList(qint32 index) -{ - numInOutList = index; -} -#endif // VITEM_H diff --git a/src/app/widgets/widgets.pri b/src/app/widgets/widgets.pri index ef5e646c1..c0c82ac37 100644 --- a/src/app/widgets/widgets.pri +++ b/src/app/widgets/widgets.pri @@ -5,7 +5,6 @@ HEADERS += \ $$PWD/vtablegraphicsview.h \ $$PWD/vmaingraphicsview.h \ $$PWD/vmaingraphicsscene.h \ - $$PWD/vitem.h \ $$PWD/doubledelegate.h \ $$PWD/textdelegate.h \ $$PWD/vtooloptionspropertybrowser.h \ @@ -16,7 +15,6 @@ SOURCES += \ $$PWD/vtablegraphicsview.cpp \ $$PWD/vmaingraphicsview.cpp \ $$PWD/vmaingraphicsscene.cpp \ - $$PWD/vitem.cpp \ $$PWD/doubledelegate.cpp \ $$PWD/textdelegate.cpp \ $$PWD/vtooloptionspropertybrowser.cpp \ From 78341ef43418dd204778c729724822b8249e4a51 Mon Sep 17 00:00:00 2001 From: Felix Ulber Date: Tue, 17 Feb 2015 17:28:32 +0100 Subject: [PATCH 157/186] Fixed problem with formula editing in vtooloptionspropertybrowser and "," decimal separator, related to issue 234 --HG-- branch : develop --- src/app/widgets/vformulaproperty.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/widgets/vformulaproperty.cpp b/src/app/widgets/vformulaproperty.cpp index 4e32e8bf9..a1f881b53 100644 --- a/src/app/widgets/vformulaproperty.cpp +++ b/src/app/widgets/vformulaproperty.cpp @@ -214,7 +214,7 @@ void VFormulaProperty::ValueChildChanged(const QVariant &value, int typeForParen if (typeForParent == static_cast(ChildType::Formula)) { VFormula newFormula = GetFormula(); - newFormula.SetFormula(value.toString()); + newFormula.SetFormula(value.toString(), FormulaType::FromUser); SetFormula(newFormula); } } From 75f6bfd38148d9c170b5b078bf451d47c4543178 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 17 Feb 2015 19:02:47 +0200 Subject: [PATCH 158/186] Fixed issue #183. Show message "Changes saved". --HG-- branch : develop --- src/app/dialogs/app/dialogincrements.cpp | 44 ++++++++- src/app/dialogs/app/dialogincrements.h | 1 + src/app/widgets/vwidgetpopup.cpp | 114 +++++++++++++++++++++++ src/app/widgets/vwidgetpopup.h | 106 +++++++++++++++++++++ src/app/widgets/widgets.pri | 6 +- 5 files changed, 268 insertions(+), 3 deletions(-) create mode 100644 src/app/widgets/vwidgetpopup.cpp create mode 100644 src/app/widgets/vwidgetpopup.h diff --git a/src/app/dialogs/app/dialogincrements.cpp b/src/app/dialogs/app/dialogincrements.cpp index 94edca85b..4fde5f5f2 100644 --- a/src/app/dialogs/app/dialogincrements.cpp +++ b/src/app/dialogs/app/dialogincrements.cpp @@ -30,6 +30,7 @@ #include "ui_dialogincrements.h" #include "../../widgets/doubledelegate.h" #include "../../widgets/textdelegate.h" +#include "../../widgets/vwidgetpopup.h" #include "../../xml/vstandardmeasurements.h" #include "../../xml/vindividualmeasurements.h" #include "../../core/vsettings.h" @@ -379,6 +380,20 @@ void DialogIncrements::ShowHeaderUnits(QTableWidget *table, int column) table->horizontalHeaderItem(column)->setText(unitHeader); } +//--------------------------------------------------------------------------------------------------------------------- +void DialogIncrements::ShowSuccess() const +{ + VWidgetPopup *popup = new VWidgetPopup(); + QLabel *label = new QLabel(tr("Data successfully saved.")); + QFont f = label->font(); + f.setBold(true); + f.setPixelSize(16); + label->setFont(f); + popup->SetWidget(label); + popup->SetLifeTime(2000); + popup->Show(frameGeometry().center()); +} + //--------------------------------------------------------------------------------------------------------------------- void DialogIncrements::ShowMeasurements() { @@ -434,6 +449,10 @@ void DialogIncrements::SaveGivenName() messageBox.setStandardButtons(QMessageBox::Ok); messageBox.exec(); } + else + { + ShowSuccess(); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -452,6 +471,10 @@ void DialogIncrements::SaveFamilyName() messageBox.setStandardButtons(QMessageBox::Ok); messageBox.exec(); } + else + { + ShowSuccess(); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -469,6 +492,10 @@ void DialogIncrements::SaveEmail() messageBox.setStandardButtons(QMessageBox::Ok); messageBox.exec(); } + else + { + ShowSuccess(); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -486,6 +513,10 @@ void DialogIncrements::SaveSex(int index) messageBox.setStandardButtons(QMessageBox::Ok); messageBox.exec(); } + else + { + ShowSuccess(); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -503,6 +534,10 @@ void DialogIncrements::SaveBirthDate(const QDate & date) messageBox.setStandardButtons(QMessageBox::Ok); messageBox.exec(); } + else + { + ShowSuccess(); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -660,6 +695,7 @@ void DialogIncrements::clickedToolButtonAdd() ui->toolButtonRemove->setEnabled(true); ui->tableWidgetIncrement->blockSignals(false); emit haveLiteChange(); + ShowSuccess(); } //--------------------------------------------------------------------------------------------------------------------- @@ -687,6 +723,7 @@ void DialogIncrements::clickedToolButtonRemove() else { qCDebug(vDialog)<<"Could not find object with id"<tableWidgetIncrement->removeRow(row); @@ -697,6 +734,7 @@ void DialogIncrements::clickedToolButtonRemove() ui->tableWidgetIncrement->blockSignals(false); emit haveLiteChange(); + ShowSuccess(); } //--------------------------------------------------------------------------------------------------------------------- @@ -801,6 +839,7 @@ void DialogIncrements::IncrementChanged ( qint32 row, qint32 column ) break; } emit haveLiteChange(); + ShowSuccess(); } //--------------------------------------------------------------------------------------------------------------------- @@ -853,7 +892,10 @@ void DialogIncrements::MeasurementChanged(qint32 row, qint32 column) messageBox.setStandardButtons(QMessageBox::Ok); messageBox.exec(); } - + else + { + ShowSuccess(); + } data->ClearVariables(); m->Measurements(); diff --git a/src/app/dialogs/app/dialogincrements.h b/src/app/dialogs/app/dialogincrements.h index 558ad65ff..d563a966d 100644 --- a/src/app/dialogs/app/dialogincrements.h +++ b/src/app/dialogs/app/dialogincrements.h @@ -107,6 +107,7 @@ private: void SetItemViewOnly(QTableWidgetItem *item); void ShowUnits(); void ShowHeaderUnits(QTableWidget *table, int column); + void ShowSuccess() const; }; #endif // DIALOGINCREMENTS_H diff --git a/src/app/widgets/vwidgetpopup.cpp b/src/app/widgets/vwidgetpopup.cpp new file mode 100644 index 000000000..ade47befd --- /dev/null +++ b/src/app/widgets/vwidgetpopup.cpp @@ -0,0 +1,114 @@ +/************************************************************************ + ** + ** @file vwidgetpopup.cpp + ** @author Roman Telezhynskyi + ** @date 16 2, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#include "vwidgetpopup.h" + +#include +#include +#include + +//--------------------------------------------------------------------------------------------------------------------- +VWidgetPopup::VWidgetPopup(QWidget *parent) + :QFrame(parent, Qt::Popup), mWidget(nullptr), mOwn(true), mOldParent(nullptr), lifeTime(-1) +{ + setAttribute(Qt::WA_WindowPropagation); + + if (parentWidget() == nullptr) + { + setAttribute(Qt::WA_DeleteOnClose); + } + + setLayout(new QVBoxLayout()); + layout()->setContentsMargins(0, 0, 0, 0); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VWidgetPopup::SetWidget(QWidget *widget, bool own) +{ + if (mWidget) + { + layout()->removeWidget(mWidget); + + if (mOwn) + { + mWidget->setParent(0); + delete mWidget; + } + else + { + mWidget->setParent(mOldParent); + } + } + + mWidget = widget; + mOwn = own; + mOldParent = 0; + + if (mWidget) + { + mOldParent = mWidget->parentWidget(); + mWidget->setParent(this); + layout()->addWidget(mWidget); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void VWidgetPopup::Show(QPoint coord) +{ + // important to do this before following adjustments! + QFrame::show(); + + const QRect screen(QDesktopWidget().availableGeometry()); + coord.setX(coord.x() - width()/2); + + if (coord.x() < screen.x()) + { + coord.setX(screen.x()); + } + + if (coord.y() < screen.y()) + { + coord.setY(screen.y()); + } + + if (coord.x() > (screen.right()-width())) + { + coord.setX(screen.right()-width()); + } + + if (coord.y() > (screen.bottom()-height())) + { + coord.setY(screen.bottom()-height()); + } + move(coord); + + if (lifeTime > 0) + { + QTimer::singleShot(lifeTime, this, SLOT(close())); + } +} diff --git a/src/app/widgets/vwidgetpopup.h b/src/app/widgets/vwidgetpopup.h new file mode 100644 index 000000000..0f61cba98 --- /dev/null +++ b/src/app/widgets/vwidgetpopup.h @@ -0,0 +1,106 @@ +/************************************************************************ + ** + ** @file vwidgetpopup.h + ** @author Roman Telezhynskyi + ** @date 16 2, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef VWIDGETPOPUP_H +#define VWIDGETPOPUP_H + +#include + +/** + \brief Class showing a widget as popup window. + + setWidget() function allows you to specify the widget to be popped up. + After widget is set, you normally should call show() slot in order to pop the + widget up at the specified global position. + + VWidgetPopup takes care about positioning of your widget on the screen so it will + be always visible even if popped beside. +*/ +class VWidgetPopup : public QFrame +{ + Q_OBJECT + +public: + /** Constructor. + + If \a parent not specified (default), then popup widget gets + attribute Qt::WA_DeleteOnClose and will be deleted after close. + */ + VWidgetPopup(QWidget *parent = 0); + + /** Sets widget to be popped up to \a widget. + If \a own is true then the widget will be reparented to the popup widget. + */ + void SetWidget(QWidget *widget, bool own = true); + + /** Returns widget to be popped up. */ + inline QWidget* Widget() const; + + /** Returns true if widget is owned by this popup widget, false otherwise. */ + inline bool isOwned() const; + + int GetLifeTime() const; + void SetLifeTime(int value); + +public slots: + /** Pops up the widget at global coordinates \a coord. */ + void Show(QPoint coord); + +protected: + Q_DISABLE_COPY(VWidgetPopup) + QWidget *mWidget; + bool mOwn; + QWidget *mOldParent; + int lifeTime; +}; + +//--------------------------------------------------------------------------------------------------------------------- +inline QWidget *VWidgetPopup::Widget() const +{ + return mWidget; +} + +//--------------------------------------------------------------------------------------------------------------------- +inline bool VWidgetPopup::isOwned() const +{ + return mOwn; +} + +//--------------------------------------------------------------------------------------------------------------------- +inline int VWidgetPopup::GetLifeTime() const +{ + return lifeTime; +} + +//--------------------------------------------------------------------------------------------------------------------- +inline void VWidgetPopup::SetLifeTime(int value) +{ + lifeTime = value; +} + +#endif // VWIDGETPOPUP_H diff --git a/src/app/widgets/widgets.pri b/src/app/widgets/widgets.pri index c0c82ac37..1e0e507e6 100644 --- a/src/app/widgets/widgets.pri +++ b/src/app/widgets/widgets.pri @@ -9,7 +9,8 @@ HEADERS += \ $$PWD/textdelegate.h \ $$PWD/vtooloptionspropertybrowser.h \ $$PWD/vformulapropertyeditor.h \ - $$PWD/vformulaproperty.h + $$PWD/vformulaproperty.h \ + $$PWD/vwidgetpopup.h SOURCES += \ $$PWD/vtablegraphicsview.cpp \ @@ -19,4 +20,5 @@ SOURCES += \ $$PWD/textdelegate.cpp \ $$PWD/vtooloptionspropertybrowser.cpp \ $$PWD/vformulapropertyeditor.cpp \ - $$PWD/vformulaproperty.cpp + $$PWD/vformulaproperty.cpp \ + $$PWD/vwidgetpopup.cpp From 48c5e6ad94b27dd1f031ca1a5e82a464e65eefe5 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 17 Feb 2015 23:34:32 +0200 Subject: [PATCH 159/186] Fixed issue #247. Individual measurement file 'Where save measurements' dialog doesn't open directory from Preferences. --HG-- branch : develop --- src/app/dialogs/app/dialogindividualmeasurements.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/dialogs/app/dialogindividualmeasurements.cpp b/src/app/dialogs/app/dialogindividualmeasurements.cpp index f85925557..2b6257867 100644 --- a/src/app/dialogs/app/dialogindividualmeasurements.cpp +++ b/src/app/dialogs/app/dialogindividualmeasurements.cpp @@ -229,7 +229,7 @@ void DialogIndividualMeasurements::OpenTable() //--------------------------------------------------------------------------------------------------------------------- void DialogIndividualMeasurements::NewTable() { - QString dir = QDir::homePath()+"/measurements.vit"; + const QString dir = qApp->getSettings()->GetPathIndividualMeasurements()+"/measurements.vit"; QString name = QFileDialog::getSaveFileName(this, tr("Where save measurements?"), dir, tr("Individual measurements (*.vit)")); @@ -239,7 +239,7 @@ void DialogIndividualMeasurements::NewTable() } // what if the users did not specify a suffix...? - QFileInfo f( name ); + const QFileInfo f( name ); if (f.suffix().isEmpty() && f.suffix() != "vit") { name += ".vit"; From 0d6a53f5d2ef77c754c18a51dcf0e76c4c3a4f23 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 18 Feb 2015 12:06:03 +0200 Subject: [PATCH 160/186] Fixed issue #248. Fix dialog header for Tables Of Variables. --HG-- branch : develop --- src/app/dialogs/app/dialogincrements.ui | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/dialogs/app/dialogincrements.ui b/src/app/dialogs/app/dialogincrements.ui index d55672606..08556feaa 100644 --- a/src/app/dialogs/app/dialogincrements.ui +++ b/src/app/dialogs/app/dialogincrements.ui @@ -17,7 +17,7 @@ - Increments + Tables of Variables @@ -118,8 +118,8 @@ 0 0 - 939 - 411 + 559 + 82 From f3fceaea645d38b4888541d0ec6745ea0fe9b9f1 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 18 Feb 2015 12:17:56 +0200 Subject: [PATCH 161/186] Build revision in crash report. --HG-- branch : develop --- src/app/core/vapplication.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/core/vapplication.cpp b/src/app/core/vapplication.cpp index fc4256c2c..98f159739 100644 --- a/src/app/core/vapplication.cpp +++ b/src/app/core/vapplication.cpp @@ -2316,6 +2316,7 @@ void VApplication::SendReport(const QString &reportName) const // Additional information content.append(QString("-------------------------------")+"\r\n"); content.append(QString("Version:%1").arg(APP_VERSION)+"\r\n"); + content.append(QString("Build revision:%1").arg(BUILD_REVISION)+"\r\n"); content.append(QString("Based on Qt %2 (32 bit)").arg(QT_VERSION_STR)+"\r\n"); content.append(QString("Built on %3 at %4").arg(__DATE__).arg(__TIME__)+"\r\n"); content.append("\r\n"); From 8d0027ab8fc162b61506eca1fcff16965e4dbe08 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 18 Feb 2015 15:05:20 +0200 Subject: [PATCH 162/186] Improving log. --HG-- branch : develop --- src/app/undocommands/movespoint.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app/undocommands/movespoint.cpp b/src/app/undocommands/movespoint.cpp index 668594e90..5c7fa0ac8 100644 --- a/src/app/undocommands/movespoint.cpp +++ b/src/app/undocommands/movespoint.cpp @@ -89,8 +89,10 @@ bool MoveSPoint::mergeWith(const QUndoCommand *command) SCASSERT(moveCommand != nullptr); const quint32 id = moveCommand->getSPointId(); + qCDebug(vUndo)<<"Mergin."; if (id != nodeId) { + qCDebug(vUndo)<<"Merging canceled."; return false; } From 22aa73e308b2692c1d60203985c64c39212ae1ae Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 18 Feb 2015 15:29:44 +0200 Subject: [PATCH 163/186] Web site URL in log file. --HG-- branch : develop --- src/app/core/vapplication.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/core/vapplication.cpp b/src/app/core/vapplication.cpp index 98f159739..ecd050556 100644 --- a/src/app/core/vapplication.cpp +++ b/src/app/core/vapplication.cpp @@ -2319,6 +2319,7 @@ void VApplication::SendReport(const QString &reportName) const content.append(QString("Build revision:%1").arg(BUILD_REVISION)+"\r\n"); content.append(QString("Based on Qt %2 (32 bit)").arg(QT_VERSION_STR)+"\r\n"); content.append(QString("Built on %3 at %4").arg(__DATE__).arg(__TIME__)+"\r\n"); + content.append(QString("Web site:http://www.valentina-project.org/ ")+"\r\n"); content.append("\r\n"); // Creating json with report From f77258ac7096c79bf5b5a928cb0ed70ecebb974b Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 18 Feb 2015 15:34:06 +0200 Subject: [PATCH 164/186] Close property browser when reset window. --HG-- branch : develop --- src/app/mainwindow.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index 80dd7f7fa..597e96536 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -1475,6 +1475,7 @@ void MainWindow::Clear() qt_ntfs_permission_lookup--; // turn it off again #endif /*Q_OS_WIN32*/ qApp->getUndoStack()->clear(); + toolOptions->itemClicked(nullptr); } //--------------------------------------------------------------------------------------------------------------------- From 890c87e228a91cb260ca7ae9409ee873a83fce56 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 18 Feb 2015 18:04:27 +0200 Subject: [PATCH 165/186] Set color for curved path. --HG-- branch : develop --- src/app/tools/drawTools/vtoolsplinepath.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/tools/drawTools/vtoolsplinepath.cpp b/src/app/tools/drawTools/vtoolsplinepath.cpp index 6ca030ff5..3d1c18e5a 100644 --- a/src/app/tools/drawTools/vtoolsplinepath.cpp +++ b/src/app/tools/drawTools/vtoolsplinepath.cpp @@ -47,6 +47,7 @@ VToolSplinePath::VToolSplinePath(VPattern *doc, VContainer *data, quint32 id, co :VAbstractSpline(doc, data, id, parent), oldPosition() { sceneType = SceneObject::SplinePath; + lineColor = color; this->setPath(ToolPath()); this->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine())/factor)); From 9f92c1ca949350052f3c16bdab8b9b6ce2569f97 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 18 Feb 2015 18:26:28 +0200 Subject: [PATCH 166/186] Build on Windows in debug mode. --HG-- branch : develop --- src/libs/ifc/ifcdef.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libs/ifc/ifcdef.h b/src/libs/ifc/ifcdef.h index 3426f76ef..4facd7b4d 100644 --- a/src/libs/ifc/ifcdef.h +++ b/src/libs/ifc/ifcdef.h @@ -34,6 +34,7 @@ #ifdef Q_OS_WIN32 extern Q_CORE_EXPORT int qt_ntfs_permission_lookup; + #include #endif /*Q_OS_WIN32*/ enum class Unit : char { Mm, Cm, Inch, Px }; @@ -80,7 +81,7 @@ static const quint32 null_id = 0; { \ qDebug("ASSERT: %s in %s (%s:%u)", \ #cond, __PRETTY_FUNCTION__, __FILE__, __LINE__);\ - std::raise(SIGTRAP); \ + DebugBreak(); \ } \ } \ From c16928733648de2894701e6a8ac883423935ea45 Mon Sep 17 00:00:00 2001 From: Felix Ulber Date: Sat, 21 Feb 2015 16:38:11 +0100 Subject: [PATCH 167/186] Completed Issue #241 --HG-- branch : develop --- src/app/mainwindow.cpp | 129 ++++++++++++++++++++++++++++++++++++++--- src/app/mainwindow.h | 8 ++- src/app/mainwindow.ui | 24 ++++++-- 3 files changed, 147 insertions(+), 14 deletions(-) diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index 597e96536..7d9a6f555 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -71,7 +71,7 @@ Q_LOGGING_CATEGORY(vMainWindow, "v.mainwindow") * @param parent parent widget. */ MainWindow::MainWindow(QWidget *parent) - :QMainWindow(parent), ui(new Ui::MainWindow), pattern(nullptr), doc(nullptr), tool(Tool::Arrow), + :QMainWindow(parent), ui(new Ui::MainWindow), pattern(nullptr), doc(nullptr), currentTool(Tool::Arrow), lastUsedTool(Tool::Arrow), currentScene(nullptr), sceneDraw(nullptr), sceneDetails(nullptr), mouseCoordinate(nullptr), helpLabel(nullptr), isInitialized(false), dialogTable(nullptr), dialogTool(nullptr), dialogHistory(nullptr), comboBoxDraws(nullptr), curFile(QString()), mode(Draw::Calculation), currentDrawIndex(0), @@ -301,7 +301,7 @@ void MainWindow::SetToolButton(bool checked, Tool t, const QString &cursor, cons { CancelTool(); emit EnableItemMove(false); - tool = t; + currentTool = lastUsedTool = t; QPixmap pixmap(cursor); QCursor cur(pixmap, 2, 3); ui->view->setCursor(cur); @@ -342,7 +342,7 @@ void MainWindow::SetToolButtonWithApply(bool checked, Tool t, const QString &cur { CancelTool(); emit EnableItemMove(false); - tool = t; + currentTool = lastUsedTool = t; QPixmap pixmap(cursor); QCursor cur(pixmap, 2, 3); ui->view->setCursor(cur); @@ -1046,7 +1046,7 @@ void MainWindow::CancelTool() delete dialogTool; dialogTool = nullptr; qCDebug(vMainWindow)<<"Dialog closed."; - switch ( tool ) + switch ( currentTool ) { case Tool::Arrow: ui->actionArrowTool->setChecked(false); @@ -1143,7 +1143,7 @@ void MainWindow::ArrowTool() CancelTool(); ui->actionArrowTool->setChecked(true); ui->actionStopTool->setEnabled(false); - tool = Tool::Arrow; + currentTool = Tool::Arrow; emit EnableItemMove(true); QCursor cur(Qt::ArrowCursor); ui->view->setCursor(cur); @@ -1236,6 +1236,7 @@ void MainWindow::ActionDraw(bool checked) ui->actionHistory->setEnabled(true); ui->actionOptionDraw->setEnabled(true); ui->actionNewDraw->setEnabled(true); + } else { @@ -1275,6 +1276,7 @@ void MainWindow::ActionDetails(bool checked) ui->actionHistory->setEnabled(false); ui->actionOptionDraw->setEnabled(false); ui->actionNewDraw->setEnabled(false); + } else { @@ -1462,6 +1464,7 @@ void MainWindow::Clear() ui->actionHistory->setEnabled(false); ui->actionTable->setEnabled(false); ui->actionEdit_pattern_code->setEnabled(false); + ui->actionLast_tool->setEnabled(false); SetEnableTool(false); qApp->setPatternUnit(Unit::Cm); qApp->setPatternType(MeasurementsType::Individual); @@ -1965,6 +1968,8 @@ void MainWindow::SetEnableTool(bool enable) ui->toolButtonCurveIntersectAxis->setEnabled(drawTools); ui->toolButtonArcIntersectAxis->setEnabled(drawTools); + ui->actionLast_tool->setEnabled(drawTools); + //Modeling Tools ui->toolButtonUnionDetails->setEnabled(modelingTools); } @@ -2169,13 +2174,13 @@ void MainWindow::CreateMenus() QAction *undoAction = qApp->getUndoStack()->createUndoAction(this, tr("&Undo")); undoAction->setShortcuts(QKeySequence::Undo); undoAction->setIcon(QIcon::fromTheme("edit-undo")); - ui->menuPatternPiece->insertAction(ui->actionPattern_properties, undoAction); + ui->menuPatternPiece->insertAction(ui->actionLast_tool, undoAction); ui->toolBarTools->addAction(undoAction); QAction *redoAction = qApp->getUndoStack()->createRedoAction(this, tr("&Redo")); redoAction->setShortcuts(QKeySequence::Redo); redoAction->setIcon(QIcon::fromTheme("edit-redo")); - ui->menuPatternPiece->insertAction(ui->actionPattern_properties, redoAction); + ui->menuPatternPiece->insertAction(ui->actionLast_tool, redoAction); ui->toolBarTools->addAction(redoAction); separatorAct = new QAction(this); @@ -2191,6 +2196,115 @@ void MainWindow::CreateMenus() AddDocks(); } +void MainWindow::LastUsedTool() +{ + if (currentTool == lastUsedTool) + return; + + switch ( lastUsedTool ) + { + case Tool::Arrow: + ui->actionArrowTool->setChecked(true); + ArrowTool(); + break; + case Tool::SinglePoint: + Q_UNREACHABLE(); + //Nothing to do here because we can't create this tool from main window. + break; + case Tool::EndLine: + ui->toolButtonEndLine->setChecked(true); + ToolEndLine(true); + break; + case Tool::Line: + ui->toolButtonLine->setChecked(true); + ToolLine(true); + break; + case Tool::AlongLine: + ui->toolButtonAlongLine->setChecked(true); + ToolAlongLine(true); + break; + case Tool::ShoulderPoint: + ui->toolButtonShoulderPoint->setChecked(true); + ToolShoulderPoint(true); + break; + case Tool::Normal: + ui->toolButtonNormal->setChecked(true); + ToolNormal(true); + break; + case Tool::Bisector: + ui->toolButtonBisector->setChecked(true); + ToolBisector(true); + break; + case Tool::LineIntersect: + ui->toolButtonLineIntersect->setChecked(true); + ToolLineIntersect(true); + break; + case Tool::Spline: + ui->toolButtonSpline->setChecked(true); + ToolSpline(true); + break; + case Tool::Arc: + ui->toolButtonArc->setChecked(true); + ToolArc(true); + break; + case Tool::SplinePath: + ui->toolButtonSplinePath->setChecked(true); + ToolSplinePath(true); + break; + case Tool::PointOfContact: + ui->toolButtonPointOfContact->setChecked(true); + ToolPointOfContact(true); + break; + case Tool::Detail: + ui->toolButtonNewDetail->setChecked(true); + ToolDetail(true); + break; + case Tool::Height: + ui->toolButtonHeight->setChecked(true); + ToolHeight(true); + break; + case Tool::Triangle: + ui->toolButtonTriangle->setChecked(true); + ToolTriangle(true); + break; + case Tool::PointOfIntersection: + ui->toolButtonPointOfIntersection->setChecked(true); + ToolPointOfIntersection(true); + break; + case Tool::CutSpline: + ui->toolButtonSplineCutPoint->setChecked(true); + ToolCutSpline(true); + break; + case Tool::CutSplinePath: + ui->toolButtonSplinePathCutPoint->setChecked(true); + ToolCutSplinePath(true); + break; + case Tool::UnionDetails: + ui->toolButtonUnionDetails->setChecked(true); + ToolUnionDetails(true); + break; + case Tool::CutArc: + ui->toolButtonArcCutPoint->setChecked(true); + ToolCutArc(true); + break; + case Tool::LineIntersectAxis: + ui->toolButtonLineIntersectAxis->setChecked(true); + ToolLineIntersectAxis(true); + break; + case Tool::CurveIntersectAxis: + ui->toolButtonCurveIntersectAxis->setChecked(true); + ToolCurveIntersectAxis(true); + break; + case Tool::NodePoint: + case Tool::NodeArc: + case Tool::NodeSpline: + case Tool::NodeSplinePath: + default: + qDebug()<<"Got wrong tool type. Ignored."; + break; + } +} + //--------------------------------------------------------------------------------------------------------------------- void MainWindow::AddDocks() { @@ -2244,6 +2358,7 @@ void MainWindow::CreateActions() connect(ui->actionPreferences, &QAction::triggered, this, &MainWindow::Preferences); connect(ui->actionRepotBug, &QAction::triggered, this, &MainWindow::RepotBug); connect(ui->actionOnlineHelp, &QAction::triggered, this, &MainWindow::OnlineHelp); + connect(ui->actionLast_tool, &QAction::triggered, this, &MainWindow::LastUsedTool); connect(ui->actionPattern_properties, &QAction::triggered, this, &MainWindow::PatternProperties); ui->actionPattern_properties->setEnabled(false); connect(ui->actionEdit_pattern_code, &QAction::triggered, this, &MainWindow::EditPatternCode); diff --git a/src/app/mainwindow.h b/src/app/mainwindow.h index 8cb40ce60..1f5083f29 100644 --- a/src/app/mainwindow.h +++ b/src/app/mainwindow.h @@ -120,6 +120,9 @@ public slots: void AboutQt(); void PatternProperties(); +//tmp + void LastUsedTool(); + /** * @brief Edit XML code of pattern */ @@ -158,7 +161,10 @@ private: VPattern *doc; /** @brief tool current tool */ - Tool tool; + Tool currentTool; + + /** @brief tool last used tool */ + Tool lastUsedTool; /** @brief currentScene pointer to current scene. */ VMainGraphicsScene *currentScene; diff --git a/src/app/mainwindow.ui b/src/app/mainwindow.ui index 4fbddb57f..fd436d417 100644 --- a/src/app/mainwindow.ui +++ b/src/app/mainwindow.ui @@ -48,7 +48,7 @@ 0 0 105 - 272 + 262 @@ -335,7 +335,7 @@ 0 0 105 - 58 + 56 @@ -411,7 +411,7 @@ 0 0 105 - 156 + 150 @@ -565,7 +565,7 @@ 0 0 105 - 104 + 100 @@ -667,7 +667,7 @@ 0 0 105 - 58 + 56 @@ -763,7 +763,7 @@ 0 0 1100 - 25 + 21 @@ -802,6 +802,7 @@ + @@ -1296,6 +1297,17 @@ Show online help + + + Last Tool + + + Activate last used tool again + + + L + + From 0bfd03d98aba1fc35bd7a1ddb4b209351a985e01 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sun, 22 Feb 2015 20:46:08 +0200 Subject: [PATCH 168/186] Hide token. --HG-- branch : develop --- src/app/core/vapplication.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/app/core/vapplication.cpp b/src/app/core/vapplication.cpp index ecd050556..b3789393d 100644 --- a/src/app/core/vapplication.cpp +++ b/src/app/core/vapplication.cpp @@ -2387,13 +2387,17 @@ void VApplication::SendReport(const QString &reportName) const gistFile.write(saveRep.toJson()); gistFile.close(); - QFile curlFile("curl.exe"); + const QString curl = QString("%1/curl.exe").arg(qApp->applicationDirPath()); + QFile curlFile(curl); if (curlFile.exists()) {// Trying send report - // Change token 28df778e0ef75e3724f7b9622fb70b9c69187779 if need - QString arg = QString("curl.exe -k -H \"Authorization: bearer 28df778e0ef75e3724f7b9622fb70b9c69187779\" " - "-H \"Accept: application/json\" -H \"Content-type: application/json\" -X POST " - "--data @gist.json https://api.github.com/gists"); + // Change token if need + const QStringList token = QStringList()<<"3c"<<"6e"<<"91"<<"19"<<"96"<<"92"<<"dc"<<"50"<<"67"<<"8a"<<"2a"<<"89" + <<"a3"<<"55"<<"9e"<<"c7"<<"9d"<<"f8"<<"66"<<"a5"; + + const QString arg = QString("curl.exe -k -H \"Authorization: bearer ")+token.join("")+ + QString("\" -H \"Accept: application/json\" -H \"Content-type: application/json\" -X POST " + "--data @gist.json https://api.github.com/gists"); QProcess::startDetached(arg); reportFile.remove();// Clear after yourself } @@ -2401,6 +2405,7 @@ void VApplication::SendReport(const QString &reportName) const {// We can not send than just collect CollectReport(reportName); } + curlFile.close(); } //--------------------------------------------------------------------------------------------------------------------- From e27d7bee5e3f93fe5d50877c59234e416464ce08 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sun, 22 Feb 2015 20:49:22 +0200 Subject: [PATCH 169/186] Hide ._.DS_Store files. --HG-- branch : develop --- .hgignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.hgignore b/.hgignore index 305d6889b..8222b4881 100644 --- a/.hgignore +++ b/.hgignore @@ -13,8 +13,9 @@ syntax: glob # Temporary files used by the vim editor. .*.swp -# A hidden file created by the Mac OS X Finder. +# A hidden files created by the Mac OS X Finder. .DS_Store +._.DS_Store # Ignore this directory. html/ From 9c1972ede2307fefd8e020c4417904cd5c18fb73 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 25 Feb 2015 15:21:34 +0200 Subject: [PATCH 170/186] =?UTF-8?q?Suppressing=20warning=20=E2=80=9CISO=20?= =?UTF-8?q?C99=20requires=20rest=20arguments=20to=20be=20used=E2=80=9D=20o?= =?UTF-8?q?n=20Windows.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : develop --- Valentina.pri | 1 - 1 file changed, 1 deletion(-) diff --git a/Valentina.pri b/Valentina.pri index ae716f1e0..e215a09fc 100644 --- a/Valentina.pri +++ b/Valentina.pri @@ -529,7 +529,6 @@ GCC_DEBUG_CXXFLAGS += \ -O0 \ -Wall \ -Wextra \ - -pedantic \ -fno-omit-frame-pointer # Need for exchndl.dll CLANG_DEBUG_CXXFLAGS += \ From cdeddbfa1e8ef14f304c9910aea12a5bae0b1bae Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 25 Feb 2015 20:12:15 +0200 Subject: [PATCH 171/186] Check pointers. --HG-- branch : develop --- src/app/tools/vabstracttool.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/app/tools/vabstracttool.cpp b/src/app/tools/vabstracttool.cpp index d01708581..2a7a738c5 100644 --- a/src/app/tools/vabstracttool.cpp +++ b/src/app/tools/vabstracttool.cpp @@ -117,6 +117,9 @@ VAbstractTool::~VAbstractTool() */ void VAbstractTool::NewSceneRect(QGraphicsScene *sc, QGraphicsView *view) { + SCASSERT(sc != nullptr); + SCASSERT(view != nullptr); + QRectF rect = sc->itemsBoundingRect(); QRect rec0 = view->rect(); From 924af81eaee990cfc0c3c4f1004db17f7e557af6 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 25 Feb 2015 20:21:44 +0200 Subject: [PATCH 172/186] Rows in list can't be more than count(); --HG-- branch : develop --- src/app/dialogs/tools/dialogdetail.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/dialogs/tools/dialogdetail.cpp b/src/app/dialogs/tools/dialogdetail.cpp index cbbe47047..d3d909b94 100644 --- a/src/app/dialogs/tools/dialogdetail.cpp +++ b/src/app/dialogs/tools/dialogdetail.cpp @@ -340,11 +340,12 @@ void DialogDetail::ClickedReverse(bool checked) */ void DialogDetail::ObjectChanged(int row) { - if (ui.listWidget->count() == 0 || row == -1) + if (ui.listWidget->count() == 0 || row == -1 || row >= ui.listWidget->count()) { return; } const QListWidgetItem *item = ui.listWidget->item( row ); + SCASSERT(item != nullptr); const VNodeDetail node = qvariant_cast(item->data(Qt::UserRole)); ui.doubleSpinBoxBiasX->setValue(qApp->fromPixel(node.getMx())); ui.doubleSpinBoxBiasY->setValue(qApp->fromPixel(node.getMy())); From 72324c09420100bda40f8f293b67132b4586cb30 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 25 Feb 2015 21:50:13 +0200 Subject: [PATCH 173/186] Fixed issue #249. Size Base and Height Base (Calculations Error and Display Wish List). --HG-- branch : develop --- src/app/mainwindow.cpp | 22 ++++++++++--------- src/app/xml/vstandardmeasurements.cpp | 10 +++++---- src/app/xml/vstandardmeasurements.h | 4 +++- src/libs/ifc/schema/standard_measurements.xsd | 1 - 4 files changed, 21 insertions(+), 16 deletions(-) diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index 7d9a6f555..0b636a272 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -861,12 +861,12 @@ void MainWindow::ToolBarOption() const QStringList listSizes = VMeasurement::ListSizes(doc->GetGradationSizes()); gradationHeights = SetGradationList(tr("Height: "), listHeights); - SetDefaultHeight(static_cast(GHeights::H176)); + SetDefaultHeight(static_cast(pattern->height())); connect(gradationHeights, static_cast(&QComboBox::currentIndexChanged), this, &MainWindow::ChangedHeight); gradationSizes = SetGradationList(tr("Size: "), listSizes); - SetDefaultSize(static_cast(GSizes::S50)); + SetDefaultSize(static_cast(pattern->size())); connect(gradationSizes, static_cast(&QComboBox::currentIndexChanged), this, &MainWindow::ChangedSize); @@ -890,12 +890,13 @@ QComboBox *MainWindow::SetGradationList(const QString &label, const QStringList } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief SetDefaultHeight set base height in combobox. + * @param value [in] height value in pattern units. + */ void MainWindow::SetDefaultHeight(int value) { - qreal val = VAbstractMeasurements::UnitConvertor(value, Unit::Cm, qApp->patternUnit()); - QString strVal = QString("%1").arg(val); - - qint32 index = gradationHeights->findText(strVal); + const qint32 index = gradationHeights->findText(QString("%1").arg(value)); if (index != -1) { gradationHeights->setCurrentIndex(index); @@ -907,12 +908,13 @@ void MainWindow::SetDefaultHeight(int value) } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief SetDefaultSize set base size in combobox. + * @param value [in] size value in pattern units. + */ void MainWindow::SetDefaultSize(int value) { - qreal val = VAbstractMeasurements::UnitConvertor(value, Unit::Cm, qApp->patternUnit()); - QString strVal = QString("%1").arg(val); - - qint32 index = gradationSizes->findText(strVal); + const qint32 index = gradationSizes->findText(QString("%1").arg(value)); if (index != -1) { gradationSizes->setCurrentIndex(index); diff --git a/src/app/xml/vstandardmeasurements.cpp b/src/app/xml/vstandardmeasurements.cpp index 43124da00..5e010c69c 100644 --- a/src/app/xml/vstandardmeasurements.cpp +++ b/src/app/xml/vstandardmeasurements.cpp @@ -34,8 +34,10 @@ const QString VStandardMeasurements::TagDescription = QStringLiteral("descr const QString VStandardMeasurements::TagId = QStringLiteral("id"); const QString VStandardMeasurements::TagSize = QStringLiteral("size"); const QString VStandardMeasurements::TagHeight = QStringLiteral("height"); + const QString VStandardMeasurements::AttrSize_increase = QStringLiteral("size_increase"); const QString VStandardMeasurements::AttrHeight_increase = QStringLiteral("height_increase"); +const QString VStandardMeasurements::AttrBase = QStringLiteral("base"); //--------------------------------------------------------------------------------------------------------------------- VStandardMeasurements::VStandardMeasurements(VContainer *data) @@ -93,7 +95,7 @@ void VStandardMeasurements::ReadMeasurement(const QDomElement &domElement, const //--------------------------------------------------------------------------------------------------------------------- -qreal VStandardMeasurements::TakeParametr(const QString &tag, qreal defValue) const +qreal VStandardMeasurements::TakeParametr(const QString &tag, const QString &attr, qreal defValue) const { const qreal defVal = UnitConvertor(defValue, Unit::Cm, qApp->patternUnit()); @@ -110,7 +112,7 @@ qreal VStandardMeasurements::TakeParametr(const QString &tag, qreal defValue) co const QDomElement domElement = domNode.toElement(); if (domElement.isNull() == false) { - qreal value = GetParametrDouble(domElement, AttrValue, QString("%1").arg(defVal)); + qreal value = GetParametrDouble(domElement, attr, QString("%1").arg(defVal)); value = UnitConvertor(value, MUnit(), qApp->patternUnit()); return value; } @@ -122,7 +124,7 @@ qreal VStandardMeasurements::TakeParametr(const QString &tag, qreal defValue) co //--------------------------------------------------------------------------------------------------------------------- void VStandardMeasurements::SetSize() { - const qreal value = TakeParametr(TagSize, 50); + const qreal value = TakeParametr(TagSize, AttrBase, 50); data->SetSize(value); data->SetSizeName(size_M); } @@ -130,7 +132,7 @@ void VStandardMeasurements::SetSize() //--------------------------------------------------------------------------------------------------------------------- void VStandardMeasurements::SetHeight() { - const qreal value = TakeParametr(TagHeight, 176); + const qreal value = TakeParametr(TagHeight, AttrBase, 176); data->SetHeight(value); data->SetHeightName(height_M); } diff --git a/src/app/xml/vstandardmeasurements.h b/src/app/xml/vstandardmeasurements.h index 93082b7bc..70cc3dbc9 100644 --- a/src/app/xml/vstandardmeasurements.h +++ b/src/app/xml/vstandardmeasurements.h @@ -53,13 +53,15 @@ public: static const QString TagId; static const QString TagSize; static const QString TagHeight; + static const QString AttrSize_increase; static const QString AttrHeight_increase; + static const QString AttrBase; protected: virtual void ReadMeasurement(const QDomElement &domElement, const QString &tag); private: Q_DISABLE_COPY(VStandardMeasurements) - qreal TakeParametr(const QString &tag, qreal defValue) const; + qreal TakeParametr(const QString &tag, const QString &attr, qreal defValue) const; }; #endif // VSTANDARDMEASUREMENTS_H diff --git a/src/libs/ifc/schema/standard_measurements.xsd b/src/libs/ifc/schema/standard_measurements.xsd index 97730dd24..913b6db89 100644 --- a/src/libs/ifc/schema/standard_measurements.xsd +++ b/src/libs/ifc/schema/standard_measurements.xsd @@ -15,7 +15,6 @@ - From 80a58cd729acc6b4f4579ec64c149dd945f6377a Mon Sep 17 00:00:00 2001 From: Felix Ulber Date: Wed, 25 Feb 2015 23:27:09 +0100 Subject: [PATCH 174/186] Fixed Issue #235 --HG-- branch : develop --- src/app/core/vsettings.cpp | 13 + src/app/core/vsettings.h | 4 + .../app/configpages/configurationpage.cpp | 18 + .../app/configpages/configurationpage.h | 2 + src/app/tools/drawTools/vtoolsinglepoint.cpp | 2 +- src/app/tools/vabstracttool.cpp | 41 +- src/app/tools/vtooldetail.cpp | 2 +- .../vpropertyexplorer/checkablemessagebox.cpp | 441 ++++++++++++++++++ .../vpropertyexplorer/checkablemessagebox.h | 141 ++++++ .../vpropertyexplorer/vpropertyexplorer.pri | 150 +++--- 10 files changed, 723 insertions(+), 91 deletions(-) create mode 100644 src/libs/vpropertyexplorer/checkablemessagebox.cpp create mode 100644 src/libs/vpropertyexplorer/checkablemessagebox.h diff --git a/src/app/core/vsettings.cpp b/src/app/core/vsettings.cpp index 884695fc2..456fffd5b 100644 --- a/src/app/core/vsettings.cpp +++ b/src/app/core/vsettings.cpp @@ -40,6 +40,7 @@ const QString VSettings::SettingConfigurationSendReportState = QStringLiteral(" const QString VSettings::SettingConfigurationLocale = QStringLiteral("configuration/locale"); const QString VSettings::SettingConfigurationUnit = QStringLiteral("configuration/unit"); const QString VSettings::SettingConfigurationLabelLanguage = QStringLiteral("configuration/label_language"); +const QString VSettings::SettingConfigurationConfirmItemDeletion= QStringLiteral("configuration/confirm_item_deletion"); const QString VSettings::SettingPathsIndividualMeasurements = QStringLiteral("paths/individual_measurements"); const QString VSettings::SettingPathsStandardMeasurements = QStringLiteral("paths/standard_measurements"); @@ -164,6 +165,18 @@ void VSettings::SetLabelLanguage(const QString &value) setValue(SettingConfigurationLabelLanguage, value); } +//--------------------------------------------------------------------------------------------------------------------- +bool VSettings::GetConfirmItemDelete() const +{ + return value(SettingConfigurationConfirmItemDeletion, 1).toBool(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VSettings::SetConfirmItemDelete(const bool &value) +{ + setValue(SettingConfigurationConfirmItemDeletion, value); +} + //--------------------------------------------------------------------------------------------------------------------- QString VSettings::GetPathIndividualMeasurements() const { diff --git a/src/app/core/vsettings.h b/src/app/core/vsettings.h index c00fe4b6a..80e8dc500 100644 --- a/src/app/core/vsettings.h +++ b/src/app/core/vsettings.h @@ -61,6 +61,9 @@ public: QString GetLabelLanguage() const; void SetLabelLanguage(const QString &value); + bool GetConfirmItemDelete() const; + void SetConfirmItemDelete(const bool &value); + QString GetPathIndividualMeasurements() const; void SetPathIndividualMeasurements(const QString &value); @@ -133,6 +136,7 @@ private: static const QString SettingConfigurationLocale; static const QString SettingConfigurationUnit; static const QString SettingConfigurationLabelLanguage; + static const QString SettingConfigurationConfirmItemDeletion; static const QString SettingPathsIndividualMeasurements; static const QString SettingPathsStandardMeasurements; diff --git a/src/app/dialogs/app/configpages/configurationpage.cpp b/src/app/dialogs/app/configpages/configurationpage.cpp index 06e39023a..1f0e713d0 100644 --- a/src/app/dialogs/app/configpages/configurationpage.cpp +++ b/src/app/dialogs/app/configpages/configurationpage.cpp @@ -51,11 +51,13 @@ ConfigurationPage::ConfigurationPage(QWidget *parent) QGroupBox *saveGroup = SaveGroup(); QGroupBox *langGroup = LangGroup(); QGroupBox *sendGroup = SendGroup(); + QGroupBox *drawGroup = DrawGroup(); QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addWidget(saveGroup); mainLayout->addWidget(langGroup); mainLayout->addWidget(sendGroup); + mainLayout->addWidget(drawGroup); mainLayout->addStretch(1); setLayout(mainLayout); } @@ -73,6 +75,7 @@ void ConfigurationPage::Apply() qApp->getSettings()->SetOsSeparator(osOptionCheck->isChecked()); qApp->getSettings()->SetSendReportState(sendReportCheck->isChecked()); + qApp->getSettings()->SetConfirmItemDelete(askPointDeletionCheck->isChecked()); if (langChanged) { @@ -271,6 +274,21 @@ QGroupBox *ConfigurationPage::SendGroup() return sendGroup; } +//--------------------------------------------------------------------------------------------------------------------- +QGroupBox *ConfigurationPage::DrawGroup() +{ + QGroupBox *drawGroup = new QGroupBox(tr("Pattern Editing")); + + askPointDeletionCheck = new QCheckBox(tr("Confirm item deletion")); + askPointDeletionCheck->setChecked(qApp->getSettings()->GetConfirmItemDelete()); + + QVBoxLayout *editLayout = new QVBoxLayout; + editLayout->addWidget(askPointDeletionCheck); + + drawGroup->setLayout(editLayout); + return drawGroup; +} + //--------------------------------------------------------------------------------------------------------------------- void ConfigurationPage::SetLabelComboBox(const QStringList &list) { diff --git a/src/app/dialogs/app/configpages/configurationpage.h b/src/app/dialogs/app/configpages/configurationpage.h index 3b83e2996..12f549464 100644 --- a/src/app/dialogs/app/configpages/configurationpage.h +++ b/src/app/dialogs/app/configpages/configurationpage.h @@ -59,10 +59,12 @@ private: bool unitChanged; bool labelLangChanged; QCheckBox *sendReportCheck; + QCheckBox *askPointDeletionCheck; QGroupBox *SaveGroup(); QGroupBox *LangGroup(); QGroupBox *SendGroup(); + QGroupBox *DrawGroup(); void SetLabelComboBox(const QStringList &list); }; diff --git a/src/app/tools/drawTools/vtoolsinglepoint.cpp b/src/app/tools/drawTools/vtoolsinglepoint.cpp index dde2a162c..a8abd0336 100644 --- a/src/app/tools/drawTools/vtoolsinglepoint.cpp +++ b/src/app/tools/drawTools/vtoolsinglepoint.cpp @@ -173,7 +173,7 @@ void VToolSinglePoint::DeleteTool(bool ask) qApp->getSceneView()->itemClicked(nullptr); if (ask) { - if (ConfirmDeletion() == QMessageBox::Cancel) + if (ConfirmDeletion() == QMessageBox::No) { return; } diff --git a/src/app/tools/vabstracttool.cpp b/src/app/tools/vabstracttool.cpp index d01708581..fd33c7b41 100644 --- a/src/app/tools/vabstracttool.cpp +++ b/src/app/tools/vabstracttool.cpp @@ -28,13 +28,15 @@ #include "vabstracttool.h" #include -#include +#include +#include +#include "checkablemessagebox.h" #include "../undocommands/deltool.h" #include "../core/vapplication.h" #include "../geometry/vpointf.h" #include "../undocommands/savetooloptions.h" #include "../widgets/vmaingraphicsview.h" -#include +#include "../core/vsettings.h" const QString VAbstractTool::AttrType = QStringLiteral("type"); const QString VAbstractTool::AttrMx = QStringLiteral("mx"); @@ -154,7 +156,7 @@ void VAbstractTool::DeleteTool(bool ask) qApp->getSceneView()->itemClicked(nullptr); if (ask) { - if (ConfirmDeletion() == QMessageBox::Cancel) + if (ConfirmDeletion() == QMessageBox::No) { return; } @@ -165,6 +167,27 @@ void VAbstractTool::DeleteTool(bool ask) } } +//--------------------------------------------------------------------------------------------------------------------- +int VAbstractTool::ConfirmDeletion() +{ + if (false == qApp->getSettings()->GetConfirmItemDelete()) + return QMessageBox::Yes; + + Utils::CheckableMessageBox msgBox(qApp->getMainWindow()); + msgBox.setWindowTitle(tr("Confirm deletion")); + msgBox.setText(tr("Do you really want to delete?")); + msgBox.setStandardButtons(QDialogButtonBox::Yes | QDialogButtonBox::No); + msgBox.setDefaultButton(QDialogButtonBox::No); + msgBox.setIconPixmap(qApp->style()->standardIcon(QStyle::SP_MessageBoxQuestion).pixmap(32,32) ); + + int dialogResult = msgBox.exec(); + + if (dialogResult == QDialog::Accepted) + qApp->getSettings()->SetConfirmItemDelete(not msgBox.isChecked()); + + return dialogResult == QDialog::Accepted ? QMessageBox::Yes : QMessageBox::No; +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief LineStyle return pen style for current line style. @@ -294,18 +317,6 @@ QMap VAbstractTool::PointsList() const return list; } -//--------------------------------------------------------------------------------------------------------------------- -int VAbstractTool::ConfirmDeletion() -{ - QMessageBox msgBox; - msgBox.setText(tr("Confirm the deletion.")); - msgBox.setInformativeText(tr("Do you really want delete?")); - msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel); - msgBox.setDefaultButton(QMessageBox::Ok); - msgBox.setIcon(QMessageBox::Question); - return msgBox.exec(); -} - //--------------------------------------------------------------------------------------------------------------------- void VAbstractTool::SaveOption(QSharedPointer &obj) { diff --git a/src/app/tools/vtooldetail.cpp b/src/app/tools/vtooldetail.cpp index cab1ed4b5..27d42fd6a 100644 --- a/src/app/tools/vtooldetail.cpp +++ b/src/app/tools/vtooldetail.cpp @@ -522,7 +522,7 @@ void VToolDetail::DeleteTool(bool ask) DeleteDetail *delDet = new DeleteDetail(doc, id); if (ask) { - if (ConfirmDeletion() == QMessageBox::Cancel) + if (ConfirmDeletion() == QMessageBox::No) { return; } diff --git a/src/libs/vpropertyexplorer/checkablemessagebox.cpp b/src/libs/vpropertyexplorer/checkablemessagebox.cpp new file mode 100644 index 000000000..205d07b67 --- /dev/null +++ b/src/libs/vpropertyexplorer/checkablemessagebox.cpp @@ -0,0 +1,441 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** Modified work Copyright 2015 Felix Ulber +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://www.qt.io/licensing. For further information +** use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +#include "checkablemessagebox.h" + +#include +#include +#include +#include +#include +#include + +/*! + \class Utils::CheckableMessageBox + + \brief The CheckableMessageBox class implements a message box suitable for + questions with a + "Do not ask me again" checkbox. + + Emulates the QMessageBox API with + static conveniences. The message label can open external URLs. +*/ + +static const char kDoNotAskAgainKey[] = "DoNotAskAgain"; + +namespace Utils { + +class CheckableMessageBoxPrivate +{ +public: + CheckableMessageBoxPrivate(QDialog *q) + : clickedButton(0) + { + QSizePolicy sizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred); + + pixmapLabel = new QLabel(q); + sizePolicy.setHorizontalStretch(0); + sizePolicy.setVerticalStretch(0); + sizePolicy.setHeightForWidth(pixmapLabel->sizePolicy().hasHeightForWidth()); + pixmapLabel->setSizePolicy(sizePolicy); + pixmapLabel->setVisible(false); + + QSpacerItem *pixmapSpacer = + new QSpacerItem(0, 5, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding); + + messageLabel = new QLabel(q); + messageLabel->setMinimumSize(QSize(300, 0)); + messageLabel->setWordWrap(true); + messageLabel->setOpenExternalLinks(true); + messageLabel->setTextInteractionFlags(Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse); + + QSpacerItem *checkBoxRightSpacer = + new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum); + QSpacerItem *buttonSpacer = + new QSpacerItem(0, 1, QSizePolicy::Minimum, QSizePolicy::Minimum); + + checkBox = new QCheckBox(q); + checkBox->setText(CheckableMessageBox::tr("Do not ask again")); + + buttonBox = new QDialogButtonBox(q); + buttonBox->setOrientation(Qt::Horizontal); + buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); + + QVBoxLayout *verticalLayout = new QVBoxLayout(); + verticalLayout->addWidget(pixmapLabel); + verticalLayout->addItem(pixmapSpacer); + + QHBoxLayout *horizontalLayout_2 = new QHBoxLayout(); + horizontalLayout_2->addLayout(verticalLayout); + horizontalLayout_2->addWidget(messageLabel); + + QHBoxLayout *horizontalLayout = new QHBoxLayout(); + horizontalLayout->addWidget(checkBox); + horizontalLayout->addItem(checkBoxRightSpacer); + + QVBoxLayout *verticalLayout_2 = new QVBoxLayout(q); + verticalLayout_2->addLayout(horizontalLayout_2); + verticalLayout_2->addLayout(horizontalLayout); + verticalLayout_2->addItem(buttonSpacer); + verticalLayout_2->addWidget(buttonBox); + } + + QLabel *pixmapLabel; + QLabel *messageLabel; + QCheckBox *checkBox; + QDialogButtonBox *buttonBox; + QAbstractButton *clickedButton; +}; + +CheckableMessageBox::CheckableMessageBox(QWidget *parent) : + QDialog(parent), + d(new CheckableMessageBoxPrivate(this)) +{ + setModal(true); + setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); + connect(d->buttonBox, SIGNAL(accepted()), SLOT(accept())); + connect(d->buttonBox, SIGNAL(rejected()), SLOT(reject())); + connect(d->buttonBox, SIGNAL(clicked(QAbstractButton*)), + SLOT(slotClicked(QAbstractButton*))); +} + +CheckableMessageBox::~CheckableMessageBox() +{ + delete d; +} + +void CheckableMessageBox::slotClicked(QAbstractButton *b) +{ + d->clickedButton = b; +} + +QAbstractButton *CheckableMessageBox::clickedButton() const +{ + return d->clickedButton; +} + +QDialogButtonBox::StandardButton CheckableMessageBox::clickedStandardButton() const +{ + if (d->clickedButton) + return d->buttonBox->standardButton(d->clickedButton); + return QDialogButtonBox::NoButton; +} + +QString CheckableMessageBox::text() const +{ + return d->messageLabel->text(); +} + +void CheckableMessageBox::setText(const QString &t) +{ + d->messageLabel->setText(t); +} + +QPixmap CheckableMessageBox::iconPixmap() const +{ + if (const QPixmap *p = d->pixmapLabel->pixmap()) + return QPixmap(*p); + return QPixmap(); +} + +void CheckableMessageBox::setIconPixmap(const QPixmap &p) +{ + d->pixmapLabel->setPixmap(p); + d->pixmapLabel->setVisible(!p.isNull()); +} + +bool CheckableMessageBox::isChecked() const +{ + return d->checkBox->isChecked(); +} + +void CheckableMessageBox::setChecked(bool s) +{ + d->checkBox->setChecked(s); +} + +QString CheckableMessageBox::checkBoxText() const +{ + return d->checkBox->text(); +} + +void CheckableMessageBox::setCheckBoxText(const QString &t) +{ + d->checkBox->setText(t); +} + +bool CheckableMessageBox::isCheckBoxVisible() const +{ + return d->checkBox->isVisible(); +} + +void CheckableMessageBox::setCheckBoxVisible(bool v) +{ + d->checkBox->setVisible(v); +} + +QDialogButtonBox::StandardButtons CheckableMessageBox::standardButtons() const +{ + return d->buttonBox->standardButtons(); +} + +void CheckableMessageBox::setStandardButtons(QDialogButtonBox::StandardButtons s) +{ + d->buttonBox->setStandardButtons(s); +} + +QPushButton *CheckableMessageBox::button(QDialogButtonBox::StandardButton b) const +{ + return d->buttonBox->button(b); +} + +QPushButton *CheckableMessageBox::addButton(const QString &text, QDialogButtonBox::ButtonRole role) +{ + return d->buttonBox->addButton(text, role); +} + +QDialogButtonBox::StandardButton CheckableMessageBox::defaultButton() const +{ + foreach (QAbstractButton *b, d->buttonBox->buttons()) + if (QPushButton *pb = qobject_cast(b)) + if (pb->isDefault()) + return d->buttonBox->standardButton(pb); + return QDialogButtonBox::NoButton; +} + +void CheckableMessageBox::setDefaultButton(QDialogButtonBox::StandardButton s) +{ + if (QPushButton *b = d->buttonBox->button(s)) { + b->setDefault(true); + b->setFocus(); + } +} + +QDialogButtonBox::StandardButton +CheckableMessageBox::question(QWidget *parent, + const QString &title, + const QString &question, + const QString &checkBoxText, + bool *checkBoxSetting, + QDialogButtonBox::StandardButtons buttons, + QDialogButtonBox::StandardButton defaultButton) +{ + CheckableMessageBox mb(parent); + mb.setWindowTitle(title); + mb.setIconPixmap(QMessageBox::standardIcon(QMessageBox::Question)); + mb.setText(question); + mb.setCheckBoxText(checkBoxText); + mb.setChecked(*checkBoxSetting); + mb.setStandardButtons(buttons); + mb.setDefaultButton(defaultButton); + mb.exec(); + *checkBoxSetting = mb.isChecked(); + return mb.clickedStandardButton(); +} + +QDialogButtonBox::StandardButton +CheckableMessageBox::information(QWidget *parent, + const QString &title, + const QString &text, + const QString &checkBoxText, + bool *checkBoxSetting, + QDialogButtonBox::StandardButtons buttons, + QDialogButtonBox::StandardButton defaultButton) +{ + CheckableMessageBox mb(parent); + mb.setWindowTitle(title); + mb.setIconPixmap(QMessageBox::standardIcon(QMessageBox::Information)); + mb.setText(text); + mb.setCheckBoxText(checkBoxText); + mb.setChecked(*checkBoxSetting); + mb.setStandardButtons(buttons); + mb.setDefaultButton(defaultButton); + mb.exec(); + *checkBoxSetting = mb.isChecked(); + return mb.clickedStandardButton(); +} + +QMessageBox::StandardButton CheckableMessageBox::dialogButtonBoxToMessageBoxButton(QDialogButtonBox::StandardButton db) +{ + return static_cast(int(db)); +} + +bool askAgain(QSettings *settings, const QString &settingsSubKey) +{ + //QTC_CHECK(settings); + if (settings) { + settings->beginGroup(QLatin1String(kDoNotAskAgainKey)); + bool shouldNotAsk = settings->value(settingsSubKey, false).toBool(); + settings->endGroup(); + if (shouldNotAsk) + return false; + } + return true; +} + +enum DoNotAskAgainType{Question, Information}; + +void initDoNotAskAgainMessageBox(CheckableMessageBox &messageBox, const QString &title, + const QString &text, QDialogButtonBox::StandardButtons buttons, + QDialogButtonBox::StandardButton defaultButton, + DoNotAskAgainType type) +{ + messageBox.setWindowTitle(title); + messageBox.setIconPixmap(QMessageBox::standardIcon(type == Information + ? QMessageBox::Information + : QMessageBox::Question)); + messageBox.setText(text); + messageBox.setCheckBoxVisible(true); + messageBox.setCheckBoxText(type == Information ? CheckableMessageBox::msgDoNotShowAgain() + : CheckableMessageBox::msgDoNotAskAgain()); + messageBox.setChecked(false); + messageBox.setStandardButtons(buttons); + messageBox.setDefaultButton(defaultButton); +} + +void doNotAskAgain(QSettings *settings, const QString &settingsSubKey) +{ + if (!settings) + return; + + settings->beginGroup(QLatin1String(kDoNotAskAgainKey)); + settings->setValue(settingsSubKey, true); + settings->endGroup(); +} + +/*! + Shows a message box with given \a title and \a text, and a \gui {Do not ask again} check box. + If the user checks the check box and accepts the dialog with the \a acceptButton, + further invocations of this function with the same \a settings and \a settingsSubKey will not + show the dialog, but instantly return \a acceptButton. + + Returns the clicked button, or QDialogButtonBox::NoButton if the user rejects the dialog + with the escape key, or \a acceptButton if the dialog is suppressed. +*/ +QDialogButtonBox::StandardButton +CheckableMessageBox::doNotAskAgainQuestion(QWidget *parent, const QString &title, + const QString &text, QSettings *settings, + const QString &settingsSubKey, + QDialogButtonBox::StandardButtons buttons, + QDialogButtonBox::StandardButton defaultButton, + QDialogButtonBox::StandardButton acceptButton) + +{ + if (!askAgain(settings, settingsSubKey)) + return acceptButton; + + CheckableMessageBox messageBox(parent); + initDoNotAskAgainMessageBox(messageBox, title, text, buttons, defaultButton, Question); + messageBox.exec(); + if (messageBox.isChecked() && (messageBox.clickedStandardButton() == acceptButton)) + doNotAskAgain(settings, settingsSubKey); + + return messageBox.clickedStandardButton(); +} + +/*! + Shows a message box with given \a title and \a text, and a \gui {Do not show again} check box. + If the user checks the check box and quits the dialog, further invocations of this + function with the same \a settings and \a settingsSubKey will not show the dialog, but instantly return. + + Returns the clicked button, or QDialogButtonBox::NoButton if the user rejects the dialog + with the escape key, or \a defaultButton if the dialog is suppressed. +*/ +QDialogButtonBox::StandardButton +CheckableMessageBox::doNotShowAgainInformation(QWidget *parent, const QString &title, + const QString &text, QSettings *settings, + const QString &settingsSubKey, + QDialogButtonBox::StandardButtons buttons, + QDialogButtonBox::StandardButton defaultButton) + +{ + if (!askAgain(settings, settingsSubKey)) + return defaultButton; + + CheckableMessageBox messageBox(parent); + initDoNotAskAgainMessageBox(messageBox, title, text, buttons, defaultButton, Information); + messageBox.exec(); + if (messageBox.isChecked()) + doNotAskAgain(settings, settingsSubKey); + + return messageBox.clickedStandardButton(); +} + +/*! + Resets all suppression settings for doNotAskAgainQuestion() found in \a settings, + so all these message boxes are shown again. + */ +void CheckableMessageBox::resetAllDoNotAskAgainQuestions(QSettings *settings) +{ + //Q_ASSERT(settings, return); + settings->beginGroup(QLatin1String(kDoNotAskAgainKey)); + settings->remove(QString()); + settings->endGroup(); +} + +/*! + Returns whether any message boxes from doNotAskAgainQuestion() are suppressed + in the \a settings. +*/ +bool CheckableMessageBox::hasSuppressedQuestions(QSettings *settings) +{ + //Q_ASSERT(settings, return false); + bool hasSuppressed = false; + settings->beginGroup(QLatin1String(kDoNotAskAgainKey)); + foreach (const QString &subKey, settings->childKeys()) { + if (settings->value(subKey, false).toBool()) { + hasSuppressed = true; + break; + } + } + settings->endGroup(); + return hasSuppressed; +} + +/*! + Returns the standard \gui {Do not ask again} check box text. + \sa doNotAskAgainQuestion() +*/ +QString CheckableMessageBox::msgDoNotAskAgain() +{ + return QApplication::translate("Utils::CheckableMessageBox", "Do not &ask again"); +} + +/*! + Returns the standard \gui {Do not show again} check box text. + \sa doNotShowAgainInformation() +*/ +QString CheckableMessageBox::msgDoNotShowAgain() +{ + return QApplication::translate("Utils::CheckableMessageBox", "Do not &show again"); +} + +} // namespace Utils diff --git a/src/libs/vpropertyexplorer/checkablemessagebox.h b/src/libs/vpropertyexplorer/checkablemessagebox.h new file mode 100644 index 000000000..233b505d6 --- /dev/null +++ b/src/libs/vpropertyexplorer/checkablemessagebox.h @@ -0,0 +1,141 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** Modified work Copyright 2015 Felix Ulber +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://www.qt.io/licensing. For further information +** use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +#ifndef CHECKABLEMESSAGEBOX_H +#define CHECKABLEMESSAGEBOX_H + +#include +#include + +QT_BEGIN_NAMESPACE +class QSettings; +QT_END_NAMESPACE + +namespace Utils { + +class CheckableMessageBoxPrivate; + +class Q_DECL_EXPORT CheckableMessageBox : public QDialog +{ + Q_OBJECT + Q_PROPERTY(QString text READ text WRITE setText) + Q_PROPERTY(QPixmap iconPixmap READ iconPixmap WRITE setIconPixmap) + Q_PROPERTY(bool isChecked READ isChecked WRITE setChecked) + Q_PROPERTY(QString checkBoxText READ checkBoxText WRITE setCheckBoxText) + Q_PROPERTY(QDialogButtonBox::StandardButtons buttons READ standardButtons WRITE setStandardButtons) + Q_PROPERTY(QDialogButtonBox::StandardButton defaultButton READ defaultButton WRITE setDefaultButton) + +public: + explicit CheckableMessageBox(QWidget *parent); + virtual ~CheckableMessageBox(); + + static QDialogButtonBox::StandardButton + question(QWidget *parent, + const QString &title, + const QString &question, + const QString &checkBoxText, + bool *checkBoxSetting, + QDialogButtonBox::StandardButtons buttons = QDialogButtonBox::Yes|QDialogButtonBox::No, + QDialogButtonBox::StandardButton defaultButton = QDialogButtonBox::No); + + static QDialogButtonBox::StandardButton + information(QWidget *parent, + const QString &title, + const QString &text, + const QString &checkBoxText, + bool *checkBoxSetting, + QDialogButtonBox::StandardButtons buttons = QDialogButtonBox::Ok, + QDialogButtonBox::StandardButton defaultButton = QDialogButtonBox::NoButton); + + static QDialogButtonBox::StandardButton + doNotAskAgainQuestion(QWidget *parent, + const QString &title, + const QString &text, + QSettings *settings, + const QString &settingsSubKey, + QDialogButtonBox::StandardButtons buttons = QDialogButtonBox::Yes|QDialogButtonBox::No, + QDialogButtonBox::StandardButton defaultButton = QDialogButtonBox::No, + QDialogButtonBox::StandardButton acceptButton = QDialogButtonBox::Yes); + + static QDialogButtonBox::StandardButton + doNotShowAgainInformation(QWidget *parent, + const QString &title, + const QString &text, + QSettings *settings, + const QString &settingsSubKey, + QDialogButtonBox::StandardButtons buttons = QDialogButtonBox::Ok, + QDialogButtonBox::StandardButton defaultButton = QDialogButtonBox::NoButton); + + QString text() const; + void setText(const QString &); + + bool isChecked() const; + void setChecked(bool s); + + QString checkBoxText() const; + void setCheckBoxText(const QString &); + + bool isCheckBoxVisible() const; + void setCheckBoxVisible(bool); + + QDialogButtonBox::StandardButtons standardButtons() const; + void setStandardButtons(QDialogButtonBox::StandardButtons s); + QPushButton *button(QDialogButtonBox::StandardButton b) const; + QPushButton *addButton(const QString &text, QDialogButtonBox::ButtonRole role); + + QDialogButtonBox::StandardButton defaultButton() const; + void setDefaultButton(QDialogButtonBox::StandardButton s); + + // See static QMessageBox::standardPixmap() + QPixmap iconPixmap() const; + void setIconPixmap (const QPixmap &p); + + // Query the result + QAbstractButton *clickedButton() const; + QDialogButtonBox::StandardButton clickedStandardButton() const; + + // Conversion convenience + static QMessageBox::StandardButton dialogButtonBoxToMessageBoxButton(QDialogButtonBox::StandardButton); + static void resetAllDoNotAskAgainQuestions(QSettings *settings); + static bool hasSuppressedQuestions(QSettings *settings); + static QString msgDoNotAskAgain(); + static QString msgDoNotShowAgain(); + +private slots: + void slotClicked(QAbstractButton *b); + +private: + CheckableMessageBoxPrivate *d; +}; + +} // namespace Utils + +#endif // CHECKABLEMESSAGEBOX_H diff --git a/src/libs/vpropertyexplorer/vpropertyexplorer.pri b/src/libs/vpropertyexplorer/vpropertyexplorer.pri index 6f11c2705..eb38f6dcc 100644 --- a/src/libs/vpropertyexplorer/vpropertyexplorer.pri +++ b/src/libs/vpropertyexplorer/vpropertyexplorer.pri @@ -1,74 +1,76 @@ -# ADD TO EACH PATH $$PWD VARIABLE!!!!!! -# This need for corect working file translations.pro - -SOURCES += \ - $$PWD/vproperty.cpp \ - $$PWD/vpropertydelegate.cpp \ - $$PWD/vpropertyfactorymanager.cpp \ - $$PWD/vpropertyformview.cpp \ - $$PWD/vpropertyformwidget.cpp \ - $$PWD/vpropertymodel.cpp \ - $$PWD/vpropertyset.cpp \ - $$PWD/vpropertytreeview.cpp \ - $$PWD/vserializedproperty.cpp \ - $$PWD/plugins/vwidgetproperty.cpp \ - $$PWD/plugins/vemptyproperty.cpp \ - $$PWD/plugins/vboolproperty.cpp \ - $$PWD/plugins/vshortcutproperty.cpp \ - $$PWD/plugins/vcolorproperty.cpp \ - $$PWD/plugins/vshortcutpropertyeditor.cpp \ - $$PWD/plugins/venumproperty.cpp \ - $$PWD/plugins/vfileproperty.cpp \ - $$PWD/plugins/vcolorpropertyeditor.cpp \ - $$PWD/plugins/vfilepropertyeditor.cpp \ - $$PWD/plugins/vnumberproperty.cpp \ - $$PWD/plugins/Vector3d/vvector3dproperty.cpp \ - $$PWD/vstandardpropertyfactory.cpp \ - $$PWD/plugins/vstringproperty.cpp \ - $$PWD/plugins/vpointfproperty.cpp \ - $$PWD/plugins/vobjectproperty.cpp \ - $$PWD/stable.cpp \ - $$PWD/plugins/vlinetypeproperty.cpp \ - $$PWD/plugins/vlinecolorproperty.cpp - -HEADERS +=\ - $$PWD/vpropertyexplorer_global.h \ - $$PWD/vpropertyfactorymanager_p.h \ - $$PWD/vpropertytreeview_p.h \ - $$PWD/vpropertyset_p.h \ - $$PWD/vabstractpropertyfactory.h \ - $$PWD/vfileproperty_p.h \ - $$PWD/vwidgetproperty_p.h \ - $$PWD/vpropertymodel_p.h \ - $$PWD/vstandardpropertyfactory.h \ - $$PWD/vpropertyformview_p.h \ - $$PWD/vpropertytreeview.h \ - $$PWD/vpropertyformwidget_p.h \ - $$PWD/vpropertydelegate.h \ - $$PWD/vproperty_p.h \ - $$PWD/vpropertyformwidget.h \ - $$PWD/vpropertyformview.h \ - $$PWD/vpropertyset.h \ - $$PWD/vpropertymodel.h \ - $$PWD/vproperty.h \ - $$PWD/plugins/vwidgetproperty.h \ - $$PWD/plugins/vcolorproperty.h \ - $$PWD/plugins/vboolproperty.h \ - $$PWD/plugins/vcolorpropertyeditor.h \ - $$PWD/plugins/vshortcutpropertyeditor.h \ - $$PWD/plugins/vemptyproperty.h \ - $$PWD/plugins/vshortcutproperty.h \ - $$PWD/plugins/venumproperty.h \ - $$PWD/plugins/vfilepropertyeditor.h \ - $$PWD/plugins/vfileproperty.h \ - $$PWD/plugins/vnumberproperty.h \ - $$PWD/plugins/Vector3d/vvector3dproperty.h \ - $$PWD/vpropertyfactorymanager.h \ - $$PWD/vserializedproperty.h \ - $$PWD/plugins/vstringproperty.h \ - $$PWD/plugins/vpointfproperty.h \ - $$PWD/plugins/vobjectproperty.h \ - $$PWD/vproperties.h \ - $$PWD/stable.h \ - $$PWD/plugins/vlinetypeproperty.h \ - $$PWD/plugins/vlinecolorproperty.h +# ADD TO EACH PATH $$PWD VARIABLE!!!!!! +# This need for corect working file translations.pro + +SOURCES += \ + $$PWD/vproperty.cpp \ + $$PWD/vpropertydelegate.cpp \ + $$PWD/vpropertyfactorymanager.cpp \ + $$PWD/vpropertyformview.cpp \ + $$PWD/vpropertyformwidget.cpp \ + $$PWD/vpropertymodel.cpp \ + $$PWD/vpropertyset.cpp \ + $$PWD/vpropertytreeview.cpp \ + $$PWD/vserializedproperty.cpp \ + $$PWD/plugins/vwidgetproperty.cpp \ + $$PWD/plugins/vemptyproperty.cpp \ + $$PWD/plugins/vboolproperty.cpp \ + $$PWD/plugins/vshortcutproperty.cpp \ + $$PWD/plugins/vcolorproperty.cpp \ + $$PWD/plugins/vshortcutpropertyeditor.cpp \ + $$PWD/plugins/venumproperty.cpp \ + $$PWD/plugins/vfileproperty.cpp \ + $$PWD/plugins/vcolorpropertyeditor.cpp \ + $$PWD/plugins/vfilepropertyeditor.cpp \ + $$PWD/plugins/vnumberproperty.cpp \ + $$PWD/plugins/Vector3d/vvector3dproperty.cpp \ + $$PWD/vstandardpropertyfactory.cpp \ + $$PWD/plugins/vstringproperty.cpp \ + $$PWD/plugins/vpointfproperty.cpp \ + $$PWD/plugins/vobjectproperty.cpp \ + $$PWD/stable.cpp \ + $$PWD/plugins/vlinetypeproperty.cpp \ + $$PWD/plugins/vlinecolorproperty.cpp \ + $$PWD/checkablemessagebox.cpp + +HEADERS +=\ + $$PWD/vpropertyexplorer_global.h \ + $$PWD/vpropertyfactorymanager_p.h \ + $$PWD/vpropertytreeview_p.h \ + $$PWD/vpropertyset_p.h \ + $$PWD/vabstractpropertyfactory.h \ + $$PWD/vfileproperty_p.h \ + $$PWD/vwidgetproperty_p.h \ + $$PWD/vpropertymodel_p.h \ + $$PWD/vstandardpropertyfactory.h \ + $$PWD/vpropertyformview_p.h \ + $$PWD/vpropertytreeview.h \ + $$PWD/vpropertyformwidget_p.h \ + $$PWD/vpropertydelegate.h \ + $$PWD/vproperty_p.h \ + $$PWD/vpropertyformwidget.h \ + $$PWD/vpropertyformview.h \ + $$PWD/vpropertyset.h \ + $$PWD/vpropertymodel.h \ + $$PWD/vproperty.h \ + $$PWD/plugins/vwidgetproperty.h \ + $$PWD/plugins/vcolorproperty.h \ + $$PWD/plugins/vboolproperty.h \ + $$PWD/plugins/vcolorpropertyeditor.h \ + $$PWD/plugins/vshortcutpropertyeditor.h \ + $$PWD/plugins/vemptyproperty.h \ + $$PWD/plugins/vshortcutproperty.h \ + $$PWD/plugins/venumproperty.h \ + $$PWD/plugins/vfilepropertyeditor.h \ + $$PWD/plugins/vfileproperty.h \ + $$PWD/plugins/vnumberproperty.h \ + $$PWD/plugins/Vector3d/vvector3dproperty.h \ + $$PWD/vpropertyfactorymanager.h \ + $$PWD/vserializedproperty.h \ + $$PWD/plugins/vstringproperty.h \ + $$PWD/plugins/vpointfproperty.h \ + $$PWD/plugins/vobjectproperty.h \ + $$PWD/vproperties.h \ + $$PWD/stable.h \ + $$PWD/plugins/vlinetypeproperty.h \ + $$PWD/plugins/vlinecolorproperty.h \ + $$PWD/checkablemessagebox.h From 326a790044de79c60a6ee89e91e528e2c5365da0 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 26 Feb 2015 11:26:43 +0200 Subject: [PATCH 175/186] Fixed issue #253. Add description, id, size base and height base to Table of Variables. --HG-- branch : develop --- src/app/dialogs/app/dialogincrements.cpp | 25 ++++++++++++++ src/app/dialogs/app/dialogincrements.ui | 21 ++++++++++-- .../app/dialogstandardmeasurements.cpp | 13 +++---- src/app/xml/vstandardmeasurements.cpp | 34 ++++++++++++++++--- src/app/xml/vstandardmeasurements.h | 7 +++- 5 files changed, 83 insertions(+), 17 deletions(-) diff --git a/src/app/dialogs/app/dialogincrements.cpp b/src/app/dialogs/app/dialogincrements.cpp index 4fde5f5f2..3060e10db 100644 --- a/src/app/dialogs/app/dialogincrements.cpp +++ b/src/app/dialogs/app/dialogincrements.cpp @@ -100,6 +100,27 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par if (qApp->patternType() == MeasurementsType::Standard) { ui->toolBoxMeasurements->setItemEnabled(0, false); + + const QString filePath = doc->MPath(); + VStandardMeasurements *mSt; + try + { + VDomDocument::ValidateXML("://schema/standard_measurements.xsd", filePath); + mSt = new VStandardMeasurements(data); + mSt->setXMLContent(filePath); + + ui->labelBaseValues->setText(tr("Base size: %1 %3; Base height: %2 %3").arg(mSt->Size()) + .arg(mSt->Height()).arg(VDomDocument::UnitsToStr(qApp->patternUnit()))); + ui->labelDescription->setText(tr("Description: \"%1\"").arg(mSt->TrDescription())); + delete mSt; + } + catch (VException &e) + { + e.CriticalMessageBox(tr("File error."), this); + delete mSt; + emit DialogClosed(QDialog::Rejected); + return; + } } else { @@ -133,6 +154,10 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par connect(ui->comboBoxSex, static_cast(&QComboBox::currentIndexChanged), this, &DialogIncrements::SaveSex); connect(ui->dateEditBirthDate, &QDateEdit::dateChanged, this, &DialogIncrements::SaveBirthDate); + + // hide fileds that don't exist in individual measurements + ui->labelBaseValues->setVisible(false); + ui->labelDescription->setVisible(false); } ui->toolBoxMeasurements->setCurrentIndex(1); diff --git a/src/app/dialogs/app/dialogincrements.ui b/src/app/dialogs/app/dialogincrements.ui index 08556feaa..72dbd4d04 100644 --- a/src/app/dialogs/app/dialogincrements.ui +++ b/src/app/dialogs/app/dialogincrements.ui @@ -118,8 +118,8 @@ 0 0 - 559 - 82 + 939 + 411 @@ -290,6 +290,23 @@ Measurements + + + + Base size: ; base height: + + + + + + + Description: + + + true + + + diff --git a/src/app/dialogs/app/dialogstandardmeasurements.cpp b/src/app/dialogs/app/dialogstandardmeasurements.cpp index 5b4bc433b..8cc53bcb6 100644 --- a/src/app/dialogs/app/dialogstandardmeasurements.cpp +++ b/src/app/dialogs/app/dialogstandardmeasurements.cpp @@ -183,16 +183,11 @@ void DialogStandardMeasurements::LoadStandardTables() } else { - const QString trDesc = qApp->STDescription(m.Id()); - if (trDesc.isEmpty() == false) + const QString desc = m.TrDescription(); + if (desc.isEmpty() == false) { - qCDebug(vStMeasur)<<"Adding user table from"<comboBoxTables->addItem(trDesc, QVariant(fi.absoluteFilePath())); - } - else if (m.Description().isEmpty() == false) - { - qCDebug(vStMeasur)<<"Adding table with id"<comboBoxTables->addItem(m.Description(), QVariant(fi.absoluteFilePath())); + qCDebug(vStMeasur)<<"Adding table from"<comboBoxTables->addItem(desc, QVariant(fi.absoluteFilePath())); } } } diff --git a/src/app/xml/vstandardmeasurements.cpp b/src/app/xml/vstandardmeasurements.cpp index 5e010c69c..e252cf7de 100644 --- a/src/app/xml/vstandardmeasurements.cpp +++ b/src/app/xml/vstandardmeasurements.cpp @@ -51,7 +51,7 @@ VStandardMeasurements::~VStandardMeasurements() {} //--------------------------------------------------------------------------------------------------------------------- -QString VStandardMeasurements::Description() +QString VStandardMeasurements::OrigDescription () { const QString desc = UniqueTagText(TagDescription, ""); if (desc.isEmpty()) @@ -61,6 +61,20 @@ QString VStandardMeasurements::Description() return desc; } +//--------------------------------------------------------------------------------------------------------------------- +QString VStandardMeasurements::TrDescription() +{ + const QString trDesc = qApp->STDescription(Id()); + if (trDesc.isEmpty() == false) + { + return trDesc; + } + else + { + return OrigDescription (); + } +} + //--------------------------------------------------------------------------------------------------------------------- QString VStandardMeasurements::Id() { @@ -72,6 +86,18 @@ QString VStandardMeasurements::Id() return id; } +//--------------------------------------------------------------------------------------------------------------------- +qreal VStandardMeasurements::Size() const +{ + return TakeParametr(TagSize, AttrBase, 50); +} + +//--------------------------------------------------------------------------------------------------------------------- +qreal VStandardMeasurements::Height() const +{ + return TakeParametr(TagHeight, AttrBase, 176); +} + //--------------------------------------------------------------------------------------------------------------------- void VStandardMeasurements::ReadMeasurement(const QDomElement &domElement, const QString &tag) { @@ -124,15 +150,13 @@ qreal VStandardMeasurements::TakeParametr(const QString &tag, const QString &att //--------------------------------------------------------------------------------------------------------------------- void VStandardMeasurements::SetSize() { - const qreal value = TakeParametr(TagSize, AttrBase, 50); - data->SetSize(value); + data->SetSize(Size()); data->SetSizeName(size_M); } //--------------------------------------------------------------------------------------------------------------------- void VStandardMeasurements::SetHeight() { - const qreal value = TakeParametr(TagHeight, AttrBase, 176); - data->SetHeight(value); + data->SetHeight(Height()); data->SetHeightName(height_M); } diff --git a/src/app/xml/vstandardmeasurements.h b/src/app/xml/vstandardmeasurements.h index 70cc3dbc9..8de409cf6 100644 --- a/src/app/xml/vstandardmeasurements.h +++ b/src/app/xml/vstandardmeasurements.h @@ -44,8 +44,13 @@ class VStandardMeasurements:public VAbstractMeasurements public: VStandardMeasurements(VContainer *data); virtual ~VStandardMeasurements(); - QString Description(); + QString OrigDescription (); + QString TrDescription (); QString Id(); + + qreal Size() const; + qreal Height() const; + void SetSize(); void SetHeight(); static const QString TagMeasurement; From fbe84b74f44d809d01a57caa88be29e6f4ebf35f Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 26 Feb 2015 16:10:01 +0200 Subject: [PATCH 176/186] Updated translations. New language Spanish. --HG-- branch : develop --- share/translations.pro | 3 +- share/translations/valentina.ts | 696 +- share/translations/valentina_cs_CZ.ts | 1257 ++-- share/translations/valentina_de_DE.ts | 1637 +++-- share/translations/valentina_es_ES.ts | 6639 +++++++++++++++++++ share/translations/valentina_fr_FR.ts | 604 +- share/translations/valentina_he_IL.ts | 674 +- share/translations/valentina_id_ID.ts | 2782 +++----- share/translations/valentina_it_IT.ts | 700 +- share/translations/valentina_nl_NL.ts | 652 +- share/translations/valentina_ru_RU.ts | 580 +- share/translations/valentina_uk_UA.ts | 582 +- src/app/app.pro | 11 +- src/app/dialogs/app/dialoglayoutsettings.ui | 8 +- src/app/mainwindow.ui | 12 +- src/app/share/resources/flags.qrc | 1 + src/app/share/resources/flags/Spain.png | Bin 0 -> 312 bytes 17 files changed, 12757 insertions(+), 4081 deletions(-) create mode 100644 share/translations/valentina_es_ES.ts create mode 100644 src/app/share/resources/flags/Spain.png diff --git a/share/translations.pro b/share/translations.pro index ba2acf717..a8bf3a546 100644 --- a/share/translations.pro +++ b/share/translations.pro @@ -37,4 +37,5 @@ TRANSLATIONS += translations/valentina.ts \ translations/valentina_fr_FR.ts \ translations/valentina_it_IT.ts \ translations/valentina_nl_NL.ts \ - translations/valentina_id_ID.ts + translations/valentina_id_ID.ts \ + translations/valentina_es_ES.ts diff --git a/share/translations/valentina.ts b/share/translations/valentina.ts index 7389c3bf9..9beac07b2 100644 --- a/share/translations/valentina.ts +++ b/share/translations/valentina.ts @@ -252,10 +252,6 @@ DialogAlongLine - - Point along line - - Length @@ -264,10 +260,6 @@ Insert variable into the formula - - Calculate value - - Value of length @@ -348,6 +340,14 @@ Select second point of line + + Point at distance along line + + + + Line color + + DialogArc @@ -363,10 +363,6 @@ Insert variable into the formula - - Calculate value - - Value of radius @@ -447,10 +443,6 @@ Variables - - Value of angle of line. - - Error @@ -463,13 +455,13 @@ Angles equal + + Color + + DialogBisector - - Bisector - - Length @@ -478,10 +470,6 @@ Insert marked variable into the formula - - Calculate value - - Value of length @@ -574,21 +562,21 @@ Select third point of angle + + Point along bisector + + + + Line color + + DialogCurveIntersectAxis - - Curve intersect axis - - Angle - - Calculate value - - Value of angle @@ -601,10 +589,6 @@ Axis point - - First point of line - - Curve @@ -665,21 +649,25 @@ Select axis point + + Point intersect curve and axis + + + + Axis Point + + + + Line color + + DialogCutArc - - Cut arc - - Length - - Calculate value - - Value of length @@ -696,10 +684,6 @@ Arc - - Selected curve - - Point label @@ -744,21 +728,25 @@ Variables - Click twice to insert into formula + + Segment an arc + + + + Selected arc + + + + Color + + DialogCutSpline - - Cut curve - - Length - - Calculate value - - Value of length @@ -823,21 +811,21 @@ Variables - Click twice to insert into formula + + Segmenting a simple curve + + + + Color + + DialogCutSplinePath - - Cut curve path - - Length - - Calculate value - - Value of length @@ -902,6 +890,14 @@ Variables - Click twice to insert into formula + + Segment a curved path + + + + Color + + DialogDetail @@ -953,6 +949,10 @@ Reverse + + Seam allowance tool + + DialogEditWrongFormula @@ -968,10 +968,6 @@ Insert variable into formula - - Calculate value - - Value of first angle @@ -1027,18 +1023,10 @@ DialogEndLine - - Point in the end of a line - - Length - - Calculate value - - Value of length @@ -1115,13 +1103,17 @@ Variables + + Point at distance and angle + + + + Line color + + DialogHeight - - Height - - Point label @@ -1154,6 +1146,18 @@ Select second point of line + + Perpendicular point along line + + + + Base Point + + + + Line color + + DialogHistory @@ -1400,6 +1404,22 @@ Can't save measurement + + Tables of Variables + + + + Base size: %1 %3; Base height: %2 %3 + + + + Description: "%1" + + + + Data successfully saved. + + DialogIndividualMeasurements @@ -1473,11 +1493,113 @@ - DialogLine + DialogLayoutProgress - Line + Creation a layout + + <html><head/><body><p>Finding best position for worpieces. Please, waite.</p></body></html> + + + + Couldn't prepare data for creation layout + + + + Critical error + + + + Wrong paper size + + + + Several workpieces left not arranged, but none of them match for paper + + + + + DialogLayoutSettings + + Creation a layout + + + + Paper size + + + + Templates: + + + + Width: + + + + Height: + + + + Rotate workpiece + + + + Rotate by + + + + degree + + + + Creation options + + + + Layout width: + + + + Shift length: + + + + Principle of choosing the next workpiece + + + + Three groups: big, middle, small + + + + Two groups: big, small + + + + Descending area + + + + Millimiters + + + + Centimeters + + + + Inches + + + + Pixels + + + + + DialogLine First point @@ -1498,13 +1620,17 @@ Select second point + + Line between points + + + + Line color + + DialogLineIntersect - - Intersection of lines - - Point label @@ -1537,21 +1663,17 @@ Select second point of second line + + Point at line intersection + + DialogLineIntersectAxis - - Line intersect axis - - Angle - - Calculate value - - Value of angle @@ -1636,6 +1758,22 @@ Select axis point + + Point intersect line and axis + + + + Axis Point + + + + Second point of line + + + + Line color + + DialogMeasurements @@ -1666,10 +1804,6 @@ DialogNormal - - Normal - - Length @@ -1678,10 +1812,6 @@ Insert variable into formula - - Calculate value - - Value of length @@ -1758,6 +1888,22 @@ Select second point of line + + Point along perpendicular + + + + First point of line + + + + Second point of line + + + + Line color + + DialogPatternProperties @@ -1931,10 +2077,6 @@ DialogPointOfContact - - Point of contact - - Radius @@ -1943,10 +2085,6 @@ Insert variable into formula - - Calculate value - - Value of radius @@ -2019,44 +2157,44 @@ Select second point of line + + Point at intersection of arc and line + + DialogPointOfIntersection - - Point of intersection - - Point label - - vertical point - - First point of angle - - horizontal point - - Second point of angle - Select point horizontally + Point from X and Y of two other points + + + + X: vertical point + + + + Y: horizontal point + + + + Select point for Y value (horizontal) DialogShoulderPoint - - Point of shoulder - - Length @@ -2065,10 +2203,6 @@ Insert variable into formula - - Calculate value - - Value of length @@ -2149,6 +2283,14 @@ Select second point of line + + Special point on shoulder + + + + Line color + + DialogSinglePoint @@ -2179,10 +2321,6 @@ DialogSpline - - Curve - - First point @@ -2215,6 +2353,14 @@ Select last point of curve + + Simple curve + + + + Color + + DialogSplinePath @@ -2254,6 +2400,10 @@ Select point of curve path + + Color + + DialogStandardMeasurements @@ -2316,13 +2466,13 @@ Parser error: %1 + + Line Angle + + DialogTriangle - - Triangle - - Point label @@ -2359,6 +2509,22 @@ Select second point + + Triangle tool + + + + First point of the axis + + + + Second point of the axis + + + + Second point of line + + DialogUndo @@ -2385,10 +2551,6 @@ DialogUnionDetails - - Union details - - <html><head/><body><p>Do you really want union details?</p></body></html> @@ -2409,6 +2571,10 @@ Select detail + + Union tool + + Functions @@ -2563,14 +2729,6 @@ Point along perpendicular - - Special point on shoulder. - - - - Tool triangle. - - Perpendicular point along line @@ -2579,14 +2737,6 @@ Point along bisector - - Point at intersection of arc and line. - - - - Tool to make point from x & y of two other points. - - Point at distance and angle @@ -2595,10 +2745,6 @@ Point at distance along line - - Point of intersection line and axis - - ... @@ -2627,22 +2773,6 @@ Curve - - Curve tool. - - - - Tool for path curve. - - - - Tool for segmenting a curve. - - - - Tool segment a pathed curve. - - Tools for creating arcs. @@ -2651,14 +2781,6 @@ Arc - - Arc tool. - - - - Cut arc tool. - - Tools for creating details. @@ -2667,14 +2789,6 @@ Detail - - Tool new detail. - - - - Tool for union two details. - - &File @@ -3004,10 +3118,6 @@ For opening pattern need keep both files: pattern and measurements. Do you want Select first point of axis - - Select point vertically - - Select detail @@ -3165,6 +3275,82 @@ Do you want to save your changes? Individual measurements (*.vit) + + Special point on shoulder + + + + Triangle tool + + + + Point at intersection of arc and line + + + + Point from X and Y of two other points + + + + Point intersect line and axis + + + + Simple curve + + + + Curved path + + + + Segmenting a simple curve + + + + Segment a curved path + + + + Point intersect curve and axis + + + + Segment an arc + + + + Point intersect arc and axis + + + + Seam allowance tool + + + + Union tool + + + + toolBar + + + + Last Tool + + + + Activate last used tool again + + + + L + + + + Select point for X value (vertical) + + Measurements @@ -5232,6 +5418,14 @@ Do you want to save your changes? Patterns + + Standard measurements + + + + Layout + + PatternPage @@ -5321,6 +5515,10 @@ Do you want to save your changes? The text that appears in the second column header + + px + + QmuParserErrorMsg @@ -5552,22 +5750,6 @@ Do you want to save your changes? Save layout - - Next - - - - Next detail - - - - Turn - - - - Turn the detail 90 degrees - - Stop @@ -5576,26 +5758,6 @@ Do you want to save your changes? Stop laying - - Enlarge letter - - - - Enlarge the length of the sheet - - - - Reduce sheet - - - - Reduce the length of the sheet - - - - Mirroring - - Zoom In @@ -5604,18 +5766,6 @@ Do you want to save your changes? Zoom Out - - 0 details left. - - - - Collisions not found. - - - - %1 details left. - - untitled @@ -5640,10 +5790,6 @@ Do you want to save your changes? EPS files (*.eps) - - Collisions found. - - Creating file '%1' failed! %2 @@ -5656,6 +5802,14 @@ Do you want to save your changes? Wavefront OBJ (*.obj) + + Layout pages + + + + Layout + + VAbstractConverter @@ -5706,6 +5860,34 @@ Do you want to save your changes? Do you really want delete? + + black + + + + green + + + + blue + + + + dark red + + + + dark green + + + + dark blue + + + + yellow + + VApplication @@ -6181,6 +6363,18 @@ Do you want to save your changes? Point intersection line and axis + + Line color + + + + Color + + + + Point intersection curve and axis + + Variables diff --git a/share/translations/valentina_cs_CZ.ts b/share/translations/valentina_cs_CZ.ts index b3cc1b8d6..dbf22b21e 100644 --- a/share/translations/valentina_cs_CZ.ts +++ b/share/translations/valentina_cs_CZ.ts @@ -41,7 +41,7 @@ Secure connection - Bezpečné připojení + Zabezpečené připojení Proxy settings @@ -57,7 +57,7 @@ Proxy port - Přípojka proxy + Port proxy Proxy user @@ -112,7 +112,7 @@ Community - Společenství + Komunita Paths @@ -123,11 +123,11 @@ ConfigurationPage Setup user interface language updated and will be used the next time start - + Nastavení uživatelského rozhraní bylo změněno a bude použito při příštím spuštění Default unit updated and will be used the next pattern creation - + Výchozí jednotka byla změněna a bude použita při vytvoření dalšího střihu Save @@ -179,7 +179,7 @@ Label language - + Jazyk štítků Send crash reports @@ -191,7 +191,7 @@ After each crash Valentina collect information that may help us fix a problem. We do not collect any personal information. Find more about what <a href="https://bitbucket.org/dismine/valentina/wiki/manual/Crash_reports">kind of information</a> we collect. - + Po každém pádu Valentina sbírá informace, které nám mohou pomoci problém opravit. Nesbíráme žádné osobní údaje. Podívejte se, jaký <a href="https://bitbucket.org/dismine/valentina/wiki/manual/Crash_reports">typ informací</a> sbíráme. @@ -223,16 +223,12 @@ Valentina version - Verze Valentiny + Verze programu Valentina Contributors Přispěvatelé - - Based on Qt %2 (32 bit) - Založeno na Qt %2 (32 bit) - Built on %3 at %4 Sestaveno %3 v %4 @@ -251,14 +247,14 @@ Build revision: - + Revize sestavení: DialogAlongLine Point along line - Bod podél čáry + Bod podél čáry Length @@ -270,7 +266,7 @@ Calculate value - Vypočítat hodnotu + Vypočítat hodnotu Value of length @@ -282,7 +278,7 @@ Point label - Označení bodu + Štítek bodu First point @@ -352,6 +348,14 @@ Select second point of line Vybrat druhý bod čáry + + Point at distance along line + Bod ve vzdálenosti podél čáry + + + Line color + + DialogArc @@ -369,7 +373,7 @@ Calculate value - Vypočítat hodnotu + Vypočítat hodnotu Value of radius @@ -405,7 +409,7 @@ Center point - Bod ve středu + Středový bod Select point of center of arc @@ -453,18 +457,22 @@ Value of angle of line. - Hodnota úhlu čáry. + Hodnota úhlu čáry. Error - Chyba + Chyba Radius can't be negative - + Poloměr nemůže být záporný Angles equal + Úhly jsou si rovny + + + Color @@ -472,7 +480,7 @@ DialogBisector Bisector - Osa souměrnosti úhlu + Osa souměrnosti úhlu Length @@ -484,7 +492,7 @@ Calculate value - Vypočítat hodnotu + Vypočítat hodnotu Value of length @@ -496,7 +504,7 @@ Point label - Označení bodu + Štítek bodu First point @@ -578,12 +586,20 @@ Select third point of angle Vybrat třetí bod úhlu + + Point along bisector + Bod podél osy úhlu + + + Line color + + DialogCurveIntersectAxis Curve intersect axis - Osa průsečíku křivky + Osa průsečíku křivky Angle @@ -591,7 +607,7 @@ Calculate value - Vypočítat hodnotu + Vypočítat hodnotu Value of angle @@ -599,7 +615,7 @@ <html><head/><body><p>Show full calculation in message box</p></body></html> - <html><head/><body><p>Ukázat celý výpočet v okně se zprávami</p></body></html> + <html><head/><body><p>Ukázat celý výpočet v okně se zprávami</p></body></html> Axis point @@ -607,7 +623,7 @@ First point of line - První bod čáry + První bod čáry Curve @@ -615,7 +631,7 @@ Point label - Označení bodu + Štítek bodu Type of line @@ -669,12 +685,24 @@ Select axis point Vybrat bod osy + + Point intersect curve and axis + + + + Axis Point + + + + Line color + + DialogCutArc Cut arc - Vyjmout oblouk + Vyjmout oblouk Length @@ -682,7 +710,7 @@ Calculate value - Vypočítat hodnotu + Vypočítat hodnotu Value of length @@ -702,11 +730,11 @@ Selected curve - Vybraná křivka + Vybraná křivka Point label - Označení bodu + Štítek bodu Input data @@ -748,12 +776,24 @@ Variables - Click twice to insert into formula Proměnné - Klepněte dvakrát pro vložení do vzorce + + Segment an arc + + + + Selected arc + + + + Color + + DialogCutSpline Cut curve - Vyjmout úhel + Vyjmout úhel Length @@ -761,7 +801,7 @@ Calculate value - Vypočítat hodnotu + Vypočítat hodnotu Value of length @@ -785,7 +825,7 @@ Point label - Označení bodu + Štítek bodu Input data @@ -827,12 +867,20 @@ Variables - Click twice to insert into formula Proměnné - Klepněte dvakrát pro vložení do vzorce + + Segmenting a simple curve + + + + Color + + DialogCutSplinePath Cut curve path - Vyjmout cestu křivky + Vyjmout cestu křivky Length @@ -840,7 +888,7 @@ Calculate value - Vypočítat hodnotu + Vypočítat hodnotu Value of length @@ -864,7 +912,7 @@ Point label - Označení bodu + Štítek bodu Input data @@ -906,6 +954,14 @@ Variables - Click twice to insert into formula Proměnné - Klepněte dvakrát pro vložení do vzorce + + Segment a curved path + + + + Color + + DialogDetail @@ -955,6 +1011,10 @@ Reverse + Převrátit + + + Seam allowance tool @@ -974,7 +1034,7 @@ Calculate value - Vypočítat hodnotu + Vypočítat hodnotu Value of first angle @@ -1033,7 +1093,7 @@ DialogEndLine Point in the end of a line - Bod na konci čáry + Bod na konci čáry Length @@ -1041,7 +1101,7 @@ Calculate value - Vypočítat hodnotu + Vypočítat hodnotu Value of length @@ -1069,7 +1129,7 @@ Point label - Označení bodu + Štítek bodu Type of line @@ -1119,16 +1179,24 @@ Variables Proměnné + + Point at distance and angle + Bod ve vzdálenosti a úhlu + + + Line color + + DialogHeight Height - Výška + Výška Point label - Označení bodu + Štítek bodu Base point @@ -1158,6 +1226,18 @@ Select second point of line Vybrat druhý bod čáry + + Perpendicular point along line + Bod v pravém úhlu podél čáry + + + Base Point + + + + Line color + + DialogHistory @@ -1191,15 +1271,15 @@ %3 - normal to line %1_%2 - %3 - Kolmice k čáře %1_%2 + %3 - kolmice k čáře %1_%2 %4 - bisector of angle %1_%2_%3 - %4 - Osa úhlu %1_%2_%3 + %4 - osa úhlu %1_%2_%3 %5 - intersection of lines %1_%2 and %3_%4 - %5 - Průsečík čar %1_%2 a %3_%4 + %5 - průsečík čar %1_%2 a %3_%4 Curve %1_%2 @@ -1215,11 +1295,11 @@ %4 - point of contact of arc with the center in point %1 and line %2_%3 - + %4 - bod doteku oblouku se středem v bodě %1 a čáry %2_%3 Point of perpendicular from point %1 to line %2_%3 - + Bod pravého úhlu z bodu %1 k čáře %2_%3 Triangle: axis %1_%2, points %3 and %4 @@ -1227,27 +1307,27 @@ %1 - point of intersection %2 and %3 - %1 - Bod průsečíku %2 a %3 + %1 - bod průsečíku %2 a %3 %1 - cut arc with center %2 - %1 - Vyjmout oblouk se středem %2 + %1 - vyjmout oblouk se středem %2 %1 - cut curve %2_%3 - %1 - Vyjmout křivku %2_%3 + %1 - vyjmout křivku %2_%3 %1 - cut curve path %2 - %1 - Vyjmout cestu křivky %2 + %1 - vyjmout cestu křivky %2 %1 - point of intersection line %2_%3 and axis through point %4 - + %1 - bod průsečíku čáry %2_%3 a osy procházející bodem %4 %1 - point of intersection curve and axis through point %2 - + %1 - bod průsečíku křivky a osy procházející bodem %2 @@ -1310,7 +1390,7 @@ In heights - O výškách + Ve výškách Description @@ -1350,11 +1430,11 @@ male - Muž + muž female - Žena + žena Could not save GivenName @@ -1378,11 +1458,11 @@ Measurements use different units than pattern. This pattern required measurements in %1 - Míry používají odlišné jednotky než střihy. Tento střih vyžaduje míry v %1 + Míry používají odlišné jednotky než střih. Tento střih vyžaduje míry v %1 Individual measurements (*.vit) - Osobité míry (*.vit) + Individuální míry (*.vit) Open file @@ -1402,14 +1482,30 @@ Can't save measurement - Nelze uložit míry + Nelze uložit míru + + + Tables of Variables + + + + Base size: %1 %3; Base height: %2 %3 + + + + Description: "%1" + + + + Data successfully saved. + DialogIndividualMeasurements Individual measurements - Osobité míry + Individuální míry Pattern piece name @@ -1453,7 +1549,7 @@ Individual measurements (*.vit) - Osobité míry (*.vit) + Individuální míry (*.vit) Open file @@ -1461,7 +1557,7 @@ Where save measurements? - Kam míry uložit? + Kam uložit míry? Centimeters @@ -1469,18 +1565,128 @@ Millimiters - Milimitry + Milimetry Inches Palce + + DialogLayoutProgress + + Creation a layout + + + + <html><head/><body><p>Finding best position for worpieces. Please, waite.</p></body></html> + + + + Couldn't prepare data for creation layout + + + + Critical error + + + + Wrong paper size + + + + Several workpieces left not arranged, but none of them match for paper + + + + + DialogLayoutSettings + + Creation a layout + + + + Paper size + + + + Templates: + + + + Width: + + + + Height: + + + + ... + ... + + + Rotate workpiece + + + + Rotate by + + + + degree + + + + Creation options + + + + Layout width: + + + + Shift length: + + + + Principle of choosing the next workpiece + + + + Three groups: big, middle, small + + + + Two groups: big, small + + + + Descending area + + + + Millimiters + Milimetry + + + Centimeters + Centimetry + + + Inches + Palce + + + Pixels + + + DialogLine Line - Čára + Čára First point @@ -1502,16 +1708,24 @@ Select second point Vybrat druhý bod + + Line between points + Čára mezi body + + + Line color + + DialogLineIntersect Intersection of lines - Průsečík čar + Průsečík čar Point label - Označení bodu + Štítek bodu First line @@ -1541,12 +1755,16 @@ Select second point of second line Vybrat druhý bod druhé čáry + + Point at line intersection + Bod na průsečíku čar + DialogLineIntersectAxis Line intersect axis - Osa průsečíku čáry + Osa průsečíku čáry Angle @@ -1554,7 +1772,7 @@ Calculate value - Vypočítat hodnotu + Vypočítat hodnotu Value of angle @@ -1582,7 +1800,7 @@ Point label - Označení bodu + Štítek bodu Type of line @@ -1640,6 +1858,22 @@ Select axis point Vybrat bod osy + + Point intersect line and axis + + + + Axis Point + + + + Second point of line + Druhý bod čáry + + + Line color + + DialogMeasurements @@ -1661,18 +1895,18 @@ Individual - Osobité + Individuální Use for creation pattern individual measurements - Pro vytvoření střihu použít osobité míry + Pro vytvoření střihu použít Individuální míry DialogNormal Normal - Kolmice + Kolmice Length @@ -1684,7 +1918,7 @@ Calculate value - Vypočítat hodnotu + Vypočítat hodnotu Value of length @@ -1696,7 +1930,7 @@ Point label - Označení bodu + Štítek bodu First point @@ -1708,7 +1942,7 @@ Additional angle degrees - Dodatečné úhlové stupně + Dodatečné stupně úhlu Type of line @@ -1762,12 +1996,28 @@ Select second point of line Vybrat druhý bod čáry + + Point along perpendicular + + + + First point of line + První bod čáry + + + Second point of line + Druhý bod čáry + + + Line color + + DialogPatternProperties Pattern properties - Vlastnosti střihu + Vlastnosti střihu Description @@ -1818,7 +2068,7 @@ Type : - Typ: + Typ: Add attribute @@ -1870,7 +2120,7 @@ Cannot delete previously created node - Nelze smazat předtím vytvořený uzel + Nelze smazat naposledy vytvořený uzel No changes left @@ -1882,7 +2132,7 @@ <no value> - <Žádná hodnota> + <žádná hodnota> Unchanged @@ -1890,7 +2140,7 @@ Cannot delete previously created attribute - Nelze smazat předtím vytvořenou vlastnost + Nelze smazat naposledy vytvořenou vlastnost Node Name @@ -1937,7 +2187,7 @@ DialogPointOfContact Point of contact - Bod dotyku + Bod dotyku Radius @@ -1949,7 +2199,7 @@ Calculate value - Vypočítat hodnotu + Vypočítat hodnotu Value of radius @@ -1961,7 +2211,7 @@ Point label - Označení bodu + Štítek bodu Center of arc @@ -1973,7 +2223,7 @@ Top of the line - Začátek čáry + Vrchol čáry End of the line @@ -2023,20 +2273,24 @@ Select second point of line Vybrat druhý bod čáry + + Point at intersection of arc and line + Bod v průsečíku oblouku a čáry + DialogPointOfIntersection Point of intersection - Bod průsečíku + Bod průsečíku Point label - Označení bodu + Štítek bodu vertical point - Svislý bod + svislý bod First point of angle @@ -2044,7 +2298,7 @@ horizontal point - Vodorovný bod + vodorovný bod Second point of angle @@ -2052,14 +2306,30 @@ Select point horizontally - Vybrat bod vodorovně + Vybrat bod vodorovně + + + Point from X and Y of two other points + + + + X: vertical point + + + + Y: horizontal point + + + + Select point for Y value (horizontal) + DialogShoulderPoint Point of shoulder - Bod ramene + Bod ramene Length @@ -2071,7 +2341,7 @@ Calculate value - Vypočítat hodnotu + Vypočítat hodnotu Value of length @@ -2083,7 +2353,7 @@ Point label - Označení bodu + Štítek bodu First point @@ -2153,6 +2423,14 @@ Select second point of line Vybrat druhý bod čáry + + Special point on shoulder + Zvláštní bod na rameni + + + Line color + + DialogSinglePoint @@ -2178,14 +2456,14 @@ Point label - Označení bodu + Štítek bodu DialogSpline Curve - Křivka + Křivka First point @@ -2219,6 +2497,14 @@ Select last point of curve Vybrat poslední bod čáry + + Simple curve + + + + Color + + DialogSplinePath @@ -2258,6 +2544,10 @@ Select point of curve path Vybrat bod cesty křivky + + Color + + DialogStandardMeasurements @@ -2318,6 +2608,10 @@ Parser error: %1 + Chyba zpracování: %1 + + + Line Angle @@ -2325,11 +2619,11 @@ DialogTriangle Triangle - Trojúhelník + Trojúhelník Point label - Označení bodu + Štítek bodu First point of axis @@ -2363,6 +2657,22 @@ Select second point Vybrat druhý bod + + Triangle tool + + + + First point of the axis + + + + Second point of the axis + + + + Second point of line + Druhý bod čáry + DialogUndo @@ -2391,7 +2701,7 @@ DialogUnionDetails Union details - Sjednotit detaily + Sjednotit detaily <html><head/><body><p>Do you really want union details?</p></body></html> @@ -2413,6 +2723,10 @@ Select detail Vybrat detail + + Union tool + + Functions @@ -2546,7 +2860,7 @@ InternalStrings The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - + Program je poskytován TAK JAK JE bez JAKÉKOLIV ZÁRUKY JAKÉHOKOLIV DRUHU, VČETNĚ ZÁRUKY VZHLEDU, PRODEJNOSTI A VHODNOSTI PRO DANÝ ÚČEL. @@ -2565,15 +2879,15 @@ Point along perpendicular - Bod podél v pravém úhlu + Bod podél pravého úhlu Special point on shoulder. - Zvláštní bod na rameni. + Zvláštní bod na rameni. Tool triangle. - Nástroj trojúhelník. + Nástroj trojúhelník. Perpendicular point along line @@ -2585,11 +2899,11 @@ Point at intersection of arc and line. - Bod v průsečíku oblouku a čáry. + Bod v průsečíku oblouku a čáry. Tool to make point from x & y of two other points. - Nástroj na udělání bodu z x a y dvou jiných bodů. + Nástroj na vytvoření bodu z x a y dvou jiných bodů. Point at distance and angle @@ -2601,7 +2915,7 @@ Point of intersection line and axis - Bod průsečíku čáry a úhlu + Bod průsečíku čáry a úhlu ... @@ -2633,19 +2947,19 @@ Curve tool. - Nástroj na křivku. + Nástroj křivky. Tool for path curve. - Nástroj pro křivku cesty. + Nástroj pro křivku cesty. Tool for segmenting a curve. - Nástroj pro rozdělení křivky. + Nástroj pro rozdělení křivky. Tool segment a pathed curve. - Nástroj pro rozdělení cesty křivky. + Nástroj pro rozdělení cesty křivky. Tools for creating arcs. @@ -2657,15 +2971,15 @@ Arc tool. - Nástroj na oblouk. + Nástroj oblouku. Cut arc tool. - Nástroj na vyjmutí oblouku. + Nástroj pro vyjmutí oblouku. Tools for creating details. - Nástroje na vytváření detailů. + Nástroje pro vytváření detailů. Detail @@ -2673,11 +2987,11 @@ Tool new detail. - Nástroj pro nový detail. + Nástroj pro nový detail. Tool for union two details. - Nástroj na spojení dvou detailů. + Nástroj pro spojení dvou detailů. &File @@ -2773,7 +3087,7 @@ Save not yet saved pattern - Uložit ještě neuložený vzor + Uložit dosud neuložený vzor Ctrl+Shift+S @@ -2821,7 +3135,7 @@ Change the label of pattern piece - Změnit označení dílu střihu + Změnit štítek dílu střihu Table of variables @@ -2889,7 +3203,7 @@ zoom in - Přiblížit + přiblížit Zoom out @@ -2901,11 +3215,11 @@ Original zoom - Původní zvětšení + Původní přiblížení Original Zoom - Původní zvětšení + Původní přiblížení Zoom fit best @@ -2937,11 +3251,11 @@ Online help - + Nápověda na internetu Show online help - + Zobrazit nápovědu na internetu Pattern piece %1 @@ -2949,12 +3263,13 @@ Individual measurements is under development - Osobité míry se vyvíjejí + Individuální míry jsou ve vývoji There is no way create individual measurements file independent on the pattern file. For opening pattern need keep both files: pattern and measurements. Do you want continue? - + Není možné vytvářet soubor s individuálními mírami nezávisle na souboru se střihem. +Pro otevření souboru je nutné zachovat oba soubory: střih a míry. Chcete pokračovat? Select point @@ -3010,7 +3325,7 @@ For opening pattern need keep both files: pattern and measurements. Do you want Select point vertically - Vybrat bod svisle + Vybrat bod svisle Select detail @@ -3030,7 +3345,7 @@ For opening pattern need keep both files: pattern and measurements. Do you want Height: - Výška: + Výška: Size: @@ -3078,11 +3393,11 @@ For opening pattern need keep both files: pattern and measurements. Do you want Error wrong id. - Chyba. Špatné ID. + Chyba. Špatný identifikátor. Critical error! - Zásadní chyba! + Vážná chyba! Error parsing file (std::bad_alloc). @@ -3090,7 +3405,7 @@ For opening pattern need keep both files: pattern and measurements. Do you want Bad id. - Špatné ID. + Špatný identifikátor. File saved @@ -3124,11 +3439,11 @@ Chcete uložit své změny? Enter a new label for the pattern piece. - Zadejte nové označení dílu střihu. + Zadejte nový štítek dílu střihu. This file already opened in another window. - + Tento soubor je již otevřen v jiném okně. Wrong units. @@ -3148,11 +3463,11 @@ Chcete uložit své změny? Valentina didn't shut down correctly. Do you want reopen files (%1) you had open? - Valentina se nevypla správně. Chcete otevřít soubory (%1), které jste měl otevřeny, znovu? + Valentina nebyla vypnuta správně. Chcete znovu otevřít soubory (%1), které jste měli otevřeny? Reopen files. - Otevřít soubor znovu + Znovu otevřít soubory The measurements file <br/><br/> <b>%1</b> <br/><br/> %3 @@ -3160,7 +3475,7 @@ Chcete uložit své změny? could not be found. Do you want to update the file location - se nepodařilo nalézt. Chcete aktualizovat umístění souboru + se nepodařilo nalézt. Chcete aktualizovat umístění souboru? Standard measurements (*.vst) @@ -3168,7 +3483,83 @@ Chcete uložit své změny? Individual measurements (*.vit) - Osobité míry (*.vit) + Individuální míry (*.vit) + + + Special point on shoulder + Zvláštní bod na rameni + + + Triangle tool + + + + Point at intersection of arc and line + Bod v průsečíku oblouku a čáry + + + Point from X and Y of two other points + + + + Point intersect line and axis + + + + Simple curve + + + + Curved path + Cesta křivky + + + Segmenting a simple curve + + + + Segment a curved path + + + + Point intersect curve and axis + + + + Segment an arc + + + + Point intersect arc and axis + + + + Seam allowance tool + + + + Union tool + + + + toolBar + Nástrojový pruh + + + Last Tool + + + + Activate last used tool again + + + + L + + + + Select point for X value (vertical) + @@ -3176,117 +3567,117 @@ Chcete uložit své změny? head_girth Short measurement name. Don't use math symbols in name!!!! - + obvod_hlavy mid_neck_girth Short measurement name. Don't use math symbols in name!!!! - + střední_obvod_krku neck_base_girth Short measurement name. Don't use math symbols in name!!!! - + dolní_obvod_krku head_and_neck_length Short measurement name. Don't use math symbols in name!!!! - + délka_hlavy_a_krku center_front_waist_length Short measurement name. Don't use math symbols in name!!!! - + střední_horní_délka_pasu center_back_waist_length Short measurement name. Don't use math symbols in name!!!! - + střední_zadní_délka_pasu shoulder_length Short measurement name. Don't use math symbols in name!!!! - + délka_ramene side_waist_length Short measurement name. Don't use math symbols in name!!!! - + boční_délka_pasu trunk_length Short measurement name. Don't use math symbols in name!!!! - + délka_trupu shoulder_girth Short measurement name. Don't use math symbols in name!!!! - + obvod_ramene upper_chest_girth Short measurement name. Don't use math symbols in name!!!! - + horní_obvod_hrudi bust_girth Short measurement name. Don't use math symbols in name!!!! - + obvod_přes_prsa under_bust_girth Short measurement name. Don't use math symbols in name!!!! - + obvod_pod_prsy waist_girth Short measurement name. Don't use math symbols in name!!!! - + obvod_pasu high_hip_girth Short measurement name. Don't use math symbols in name!!!! - + horní_obvod_boků hip_girth Short measurement name. Don't use math symbols in name!!!! - + obvod_boků upper_front_chest_width Short measurement name. Don't use math symbols in name!!!! - + horní_přední_šířka_hrudi front_chest_width Short measurement name. Don't use math symbols in name!!!! - + přední_šířka_hrudi across_front_shoulder_width Short measurement name. Don't use math symbols in name!!!! - + přední_šířka_ramen across_back_shoulder_width Short measurement name. Don't use math symbols in name!!!! - + zadní_šířka_ramen upper_back_width Short measurement name. Don't use math symbols in name!!!! - + horní_šířka_zad back_width Short measurement name. Don't use math symbols in name!!!! - + šířka_zad bustpoint_to_bustpoint Short measurement name. Don't use math symbols in name!!!! - + od_bradavky_k_bradavce halter_bustpoint_to_bustpoint @@ -3296,12 +3687,12 @@ Chcete uložit své změny? neck_to_bustpoint Short measurement name. Don't use math symbols in name!!!! - + od_krku_k_bradavce crotch_length Short measurement name. Don't use math symbols in name!!!! - + délka_rozkroku rise_height @@ -3311,167 +3702,167 @@ Chcete uložit své změny? shoulder_drop Short measurement name. Don't use math symbols in name!!!! - + pokles_ramena shoulder_slope_degrees Short measurement name. Don't use math symbols in name!!!! - + stupně_sklonu_ramen front_shoulder_slope_length Short measurement name. Don't use math symbols in name!!!! - + délka_předního_sklonu_ramen back_shoulder_slope_length Short measurement name. Don't use math symbols in name!!!! - + délka_zadního_sklonu_ramen front_shoulder_to_waist_length Short measurement name. Don't use math symbols in name!!!! - + přední_délka_od_ramene_k_pasu back_shoulder_to_waist_length Short measurement name. Don't use math symbols in name!!!! - + zadní_délka_od_ramene_k_pasu front_neck_arc Short measurement name. Don't use math symbols in name!!!! - + přední_oblouk_krku back_neck_arc Short measurement name. Don't use math symbols in name!!!! - + zadní_oblouk_krku front_upper_chest_arc Short measurement name. Don't use math symbols in name!!!! - + přední_horní_oblouk_hrudi back_upper_chest_arc Short measurement name. Don't use math symbols in name!!!! - + zadní_horní_oblouk_hrudi front_waist_arc Short measurement name. Don't use math symbols in name!!!! - + přední_oblouk_pasu back_waist_arc Short measurement name. Don't use math symbols in name!!!! - + zadní_oblouk_pasu front_upper_hip_arc Short measurement name. Don't use math symbols in name!!!! - + přední_horní_oblouk_boků back_upper_hip_arc Short measurement name. Don't use math symbols in name!!!! - + zadní_horní_oblouk_boků front_hip_arc Short measurement name. Don't use math symbols in name!!!! - + přední_oblouk_boků back_hip_arc Short measurement name. Don't use math symbols in name!!!! - + zadní_oblouk_boků chest_slope Short measurement name. Don't use math symbols in name!!!! - + sklon_hrudi back_slope Short measurement name. Don't use math symbols in name!!!! - + sklon_zad front_waist_slope Short measurement name. Don't use math symbols in name!!!! - + přední_sklon_pasu back_waist_slope Short measurement name. Don't use math symbols in name!!!! - + zadní_sklon_pasu front_neck_to_upper_chest_height Short measurement name. Don't use math symbols in name!!!! - + přední_výška_od_krku_k_horní_hrudi front_neck_to_bust_height Short measurement name. Don't use math symbols in name!!!! - + přední_výška_od_krku_k_prsům front_waist_to_upper_chest Short measurement name. Don't use math symbols in name!!!! - + přední_od_pasu_k_horní_hrudi front_waist_to_lower_breast Short measurement name. Don't use math symbols in name!!!! - + přední_od_pasu_ke_spodku_prsou back_waist_to_upper_chest Short measurement name. Don't use math symbols in name!!!! - + od_zadního_pasu_k_horní_hrudi strap_length Short measurement name. Don't use math symbols in name!!!! - + délka_řemínku armscye_girth Short measurement name. Don't use math symbols in name!!!! - + obvod_průramku elbow_girth Short measurement name. Don't use math symbols in name!!!! - + obvod_lokte upper_arm_girth Short measurement name. Don't use math symbols in name!!!! - + obvod_paže wrist_girth Short measurement name. Don't use math symbols in name!!!! - + obvod_zápěstí scye_depth Short measurement name. Don't use math symbols in name!!!! - + hloubka_průramku shoulder_and_arm_length Short measurement name. Don't use math symbols in name!!!! - + délka_ramene_a_paže underarm_length Short measurement name. Don't use math symbols in name!!!! - + délka_podpaží cervicale_to_wrist_length @@ -3481,77 +3872,77 @@ Chcete uložit své změny? shoulder_to_elbow_length Short measurement name. Don't use math symbols in name!!!! - + délka_od_ramene_k_lokti arm_length Short measurement name. Don't use math symbols in name!!!! - + délka_paže hand_width Short measurement name. Don't use math symbols in name!!!! - + šířka_ruky hand_length Short measurement name. Don't use math symbols in name!!!! - + délka_ruky hand_girth Short measurement name. Don't use math symbols in name!!!! - + obvod_ruky thigh_girth Short measurement name. Don't use math symbols in name!!!! - + obvod_stehna mid_thigh_girth Short measurement name. Don't use math symbols in name!!!! - + střední_obvod_stehna knee_girth Short measurement name. Don't use math symbols in name!!!! - + obvod_kolene calf_girth Short measurement name. Don't use math symbols in name!!!! - + obvod_lýtka ankle_girth Short measurement name. Don't use math symbols in name!!!! - + obvod_kotníku knee_height Short measurement name. Don't use math symbols in name!!!! - + výška_kolene ankle_height Short measurement name. Don't use math symbols in name!!!! - + výška_kotníku foot_width Short measurement name. Don't use math symbols in name!!!! - + šířka_chodidla foot_length Short measurement name. Don't use math symbols in name!!!! - + délka_chodidla height Short measurement name. Don't use math symbols in name!!!! - + výška cervicale_height @@ -3566,57 +3957,57 @@ Chcete uložit své změny? waist_height Short measurement name. Don't use math symbols in name!!!! - + výška_pasu high_hip_height Short measurement name. Don't use math symbols in name!!!! - + horní_výška_boků hip_height Short measurement name. Don't use math symbols in name!!!! - + výška_boků waist_to_hip_height Short measurement name. Don't use math symbols in name!!!! - + výška_od_pasu_k_bokům waist_to_knee_height Short measurement name. Don't use math symbols in name!!!! - + výška_od_pasu_ke_kolenům crotch_height Short measurement name. Don't use math symbols in name!!!! - + výška_rozkroku size Short measurement name. Don't use math symbols in name!!!! - + velikost height_front_neck_base_point Short measurement name. Don't use math symbols in name!!!! - + výška_předního_základního_bodu_krku height_base_neck_side_point Short measurement name. Don't use math symbols in name!!!! - + výška_bočního_základního_bodu_krku height_shoulder_point Short measurement name. Don't use math symbols in name!!!! - + výška_ramenního_bodu height_nipple_point Short measurement name. Don't use math symbols in name!!!! - + výška_bodu_bradavky height_back_angle_axilla @@ -3626,97 +4017,97 @@ Chcete uložit své změny? height_scapular_point Short measurement name. Don't use math symbols in name!!!! - + výška_skapulárního_bodu height_under_buttock_folds Short measurement name. Don't use math symbols in name!!!! - + výška_pod_hýždní_záhyb hips_excluding_protruding_abdomen Short measurement name. Don't use math symbols in name!!!! - + body_bez_vyčnívajícího_břicha girth_foot_instep Short measurement name. Don't use math symbols in name!!!! - + obvod_nártu side_waist_to_floor Short measurement name. Don't use math symbols in name!!!! - + zboku_od_pasu_k_podlaze front_waist_to_floor Short measurement name. Don't use math symbols in name!!!! - + zepředu_od_pasu_k_podlaze arc_through_groin_area Short measurement name. Don't use math symbols in name!!!! - + oblouk_skrz_třísla waist_to_plane_seat Short measurement name. Don't use math symbols in name!!!! - + od_pasu_k_rovině_sezení neck_to_radial_point Short measurement name. Don't use math symbols in name!!!! - + od_krku_k_radiálnímu_bodu neck_to_third_finger Short measurement name. Don't use math symbols in name!!!! - + od_krku_k_prostředníčku neck_to_first_line_chest_circumference Short measurement name. Don't use math symbols in name!!!! - + od_krku_k_první_linii_obvodu_hrudi front_waist_length Short measurement name. Don't use math symbols in name!!!! - + přední_délka_pasu arc_through_shoulder_joint Short measurement name. Don't use math symbols in name!!!! - + oblouk_skrz_kloub_ramene neck_to_back_line_chest_circumference Short measurement name. Don't use math symbols in name!!!! - + od_krku_k_zadní_linii_obvodu_hrudi waist_to_neck_side Short measurement name. Don't use math symbols in name!!!! - + boční_od_pasu_ke_krku arc_length_upper_body Short measurement name. Don't use math symbols in name!!!! - + délka_oblouku_horní_části_těla chest_width Short measurement name. Don't use math symbols in name!!!! - + šířka_hrudi anteroposterior_diameter_hands Short measurement name. Don't use math symbols in name!!!! - + předozadní_průměr_rukou height_clavicular_point Short measurement name. Don't use math symbols in name!!!! - + výška_klíčního_bodu height_armhole_slash @@ -3731,52 +4122,52 @@ Chcete uložit své změny? half_girth_neck Short measurement name. Don't use math symbols in name!!!! - + půlobvod_krku half_girth_neck_for_shirts Short measurement name. Don't use math symbols in name!!!! - + půlobvod_krku_pro_trička half_girth_chest_first Short measurement name. Don't use math symbols in name!!!! - + půlobvod_hrudi_první half_girth_chest_second Short measurement name. Don't use math symbols in name!!!! - + půlobvod_hrudi_druhý half_girth_chest_third Short measurement name. Don't use math symbols in name!!!! - + půlobvod_hrudi_třetí half_girth_waist Short measurement name. Don't use math symbols in name!!!! - + půlobvod_pasu half_girth_hips_considering_protruding_abdomen Short measurement name. Don't use math symbols in name!!!! - + půlobvod_boků_včetně_vyčnívajícího_bricha half_girth_hips_excluding_protruding_abdomen Short measurement name. Don't use math symbols in name!!!! - + půlobvod_boků_bez_vyčnívajícího_břicha girth_knee_flexed_feet Short measurement name. Don't use math symbols in name!!!! - + obvod_kolene_natažené_nohy neck_transverse_diameter Short measurement name. Don't use math symbols in name!!!! - + příčný_průměr_krku front_slash_shoulder_height @@ -3786,57 +4177,57 @@ Chcete uložit své změny? neck_to_front_waist_line Short measurement name. Don't use math symbols in name!!!! - + od_krku_k_přední_linii_pasu hand_vertical_diameter Short measurement name. Don't use math symbols in name!!!! - + svislý_průměr_ruky neck_to_knee_point Short measurement name. Don't use math symbols in name!!!! - + od_krku_k_bodu_kolene waist_to_knee Short measurement name. Don't use math symbols in name!!!! - + od_pasu_ke_koleni shoulder_height Short measurement name. Don't use math symbols in name!!!! - + výška_ramen head_height Short measurement name. Don't use math symbols in name!!!! - + výška_hlavy body_position Short measurement name. Don't use math symbols in name!!!! - + poloha_těla arc_behind_shoulder_girdle Short measurement name. Don't use math symbols in name!!!! - + oblouk_za_ramenním_pletencem neck_to_neck_base Short measurement name. Don't use math symbols in name!!!! - + základna_od_krku_ke_krku depth_waist_first Short measurement name. Don't use math symbols in name!!!! - + hloubka_pasu_první depth_waist_second Short measurement name. Don't use math symbols in name!!!! - + hloubka_pasu_druhá @@ -3844,87 +4235,87 @@ Chcete uložit své změny? Around fullest part of Head Full measurement description - + Okolo nejplnější části hlavy Around middle part of Neck Full measurement description - + Okolo střední části krku Around Neck at base Full measurement description - + Okolo krku v jeho základně Vertical Distance from Crown to Nape Full measurement description - + Svislá vzdálenost od koruny k šíji Front Neck Center over tape at Bustline to Front Waist Center Full measurement description - + Přední střed krku přes pásku na úrovni prsou po přední střed pasu Back Neck Center to Back Waist Center Full measurement description - + Od zadního středu krku k zadnímu středu pasu NeckPoint to ShoulderTip Full measurement description - + Z bodu krku na vrchol ramene Armpit to Waist side Full measurement description - + Z podpaží k pasu na boku Around Body from middle of Shoulder length to BustPoint to Crotch up back to beginning point Full measurement description - + Kolem těla ze středu délky ramene přes poprsí a rozkrok zpět nahoru do počátečního bodu Around Arms and Torso, at bicep level parallel to floor, with arms hanging at the sides Full measurement description - + Kolem paží a těla, v úrovni bicepsu rovnoběžně s podlahou, s rukama visícíma podél těla Around Chest at Armfold level, will be parallel to floor across back, will not be parallel to floor across front chest Full measurement description - + Kolem hrudi ve výšce založených rukou, bude rovnoběžné s podlahou přes záda, nebude rovnoběžné s podlahou přes přední část hrudi Around fullest part of Bust, parallel to floor Full measurement description - + Přes nejplnější část poprsí, rovnoběžně s podlahou Around Chest below the Bust, parallel to floor Full measurement description - + Přes hruď pod prsy, rovnoběžně s podlahou Tie a string around smallest part of waist, keep string tied while taking meaasurements. Not usually parallel to floor for front waist or back waist. Full measurement description - + Uvažte provázek kolem nejužší části pasu, při měření mějte provázek napnutý. Obvykle není rovnoběžný s podlahou pro přední a zadní části pasu. Around HighHip, parallel to floor Full measurement description - + Kolem horní části boků, rovnoběžně s podlahou Around Hip, parallel to floor Full measurement description - + Kolem boků, rovnoběžně s podlahou Across Front UpperChest, smallest width from armscye to armscye Full measurement description - + Přes přední horní hruď, nejmenší šířka od průramku k průramku Across Front Chest, from armfold to armfold @@ -3944,7 +4335,7 @@ Chcete uložit své změny? Across Back UpperChest, smallest width from armscye to armscye Full measurement description - + Přes horní část zad, nejmenší šířka od průramku k průramku Across Back Chest, from armfold to armfold @@ -3969,52 +4360,52 @@ Chcete uložit své změny? From Front Waist Center, down to crotch, up to Back Waist Center Full measurement description - + Zepředu ze středu pasu, dolů do rozkroku, a nahoru dozadu do středu pasu. Sit on hard chair, measure from side waist straight down to chair bottom Full measurement description - + Sedněte si na židli, měřte ze strany pasu přímo dolů ke spodní části židle Vertical Distance from NeckPoint level to ShoulderTip level Full measurement description - + Svislá vzdálenost z úrovně krčního bodu na úroveň vrcholku ramena Degrees of angle from NeckPoint to ShoulderTip – requires goniometer Full measurement description - + Úhlové stupně od krčního bodu k vrcholu ramene - vyžaduje goniometr ShoulderTip to Front Waist Center Full measurement description - + Od vrcholku ramene ke středu pasu vepředu ShoulderTip to Back Waist Center Full measurement description - + Od vrcholku ramene ke středu pasu vzadu NeckPoint straight down front chest to Waistline Full measurement description - + Od krčního bodu přímo dolů přes hrudník na úroveň pasu Back NeckPoint straight down back chest to Waistline Full measurement description - + Od krčního bodu přímo dolů přes záda na úroveň pasu NeckPoint to NeckPoint through Front Neck Center Full measurement description - + Z krčního bodu do krčního bodu skrz přední střed krku NeckPoint to NeckPoint across Nape Full measurement description - + Z krčního bodu do krčního bodu přes šíji Front upper-bust arc @@ -4484,7 +4875,7 @@ Chcete uložit své změny? Body position Full measurement description - Poloha těla + Poloha těla Arc behind the shoulder girdle @@ -5231,12 +5622,20 @@ Chcete uložit své změny? Individual measurements - Osobité míry + Individuální míry Patterns Střihy + + Standard measurements + + + + Layout + + PatternPage @@ -5287,7 +5686,7 @@ Chcete uložit své změny? QCoreApplication Based on Qt %1 (%2, %3 bit) - + Postaveno na Qt %1 (%2, %3 bit) @@ -5319,12 +5718,16 @@ Chcete uložit své změny? Property The text that appears in the first column header - + Vlastnost Value The text that appears in the second column header - Hodnota + Hodnota + + + px + @@ -5332,182 +5735,182 @@ Chcete uložit své změny? Unexpected token "$TOK$" found at position $POS$. Math parser error messages. Left untouched "$TOK$" and $POS$ - + Nalezen neočekávaný řetězec "$TOK$" na pozici $POS$. Internal error Math parser error messages. - + Vnitřní chyba Invalid function-, variable- or constant name: "$TOK$". Math parser error messages. Left untouched "$TOK$" - + Neplatný název funkce, proměnné nebo konstanty: "$TOK$". Invalid binary operator identifier: "$TOK$". Math parser error messages. Left untouched "$TOK$" - + Neplatný identifikátor binárního operátoru: "$TOK$". Invalid infix operator identifier: "$TOK$". Math parser error messages. Left untouched "$TOK$" - + Neplatný identifikátor zaváděcího operátoru: "$TOK$". Invalid postfix operator identifier: "$TOK$". Math parser error messages. Left untouched "$TOK$" - + Neplatný identifikátor ukončujícího operátoru: "$TOK$". Invalid pointer to callback function. Math parser error messages. - + Neplatný ukazatel na funkci zpětného volání. Expression is empty. Math parser error messages. - + Výraz je prázdný. Invalid pointer to variable. Math parser error messages. - + Neplatný ukazatel na proměnnou. Unexpected operator "$TOK$" found at position $POS$ Math parser error messages. Left untouched "$TOK$" and $POS$ - + Nalezen neočekávaný operátor "$TOK$" na pozici $POS$ Unexpected end of expression at position $POS$ Math parser error messages. Left untouched $POS$ - + Neočekávaný konec výrazu v poloze $POS$ Unexpected argument separator at position $POS$ Math parser error messages. Left untouched $POS$ - + Neočekávaný oddělovač argumentů v poloze $POS$ Unexpected parenthesis "$TOK$" at position $POS$ Math parser error messages. Left untouched "$TOK$" and $POS$ - + Neočekávaná závorka "$TOK$" v poloze $POS$ Unexpected function "$TOK$" at position $POS$ Math parser error messages. Left untouched "$TOK$" and $POS$ - + Neočekávaná funkce "$TOK$" v poloze $POS$ Unexpected value "$TOK$" found at position $POS$ Math parser error messages. Left untouched "$TOK$" and $POS$ - + Nalezena neočekávaná hodnota "$TOK$" v poloze $POS$ Unexpected variable "$TOK$" found at position $POS$ Math parser error messages. Left untouched "$TOK$" and $POS$ - + Nalezena neočekávaná proměnná "$TOK$" v poloze $POS$ Function arguments used without a function (position: $POS$) Math parser error messages. Left untouched $POS$ - + Argumenty funkce použity bez funkce (pozice: $POS$) Missing parenthesis Math parser error messages. - + Chybějící závorka Too many parameters for function "$TOK$" at expression position $POS$ Math parser error messages. Left untouched "$TOK$" and $POS$ - + Příliš mnoho parametrů funkce "$TOK$" ve výrazu v poloze $POS$ Too few parameters for function "$TOK$" at expression position $POS$ Math parser error messages. Left untouched "$TOK$" and $POS$ - + Příliš málo parametrů funkce "$TOK$" ve výrazu v poloze $POS$ Divide by zero Math parser error messages. - + Dělení nulou Domain error Math parser error messages. - + Chyba domény Name conflict Math parser error messages. - + Střet názvu Invalid value for operator priority (must be greater or equal to zero). Math parser error messages. - + Neplatná hodnota pro prioritu operátoru (musí být větší nebo rovný nule). user defined binary operator "$TOK$" conflicts with a built in operator. Math parser error messages. Left untouched "$TOK$" - + uživatelem stanovený binární operátor "$TOK$" je ve střetu s vestavěným operátorem. Unexpected string token found at position $POS$. Math parser error messages. Left untouched $POS$ - + Neočekávaný řetězec textu nalezen v poloze $POS$. Unterminated string starting at position $POS$. Math parser error messages. Left untouched $POS$ - + Neukončený řetězec začínající v poloze $POS$. String function called with a non string type of argument. Math parser error messages. - + Řetězcová funkce volána s argumentem, který není řetězec. String value used where a numerical argument is expected. Math parser error messages. - + Řetězcová hodnota použita tam, kde je očekávaný číselný argument. No suitable overload for operator "$TOK$" at position $POS$. Math parser error messages. Left untouched "$TOK$" and $POS$ - + Žádné vhodné přetížení pro operátor "$TOK$" v poloze $POS$. Function result is a string. Math parser error messages. - + Výsledek funkce je řetězec. Parser error. Math parser error messages. - + Chyba při zpracování. Decimal separator is identic to function argument separator. Math parser error messages. - + Desetinný oddělovač je shodný s oddělovačem argumentů funkcí. If-then-else operator is missing an else clause Math parser error messages. Do not translate operator name. - + V operátoru if-then-else chybí část else Misplaced colon at position $POS$ Math parser error messages. Left untouched $POS$ - + Chybně umístěná dvojtečka v poloze $POS$ The "$TOK$" operator must be preceeded by a closing bracket. Math parser error messages. Left untouched "$TOK$" - + Operátoru "$TOK$" musí předcházet ukončující závorka. @@ -5522,21 +5925,21 @@ Chcete uložit své změny? Standard figures of men 1st group, chest 100 cm Standard table description - + Obvyklá čísla mužů první skupiny, hruď 100 cm SaveDetailOptions Save detail option - Uložit volbu pro detail + Uložit volbu detailu SaveToolOptions Save tool option - Uložit volbu pro nástroj + Uložit volbu nástroje @@ -5559,19 +5962,19 @@ Chcete uložit své změny? Next - Další + Další Next detail - Další detail + Další detail Turn - Otočit + Otočit Turn the detail 90 degrees - Otočit detail o 90 stupňů + Otočit detail o 90 stupňů Stop @@ -5583,23 +5986,23 @@ Chcete uložit své změny? Enlarge letter - Zvětšit list + Zvětšit list Enlarge the length of the sheet - Zvětšit délku listu + Zvětšit délku listu Reduce sheet - Zmenšit list + Zmenšit list Reduce the length of the sheet - Zmenšit velikost listu + Zmenšit délku listu Mirroring - Zrcadlení + Zrcadlení Zoom In @@ -5611,15 +6014,15 @@ Chcete uložit své změny? 0 details left. - Zbylo 0 detailů. + Zbylo 0 detailů. Collisions not found. - Střety nenalezeny. + Kolize nenalezeny. %1 details left. - Zbylo %1 detailů. + Zbylo %1 detailů. untitled @@ -5647,7 +6050,7 @@ Chcete uložit své změny? Collisions found. - Střety nalezeny. + Kolize nalezeny. Creating file '%1' failed! %2 @@ -5655,10 +6058,18 @@ Chcete uložit své změny? Critical error! - Zásadní chyba! + Vážná chyba! Wavefront OBJ (*.obj) + Wavefront OBJ (*.obj) + + + Layout pages + + + + Layout @@ -5666,51 +6077,79 @@ Chcete uložit své změny? VAbstractConverter Error creation backup file: %1. - + Chyba při vytváření záložního souboru: %1. Couldn't get version information. - + Nebylo možné získat informace o verzi. Too many tags <%1> in file. - + Příliš mnoho značek <%1> v souboru. Version "%1" invalid. - + Verze "%1" neplatná. Version "0.0.0" invalid. - + Verze "0.0.0" neplatná. Invalid version. Minimum supported version is %1 - + Neplatná verze. Nejnižší podporovaná verze je %1 Invalid version. Maximum supported version is %1 - + Neplatná verze. Nejvyšší podporovaná verze je %1 Error no unique id. - Chyba. Není jedinečné ID. + Chyba. Žádný jedinečný identifikátor. Could not change version. - + Nebylo možné změnit verzi. VAbstractTool Confirm the deletion. - Potvrdit smazání. + Potvrďte smazání. Do you really want delete? Opravdu chcete smazat? + + black + + + + green + + + + blue + + + + dark red + + + + dark green + + + + dark blue + + + + yellow + + VApplication @@ -5738,14 +6177,6 @@ Chcete uložit své změny? Something's wrong!! Něco je špatně! - - Could not copy temp file to document file - Nepodařilo se zkopírovat dočasný soubor do souboru s dokumentem - - - Could not remove document file - Nepodařilo se odstranit soubor s dokumentem - VContainer @@ -5794,7 +6225,7 @@ Chcete uložit své změny? Could not load schema file. - + Nelze načíst soubor se schématem. Validation error file %3 in line %1 column %2 @@ -5802,7 +6233,7 @@ Chcete uložit své změny? Parsing error file %3 in line %1 column %2 - Chyba při zpracování souboru%3 na řádku %1, ve sloupci %2 + Chyba při zpracování souboru %3 na řádku %1, ve sloupci %2 Couldn't get node @@ -5810,19 +6241,19 @@ Chcete uložit své změny? Got wrong parameter id. Need only id > 0. - Obdrženo špatné ID parametru. Je potřeba jen ID > 0. + Obdržen chybný identifikátor parametru. Vyžaduje pouze identifikátor > 0. This id is not unique. - Toto ID není jedinečné. + Tento identifikátor není jedinečný. Could not copy temp file to document file - Nepodařilo se zkopírovat dočasný soubor do souboru s dokumentem + Nelze kopírovat dočasný soubor do souboru dokumentu. Could not remove document file - Nepodařilo se odstranit soubor s dokumentem + Nelze odstranit soubor dokumentu. @@ -5844,7 +6275,7 @@ Chcete uložit své změny? VException Critical error! - Zásadní chyba! + Vážná chyba! @@ -5869,22 +6300,22 @@ Chcete uložit své změny? VPE::VBoolProperty True - + Pravda False - + Nepravda VPE::VFileEditWidget Directory - + Adresář Open File - + Otevřít soubor @@ -5895,7 +6326,7 @@ Chcete uložit své změny? Error no unique id. - Chyba. Není jedinečné ID. + Chyba. Není jedinečný identifikátor. Error parsing file. @@ -5911,11 +6342,11 @@ Chcete uložit své změny? Error wrong id. - Chyba. Špatné ID. + Chyba. Špatný identifikátor. Critical error! - Zásadní chyba! + Vážná chyba! Error parsing file (std::bad_alloc). @@ -5927,7 +6358,7 @@ Chcete uložit své změny? Error creating or updating single point - Chyba při vytváření nebo aktualizaci základního bodu + Chyba při vytváření nebo aktualizaci jediného bodu Error creating or updating point of end line @@ -5959,7 +6390,7 @@ Chcete uložit své změny? Error creating or updating modeling point - Chyba při vytváření nebo aktualizaci bodu + Chyba při vytváření nebo aktualizaci modelovacího bodu Error creating or updating height @@ -5987,7 +6418,7 @@ Chcete uložit své změny? Error creating or updating point of intersection line and axis - Chyba při vytváření nebo aktualizaci bodu průsečíku křivky a osy + Chyba při vytváření nebo aktualizaci bodu průsečíku křivky a osy Error creating or updating point of intersection curve and axis @@ -5999,7 +6430,7 @@ Chcete uložit své změny? Error creating or updating simple curve - Chyba při vytváření nebo aktualizaci křivky + Chyba při vytváření nebo aktualizaci jednoduché křivky Error creating or updating curve path @@ -6007,32 +6438,24 @@ Chcete uložit své změny? Error creating or updating modeling simple curve - Chyba při vytváření nebo aktualizaci modelové křivky + Chyba při vytváření nebo aktualizaci modelovací jednoduché křivky Error creating or updating modeling curve path - Chyba při vytváření nebo aktualizaci cesty modelové křivky + Chyba při vytváření nebo aktualizaci cesty modelovací křivky Error creating or updating simple arc - Chyba při vytváření nebo aktualizaci oblouku + Chyba při vytváření nebo aktualizaci jednoduchého oblouku Error creating or updating modeling arc - Chyba při vytváření nebo aktualizaci modelového oblouku + Chyba při vytváření nebo aktualizaci modelovacího oblouku Error creating or updating union details Chyba při vytváření nebo aktualizaci detailu spojení - - Got wrong parameter id. Need only id > 0. - Obdrženo špatné ID parametru. Je potřeba jen ID > 0. - - - This id is not unique. - Toto ID není jedinečné. - File error. Chyba souboru. @@ -6042,11 +6465,11 @@ Chcete uložit své změny? VPatternConverter Unexpected version "%1". - + Neočekávaná verze "%1". Error restoring backup file: %1. - + Chyba při obnově záložního souboru: %1. @@ -6068,11 +6491,11 @@ Chcete uložit své změny? VTableGraphicsView can't find detail - Nelze najít detail + nelze najít detail detail found - Detail nalezen + detail nalezen @@ -6094,7 +6517,7 @@ Chcete uložit své změny? Point label - Označení bodu + Štítek bodu Position @@ -6174,11 +6597,11 @@ Chcete uložit své změny? Point at intersection of arc and line - Bod v průsečíku oblouku a čáry. + Bod v průsečíku oblouku a čáry Tool to make point from x & y of two other points - Nástroj na udělání bodu z x a y dvou jiných bodů + Nástroj na vytvoření bodu z x a y dvou jiných bodů Special point on shoulder @@ -6186,7 +6609,7 @@ Chcete uložit své změny? Curve tool - Nástroj na křivku + Nástroj křivky Curve factor @@ -6194,16 +6617,28 @@ Chcete uložit své změny? Tool for path curve - Nástroj pro křivku cesty + Nástroj křivky cesty Tool triangle - Nástroj na trojúhelník + Nástroj trojúhelníku Point intersection line and axis Bod průsečíku oblouku a čáry + + Line color + + + + Color + + + + Point intersection curve and axis + + Variables @@ -6230,39 +6665,39 @@ Chcete uložit své změny? SplPath Do not add symbol _ to the end of name - + Cesta křivky VisToolCurveIntersectAxis <b>Intersection curve and axis</b>: angle = %1°; <b>Shift</b> - sticking angle, <b>Enter</b> - finish creation - + <b>Průnik křivky a osy</b>: úhel = %1°; <b>Shift</b> - přilnutí úhlů, <b>Enter</b> - dokončit vytváření VisToolEndLine <b>Point at distance and angle</b>: angle = %1°; <b>Shift</b> - sticking angle, <b>Enter</b> - finish creation - + <b>Bod ve vzdálenosti a úhlu</b>: úhel = %1°; <b>Shift</b> - přilnutí úhlů, <b>Enter</b> - dokončit vytváření VisToolLineIntersectAxis <b>Intersection line and axis</b>: angle = %1°; <b>Shift</b> - sticking angle, <b>Enter</b> - finish creation - + <b>Průnik čáry a osy</b>: úhel = %1°; <b>Shift</b> - přilnutí úhlů, <b>Enter</b> - dokončit vytváření VisToolSplinePath <b>Curved path</b>: select three or more points - + <b>Cesta křivky</b>: vyberte tři nebo více bodů <b>Curved path</b>: select three or more points, <b>Enter</b> - finish creation - + <b>Cesta křivky</b>: vyberte tři nebo více bodů, <b>Enter</b> - dokončit vytváření @@ -6273,7 +6708,7 @@ Chcete uložit své změny? Pattern file. - Soubor se střihem + Soubor se střihem. diff --git a/share/translations/valentina_de_DE.ts b/share/translations/valentina_de_DE.ts index 509ba8fdb..70df5acd9 100644 --- a/share/translations/valentina_de_DE.ts +++ b/share/translations/valentina_de_DE.ts @@ -41,7 +41,7 @@ Secure connection - sichere Verbindung + Sichere Verbindung Proxy settings @@ -65,7 +65,7 @@ Proxy pass - + Proxy Passwort User settings @@ -73,7 +73,7 @@ User Name - Nutzername + Benutzername Save password @@ -100,42 +100,42 @@ Config Dialog - + Einstellungen Configuration - + Allgemein Pattern - + Schnittmuster Community - + Community Paths - + Verzeichnisse ConfigurationPage Setup user interface language updated and will be used the next time start - + Die Änderung der Spracheinstellung wird erst beim nächsten Programmstart wirksam. Default unit updated and will be used the next pattern creation - + Die Änderung der Standardmaßeinheit wird erst für neu angelegte Schnittmuster-Dateien wirksam Save - Speichern + Speichern Auto-save modified pattern - + Automatisches Speichern min @@ -143,7 +143,7 @@ Interval: - + Interval: Language @@ -155,15 +155,15 @@ Decimal separator parts - + Dezimaltrennzeichen With OS options (%1) - + Nach Sprache des Betriebssystemss (%1) Default unit - + Standard-Maßeinheit Centimeters @@ -171,7 +171,7 @@ Millimiters - + Millimeter Inches @@ -179,33 +179,33 @@ Label language - + Sprache für Label Send crash reports - + Absturzberichte senden Send crash reports (recommended) - + Absturzberichte senden (empfohlen) After each crash Valentina collect information that may help us fix a problem. We do not collect any personal information. Find more about what <a href="https://bitbucket.org/dismine/valentina/wiki/manual/Crash_reports">kind of information</a> we collect. - + Nach jedem Absturz stellt Valentina Informationen zusammen, die helfen können, das Problem zu beheben. Es werden keine persönlichen Daten übertragen. Finde mehr darüber heraus, <a href="https://bitbucket.org/dismine/valentina/wiki/manual/Crash_reports">welche Information</a> übertragen werden. DelTool Delete tool - + Werkzeug löschen DeleteDetail Delete tool - + Werkzeug löschen @@ -229,10 +229,6 @@ Contributors Mitwirkende - - Based on Qt %2 (32 bit) - Basiert auf Qt %2 (32 bit) - Built on %3 at %4 Gebaut auf %3 um %4 @@ -247,18 +243,18 @@ Cannot open your default browser - + Konnte den Standard-Browser nicht starten Build revision: - + Build revision: DialogAlongLine Point along line - Punkt auf einer Linie + Punkt auf einer Linie Length @@ -270,15 +266,15 @@ Calculate value - Wert berechnen + Wert berechnen Value of length - Wert der Länge + Berechnete Länge <html><head/><body><p>Show full calculation in message box</p></body></html> - + <html><head/><body><p>Ganze Berechnungsformel anzeigen</p></body></html> Point label @@ -310,7 +306,7 @@ Input data - Eingabedaten + Eingangsgrößen Size and height @@ -318,7 +314,7 @@ Measurements - Maße + Maße Increments @@ -338,11 +334,11 @@ Angle of lines - + Winkel einer Linie Hide empty measurements - + Unbestückte Größen ausblenden Variables - Click twice to insert into formula @@ -352,6 +348,14 @@ Select second point of line Zweiten Punkt der Linie auswählen + + Point at distance along line + + + + Line color + + DialogArc @@ -369,7 +373,7 @@ Calculate value - Wert berechnen + Wert berechnen Value of radius @@ -377,11 +381,11 @@ <html><head/><body><p>Show full calculation in message box</p></body></html> - + <html><head/><body><p>Ganze Berechnungsformel anzeigen</p></body></html> First angle - + Erster Winkel Insert variable into formula @@ -393,7 +397,7 @@ Second angle - + Zweiter Winkel Insert marked variable into formula @@ -413,7 +417,7 @@ Input data - Eingabedaten + Eingangsgrößen Size and height @@ -421,7 +425,7 @@ Measurements - Maße + Maße Increments @@ -441,11 +445,11 @@ Angle of lines - Linenwinkel + Winkel einer Linie Hide empty measurements - + Unbestückte Größen ausblenden Variables @@ -453,18 +457,22 @@ Value of angle of line. - Wert des Linenwinkels. + Wert des Linenwinkels. Error - Fehler + Fehler Radius can't be negative - + Radius kann nicht negativ sein Angles equal + Beide Winkel sind identisch + + + Color @@ -472,7 +480,7 @@ DialogBisector Bisector - Winkelhalbierende + Winkelhalbierende Length @@ -484,7 +492,7 @@ Calculate value - Wert berechnen + Wert berechnen Value of length @@ -492,7 +500,7 @@ <html><head/><body><p>Show full calculation in message box</p></body></html> - + <html><head/><body><p>Ganze Berechnungsformel anzeigen</p></body></html> Point label @@ -532,7 +540,7 @@ Input data - Eingabedaten + Eingangsgrößen Size and height @@ -540,7 +548,7 @@ Measurements - Maße + Maße Increments @@ -560,11 +568,11 @@ Angle of lines - + Winkel einer Linie Hide empty measurements - + Unbestückte Größen ausblenden Variables - Click twice to insert into formula @@ -576,141 +584,62 @@ Select third point of angle - zweiten Punkt auf dem zweiten Schenkel wählen + Zweiten Punkt auf dem zweiten Schenkel wählen + + + Point along bisector + Punkt entlang einer Winkelhalbierenden + + + Line color + DialogCurveIntersectAxis Curve intersect axis - + Laufender Schnittpunkt auf Kurve Angle - + Winkel Calculate value - Wert berechnen + Wert berechnen Value of angle - + Berecheter Winkel <html><head/><body><p>Show full calculation in message box</p></body></html> - + <html><head/><body><p>Ganze Berechnungsformel anzeigen</p></body></html> Axis point - - - - First point of line - Erster Punkt der Linie + Punkt der Schnittachse Curve - Kurve - - - Point label - Bezeichnung des Punktes - - - Type of line - Linientyp - - - Show line from first point to this point - Linie vom ersten zu diesem Punkt zeigen - - - Input data - Eingabedaten - - - Size and height - Konfektion und Größe - - - Measurements - Maße - - - Increments - weitere Maße - - - Length of lines - - - - Length of arcs - - - - Length of curves - - - - Angle of lines - - - - Hide empty measurements - - - - Variables - Variablen - - - Select axis point - - - - - DialogCutArc - - Cut arc - - - - Length - Länge - - - Calculate value - Wert berechnen - - - Value of length - Wert der Länge - - - _ - - - - <html><head/><body><p>Show full calculation in message box</p></body></html> - - - - Arc - Bogen - - - Selected curve - Ausgewählte Kurve + Kurve Point label Bezeichnung des Punktes + + Type of line + Linientyp + + + Show line from first point to this point + Verbindungslinie bis zum Schnittpunkt wird mit angegebenem Stil gezeichnet + Input data - Eingabedaten + Eingangsgrößen Size and height @@ -718,7 +647,102 @@ Measurements - Maße + Maße + + + Increments + Weitere Maße + + + Length of lines + Linienlängen + + + Length of arcs + Bogenlängen + + + Length of curves + Kurvenlängen + + + Angle of lines + Winkel einer Linie + + + Hide empty measurements + Unbestückte Größen ausblenden + + + Variables + Variablen + + + Select axis point + Ausgangspunkt für Schnittachse auswählen + + + Point intersect curve and axis + + + + Axis Point + + + + Line color + + + + + DialogCutArc + + Cut arc + Kreisbogen + + + Length + Länge + + + Calculate value + Wert berechnen + + + Value of length + Wert der Länge + + + _ + _ + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + <html><head/><body><p>Ganze Berechnungsformel anzeigen</p></body></html> + + + Arc + Bogen + + + Selected curve + Ausgewählte Kurve + + + Point label + Bezeichnung des Punktes + + + Input data + Eingangsgrößen + + + Size and height + Konfektion und Größe + + + Measurements + Maße Increments @@ -738,22 +762,34 @@ Angle of lines - + Winkel einer Linie Hide empty measurements - + Unbestückte Größen ausblenden Variables - Click twice to insert into formula Variablen - Doppelklick fügt die Variable in die Formel ein + + Segment an arc + + + + Selected arc + + + + Color + + DialogCutSpline Cut curve - + Kurvensegment Length @@ -761,19 +797,19 @@ Calculate value - Wert berechnen + Wert berechnen Value of length - Wert der Länge + Berechnete Länge _ - + _ <html><head/><body><p>Show full calculation in message box</p></body></html> - + <html><head/><body><p>Ganze Berechnungsformel anzeigen</p></body></html> Curve @@ -789,7 +825,7 @@ Input data - Eingabedaten + Eingangsgrößen Size and height @@ -797,7 +833,7 @@ Measurements - Maße + Maße Increments @@ -817,22 +853,30 @@ Angle of lines - + Winkel einer Linie Hide empty measurements - + Unbestückte Größen ausblenden Variables - Click twice to insert into formula Variablen - Doppelklick fügt die Variable in die Formel ein + + Segmenting a simple curve + + + + Color + + DialogCutSplinePath Cut curve path - + Pfadsegment Length @@ -840,7 +884,7 @@ Calculate value - Wert berechnen + Wert berechnen Value of length @@ -848,11 +892,11 @@ _ - + _ <html><head/><body><p>Show full calculation in message box</p></body></html> - + <html><head/><body><p>Ganze Berechnungsformel anzeigen</p></body></html> Curve @@ -868,7 +912,7 @@ Input data - Eingabedaten + Eingangsgrößen Size and height @@ -876,7 +920,7 @@ Measurements - Maße + Maße Increments @@ -896,16 +940,24 @@ Angle of lines - + Winkel einer Linie Hide empty measurements - + Unbestückte Größen ausblenden Variables - Click twice to insert into formula Variablen - Doppelklick fügt die Variable in die Formel ein + + Segment a curved path + + + + Color + + DialogDetail @@ -919,7 +971,7 @@ cm - cm + cm Bias Y @@ -931,7 +983,7 @@ Name of detail - Name des Deails + Name des Details Seam allowance @@ -955,6 +1007,10 @@ Reverse + Umkehren + + + Seam allowance tool @@ -962,11 +1018,11 @@ DialogEditWrongFormula Edit formula - + Formel bearbeiten Formula - + Formel Insert variable into formula @@ -974,7 +1030,7 @@ Calculate value - Wert berechnen + Wert berechnen Value of first angle @@ -982,7 +1038,7 @@ _ - + _ <html><head/><body><p>Show full calculation in message box</p></body></html> @@ -990,7 +1046,7 @@ Input data - Eingabedaten + Eingangsgrößen Size and height @@ -998,31 +1054,31 @@ Measurements - Maße + Maße Increments - weitere Maße + Weitere Maße Length of lines - Linienlänge + Linienlängen Length of arcs - Bogenlänge + Bogenlängen Length of curves - Kurvenlänge + Kurvenlängen Angle of lines - Winkel der Linien + Winkel einer Linie Hide empty measurements - + Unbestückte Größen ausblenden Variables @@ -1033,7 +1089,7 @@ DialogEndLine Point in the end of a line - Punkt am Ende einer Linie + Punkt mit Abstand und Winkel Length @@ -1041,7 +1097,7 @@ Calculate value - Wert berechnen + Wert berechnen Value of length @@ -1049,15 +1105,15 @@ <html><head/><body><p>Show full calculation in message box</p></body></html> - + <html><head/><body><p>Ganze Berechnungsformel anzeigen</p></body></html> Angle - + Winkel Value of angle - + Berechneter Winkel Base point @@ -1081,7 +1137,7 @@ Input data - Eingabedaten + Eingangsgrößen Size and height @@ -1089,7 +1145,7 @@ Measurements - Maße + Maße Increments @@ -1109,23 +1165,27 @@ Angle of lines - + Winkel einer Linie Hide empty measurements - + Unbestückte Größen ausblenden Variables - Variablen + Variablen + + + Point at distance and angle + Punkt mit Abstand und Winkel + + + Line color + DialogHeight - - Height - Größe - Point label Bezeichnung des Punktes @@ -1148,7 +1208,7 @@ Show line from first point to our point - Zeige linie vom ersten punkt zu diesem Punkt + Verbindungslinie bis zum Schnittpunkt wird mit angegebenem Stil gezeichnet Select first point of line @@ -1158,6 +1218,18 @@ Select second point of line Zweiten Punkt der Linie auswählen + + Perpendicular point along line + + + + Base Point + + + + Line color + + DialogHistory @@ -1171,7 +1243,7 @@ Can't create record. - + Konnte Eintrag nicht anlegen. %1 - Base point @@ -1215,7 +1287,7 @@ %4 - point of contact of arc with the center in point %1 and line %2_%3 - %4 - Kontaktpunkt von Bogen und dem Mittelpunkt von Punkt %1 und Linie %2_%3 + %4 - Schmittpunkt von Bogen mit Mittelpunkt %1 und Linie %2_%3 Point of perpendicular from point %1 to line %2_%3 @@ -1231,23 +1303,23 @@ %1 - cut arc with center %2 - %1 - Bogen mit Zentrum %2 schneiden + %1 - Kreisbogen mit Zentrum %2 %1 - cut curve %2_%3 - %1 - schneide Kurve %2_%3 + %1 - Kurvensegment %2_%3 %1 - cut curve path %2 - + %1 - Pfadsegment %2 %1 - point of intersection line %2_%3 and axis through point %4 - + %1 - Laufender Punkt auf Linie %2_%3 ausgehend von Punkt %4 %1 - point of intersection curve and axis through point %2 - + %1 - Laufender Punkt auf Kurve ausgehend von Punkt %2 @@ -1258,39 +1330,39 @@ Measurements - Maße + Maße Load another measurements table - + Eine andere Maßtabelle laden Personal information - + Persönliche Informationen Given name - + Vorname Family name - + Nachname Birth date - + Geburtsdatum Sex - + Geschlecht Email - + Email Hide empty measurements - + Unbestückte Größen ausblenden Name @@ -1358,23 +1430,23 @@ Could not save GivenName - + Vorname konnte nicht gespeichert werden Could not save FamilyName - + Nachname konnte nicht gespeichert werden Could not save Email - + Emailadresse konnte nicht gespeichert werden Could not save Sex - + Geschlecht konnte nicht gespeichert werden Could not save BirthDate - + Geburtsdatum konnte nicht gespeichert werden Measurements use different units than pattern. This pattern required measurements in %1 @@ -1402,6 +1474,22 @@ Can't save measurement + Maß kann nicht gespeichert werden + + + Tables of Variables + + + + Base size: %1 %3; Base height: %2 %3 + + + + Description: "%1" + + + + Data successfully saved. @@ -1413,11 +1501,11 @@ Pattern piece name - Schnittteilname + Name des Schnittteils Exist measurements - + Vorhandene Maßtabelle Path: @@ -1449,7 +1537,7 @@ File error. - Datei Fehler. + Dateifehler. Individual measurements (*.vit) @@ -1461,26 +1549,136 @@ Where save measurements? - + Verzeichnis auswählen Centimeters - Zentimeter + Zentimeter Millimiters - + Millimeter Inches Zoll + + DialogLayoutProgress + + Creation a layout + + + + <html><head/><body><p>Finding best position for worpieces. Please, waite.</p></body></html> + + + + Couldn't prepare data for creation layout + + + + Critical error + + + + Wrong paper size + + + + Several workpieces left not arranged, but none of them match for paper + + + + + DialogLayoutSettings + + Creation a layout + + + + Paper size + + + + Templates: + + + + Width: + + + + Height: + + + + ... + ... + + + Rotate workpiece + + + + Rotate by + + + + degree + + + + Creation options + + + + Layout width: + + + + Shift length: + + + + Principle of choosing the next workpiece + + + + Three groups: big, middle, small + + + + Two groups: big, small + + + + Descending area + + + + Millimiters + Millimeter + + + Centimeters + Zentimeter + + + Inches + Zoll + + + Pixels + + + DialogLine Line - Linie + Linie First point @@ -1502,12 +1700,20 @@ Select second point Wähle zweiten Punkt + + Line between points + Verbindungslinie zwischen zwei Punkten + + + Line color + + DialogLineIntersect Intersection of lines - Schnittpunkt von Linien + Schnittpunkt von Linien Point label @@ -1541,103 +1747,123 @@ Select second point of second line Zweiten Punkt der zweiten Linie auswählen + + Point at line intersection + + DialogLineIntersectAxis Line intersect axis - + Laufender Schnittpunkt auf Linie Angle - + Winkel Calculate value - Wert berechnen + Wert berechnen Value of angle - + Berechneter Winkel <html><head/><body><p>Show full calculation in message box</p></body></html> - + <html><head/><body><p>Ganze Berechnungsformel anzeigen</p></body></html> Axis point - + Punkt der Schnittachse First point of line - Erster Punkt der Linie + Erster Punkt der Linie First line point - + Punkt 1 der Linie Second line point - + Punkt 2 der Linie Point label - Bezeichnung des Punktes + Bezeichnung des Punktes Type of line - Linientyp + Linientyp Show line from first point to this point - Linie vom ersten zu diesem Punkt zeigen + Verbindungslinie bis zum Schnittpunkt wird mit angegebenem Stil gezeichnet Input data - Eingabedaten + Eingangsgrößen Size and height - Konfektion und Größe + Konfektion und Größe Measurements - Maße + Maße Increments - weitere Maße + Weitere Maße Length of lines - + Linienlängen Length of arcs - + Bogenlängen Length of curves - + Kurvenlängen Angle of lines - + Winkel einer Linie Hide empty measurements - + Unbestückte Größen ausblenden Variables - Variablen + Variablen Select second point of line - Zweiten Punkt der Linie auswählen + Zweiten Punkt der Linie auswählen Select axis point + Ausgangspunkt für Schnittachse auswählen + + + Point intersect line and axis + + + + Axis Point + + + + Second point of line + Zweiter Punkt der Linie + + + Line color @@ -1672,7 +1898,7 @@ DialogNormal Normal - Normale + Normale Length @@ -1684,7 +1910,7 @@ Calculate value - Wert berechnen + Wert berechnen Value of length @@ -1720,7 +1946,7 @@ Input data - Eingabedaten + Eingangsgrößen Size and height @@ -1728,7 +1954,7 @@ Measurements - Maße + Maße Increments @@ -1748,11 +1974,11 @@ Angle of lines - + Winkel einer Linie Hide empty measurements - + Unbestückte Größen ausblenden Variables - Click twice to insert into formula @@ -1762,6 +1988,22 @@ Select second point of line Zweiten Punkt der Linie auswählen + + Point along perpendicular + Punkt auf einer Normalen + + + First point of line + Erster Punkt der Linie + + + Second point of line + Zweiter Punkt der Linie + + + Line color + + DialogPatternProperties @@ -1771,7 +2013,7 @@ Description - Beschreibung + Beschreibung Author name @@ -1830,7 +2072,7 @@ Remove attribute - + Attribut entfernen Remove node @@ -1937,7 +2179,7 @@ DialogPointOfContact Point of contact - Kontaktpunkt + Kontaktpunkt Radius @@ -1949,7 +2191,7 @@ Calculate value - Wert berechnen + Wert berechnen Value of radius @@ -1981,7 +2223,7 @@ Input data - Eingabedaten + Eingangsgrößen Size and height @@ -1989,7 +2231,7 @@ Measurements - Maße + Maße Increments @@ -2009,11 +2251,11 @@ Angle of lines - + Winkel einer Linie Hide empty measurements - + Unbestückte Größen ausblenden Variables - Click twice to insert into formula. @@ -2023,12 +2265,16 @@ Select second point of line Zweiten Punkt der Linie auswählen + + Point at intersection of arc and line + Laufender Schnittpunkt auf Kreisbogen + DialogPointOfIntersection Point of intersection - + Punkt aus Koordinaten Point label @@ -2036,7 +2282,7 @@ vertical point - vertikaler Punkt + vertikaler Punkt First point of angle @@ -2044,7 +2290,7 @@ horizontal point - horizontaler Punkt + horizontaler Punkt Second point of angle @@ -2052,14 +2298,30 @@ Select point horizontally - Wähle Punkt horizontal + Wähle Punkt horizontal + + + Point from X and Y of two other points + + + + X: vertical point + + + + Y: horizontal point + + + + Select point for Y value (horizontal) + DialogShoulderPoint Point of shoulder - Schulterpunkt + Spezieller Punkt an der Schulter Length @@ -2071,7 +2333,7 @@ Calculate value - Wert berechnen + Wert berechnen Value of length @@ -2079,7 +2341,7 @@ <html><head/><body><p>Show full calculation in message box</p></body></html> - + <html><head/><body><p>Ganze Berechnungsformel anzeigen</p></body></html> Point label @@ -2095,7 +2357,7 @@ Third point - Punkt der zweiten Scheitelgeraden + Dritter Punkt Type of line @@ -2107,7 +2369,7 @@ Input data - Eingabedaten + Eingangsgrößen Size and height @@ -2115,7 +2377,7 @@ Measurements - Maße + Maße Increments @@ -2127,7 +2389,7 @@ Length of arcs - + Bogenlängen Length of curves @@ -2135,11 +2397,11 @@ Angle of lines - + Winkel einer Linie Hide empty measurements - + Unbestückte Größen ausblenden Variables - Click twice to insert into formula @@ -2147,12 +2409,20 @@ Select first point of line - Ersten Punkt der Linie auswählen + Ersten Punkt der Linie auswählen Select second point of line Zweiten Punkt der Linie auswählen + + Special point on shoulder + Spezieller Punkt an der Schulter + + + Line color + + DialogSinglePoint @@ -2185,7 +2455,7 @@ DialogSpline Curve - Kurve + Kurve First point @@ -2219,12 +2489,20 @@ Select last point of curve Letzten Punkt auf der Kurve auswählen + + Simple curve + + + + Color + + DialogSplinePath Curved path - + Pfad Point of curve @@ -2258,6 +2536,10 @@ Select point of curve path Punkt für den Kurvenpfad auswählen + + Color + + DialogStandardMeasurements @@ -2267,7 +2549,7 @@ Pattern piece name - Schnittteilname + Name des Schnittteils Standard measurements table @@ -2275,7 +2557,7 @@ File error. - + Dateifehler. @@ -2286,15 +2568,15 @@ Empty field - + Leeres Eingabefeld Value can't be 0 - + Wert kann nicht 0 sein Value - + Berechneter Wert Height @@ -2318,6 +2600,10 @@ Parser error: %1 + Auswertungsfehler: %1 + + + Line Angle @@ -2325,7 +2611,7 @@ DialogTriangle Triangle - + Dreieck Point label @@ -2363,35 +2649,51 @@ Select second point Zweiten Punkt wählen + + Triangle tool + + + + First point of the axis + + + + Second point of the axis + + + + Second point of line + Zweiter Punkt der Linie + DialogUndo Broken formula - + Ungültige Formel Error while calculation formula. You can try undo last operation or fix broken formula. - + Fehler beim Berechnen der Formel. Machen sie den letzten Schritt rückgängig oder korrigieren sie die Formel. &Undo - + &Rückgängig &Fix formula - + &Formel korrigieren &Cancel - &Abbrechen + &Abbrechen DialogUnionDetails Union details - Details vereinigen + Details vereinigen <html><head/><body><p>Do you really want union details?</p></body></html> @@ -2413,133 +2715,137 @@ Select detail Detail auswählen + + Union tool + + Functions sin sine function - + sin cos cosine function - + cos tan tangens function - + tan asin arcus sine function - + asin acos arcus cosine function - + acos atan arcus tangens function - + atan sinh hyperbolic sine function - + sinh cosh hyperbolic cosine - + cosh tanh hyperbolic tangens function - + tanh asinh hyperbolic arcus sine function - + asinh acosh hyperbolic arcus tangens function - + acosh atanh hyperbolic arcur tangens function - + atanh log2 logarithm to the base 2 - + log2 log10 logarithm to the base 10 - + log10 log logarithm to the base 10 - + log ln logarithm to base e (2.71828...) - + ln exp e raised to the power of x - + exp sqrt square root of a value - + sqrt sign sign function -1 if x<0; 1 if x>0 - + sign rint round to nearest integer - + rint abs absolute value - + abs min min of all arguments - min + min max max of all arguments - + max sum sum of all arguments - + sum avg mean value of all arguments - + avg @@ -2569,11 +2875,11 @@ Special point on shoulder. - Spezieller Punkt an einer Schulter + Spezieller Punkt an der Schulter. Tool triangle. - Werkzeug Dreieck. + Werkzeug Dreieck. Perpendicular point along line @@ -2581,19 +2887,19 @@ Point along bisector - Punkt auf einer Winkelhalbierenden + Punkt entlang einer Winkelhalbierenden Point at intersection of arc and line. - Schnittpunkt eines Bogens und einer Linie + Schnittpunkt eines Bogens und einer Linie. Tool to make point from x & y of two other points. - Werkzeug zum Erstellen eines Punktes aus den x- und y-Koordinaten zweier anderer Punkte. + Werkzeug zum Erstellen eines Punktes aus den x- und y-Koordinaten zweier anderer Punkte. Point at distance and angle - Punkt in einer Distanz und mit einem Winkel + Punkt mit Abstand und Winkel Point at distance along line @@ -2601,11 +2907,11 @@ Point of intersection line and axis - + Laufender Schnittpunkt auf Linie ... - + ... Tools for creating lines. @@ -2617,7 +2923,7 @@ Line between points - Linie zwischen Punkten + Verbindungslinie zwischen zwei Punkten Point at line intersection @@ -2633,23 +2939,23 @@ Curve tool. - Kurvenverkzeug. + Kurvenverkzeug. Tool for path curve. - Werkzeug zur Definition einer Kurve. + Pfad-Werkzeug. Tool for segmenting a curve. - Werkzeug zur Kurvensegmentierung. + Werkzeug zur Kurvensegmentierung. Tool segment a pathed curve. - Werkzeug zum Segmentieren einer definierten Kurve + Werkzeug zur Pfadsegmentierung. Tools for creating arcs. - Werkzeuge zur Kurvenerzeugung. + Werkzeuge zur Bogenerzeugung. Arc @@ -2657,11 +2963,11 @@ Arc tool. - Bogenwerkzeug. + Bogenwerkzeug. Cut arc tool. - + Kreisbogenwerkzeug. Tools for creating details. @@ -2673,55 +2979,55 @@ Tool new detail. - Werkzeug neues Detail. + Werkzeug neues Detail. Tool for union two details. - + Werkzeug zum zusammenfügen zweier Details. &File - + &Datei &Help - + &Hilfe &Pattern piece - + &Schnittteil Measurements - Maße + Maße Window - + Fenster Toolbar files - + Toolbar Datei ToolBar modes - + Toolbar Modus Toolbar pattern - + ToolbarSchnittmuster Toolbar options - + Toolbar Optionen Toolbar tools - + Toolbar Werkzeuge Tool options - + Werkzeugeinstellungen New @@ -2769,7 +3075,7 @@ Save &As... - + Speichern &unter... Save not yet saved pattern @@ -2821,7 +3127,7 @@ Change the label of pattern piece - Das Label eines Schnittteils ändern + Label des Schnittteils ändern Table of variables @@ -2845,7 +3151,7 @@ Export pattern (layout) - + Schnittmuster-Layout exportieren... Create layout @@ -2857,7 +3163,7 @@ About &Qt - + Über &Qt &About Valentina @@ -2865,11 +3171,11 @@ E&xit - + Valentina &beenden Exit the application - + Programm beenden Ctrl+Q @@ -2877,7 +3183,7 @@ Preferences - + Einstellungen Pattern properties @@ -2885,63 +3191,63 @@ Zoom in - + Vergrößern zoom in - + Vergrößern Zoom out - + Verkleinern Edit pattern XML code - + XML-Darstellung des Schnittmusters bearbeiten Original zoom - + Originialgröße Original Zoom - + Originialgröße Zoom fit best - + In Ansicht einpassen Ctrl+= - + Ctrl+= Stop - Stop + Stop Stop using tool - + Aktives Werkzeug beenden Repot Bug... - + Programmfehler melden... Report bug - + Programmfehler melden Close window - + Fenster schließen Online help - + Onlinehilfe Show online help - + Onlinehilfe anzeigen Pattern piece %1 @@ -2949,12 +3255,12 @@ Individual measurements is under development - + Individuelle Maße befindet sich noch in Entwicklung There is no way create individual measurements file independent on the pattern file. For opening pattern need keep both files: pattern and measurements. Do you want continue? - + Es gibt aktuell noch keine Möglichkeit, individuelle Körpermaße mit in der Schnittmusterdatei abzuspeichern. Um das Schnittmuster später erfolgreich wieder laden zu können muss zusätzlich die Datei mit den individuellen Maßen bereitgehalten werden. Fortfahren? Select point @@ -3008,21 +3314,17 @@ For opening pattern need keep both files: pattern and measurements. Do you want Select first point of axis Ersten Punkt der Achse auswählen - - Select point vertically - - Select detail Detail auswählen Select arc - + Bogen auswählen Select curve - + Kurve auswählen About Qt @@ -3058,7 +3360,7 @@ For opening pattern need keep both files: pattern and measurements. Do you want Could not save file - + Datei konnte nicht gespeichert werden Open file @@ -3082,15 +3384,15 @@ For opening pattern need keep both files: pattern and measurements. Do you want Critical error! - + Schwerwiegender Fehler! Error parsing file (std::bad_alloc). - + Fehler beim Auswerten der Datei (std::bad_alloc). Bad id. - + Ungültige ID. File saved @@ -3112,7 +3414,7 @@ Sollen die Änderungen gespeichert werden? &Undo - + &Rückgängig &Redo @@ -3124,11 +3426,11 @@ Sollen die Änderungen gespeichert werden? Enter a new label for the pattern piece. - Es muss ein neues Label für das Schnittteil eingegeben werden. + Neues Label für das Schnittteil eingeben. This file already opened in another window. - + Diese Datei ist bereits geöffnet. Wrong units. @@ -3136,7 +3438,7 @@ Sollen die Änderungen gespeichert werden? Application doesn't support standard table with inches. - + Die Anwendung unterstützt keine Standard-Maßtabellen mit Größen in Zoll. File error. @@ -3144,31 +3446,107 @@ Sollen die Änderungen gespeichert werden? File loaded - + Datei geladen Valentina didn't shut down correctly. Do you want reopen files (%1) you had open? - + Valentina wurde nicht korrekt beendet. Zuletzt geöffnete Dateien (%1) laden? Reopen files. - + Zuletzt geöffnete Dateien laden? The measurements file <br/><br/> <b>%1</b> <br/><br/> %3 - + Die Maßangaben-Datei <br/><br/> <b>%1</b> <br/><br/> %3 could not be found. Do you want to update the file location - + konnte nicht gefunden werden. Soll der Dateipfad aktualisiert werden? Standard measurements (*.vst) - Standardmaße (*.vst) + Standardmaße (*.vst) Individual measurements (*.vit) - Individuelle Maße (*.vit) + Individuelle Maße (*.vit) + + + Special point on shoulder + Spezieller Punkt an der Schulter + + + Triangle tool + + + + Point at intersection of arc and line + Laufender Schnittpunkt auf Kreisbogen + + + Point from X and Y of two other points + + + + Point intersect line and axis + + + + Simple curve + + + + Curved path + Pfad + + + Segmenting a simple curve + + + + Segment a curved path + + + + Point intersect curve and axis + + + + Segment an arc + + + + Point intersect arc and axis + + + + Seam allowance tool + + + + Union tool + + + + toolBar + Werkzeugleiste + + + Last Tool + + + + Activate last used tool again + + + + L + + + + Select point for X value (vertical) + @@ -3176,7 +3554,7 @@ Sollen die Änderungen gespeichert werden? head_girth Short measurement name. Don't use math symbols in name!!!! - + kopf_umfang mid_neck_girth @@ -3186,7 +3564,7 @@ Sollen die Änderungen gespeichert werden? neck_base_girth Short measurement name. Don't use math symbols in name!!!! - + hals_umfang head_and_neck_length @@ -3231,7 +3609,7 @@ Sollen die Änderungen gespeichert werden? bust_girth Short measurement name. Don't use math symbols in name!!!! - + brust_umfang under_bust_girth @@ -3241,7 +3619,7 @@ Sollen die Änderungen gespeichert werden? waist_girth Short measurement name. Don't use math symbols in name!!!! - + taillen_umfang high_hip_girth @@ -3251,7 +3629,7 @@ Sollen die Änderungen gespeichert werden? hip_girth Short measurement name. Don't use math symbols in name!!!! - + hüft_umfang upper_front_chest_width @@ -3281,7 +3659,7 @@ Sollen die Änderungen gespeichert werden? back_width Short measurement name. Don't use math symbols in name!!!! - + ruecken_breite bustpoint_to_bustpoint @@ -3301,12 +3679,12 @@ Sollen die Änderungen gespeichert werden? crotch_length Short measurement name. Don't use math symbols in name!!!! - + taille_schritt_taille rise_height Short measurement name. Don't use math symbols in name!!!! - + leib_höhe shoulder_drop @@ -3451,12 +3829,12 @@ Sollen die Änderungen gespeichert werden? upper_arm_girth Short measurement name. Don't use math symbols in name!!!! - + oberarm_umfang wrist_girth Short measurement name. Don't use math symbols in name!!!! - + handgelenk_umfang scye_depth @@ -3486,7 +3864,7 @@ Sollen die Änderungen gespeichert werden? arm_length Short measurement name. Don't use math symbols in name!!!! - + arm_länge hand_width @@ -3501,12 +3879,12 @@ Sollen die Änderungen gespeichert werden? hand_girth Short measurement name. Don't use math symbols in name!!!! - + hand_umfang thigh_girth Short measurement name. Don't use math symbols in name!!!! - + oberschenkel_umfang mid_thigh_girth @@ -3516,17 +3894,17 @@ Sollen die Änderungen gespeichert werden? knee_girth Short measurement name. Don't use math symbols in name!!!! - + knie_umfang calf_girth Short measurement name. Don't use math symbols in name!!!! - + waden_umfang ankle_girth Short measurement name. Don't use math symbols in name!!!! - + knöchel_umfang knee_height @@ -3576,7 +3954,7 @@ Sollen die Änderungen gespeichert werden? hip_height Short measurement name. Don't use math symbols in name!!!! - + hüft_höhe waist_to_hip_height @@ -3591,7 +3969,7 @@ Sollen die Änderungen gespeichert werden? crotch_height Short measurement name. Don't use math symbols in name!!!! - + schritt_laenge size @@ -3681,7 +4059,7 @@ Sollen die Änderungen gespeichert werden? front_waist_length Short measurement name. Don't use math symbols in name!!!! - + vordere_taillen_laenge arc_through_shoulder_joint @@ -3854,7 +4232,7 @@ Sollen die Änderungen gespeichert werden? Around Neck at base Full measurement description - + Halsumfang am Halsansatz gemessen Vertical Distance from Crown to Nape @@ -3899,7 +4277,7 @@ Sollen die Änderungen gespeichert werden? Around fullest part of Bust, parallel to floor Full measurement description - + Auch: Oberweite. Um die stärkste Brustpartie gemessen, parallel zum Boden. Around Chest below the Bust, parallel to floor @@ -3919,7 +4297,7 @@ Sollen die Änderungen gespeichert werden? Around Hip, parallel to floor Full measurement description - + Die kräftigste Hüftpartie, parallel zum Boden gemessen Across Front UpperChest, smallest width from armscye to armscye @@ -3949,7 +4327,7 @@ Sollen die Änderungen gespeichert werden? Across Back Chest, from armfold to armfold Full measurement description - + Waagerecht von Armansatz zu Armansatz messen. Wichtig: eine lockere, aufrechte Haltung. Distance between BustPoints, across Chest @@ -3969,12 +4347,12 @@ Sollen die Änderungen gespeichert werden? From Front Waist Center, down to crotch, up to Back Waist Center Full measurement description - + Von vorne ab der unteren Kante des fixierten Taillenbandes bis hinten zur unteren Kante des Taillenbandesge messen. Dabei das Maßband zwischen den Beinen durchführen und eng am Körper messen Sit on hard chair, measure from side waist straight down to chair bottom Full measurement description - + Auf einem harten Untergrund sitzend seitlich von Taille senkrecht abwärts zum Sitzhöcker gemessen. Vertical Distance from NeckPoint level to ShoulderTip level @@ -4119,7 +4497,7 @@ Sollen die Änderungen gespeichert werden? Around UpperArm Full measurement description - + Um die stärkste Partie des Oberarms gemessen. Den stärkeren Arm angeben. Around Wrist @@ -4154,7 +4532,7 @@ Sollen die Änderungen gespeichert werden? ShoulderTip to Wrist, with elbow bent and hand on hip Full measurement description - + Vom Schulteransatz bis zum Handgelenk, Ellenbogen angewinkelt und Hand auf der Hüfte Hand side to side @@ -4174,7 +4552,7 @@ Sollen die Änderungen gespeichert werden? Around Thigh Full measurement description - + Um die kräftigeste Oberschenkelpartie gemessen Around MidThigh @@ -4189,7 +4567,7 @@ Sollen die Änderungen gespeichert werden? Around Calf Full measurement description - + Um die kräftigste Wadenpartie gemessen Around Ankle @@ -4259,7 +4637,7 @@ Sollen die Änderungen gespeichert werden? Crotch to Floor along inside leg Full measurement description - + Vom Schritt innen bis zum Boden gemessen Size @@ -4349,7 +4727,7 @@ Sollen die Änderungen gespeichert werden? The distance from the base of the neck to the waist side front (waist length in the front) Full measurement description - + Gemessen vom seitlichen Halsansatz über die Brustspitze bis zur Unterkante des Taillenbandes Arc through the highest point of the shoulder joint @@ -4512,7 +4890,7 @@ Sollen die Änderungen gespeichert werden? Head girth Full measurement name - + Kopfumfang Mid-neck girth @@ -4567,7 +4945,7 @@ Sollen die Änderungen gespeichert werden? Bust girth Full measurement name - + Brustumfang Under Bust girth @@ -4577,7 +4955,7 @@ Sollen die Änderungen gespeichert werden? Waist girth Full measurement name - + Taillenunfang HighHip girth @@ -4587,7 +4965,7 @@ Sollen die Änderungen gespeichert werden? Hip girth Full measurement name - + Hüftumfang Front Upper Chest width @@ -4617,7 +4995,7 @@ Sollen die Änderungen gespeichert werden? Back Chest width Full measurement name - + Rückenbreite BustPoint to BustPoint @@ -4637,12 +5015,12 @@ Sollen die Änderungen gespeichert werden? Crotch length Full measurement name - + Taille-Schritt-Taille Rise height Full measurement name - + Leibhöhe Shoulder Drop @@ -4787,12 +5165,12 @@ Sollen die Änderungen gespeichert werden? Upperarm Girth Full measurement name - + Oberarmumfang Wrist girth Full measurement name - + Handgelenkumfang Armscye depth @@ -4822,7 +5200,7 @@ Sollen die Änderungen gespeichert werden? Arm length Full measurement name - + Armlänge Hand width @@ -4837,12 +5215,12 @@ Sollen die Änderungen gespeichert werden? Hand girth Full measurement name - + Handumfang Thigh girth Full measurement name - + Oberschenkelumfang Midthigh girth @@ -4852,17 +5230,17 @@ Sollen die Änderungen gespeichert werden? Knee girth Full measurement name - + Knieumfang Calf girth Full measurement name - + Wadenumfang Ankle girth Full measurement name - + Knöchelumfang Knee height @@ -4912,7 +5290,7 @@ Sollen die Änderungen gespeichert werden? Hip height Full measurement name - + Hüfthöhe Waist to Hip height @@ -4927,7 +5305,7 @@ Sollen die Änderungen gespeichert werden? Crotch height/Inseam Full measurement name - + Schrittlänge Size @@ -5017,7 +5395,7 @@ Sollen die Änderungen gespeichert werden? Front waist length Full measurement name - + Vordere Taillenlänge Arc through shoulder joint @@ -5179,64 +5557,72 @@ Sollen die Änderungen gespeichert werden? MoveLabel Move point label - + Punkt-Bezeichner verschieben MoveSPoint Move single point - + Punkt verschieben MoveSpline Move spline - + Kurve bearbeiten MoveSplinePath Move spline path - + Pfad bearbeiten PathPage Open Directory - + Verzeichnis öffnen Path that use Valentina - + Verwendete Verzeichnisse Default - + Standard Edit - + Auswählen... Type - + Typ Path - + Verzeichnis Individual measurements - individuelle Maße + Individuelle Maße Patterns Schnittmuster + + Standard measurements + + + + Layout + + PatternPage @@ -5246,7 +5632,7 @@ Sollen die Änderungen gespeichert werden? User name - Nutzername + Benutzername Graphical output @@ -5254,7 +5640,7 @@ Sollen die Änderungen gespeichert werden? Use antialiasing - + Antialiasing verwenden Undo @@ -5262,7 +5648,7 @@ Sollen die Änderungen gespeichert werden? Count steps (0 - no limit) - + Schritte (0 - unbegrenzt) @@ -5287,7 +5673,7 @@ Sollen die Änderungen gespeichert werden? QCoreApplication Based on Qt %1 (%2, %3 bit) - + Basierend auf Qt %1 (%2, %3 Bit) @@ -5314,16 +5700,20 @@ Sollen die Änderungen gespeichert werden? inch - + Zoll Property The text that appears in the first column header - + Eigenschaft Value The text that appears in the second column header + Wert + + + px @@ -5337,7 +5727,7 @@ Sollen die Änderungen gespeichert werden? Internal error Math parser error messages. - + Interner Fehler Invalid function-, variable- or constant name: "$TOK$". @@ -5367,7 +5757,7 @@ Sollen die Änderungen gespeichert werden? Expression is empty. Math parser error messages. - + Leerer Ausdruck. Invalid pointer to variable. @@ -5417,7 +5807,7 @@ Sollen die Änderungen gespeichert werden? Missing parenthesis Math parser error messages. - + Fehlende Klammer Too many parameters for function "$TOK$" at expression position $POS$ @@ -5432,7 +5822,7 @@ Sollen die Änderungen gespeichert werden? Divide by zero Math parser error messages. - + Division durch Null Domain error @@ -5442,7 +5832,7 @@ Sollen die Änderungen gespeichert werden? Name conflict Math parser error messages. - + Namenskonflikt Invalid value for operator priority (must be greater or equal to zero). @@ -5457,7 +5847,7 @@ Sollen die Änderungen gespeichert werden? Unexpected string token found at position $POS$. Math parser error messages. Left untouched $POS$ - + Unerwartetes String-Segment an Position $POS$ gefunden. Unterminated string starting at position $POS$. @@ -5547,7 +5937,7 @@ Sollen die Änderungen gespeichert werden? toolBar - toolBar + Werkzeugleiste Save @@ -5559,19 +5949,19 @@ Sollen die Änderungen gespeichert werden? Next - Weiter + Weiter Next detail - Nächstes Detail + Nächstes Detail Turn - Drehen + Drehen Turn the detail 90 degrees - Detail um 90° drehen + Detail um 90° drehen Stop @@ -5583,23 +5973,23 @@ Sollen die Änderungen gespeichert werden? Enlarge letter - Buchstaben vergrößern + Buchstaben vergrößern Enlarge the length of the sheet - Länge des Blattes verlängern + Länge des Blattes verlängern Reduce sheet - Seite verkleinern + Seite verkleinern Reduce the length of the sheet - Die Länge der Seite verkleinern + Die Länge der Seite verkleinern Mirroring - Spiegeln + Spiegeln Zoom In @@ -5611,54 +6001,62 @@ Sollen die Änderungen gespeichert werden? 0 details left. - 0 Details übrig. + 0 Details übrig. Collisions not found. - Kollisionen nicht gefunden. + Kollisionen nicht gefunden. %1 details left. - %1 Details übrig. + %1 Details übrig. untitled - + unbenannt Svg files (*.svg) - + Svg Dateien (*.svg) PDF files (*.pdf) - + PDF Dateien (*.pdf) Images (*.png) - + Bilddateien (*.png) PS files (*.ps) - + PS-Dateien (*.ps) EPS files (*.eps) - + EPS Dateien (*.eps) Collisions found. - Kollisionen gefunden. + Kollisionen gefunden. Creating file '%1' failed! %2 - + Fehler beim anlegen von Datei '%1'! "%2' Critical error! - + Schwerwiegender Fehler! Wavefront OBJ (*.obj) + Wavefront OBJ (*.obj) + + + Layout pages + + + + Layout @@ -5666,49 +6064,77 @@ Sollen die Änderungen gespeichert werden? VAbstractConverter Error creation backup file: %1. - + Konnte Sicherungsdatei nicht anlegen: %1. Couldn't get version information. - + Versionsinformation konnte nicht gelesen werden. Too many tags <%1> in file. - + Zu viele Tags <%1> in der Datei. Version "%1" invalid. - + Versionsnummer "%1" ist ungültig. Version "0.0.0" invalid. - + Versionsnummer 0.0.0 ist ungültig. Invalid version. Minimum supported version is %1 - + Ungültige Version. Mindestens Version %1 erforderlich Invalid version. Maximum supported version is %1 - + Ungültige Version. Höchstens Version %1 unterztützt Error no unique id. - + Fehler: mehrdeutige ID. Could not change version. - + Konnte Versionsnummer nicht ändern. VAbstractTool Confirm the deletion. - + Löschen bestätigen. Do you really want delete? + Wirklich löschen? + + + black + + + + green + + + + blue + + + + dark red + + + + dark green + + + + dark blue + + + + yellow @@ -5736,7 +6162,7 @@ Sollen die Änderungen gespeichert werden? Something's wrong!! - + Etwas ist schiefgegangen! @@ -5747,22 +6173,22 @@ Sollen die Änderungen gespeichert werden? Can't cast object - + Objekt kann nicht gelesen werden Can't find object. Type mismatch. - + Objekt kann nicht gefunden werden. Falscher Typ. VDomDocument Can't convert toUInt parameter - + Konnte nicht in Parameter vom Typ 'Integer' umwandeln Can't convert toBool parameter - + Konnte nicht in Parameter vom Typ 'Boolean' umwandeln Got empty parameter @@ -5775,51 +6201,52 @@ Sollen die Änderungen gespeichert werden? Can't open file %1: %2. - + Konnte Datei %1 nicht öffnen: %2. Can't open schema file %1: %2. - + Konnte Schema-Datei %1 nicht öffnen: +%2. Could not load schema file. - + Konnte Schema-Datei nicht öffnen. Validation error file %3 in line %1 column %2 - + Fehler bei der Gültigkeitsprüfung in Datei %3, Zeile %1, Spalte %2 Parsing error file %3 in line %1 column %2 - + Auswertungsfehler in Datei %3, Zeile %1, Spalte %2 Couldn't get node - + Konnte Knoten nicht lesen Got wrong parameter id. Need only id > 0. - + Falsche Parameter-ID. Wert > 0 erforderlich. This id is not unique. - + Diese ID ist nicht eindeutig. Could not copy temp file to document file - + Konnte temporäre Datei nicht umkopieren Could not remove document file - + Konnte Dokument nicht entfernen VDrawTool Edit wrong formula - + Formel korrigieren Options @@ -5834,25 +6261,25 @@ Sollen die Änderungen gespeichert werden? VException Critical error! - + Schwerwiegender Fehler! VFormula Error - Fehler + Fehler VFormulaProperty Value - + Wert Formula - + Formel @@ -5870,165 +6297,165 @@ Sollen die Änderungen gespeichert werden? VPE::VFileEditWidget Directory - + Verzeichnis Open File - + Datei öffnen VPattern Can't find tool in table. - + Konnte Werkzeug nicht in der List finden. Error no unique id. - + Fehler: uneindeutige ID. Error parsing file. - Fehler beim Parsen der Datei. + Fehler beim Auswerten der Datei. Error can't convert value. - Fehler Wert kann nicht konvertiert werden. + Fehler: Wert kann nicht konvertiert werden. Error empty parameter. - Fehler leerer parameter. + Fehler: leerer Parameter. Error wrong id. - Fehler falsche Id. + Fehler: falsche ID. Critical error! - + Schwerwiegender Fehler! Error parsing file (std::bad_alloc). - + Fehler beim Auswerten der Datei (std::bad_alloc). Error creating or updating detail - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Detail" Error creating or updating single point - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Punkt" Error creating or updating point of end line - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Punkt mit Abstand und Winkel" Error creating or updating point along line - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Punkt auf einer Linie" Error creating or updating point of shoulder - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Spezieller Punkt an der Schulter" Error creating or updating point of normal - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Punkt auf einer Senkrechten" Error creating or updating point of bisector - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Winkelhalbierende" Error creating or updating point of lineintersection - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Schnittpunkt zweier Linien" Error creating or updating point of contact - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Schmittpukt Kreis und Gerade" Error creating or updating modeling point - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Punkt" Error creating or updating height - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Lotfußpunkt" Error creating or updating triangle - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Dreieck" Error creating or updating point of intersection - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Laufender Schnittpunkt" Error creating or updating cut spline point - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Kurvensegment" Error creating or updating cut spline path point - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Pfadsegment" Error creating or updating cut arc point - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Kreisbogen" Error creating or updating point of intersection line and axis - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Laufender Schnittpunkt auf Linie" Error creating or updating point of intersection curve and axis - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Laufender Schnittpunkt auf Kurve" Error creating or updating line - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Linie" Error creating or updating simple curve - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Kurve" Error creating or updating curve path - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Pfad" Error creating or updating modeling simple curve - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Kurve Detail" Error creating or updating modeling curve path - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Pfad Detail" Error creating or updating simple arc - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Bogen" Error creating or updating modeling arc - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Bogen Detail" Error creating or updating union details - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Details vereinigen" File error. - + Dateifehler. VPatternConverter Unexpected version "%1". - + Unerwartete Version "%1". Error restoring backup file: %1. - + Fehler beim wiederherstellen aus Backupdatei %1. @@ -6072,118 +6499,130 @@ Sollen die Änderungen gespeichert werden? VToolOptionsPropertyBrowser Base point - Startpunkt + Ausgangspunkt Point label - Bezeichnung des Punktes + Bezeichnung des Punktes Position - + Koordinaten Point at distance and angle - Punkt in einer Distanz und mit einem Winkel + Punkt mit Abstand und Winkel Line type - + Linientyp Length - Länge + Länge Angle - + Winkel Point at distance along line - Punkt in einer Distanz auf einer Linie + Punkt auf einer Linie Arc - Bogen + Bogen Radius - Radius + Radius First angle - + Erster Winkel Second angle - + Zweiter Winkel Point along bisector - Punkt auf einer Winkelhalbierenden + Punkt entlang einer Winkelhalbierenden Cut arc tool - + Kreisbogen-Werkzeug Tool for segmenting a curve - + Werkzeug Kurvensegment Tool segment a pathed curve - + Werkzeug Pfadsegment Perpendicular point along line - Lotfußpunkt auf einer Linie + Loftfußpunkt auf einer Linie Line between points - Linie zwischen Punkten + Verbindungslinie zwischen zwei Punkten Point at line intersection - Linienschnittpunkt + Schnittpunkt zweier Linien Point along perpendicular - Punkt auf einer Normalen + Punkt auf einer Normalen Additional angle degrees - Zusätzlicher Winkel + Zusätzlicher Winkel Point at intersection of arc and line - + Laufender Schnittpunkt auf Kreisbogen Tool to make point from x & y of two other points - + Punkt aus Koordinaten Special point on shoulder - + Spezieller Punkt an der Schulter Curve tool - + Kurven-Werkzeug Curve factor - + Koeffizient für die Krümmung der Kurve Tool for path curve - + Pfadwerkzeug Tool triangle - + Dreieck-Werkzeug Point intersection line and axis + Laufender Schnittpunkt auf Linie + + + Line color + + + + Color + + + + Point intersection curve and axis @@ -6219,43 +6658,43 @@ Sollen die Änderungen gespeichert werden? VisToolCurveIntersectAxis <b>Intersection curve and axis</b>: angle = %1°; <b>Shift</b> - sticking angle, <b>Enter</b> - finish creation - + <b>Laufender Schnittpunkt auf Kurve</b>: Winkel = %1°; <b>Shift</b> - Winkel einrasten, <b>Enter</b> - fertigstellen VisToolEndLine <b>Point at distance and angle</b>: angle = %1°; <b>Shift</b> - sticking angle, <b>Enter</b> - finish creation - + <b>Punkt mit Abstand und Winkel</b>: Winkel = %1°; <b>Shift</b> - Winkel einrasten, <b>Enter</b> - fertigstellen VisToolLineIntersectAxis <b>Intersection line and axis</b>: angle = %1°; <b>Shift</b> - sticking angle, <b>Enter</b> - finish creation - + <b>Laufender Schnittpunkt auf Linie</b>: Winkel = %1°; <b>Shift</b> - Winkel einrasten, <b>Enter</b> - fertigstellen VisToolSplinePath <b>Curved path</b>: select three or more points - + <b>Pfad</b>: drei oder mehr Punket auswählen <b>Curved path</b>: select three or more points, <b>Enter</b> - finish creation - + <b>Pfad</b>: drei oder mehr Punket auswählen, <b>Enter</b> - fertigstellen main Pattern making program. - Programm zum Schnittmuster erstellen. + Programm zur Schnittmusterkonstruktion. Pattern file. - Schnittmusterdatei + Schnittmusterdatei. diff --git a/share/translations/valentina_es_ES.ts b/share/translations/valentina_es_ES.ts new file mode 100644 index 000000000..20ba7a1cb --- /dev/null +++ b/share/translations/valentina_es_ES.ts @@ -0,0 +1,6639 @@ + + + + + AddDet + + Add detail + Añadir detalle + + + + AddPatternPiece + + Add pattern piece %1 + Añadir pieza de patrón %1 + + + + AddToCalc + + Add object + Añadir objeto + + + + AddUnionDetails + + Add union details + Añadir detalle de unión + + + + CommunityPage + + Server + Servidor + + + Server name/IP + Nombre del servidor/IP + + + Secure connection + Conexión segura + + + Proxy settings + Configuración del proxy + + + Use Proxy + Usar Proxy + + + Proxy address + Dirección del Proxy + + + Proxy port + Puerto del Proxy + + + Proxy user + Usuario del Proxy + + + Proxy pass + Contraseña del Proxy + + + User settings + Configuración del usuario + + + User Name + Nombre del usuario + + + Save password + Guardar contraseña + + + Password + Contraseña + + + + ConfigDialog + + Apply + Aplicar + + + &Cancel + &Cancelar + + + &Ok + &Ok + + + Config Dialog + Preferencias + + + Configuration + Configuración + + + Pattern + Patrón + + + Community + Comunidad + + + Paths + Carpetas + + + + ConfigurationPage + + Setup user interface language updated and will be used the next time start + El lenguaje del interfaz se actualizara la próxima vez que inicie el programa + + + Default unit updated and will be used the next pattern creation + Las unidades por defecto se actualizaran cuando cree el próximo patrón + + + Save + Guardar + + + Auto-save modified pattern + Auto guardado en patrón modificado + + + min + min + + + Interval: + Intervalo + + + Language + Idioma + + + GUI language + Idioma de interfaz gráfica de usuario + + + Decimal separator parts + Partes separador decimal + + + With OS options (%1) + Con las opciones del SO (%1) + + + Default unit + Unidades por defecto + + + Centimeters + Centímetros + + + Millimiters + Milímetros + + + Inches + pulgadas + + + Label language + Idioma de Etiquetas + + + Send crash reports + Enviar informe de errores + + + Send crash reports (recommended) + Enviar informe de errores (recomendado) + + + After each crash Valentina collect information that may help us fix a problem. We do not collect any personal information. Find more about what <a href="https://bitbucket.org/dismine/valentina/wiki/manual/Crash_reports">kind of information</a> we collect. + + + + + DelTool + + Delete tool + Herramienta borrar + + + + DeleteDetail + + Delete tool + Herramienta borrar + + + + DeletePatternPiece + + Delete pattern piece %1 + Borrar pieza de patrón %1 + + + + DialogAboutApp + + About Valentina + Sobre Valentina + + + Valentina version + Versión de Valentina + + + Contributors + Colaboradores + + + Built on %3 at %4 + + + + Web site : %1 + Sitio web: %1 + + + Warning + Atención + + + Cannot open your default browser + No se puede abrir su navegador por defecto + + + Build revision: + + + + + DialogAlongLine + + Length + Longitud + + + Insert variable into the formula + Insertar variable en la fórmula + + + Calculate value + Calcular valor + + + Value of length + Valor de la longitud + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + <html><head/><body><p>Mostrar cálculo total en una caja de mensajes</p></body></html> + + + Point label + Etiqueta de punto + + + First point + Primer punto + + + First point of line + Primer punto de línea + + + Second point + Segundo punto + + + Second point of line + Segundo punto de línea + + + Type of line + Tipo de línea + + + Show line from first point to this point + Mostrar línea desde primer punto a este punto + + + Input data + Introducir datos + + + Size and height + Alto y ancho + + + Measurements + Medidas + + + Increments + Incrementos + + + Length of lines + Longitud de las líneas + + + Length of arcs + Longitud del arco + + + Length of curves + Longitud de las curvas + + + Angle of lines + Ángulo de las líneas + + + Hide empty measurements + Ocultar medidas vacías + + + Variables - Click twice to insert into formula + Variables - Haga clic dos veces para insertar en la fórmula + + + Select second point of line + Selección segundo punto de línea + + + Point at distance along line + + + + Line color + + + + + DialogArc + + Arc + Arco + + + Radius + Radios + + + Insert variable into the formula + Insertar variable en la fórmula + + + Calculate value + Calcular valor + + + Value of radius + Valor de los radios + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + <html><head/><body><p>Mostrar cálculo total en una caja de mensajes</p></body></html> + + + First angle + Primer ángulo + + + Insert variable into formula + Introducir variable en la fórmula + + + Value of first angle + Valor del primer ángulo + + + Second angle + Segundo ángulo + + + Insert marked variable into formula + Insertar variable marcada en la fórmula + + + Value of second angle + Valor del segundo ángulo + + + Center point + Punto central + + + Select point of center of arc + Seleccionar punto del centro del arco + + + Input data + Introducir datos + + + Size and height + Alto y ancho + + + Measurements + Medidas + + + Increments + Incrementos + + + Length of lines + Longitud de las líneas + + + Length of arcs + Longitud de los arcos + + + Length of curves + Longitud de las curvas + + + Angle of lines + Ángulo de las líneas + + + Hide empty measurements + Ocultar medidas vacías + + + Variables + Variables + + + Value of angle of line. + Valor del ángulo de la línea + + + Error + Error + + + Radius can't be negative + Radio no puede ser negativo + + + Angles equal + Ángulos iguales + + + Color + + + + + DialogBisector + + Bisector + Bisectriz + + + Length + Longitud + + + Insert marked variable into the formula + Insertar variable marcada en la fórmula + + + Calculate value + Calcular valor + + + Value of length + Valor de la longitud + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + <html><head/><body><p>Mostrar cálculo total en una caja de mensajes</p></body></html> + + + Point label + Etiqueta de punto + + + First point + Primer punto + + + First point of angle + Primer punto del ángulo + + + Second point + Segundo punto + + + Second point of angle + Segundo punto del ángulo + + + Third point + Tercer punto + + + Third point of angle + Tercer punto del ángulo + + + Type of line + Tipo de línea + + + Show line from second point to this point + Mostrar línea desde segundo punto hasta este punto + + + Input data + Introducir datos + + + Size and height + Alto y ancho + + + Measurements + Medidas + + + Increments + Incrementos + + + Length of lines + Longitud de las líneas + + + Length of arcs + Longitud de los arcos + + + Length of curves + Longitud de las curvas + + + Angle of lines + Ángulos de las líneas + + + Hide empty measurements + Ocultar medidas vacías + + + Variables - Click twice to insert into formula + Variables - Doble click para insertar en la fórmula + + + Select second point of angle + Selección segundo punto de ángulo + + + Select third point of angle + Selección tercer punto de ángulo + + + Point along bisector + + + + Line color + + + + + DialogCurveIntersectAxis + + Curve intersect axis + Cruzar curva con eje + + + Angle + Ángulo + + + Calculate value + Calcular valor + + + Value of angle + Valor del ángulo + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + <html><head/><body><p>Mostrar cálculo total en una caja de mensajes</p></body></html> + + + Axis point + Punto del eje + + + First point of line + Primer punto de línea + + + Curve + Curva + + + Point label + Etiqueta de punto + + + Type of line + Tipo de línea + + + Show line from first point to this point + Mostrar línea desde el primer punto hasta este punto + + + Input data + Introducir datos + + + Size and height + Alto y ancho + + + Measurements + Medidas + + + Increments + Incrementos + + + Length of lines + Longitud de las líneas + + + Length of arcs + Longitud de los arcos + + + Length of curves + Longitud de las curvas + + + Angle of lines + Ángulo de las líneas + + + Hide empty measurements + Ocultar medidas vacías + + + Variables + Variables + + + Select axis point + Selección punto del eje + + + Point intersect curve and axis + + + + Axis Point + + + + Line color + + + + + DialogCutArc + + Cut arc + Cortar arco + + + Length + Longitud + + + Calculate value + Calcular valor + + + Value of length + Valor de la longitud + + + _ + _ + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + <html><head/><body><p>Mostrar cálculo total en una caja de mensajes</p></body></html> + + + Arc + Arco + + + Selected curve + Curva seleccionada + + + Point label + Etiqueta de punto + + + Input data + Introducir datos + + + Size and height + Alto y ancho + + + Measurements + Medidas + + + Increments + Incrementos + + + Length of lines + Longitud de las líneas + + + Length of arcs + Longitud de los arcos + + + Length of curves + Longitud de las curvas + + + Angle of lines + Ángulo de las líneas + + + Hide empty measurements + Ocultar medidas vacías + + + Variables - Click twice to insert into formula + Variables - Doble click para insertar en la fórmula + + + Segment an arc + + + + Selected arc + + + + Color + + + + + DialogCutSpline + + Cut curve + Cortar curva + + + Length + Longitud + + + Calculate value + Calcular valor + + + Value of length + Valor de la longitud + + + _ + _ + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + <html><head/><body><p>Mostrar cálculo total en una caja de mensajes</p></body></html> + + + Curve + Curva + + + Selected curve + Curva seleccionada + + + Point label + Etiqueta de punto + + + Input data + Introducir datos + + + Size and height + Alto y ancho + + + Measurements + Medidas + + + Increments + Incrementos + + + Length of lines + Longitud de las líneas + + + Length of arcs + Longitud del arco + + + Length of curves + Longitud de las curvas + + + Angle of lines + Ángulo de las líneas + + + Hide empty measurements + Ocultar medidas vacías + + + Variables - Click twice to insert into formula + Variables - Doble click para insertar en la fórmula + + + Segmenting a simple curve + + + + Color + + + + + DialogCutSplinePath + + Cut curve path + Cortar trazado curvo + + + Length + Longitud + + + Calculate value + Calcular valor + + + Value of length + Valor de la longitud + + + _ + _ + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + <html><head/><body><p>Mostrar cálculo total en una caja de mensajes</p></body></html> + + + Curve + Curva + + + Selected curve path + Trazado curvo seleccionado + + + Point label + Etiqueta de punto + + + Input data + Introducir datos + + + Size and height + Alto y ancho + + + Measurements + Medidas + + + Increments + Incrementos + + + Length of lines + Longitud de las líneas + + + Length of arcs + Longitud del arco + + + Length of curves + Longitud de las curvas + + + Angle of lines + Ángulo de las líneas + + + Hide empty measurements + Ocultar medidas vacías + + + Variables - Click twice to insert into formula + Variables - Doble click para insertar en la fórmula + + + Segment a curved path + + + + Color + + + + + DialogDetail + + Detail + Detalle + + + Bias X + + + + cm + cm + + + Bias Y + + + + Options + Opciones + + + Name of detail + Nombre del detalle + + + Seam allowance + + + + Width + Ancho + + + Closed + Cerrado + + + Delete + Borrar + + + Got wrong scene object. Ignore. + + + + Reverse + Revés + + + Seam allowance tool + + + + + DialogEditWrongFormula + + Edit formula + Editar fórmula + + + Formula + Fórmula + + + Insert variable into formula + Introducir variable en la fórmula + + + Calculate value + Calcular valor + + + Value of first angle + Valor del primer ángulo + + + _ + _ + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + <html><head/><body><p>Mostrar cálculo total en una caja de mensajes</p></body></html> + + + Input data + Introducir datos + + + Size and height + Alto y ancho + + + Measurements + Medidas + + + Increments + Incrementos + + + Length of lines + Longitud de las líneas + + + Length of arcs + Longitud del arco + + + Length of curves + Longitud de las curvas + + + Angle of lines + Ángulo de las líneas + + + Hide empty measurements + Ocultar medidas vacías + + + Variables + Variables + + + + DialogEndLine + + Point in the end of a line + Punto en el final de una línea + + + Length + Longitud + + + Calculate value + Calcular valor + + + Value of length + Valor de la longitud + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + <html><head/><body><p>Mostrar cálculo total en una caja de mensajes</p></body></html> + + + Angle + Ángulo + + + Value of angle + Valor del ángulo + + + Base point + Punto base + + + First point of line + Primer punto de línea + + + Point label + Etiqueta de punto + + + Type of line + Tipo de línea + + + Show line from first point to this point + Mostrar línea desde primer punto hasta este punto + + + Input data + Introducir datos + + + Size and height + Alto y ancho + + + Measurements + Medidas + + + Increments + Incrementos + + + Length of lines + Longitud de las líneas + + + Length of arcs + Longitud del arco + + + Length of curves + Longitud de las curvas + + + Angle of lines + Ángulo de las líneas + + + Hide empty measurements + Ocultar medidas vacías + + + Variables + Variables + + + Point at distance and angle + + + + Line color + + + + + DialogHeight + + Height + Altura + + + Point label + Etiqueta de punto + + + Base point + Punto base + + + First point of line + Primer punto de línea + + + Second point of line + Segundo punto de línea + + + Type of line + Tipo de línea + + + Show line from first point to our point + + + + Select first point of line + Selección primer punto de línea + + + Select second point of line + Selección segundo punto de línea + + + Perpendicular point along line + + + + Base Point + + + + Line color + + + + + DialogHistory + + History + Historia + + + Tool + Herramienta + + + Can't create record. + + + + %1 - Base point + %1 - Punto base + + + %1_%2 - Line from point %1 to point %2 + %1_%2 - Línea desde punto %1 hasta punto %2 + + + %3 - Point along line %1_%2 + + + + %1 - Point of shoulder + + + + %3 - normal to line %1_%2 + + + + %4 - bisector of angle %1_%2_%3 + + + + %5 - intersection of lines %1_%2 and %3_%4 + %5 - intersección de líneas %1_%2 y %3_%4 + + + Curve %1_%2 + Curva %1_%2 + + + Arc with center in point %1 + + + + Curve point %1 + + + + %4 - point of contact of arc with the center in point %1 and line %2_%3 + + + + Point of perpendicular from point %1 to line %2_%3 + + + + Triangle: axis %1_%2, points %3 and %4 + + + + %1 - point of intersection %2 and %3 + %1 - punto de intersección %2 y %3 + + + %1 - cut arc with center %2 + + + + %1 - cut curve %2_%3 + + + + %1 - cut curve path %2 + + + + %1 - point of intersection line %2_%3 and axis through point %4 + + + + %1 - point of intersection curve and axis through point %2 + + + + + DialogIncrements + + Increments + Incrementos + + + Measurements + Medidas + + + Load another measurements table + Cargar otra tabla de medidas + + + Personal information + Información personal + + + Given name + Nombre + + + Family name + Apellidos + + + Birth date + Fecha de nacimiento + + + Sex + Sexo + + + Email + Correo electrónico + + + Hide empty measurements + Ocultar medidas vacías + + + Name + Nombre + + + The calculated value + El valor calculado + + + Base value + Valor base + + + In sizes + En tamaños + + + In heights + En alturas + + + Description + Descripción + + + Lines + Líneas + + + Line + Línea + + + Length + Longitud + + + Curves + Curvas + + + Curve + Curva + + + Arcs + Arcos + + + Arc + Arco + + + File error. + Error en archivo + + + male + hombre + + + female + mujer + + + Could not save GivenName + No se pudo guardar Nombre + + + Could not save FamilyName + No se pudo guardar Apellidos + + + Could not save Email + No se pudo guardar correo electrónico + + + Could not save Sex + No se pudo guardar Sexo + + + Could not save BirthDate + No se pudo guardar fecha de nacimiento + + + Measurements use different units than pattern. This pattern required measurements in %1 + + + + Individual measurements (*.vit) + Medidas individuales (*.vit) + + + Open file + Abrir archivo + + + Wrong units. + Unidades erróneas. + + + Standard measurements (*.vst) + Medidas estándar (*.vst) + + + Name_%1 + Nombre_%1 + + + Can't save measurement + No se pudo guardar medidas + + + Tables of Variables + + + + Base size: %1 %3; Base height: %2 %3 + + + + Description: "%1" + + + + Data successfully saved. + + + + + DialogIndividualMeasurements + + Individual measurements + Medidas individuales + + + Pattern piece name + Nombre de la pieza del patrón + + + Exist measurements + Medidas existentes + + + Path: + Ruta: + + + Given name: + Nombre: + + + Family name: + Apellidos: + + + New measurements + Nuevas medidas + + + Units: + Unidades: + + + Could not create measurements file + No se pudo crear el archivo de medidas + + + Please try again or change file + Por favor, inténtelo de nuevo o cambie el archivo + + + File error. + Error en archivo. + + + Individual measurements (*.vit) + Medidas individuales (*.vit) + + + Open file + Abrir archivo + + + Where save measurements? + Donde desea guardar las medidas? + + + Centimeters + Centímetros + + + Millimiters + Milímetros + + + Inches + Pulgadas + + + + DialogLayoutProgress + + Creation a layout + + + + <html><head/><body><p>Finding best position for worpieces. Please, waite.</p></body></html> + + + + Couldn't prepare data for creation layout + + + + Critical error + + + + Wrong paper size + + + + Several workpieces left not arranged, but none of them match for paper + + + + + DialogLayoutSettings + + Creation a layout + + + + Paper size + + + + Templates: + + + + Width: + + + + Height: + + + + ... + ... + + + Rotate workpiece + + + + Rotate by + + + + degree + + + + Creation options + + + + Layout width: + + + + Shift length: + + + + Principle of choosing the next workpiece + + + + Three groups: big, middle, small + + + + Two groups: big, small + + + + Descending area + + + + Millimiters + Milímetros + + + Centimeters + Centímetros + + + Inches + + + + Pixels + + + + + DialogLine + + Line + Línea + + + First point + Primer punto + + + Second point + Segundo punto + + + Type of line + Tipo de línea + + + Show line from first point to this point + Mostrar línea desde primer punto hasta este punto + + + Select second point + Selección segundo punto de línea + + + Line between points + + + + Line color + + + + + DialogLineIntersect + + Intersection of lines + Intersección de líneas + + + Point label + Etiqueta de punto + + + First line + Primera línea + + + First point + Primer punto + + + Second point + Segundo punto + + + Second line + Segunda línea + + + Select second point of first line + Selección segundo punto de la primera línea + + + Select first point of second line + Selección primer punto de la segunda línea + + + Select second point of second line + Selección segundo punto de la segunda línea + + + Point at line intersection + + + + + DialogLineIntersectAxis + + Line intersect axis + Línea de intersección del eje + + + Angle + Ángulo + + + Calculate value + Calcular valor + + + Value of angle + Valor del ángulo + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + <html><head/><body><p>Mostrar cálculo total en una caja de mensajes</p></body></html> + + + Axis point + Punto del eje + + + First point of line + Primer punto de línea + + + First line point + Primer punto de línea + + + Second line point + Segundo punto de línea + + + Point label + Etiqueta de punto + + + Type of line + Tipo de línea + + + Show line from first point to this point + Mostrar línea desde primer punto hasta este punto + + + Input data + Introducir datos + + + Size and height + Alto y ancho + + + Measurements + Medidas + + + Increments + Incrementos + + + Length of lines + Longitud de las líneas + + + Length of arcs + Longitud de los arcos + + + Length of curves + Longitud de las curvas + + + Angle of lines + Ángulo de las líneas + + + Hide empty measurements + Ocultar medidas vacías + + + Variables + Variables + + + Select second point of line + Selección segundo punto de línea + + + Select axis point + Selección punto del eje + + + Point intersect line and axis + + + + Axis Point + + + + Second point of line + Segundo punto de línea + + + Line color + + + + + DialogMeasurements + + Measurements + Medidas + + + <html><head/><body><p><span style=" font-size:18pt;">Please, choose pattern type.</span></p></body></html> + <html><head/><body><p><span style=" font-size:18pt;">Por favor, escoja el tipo de patrón.</span></p></body></html> + + + Graduation + Graduación + + + Use for creation pattern standard measurement table + Usar para la creación de patrón estándar la tabla de medidas + + + Individual + Individual + + + Use for creation pattern individual measurements + Usar para la creación de patrón medidas individuales + + + + DialogNormal + + Normal + Normal + + + Length + Longitud + + + Insert variable into formula + Introducir variable en la fórmula + + + Calculate value + Calcular valor + + + Value of length + Valor de la longitud + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + <html><head/><body><p>Mostrar cálculo total en una caja de mensajes</p></body></html> + + + Point label + Etiqueta de patrón + + + First point + Primer punto + + + Second point + Segundo punto + + + Additional angle degrees + Grados adicionales de ángulo + + + Type of line + Tipo de línea + + + Show line from first point to this point + Mostrar línea desde primer punto hasta este punto + + + Input data + Introducir datos + + + Size and height + Alto y ancho + + + Measurements + Medidas + + + Increments + Incrementos + + + Length of lines + Longitud de las líneas + + + Length of arcs + Longitud de los arcos + + + Length of curves + Longitud de las curvas + + + Angle of lines + Ángulo de las líneas + + + Hide empty measurements + Ocultar medidas vacías + + + Variables - Click twice to insert into formula + Variables - Doble click para insertar en la fórmula + + + Select second point of line + Selección segundo punto de línea + + + Point along perpendicular + + + + First point of line + + + + Second point of line + Segundo punto de línea + + + Line color + + + + + DialogPatternProperties + + Pattern properties + Propiedades de patrón + + + Description + Descripción + + + Author name + Nombre del autor + + + Pattern description + Descripción del patrón + + + For technical notes. + Para notas técnicas. + + + Heights and Sizes + Alturas y tamaños + + + All heights (cm) + Todas las alturas (cm) + + + All sizes (cm) + Todos los tamaños (cm) + + + + DialogPatternXmlEdit + + XML Editor + Editor XML + + + Value : + Valor: + + + Name : + Nombre: + + + <No selection> + <Sin selección> + + + Type : + Tipo : + + + Add attribute + Añadir atributo + + + Add son + Añadir hijo + + + Remove attribute + Quitar atributo + + + Remove node + Quitar nodo + + + Set + + + + Cancel + Cancelar + + + Apply changes + Aplicar cambios + + + Undo last + Deshacer último + + + Immediate apply + Aplicar inmediatamente + + + Base selection + Selección de la base + + + All pattern pieces + Todas las piezas del patrón + + + No changes + Sin cambios + + + Cannot delete previously created node + No se puede borrar el nodo previamente creado + + + No changes left + Sin cambios + + + Cannot undo change + No se pueden deshacer los cambios + + + <no value> + <sin valor> + + + Unchanged + Sin cambios + + + Cannot delete previously created attribute + No se puede borrar atributo creado previamente + + + Node Name + Nombre del nodo + + + Name: + Nombre: + + + Node Value (may be empty) + Valor del Nodo (no puede estar vacío) + + + Value: + Valor: + + + Attribute Name + Nombre de atributo + + + Attribute Value + Valor de atributo + + + No selection + Sin selección + + + Root node + Nodo raíz + + + Node + Nodo + + + Attribute + Atributo + + + + DialogPointOfContact + + Point of contact + Punto de contacto + + + Radius + Radios + + + Insert variable into formula + Introducir variable en la fórmula + + + Calculate value + Calcular valor + + + Value of radius + Valor del radio + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + <html><head/><body><p>Mostrar cálculo total en una caja de mensajes</p></body></html> + + + Point label + Etiqueta de punto + + + Center of arc + Centro del arco + + + Select point of center of arc + Seleccionar punto del centro del arco + + + Top of the line + Principio de la línea + + + End of the line + Final de la línea + + + Input data + Introducir datos + + + Size and height + Alto y ancho + + + Measurements + Medidas + + + Increments + Incrementos + + + Length of lines + Longitud de las líneas + + + Length of arcs + Longitud de los arcos + + + Length of curves + Longitud de las curvas + + + Angle of lines + Ángulo de las líneas + + + Hide empty measurements + Ocultar medidas vacías + + + Variables - Click twice to insert into formula. + Variables - Doble click para insertar en la fórmula + + + Select second point of line + Selección segundo punto de línea + + + Point at intersection of arc and line + + + + + DialogPointOfIntersection + + Point of intersection + Punto de intersección + + + Point label + Etiqueta de punto + + + vertical point + punto vertical + + + First point of angle + Primer punto del ángulo + + + horizontal point + punto horizontal + + + Second point of angle + Segundo punto del ángulo + + + Select point horizontally + Selecciona punto horizontal + + + Point from X and Y of two other points + + + + X: vertical point + + + + Y: horizontal point + + + + Select point for Y value (horizontal) + + + + + DialogShoulderPoint + + Length + Longitud + + + Insert variable into formula + Introducir variable en la fórmula + + + Calculate value + Calcular valor + + + Value of length + Valor de la longitud + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + <html><head/><body><p>Mostrar cálculo total en una caja de mensajes</p></body></html> + + + Point label + Etiqueta de punto + + + First point + Primer punto + + + Second point + Segundo punto + + + Third point + Tercer punto + + + Type of line + Tipo de línea + + + Show line from first point to our point + + + + Input data + Introducir datos + + + Size and height + Alto y ancho + + + Measurements + Medidas + + + Increments + Incrementos + + + Length of lines + Longitud de las líneas + + + Length of arcs + Longitud de los arcos + + + Length of curves + Longitud de las curvas + + + Angle of lines + Ángulo de las líneas + + + Hide empty measurements + Ocultar medidas vacías + + + Variables - Click twice to insert into formula + Variables - Doble click para insertar en la fórmula + + + Select first point of line + Selección primer punto de línea + + + Select second point of line + Selección segundo punto de línea + + + Special point on shoulder + + + + Line color + + + + + DialogSinglePoint + + Single point + Punto simple + + + Coordinates on the sheet + Coordenadas en la hoja + + + Coordinates + Coordenadas + + + Y coordinate + coordenada Y + + + X coordinate + coordenada X + + + Point label + Etiqueta de punto + + + + DialogSpline + + Curve + Curva + + + First point + Primer punto + + + Length ratio of the first control point + + + + The angle of the first control point + + + + Second point + Segundo punto + + + Length ratio of the second control point + + + + The angle of the second control point + + + + Coefficient of curvature of the curve + Coeficiente de curvatura de la curva + + + Select last point of curve + Selección último punto de curva + + + Simple curve + + + + Color + + + + + DialogSplinePath + + Curved path + Trazado curvado + + + Point of curve + Punto de curva + + + Length ratio of the first control point + + + + The angle of the first control point + + + + Length ratio of the second control point + + + + The angle of the second control point + + + + List of points + Lista de puntos + + + Coefficient of curvature of the curve + Coeficiente de curvatura de la curva + + + Select point of curve path + + + + Color + + + + + DialogStandardMeasurements + + Standard table + Tabla estándar + + + Pattern piece name + Nombre de la pieza del patrón + + + Standard measurements table + Tabla de medidas estándar + + + File error. + Error en archivo. + + + + DialogTool + + Error + Error + + + Empty field + Campo vacío + + + Value can't be 0 + El valor no puede ser 0 + + + Value + Valor + + + Height + Altura + + + Size + Tamaño + + + Line length + Longitud de línea + + + Arc length + Longitud de arco + + + Curve length + Longitud de curva + + + Parser error: %1 + + + + Line Angle + + + + + DialogTriangle + + Triangle + Triángulo + + + Point label + Etiqueta de punto + + + First point of axis + Primer punto del eje + + + First point of line + Primer punto de la línea + + + Second point of axis + Segundo punto del eje + + + First point + Primer punto + + + Second point + Segundo punto + + + Select second point of axis + Selección segundo punto del eje + + + Select first point + Selección primer punto + + + Select second point + Selección segundo punto + + + Triangle tool + + + + First point of the axis + + + + Second point of the axis + + + + Second point of line + Segundo punto de línea + + + + DialogUndo + + Broken formula + + + + Error while calculation formula. You can try undo last operation or fix broken formula. + + + + &Undo + &Deshacer + + + &Fix formula + &Reparar fórmula + + + &Cancel + &Cancelar + + + + DialogUnionDetails + + Union details + Detalles de unión + + + <html><head/><body><p>Do you really want union details?</p></body></html> + + + + Select first point + Selección primer punto + + + Select second point + Selección segundo punto + + + Select another second point + Selección otro segundo punto + + + Select detail + Selección de detalle + + + Union tool + + + + + Functions + + sin + sine function + sin + + + cos + cosine function + cos + + + tan + tangens function + tan + + + asin + arcus sine function + asin + + + acos + arcus cosine function + acos + + + atan + arcus tangens function + atan + + + sinh + hyperbolic sine function + sinh + + + cosh + hyperbolic cosine + cosh + + + tanh + hyperbolic tangens function + tanh + + + asinh + hyperbolic arcus sine function + asinh + + + acosh + hyperbolic arcus tangens function + acosh + + + atanh + hyperbolic arcur tangens function + atanh + + + log2 + logarithm to the base 2 + log2 + + + log10 + logarithm to the base 10 + log10 + + + log + logarithm to the base 10 + log + + + ln + logarithm to base e (2.71828...) + in + + + exp + e raised to the power of x + exp + + + sqrt + square root of a value + sqrt + + + sign + sign function -1 if x<0; 1 if x>0 + sign + + + rint + round to nearest integer + rint + + + abs + absolute value + abs + + + min + min of all arguments + min + + + max + max of all arguments + max + + + sum + sum of all arguments + sum + + + avg + mean value of all arguments + avg + + + + InternalStrings + + The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + + + + + MainWindow + + Valentina + Valentina + + + Tools for creating points. + Herramientas para la creación de puntos. + + + Point + Punto + + + Point along perpendicular + + + + Tool triangle. + Herramienta triángulo + + + Perpendicular point along line + + + + Point along bisector + + + + Point at distance and angle + + + + Point at distance along line + + + + Point of intersection line and axis + Punto de intersección de línea y eje + + + ... + ... + + + Tools for creating lines. + Herramientas para crear líneas. + + + Line + Línea + + + Line between points + + + + Point at line intersection + + + + Tools for creating curves. + Herramientas para crear curvas. + + + Curve + Curva + + + Curve tool. + Herramienta curva. + + + Tool for path curve. + Herramienta para trazado curvo. + + + Tools for creating arcs. + Herramientas para crear arcos. + + + Arc + Arco + + + Arc tool. + Herramienta arco. + + + Cut arc tool. + Herramienta cortar arco. + + + Tools for creating details. + Herramientas para crear detalles. + + + Detail + Detalle + + + Tool new detail. + Herramienta nuevo detalle. + + + Tool for union two details. + Herramienta para unir dos detalles. + + + &File + &Archivo + + + &Help + &Ayuda + + + &Pattern piece + &Pieza de patrón + + + Measurements + Medidas + + + Window + Ventana + + + Toolbar files + + + + ToolBar modes + + + + Toolbar pattern + + + + Toolbar options + + + + Toolbar tools + + + + Tool options + Opciones de herramienta + + + New + Nuevo + + + &New + &Nuevo + + + Create a new pattern + Crear un nuevo patrón + + + Ctrl+N + Ctrl+N + + + Open + Abrir + + + &Open + &Abrir + + + Open file with pattern + Abrir archivo con patrón + + + Save + Guardar + + + &Save + &Guardar + + + Save pattern + Guardar patrón + + + Ctrl+S + Ctrl+S + + + Save &As... + + + + Save not yet saved pattern + + + + Ctrl+Shift+S + Ctrl+Shift+S + + + Draw + Dibujar + + + Draw mode + Modo de dibujo + + + Ctrl+W + Ctrl+W + + + Details + Detalles + + + Details mode + Modo de detalles + + + Ctrl+E + Ctrl+E + + + Pointer tools + Herramientas de puntero + + + New pattern piece + Nueva pieza de patrón + + + Add new pattern piece + Añadir nueva pieza de patrón + + + Ctrl+Shift+N + Ctrl+Shift+N + + + Change the label of pattern piece + Cambiar etiqueta de pieza de patrón + + + Table of variables + Tabla de variables + + + Tables of variables + Tablas de variables + + + Ctrl+T + Ctrl+T + + + History + Historia + + + Ctrl+H + Ctrl+H + + + Export pattern (layout) + Exportar patrón (plantilla) + + + Create layout + Crear plantilla + + + Ctrl+L + Ctrl+L + + + About &Qt + Sobre &Qt + + + &About Valentina + &Sobre Valentina + + + E&xit + &Salida + + + Exit the application + Salir de la aplicación + + + Ctrl+Q + Ctrl+Q + + + Preferences + Preferencias + + + Pattern properties + Propiedades de patrón + + + Zoom in + + + + zoom in + + + + Zoom out + + + + Edit pattern XML code + Editar código XML de patrón + + + Original zoom + Zoom original + + + Original Zoom + Zoom Original + + + Zoom fit best + + + + Ctrl+= + Ctrl+= + + + Stop + Parar + + + Stop using tool + Parar de usar herramienta + + + Repot Bug... + Informar de un error... + + + Report bug + Informar de un error + + + Close window + Cerrar ventana + + + Online help + Ayuda en línea + + + Show online help + Mostrar ayuda en línea + + + Pattern piece %1 + Pieza de patrón %1 + + + Individual measurements is under development + Medidas individuales está en desarrollando + + + There is no way create individual measurements file independent on the pattern file. +For opening pattern need keep both files: pattern and measurements. Do you want continue? + + + + Select point + Seleccionar punto + + + Select first point + Selección primer punto + + + Select first point of line + Selección primer punto de línea + + + Select first point of angle + + + + Select first point of first line + + + + Select first point curve + + + + Select simple curve + + + + Select point of center of arc + Seleccionar punto del centro del arco + + + Select point of curve path + + + + Select curve path + + + + Select points, arcs, curves clockwise. + + + + Select base point + + + + Select first point of axis + + + + Select point vertically + Selecciona punto horizontal + + + Select detail + Seleccionar detalle + + + Select arc + Seleccionar arco + + + Select curve + Seleccionar curva + + + About Qt + Sobre Qt + + + Height: + Altura: + + + Size: + Tamaño: + + + Pattern Piece: + Pieza de Patrón: + + + Pattern files (*.val) + Archivos de patrón (*.val) + + + pattern + patrón + + + /pattern.val + + + + Save as + Guardar como + + + Could not save file + No se ha guardado archivo + + + Open file + Abrir archivo + + + Error parsing file. + + + + Error can't convert value. + Error no se puede convertir valor. + + + Error empty parameter. + Error parámetro vacío. + + + Error wrong id. + + + + Critical error! + Error crítico!! + + + Error parsing file (std::bad_alloc). + + + + Bad id. + + + + File saved + Archivo guardado + + + untitled.val + Sin título.val + + + Unsaved change + + + + The pattern has been modified. +Do you want to save your changes? + El patrón ha sido modificado. +Quiere guardar los cambios? + + + &Undo + &Deshacer + + + &Redo + &Rehacer + + + Pattern piece: + Pieza de patrón: + + + Enter a new label for the pattern piece. + Introduzca nueva etiqueta para la pieza de patrón. + + + This file already opened in another window. + Este archivo ha sido abierto en otra ventana. + + + Wrong units. + Unidades no válidas. + + + Application doesn't support standard table with inches. + La aplicación no soporta la tabla estándar en pulgadas. + + + File error. + Error en archivo. + + + File loaded + Archivo cargado + + + Valentina didn't shut down correctly. Do you want reopen files (%1) you had open? + + + + Reopen files. + Reabrir archivos. + + + The measurements file <br/><br/> <b>%1</b> <br/><br/> %3 + El archivo de medidas <br/><br/> <b>%1</b> <br/><br/> %3 + + + could not be found. Do you want to update the file location + No se ha podido encontrar. Quiere actualizar la localización del archivo + + + Standard measurements (*.vst) + Medidas estándar (*.vst) + + + Individual measurements (*.vit) + Medidas individuales (*.vit) + + + Special point on shoulder + + + + Triangle tool + + + + Point at intersection of arc and line + + + + Point from X and Y of two other points + + + + Point intersect line and axis + + + + Simple curve + + + + Curved path + Trazado curvado + + + Segmenting a simple curve + + + + Segment a curved path + + + + Point intersect curve and axis + + + + Segment an arc + + + + Point intersect arc and axis + + + + Seam allowance tool + + + + Union tool + + + + toolBar + Barra de herramientas + + + Last Tool + + + + Activate last used tool again + + + + L + + + + Select point for X value (vertical) + + + + + Measurements + + head_girth + Short measurement name. Don't use math symbols in name!!!! + circunferencia_cabeza + + + mid_neck_girth + Short measurement name. Don't use math symbols in name!!!! + circunferencia_medio_cuello + + + neck_base_girth + Short measurement name. Don't use math symbols in name!!!! + + + + head_and_neck_length + Short measurement name. Don't use math symbols in name!!!! + + + + center_front_waist_length + Short measurement name. Don't use math symbols in name!!!! + + + + center_back_waist_length + Short measurement name. Don't use math symbols in name!!!! + + + + shoulder_length + Short measurement name. Don't use math symbols in name!!!! + + + + side_waist_length + Short measurement name. Don't use math symbols in name!!!! + + + + trunk_length + Short measurement name. Don't use math symbols in name!!!! + + + + shoulder_girth + Short measurement name. Don't use math symbols in name!!!! + + + + upper_chest_girth + Short measurement name. Don't use math symbols in name!!!! + + + + bust_girth + Short measurement name. Don't use math symbols in name!!!! + + + + under_bust_girth + Short measurement name. Don't use math symbols in name!!!! + + + + waist_girth + Short measurement name. Don't use math symbols in name!!!! + + + + high_hip_girth + Short measurement name. Don't use math symbols in name!!!! + + + + hip_girth + Short measurement name. Don't use math symbols in name!!!! + + + + upper_front_chest_width + Short measurement name. Don't use math symbols in name!!!! + + + + front_chest_width + Short measurement name. Don't use math symbols in name!!!! + + + + across_front_shoulder_width + Short measurement name. Don't use math symbols in name!!!! + + + + across_back_shoulder_width + Short measurement name. Don't use math symbols in name!!!! + + + + upper_back_width + Short measurement name. Don't use math symbols in name!!!! + + + + back_width + Short measurement name. Don't use math symbols in name!!!! + + + + bustpoint_to_bustpoint + Short measurement name. Don't use math symbols in name!!!! + + + + halter_bustpoint_to_bustpoint + Short measurement name. Don't use math symbols in name!!!! + + + + neck_to_bustpoint + Short measurement name. Don't use math symbols in name!!!! + + + + crotch_length + Short measurement name. Don't use math symbols in name!!!! + + + + rise_height + Short measurement name. Don't use math symbols in name!!!! + + + + shoulder_drop + Short measurement name. Don't use math symbols in name!!!! + + + + shoulder_slope_degrees + Short measurement name. Don't use math symbols in name!!!! + + + + front_shoulder_slope_length + Short measurement name. Don't use math symbols in name!!!! + + + + back_shoulder_slope_length + Short measurement name. Don't use math symbols in name!!!! + + + + front_shoulder_to_waist_length + Short measurement name. Don't use math symbols in name!!!! + + + + back_shoulder_to_waist_length + Short measurement name. Don't use math symbols in name!!!! + + + + front_neck_arc + Short measurement name. Don't use math symbols in name!!!! + + + + back_neck_arc + Short measurement name. Don't use math symbols in name!!!! + + + + front_upper_chest_arc + Short measurement name. Don't use math symbols in name!!!! + + + + back_upper_chest_arc + Short measurement name. Don't use math symbols in name!!!! + + + + front_waist_arc + Short measurement name. Don't use math symbols in name!!!! + + + + back_waist_arc + Short measurement name. Don't use math symbols in name!!!! + + + + front_upper_hip_arc + Short measurement name. Don't use math symbols in name!!!! + + + + back_upper_hip_arc + Short measurement name. Don't use math symbols in name!!!! + + + + front_hip_arc + Short measurement name. Don't use math symbols in name!!!! + + + + back_hip_arc + Short measurement name. Don't use math symbols in name!!!! + + + + chest_slope + Short measurement name. Don't use math symbols in name!!!! + + + + back_slope + Short measurement name. Don't use math symbols in name!!!! + + + + front_waist_slope + Short measurement name. Don't use math symbols in name!!!! + + + + back_waist_slope + Short measurement name. Don't use math symbols in name!!!! + + + + front_neck_to_upper_chest_height + Short measurement name. Don't use math symbols in name!!!! + + + + front_neck_to_bust_height + Short measurement name. Don't use math symbols in name!!!! + + + + front_waist_to_upper_chest + Short measurement name. Don't use math symbols in name!!!! + + + + front_waist_to_lower_breast + Short measurement name. Don't use math symbols in name!!!! + + + + back_waist_to_upper_chest + Short measurement name. Don't use math symbols in name!!!! + + + + strap_length + Short measurement name. Don't use math symbols in name!!!! + + + + armscye_girth + Short measurement name. Don't use math symbols in name!!!! + + + + elbow_girth + Short measurement name. Don't use math symbols in name!!!! + + + + upper_arm_girth + Short measurement name. Don't use math symbols in name!!!! + + + + wrist_girth + Short measurement name. Don't use math symbols in name!!!! + + + + scye_depth + Short measurement name. Don't use math symbols in name!!!! + + + + shoulder_and_arm_length + Short measurement name. Don't use math symbols in name!!!! + + + + underarm_length + Short measurement name. Don't use math symbols in name!!!! + + + + cervicale_to_wrist_length + Short measurement name. Don't use math symbols in name!!!! + + + + shoulder_to_elbow_length + Short measurement name. Don't use math symbols in name!!!! + + + + arm_length + Short measurement name. Don't use math symbols in name!!!! + + + + hand_width + Short measurement name. Don't use math symbols in name!!!! + + + + hand_length + Short measurement name. Don't use math symbols in name!!!! + + + + hand_girth + Short measurement name. Don't use math symbols in name!!!! + + + + thigh_girth + Short measurement name. Don't use math symbols in name!!!! + + + + mid_thigh_girth + Short measurement name. Don't use math symbols in name!!!! + + + + knee_girth + Short measurement name. Don't use math symbols in name!!!! + + + + calf_girth + Short measurement name. Don't use math symbols in name!!!! + + + + ankle_girth + Short measurement name. Don't use math symbols in name!!!! + + + + knee_height + Short measurement name. Don't use math symbols in name!!!! + + + + ankle_height + Short measurement name. Don't use math symbols in name!!!! + + + + foot_width + Short measurement name. Don't use math symbols in name!!!! + + + + foot_length + Short measurement name. Don't use math symbols in name!!!! + + + + height + Short measurement name. Don't use math symbols in name!!!! + + + + cervicale_height + Short measurement name. Don't use math symbols in name!!!! + + + + cervicale_to_knee_height + Short measurement name. Don't use math symbols in name!!!! + + + + waist_height + Short measurement name. Don't use math symbols in name!!!! + + + + high_hip_height + Short measurement name. Don't use math symbols in name!!!! + + + + hip_height + Short measurement name. Don't use math symbols in name!!!! + + + + waist_to_hip_height + Short measurement name. Don't use math symbols in name!!!! + + + + waist_to_knee_height + Short measurement name. Don't use math symbols in name!!!! + + + + crotch_height + Short measurement name. Don't use math symbols in name!!!! + + + + size + Short measurement name. Don't use math symbols in name!!!! + + + + height_front_neck_base_point + Short measurement name. Don't use math symbols in name!!!! + + + + height_base_neck_side_point + Short measurement name. Don't use math symbols in name!!!! + + + + height_shoulder_point + Short measurement name. Don't use math symbols in name!!!! + + + + height_nipple_point + Short measurement name. Don't use math symbols in name!!!! + + + + height_back_angle_axilla + Short measurement name. Don't use math symbols in name!!!! + + + + height_scapular_point + Short measurement name. Don't use math symbols in name!!!! + + + + height_under_buttock_folds + Short measurement name. Don't use math symbols in name!!!! + + + + hips_excluding_protruding_abdomen + Short measurement name. Don't use math symbols in name!!!! + + + + girth_foot_instep + Short measurement name. Don't use math symbols in name!!!! + + + + side_waist_to_floor + Short measurement name. Don't use math symbols in name!!!! + + + + front_waist_to_floor + Short measurement name. Don't use math symbols in name!!!! + + + + arc_through_groin_area + Short measurement name. Don't use math symbols in name!!!! + + + + waist_to_plane_seat + Short measurement name. Don't use math symbols in name!!!! + + + + neck_to_radial_point + Short measurement name. Don't use math symbols in name!!!! + + + + neck_to_third_finger + Short measurement name. Don't use math symbols in name!!!! + + + + neck_to_first_line_chest_circumference + Short measurement name. Don't use math symbols in name!!!! + + + + front_waist_length + Short measurement name. Don't use math symbols in name!!!! + + + + arc_through_shoulder_joint + Short measurement name. Don't use math symbols in name!!!! + + + + neck_to_back_line_chest_circumference + Short measurement name. Don't use math symbols in name!!!! + + + + waist_to_neck_side + Short measurement name. Don't use math symbols in name!!!! + + + + arc_length_upper_body + Short measurement name. Don't use math symbols in name!!!! + + + + chest_width + Short measurement name. Don't use math symbols in name!!!! + + + + anteroposterior_diameter_hands + Short measurement name. Don't use math symbols in name!!!! + + + + height_clavicular_point + Short measurement name. Don't use math symbols in name!!!! + + + + height_armhole_slash + Short measurement name. Don't use math symbols in name!!!! + + + + slash_shoulder_height + Short measurement name. Don't use math symbols in name!!!! + + + + half_girth_neck + Short measurement name. Don't use math symbols in name!!!! + + + + half_girth_neck_for_shirts + Short measurement name. Don't use math symbols in name!!!! + + + + half_girth_chest_first + Short measurement name. Don't use math symbols in name!!!! + + + + half_girth_chest_second + Short measurement name. Don't use math symbols in name!!!! + + + + half_girth_chest_third + Short measurement name. Don't use math symbols in name!!!! + + + + half_girth_waist + Short measurement name. Don't use math symbols in name!!!! + + + + half_girth_hips_considering_protruding_abdomen + Short measurement name. Don't use math symbols in name!!!! + + + + half_girth_hips_excluding_protruding_abdomen + Short measurement name. Don't use math symbols in name!!!! + + + + girth_knee_flexed_feet + Short measurement name. Don't use math symbols in name!!!! + + + + neck_transverse_diameter + Short measurement name. Don't use math symbols in name!!!! + + + + front_slash_shoulder_height + Short measurement name. Don't use math symbols in name!!!! + + + + neck_to_front_waist_line + Short measurement name. Don't use math symbols in name!!!! + + + + hand_vertical_diameter + Short measurement name. Don't use math symbols in name!!!! + + + + neck_to_knee_point + Short measurement name. Don't use math symbols in name!!!! + + + + waist_to_knee + Short measurement name. Don't use math symbols in name!!!! + + + + shoulder_height + Short measurement name. Don't use math symbols in name!!!! + + + + head_height + Short measurement name. Don't use math symbols in name!!!! + + + + body_position + Short measurement name. Don't use math symbols in name!!!! + + + + arc_behind_shoulder_girdle + Short measurement name. Don't use math symbols in name!!!! + + + + neck_to_neck_base + Short measurement name. Don't use math symbols in name!!!! + + + + depth_waist_first + Short measurement name. Don't use math symbols in name!!!! + + + + depth_waist_second + Short measurement name. Don't use math symbols in name!!!! + + + + + MeasurementsDescriptions + + Around fullest part of Head + Full measurement description + + + + Around middle part of Neck + Full measurement description + + + + Around Neck at base + Full measurement description + + + + Vertical Distance from Crown to Nape + Full measurement description + + + + Front Neck Center over tape at Bustline to Front Waist Center + Full measurement description + + + + Back Neck Center to Back Waist Center + Full measurement description + + + + NeckPoint to ShoulderTip + Full measurement description + + + + Armpit to Waist side + Full measurement description + + + + Around Body from middle of Shoulder length to BustPoint to Crotch up back to beginning point + Full measurement description + + + + Around Arms and Torso, at bicep level parallel to floor, with arms hanging at the sides + Full measurement description + + + + Around Chest at Armfold level, will be parallel to floor across back, will not be parallel to floor across front chest + Full measurement description + + + + Around fullest part of Bust, parallel to floor + Full measurement description + + + + Around Chest below the Bust, parallel to floor + Full measurement description + + + + Tie a string around smallest part of waist, keep string tied while taking meaasurements. Not usually parallel to floor for front waist or back waist. + Full measurement description + + + + Around HighHip, parallel to floor + Full measurement description + + + + Around Hip, parallel to floor + Full measurement description + + + + Across Front UpperChest, smallest width from armscye to armscye + Full measurement description + + + + Across Front Chest, from armfold to armfold + Full measurement description + + + + From ShoulderTip to ShoulderTip, across Front + Full measurement description + + + + From ShoulderTip to ShoulderTip, across Back + Full measurement description + + + + Across Back UpperChest, smallest width from armscye to armscye + Full measurement description + + + + Across Back Chest, from armfold to armfold + Full measurement description + + + + Distance between BustPoints, across Chest + Full measurement description + + + + Distance from Bustpoint, behind neck, down to Bustpoint + Full measurement description + + + + From NeckPoint to BustPoint + Full measurement description + + + + From Front Waist Center, down to crotch, up to Back Waist Center + Full measurement description + + + + Sit on hard chair, measure from side waist straight down to chair bottom + Full measurement description + + + + Vertical Distance from NeckPoint level to ShoulderTip level + Full measurement description + + + + Degrees of angle from NeckPoint to ShoulderTip – requires goniometer + Full measurement description + + + + ShoulderTip to Front Waist Center + Full measurement description + + + + ShoulderTip to Back Waist Center + Full measurement description + + + + NeckPoint straight down front chest to Waistline + Full measurement description + + + + Back NeckPoint straight down back chest to Waistline + Full measurement description + + + + NeckPoint to NeckPoint through Front Neck Center + Full measurement description + + + + NeckPoint to NeckPoint across Nape + Full measurement description + + + + Front upper-bust arc + Full measurement description + + + + Back UpperBust side to side + Full measurement description + + + + Front Waist side to side + Full measurement description + + + + Back Waist side to side + Full measurement description + + + + Front UpperHip side to side + Full measurement description + + + + Back UpperHip side to side + Full measurement description + + + + Front Hip side to side + Full measurement description + + + + Back Hip side to side + Full measurement description + + + + NeckPoint to Front ArmfoldPoint + Full measurement description + + + + NeckPoint to Back ArmfoldPoint + Full measurement description + + + + NeckPoint across Front Chest to Waist side + Full measurement description + + + + NeckPoint across Back Chest to Waist side + Full measurement description + + + + Front Neck Center straight down to UpperChest line + Full measurement description + + + + Front Neck Center straight down to Bust line + Full measurement description + + + + Front Upper chest waist + Full measurement description + + + + Front waist to lower breast + Full measurement description + + + + Back waist to upper chest + Full measurement description + + + + Strap length + Full measurement description + + + + Around Armscye + Full measurement description + + + + Around Elbow with elbow bent + Full measurement description + + + + Around UpperArm + Full measurement description + + + + Around Wrist + Full measurement description + + + + Nape straight down to UnderBust line (same as Back UpperBust height) + Full measurement description + + + + NeckPoint to ShoulderTip to Wrist, with elbow bent and hand on hip + Full measurement description + + + + Armpit to Wrist, with arm straight and hanging at side + Full measurement description + + + + Nape to Wrist, with elbow bent and hand on hip + Full measurement description + + + + ShoulderTip to Elbow, with elbow bent and hand on hip + Full measurement description + + + + ShoulderTip to Wrist, with elbow bent and hand on hip + Full measurement description + + + + Hand side to side + Full measurement description + + + + Hand Middle Finger tip to wrist + Full measurement description + + + + Around Hand + Full measurement description + + + + Around Thigh + Full measurement description + + + + Around MidThigh + Full measurement description + + + + Around Knee + Full measurement description + + + + Around Calf + Full measurement description + + + + Around Ankle + Full measurement description + + + + Knee to Floor + Full measurement description + + + + Ankle to Floor + Full measurement description + + + + Widest part of Foot side to side + Full measurement description + + + + Tip of Longest Toe straight to back of heel + Full measurement description + + + + Top of head to floor + Full measurement description + + + + Nape to Floor + Full measurement description + + + + Nape to Knee + Full measurement description + + + + Waist side to floor + Full measurement description + + + + HighHip side to Floor + Full measurement description + + + + Hip side to Floor + Full measurement description + + + + Waist side to Hip + Full measurement description + + + + Waist side to Knee + Full measurement description + + + + Crotch to Floor along inside leg + Full measurement description + + + + Size + Full measurement description + Tamaño + + + Height of the point base of the neck in front + Full measurement description + + + + Height of the base of the neck side point + Full measurement description + + + + The height of the shoulder point + Full measurement description + + + + Height nipple point + Full measurement description + + + + Height back angle axilla + Full measurement description + + + + Height scapular point + Full measurement description + + + + Height under buttock folds + Full measurement description + + + + Hips excluding protruding abdomen + Full measurement description + + + + Girth foot instep + Full measurement description + + + + The distance from the side waist to floor + Full measurement description + + + + The distance from the front waist to floor + Full measurement description + + + + Arc through groin area + Full measurement description + + + + The distance from the waist to the plane seat + Full measurement description + + + + The distance from the base of the neck to the side of the radial point + Full measurement description + + + + Distance from the base of the neck side point to the end of the third finger + Full measurement description + + + + The distance from the base of the neck to the side of the first line in front of chest circumference + Full measurement description + + + + The distance from the base of the neck to the waist side front (waist length in the front) + Full measurement description + + + + Arc through the highest point of the shoulder joint + Full measurement description + + + + The distance from the base of the neck to the back line of chest circumference of the first and the second based on ledge vanes + Full measurement description + + + + The distance from the waist to the back base of the neck side point + Full measurement description + + + + Arc length of the upper body through the base of the neck side point + Full measurement description + + + + Chest width + Full measurement description + + + + Anteroposterior diameter of the hands + Full measurement description + + + + Height clavicular point + Full measurement description + + + + The distance from the point to the cervical level of the posterior angle of the front armpit (underarm height oblique) + Full measurement description + + + + Slash shoulder height + Full measurement description + + + + Half girth neck + Full measurement description + + + + Half girth neck for shirts + Full measurement description + + + + Half girth chest first + Full measurement description + + + + Half girth chest second + Full measurement description + + + + Half girth chest third + Full measurement description + + + + Half girth waist + Full measurement description + + + + Half girth hips considering protruding abdomen + Full measurement description + + + + Half girth hips excluding protruding abdomen + Full measurement description + + + + Girth knee flexed feet + Full measurement description + + + + Neck transverse diameter + Full measurement description + + + + Front slash shoulder height + Full measurement description + + + + The distance from the base of the neck to the waist line front + Full measurement description + + + + Hand vertical diameter + Full measurement description + + + + Distance from neck to knee point + Full measurement description + + + + The distance from the waist to the knee + Full measurement description + + + + Shoulder height + Full measurement description + + + + Head height + Full measurement description + + + + Body position + Full measurement description + + + + Arc behind the shoulder girdle + Full measurement description + + + + Distance from neck point to point on the base of the neck side neck girth measurement line + Full measurement description + + + + Depth waist first + Full measurement description + + + + Depth waist second + Full measurement description + + + + + MeasurementsFullNames + + Head girth + Full measurement name + + + + Mid-neck girth + Full measurement name + + + + Neck Base girth + Full measurement name + + + + Head and Neck length + Full measurement name + + + + Front Center length + Full measurement name + + + + Back Center length + Full measurement name + + + + Shoulder length + Full measurement name + + + + Side Waist length + Full measurement name + + + + Trunk length + Full measurement name + + + + Shoulder girth + Full measurement name + + + + Upper Chest girth + Full measurement name + + + + Bust girth + Full measurement name + + + + Under Bust girth + Full measurement name + + + + Waist girth + Full measurement name + + + + HighHip girth + Full measurement name + + + + Hip girth + Full measurement name + + + + Front Upper Chest width + Full measurement name + + + + Front Chest width + Full measurement name + + + + Front Across Shoulder width + Full measurement name + + + + Back Across Shoulder width + Full measurement name + + + + Back Upper Chest width + Full measurement name + + + + Back Chest width + Full measurement name + + + + BustPoint to BustPoint + Full measurement name + + + + Halter Bustpoint to Bustpoint + Full measurement name + + + + NeckPoint to BustPoint + Full measurement name + + + + Crotch length + Full measurement name + + + + Rise height + Full measurement name + + + + Shoulder Drop + Full measurement name + + + + Shoulder Slope degrees + Full measurement name + + + + Front Shoulder Balance + Full measurement name + + + + Back Shoulder Balance + Full measurement name + + + + Front Full Length + Full measurement name + + + + Back Full Length + Full measurement name + + + + Front Neck arc + Full measurement name + + + + Back Neck arc + Full measurement name + + + + Front upper-bust arc + Full measurement name + + + + Back UpperBust arc + Full measurement name + + + + Front Waist arc + Full measurement name + + + + Back Waist arc + Full measurement name + + + + Front UpperHip arc + Full measurement name + + + + Back UpperHip arc + Full measurement name + + + + Front Hip arc + Full measurement name + + + + Back Hip arc + Full measurement name + + + + Chest Balance + Full measurement name + + + + Back Balance + Full measurement name + + + + Front Waist Balance + Full measurement name + + + + Back Waist Balance + Full measurement name + + + + Front UpperChest height + Full measurement name + + + + Bust height + Full measurement name + + + + Front Upper chest waist + Full measurement name + + + + Front waist to lower breast + Full measurement name + + + + Back waist to upper chest + Full measurement name + + + + Strap length + Full measurement name + + + + Armscye Girth + Full measurement name + + + + Elbow Girth + Full measurement name + + + + Upperarm Girth + Full measurement name + + + + Wrist girth + Full measurement name + + + + Armscye depth + Full measurement name + + + + Shoulder and Arm length + Full measurement name + + + + Underarm length + Full measurement name + + + + Nape to wrist length + Full measurement name + + + + Elbow length + Full measurement name + + + + Arm length + Full measurement name + + + + Hand width + Full measurement name + + + + Hand length + Full measurement name + + + + Hand girth + Full measurement name + + + + Thigh girth + Full measurement name + + + + Midthigh girth + Full measurement name + + + + Knee girth + Full measurement name + + + + Calf girth + Full measurement name + + + + Ankle girth + Full measurement name + + + + Knee height + Full measurement name + + + + Ankle height + Full measurement name + + + + Foot width + Full measurement name + + + + Foot length + Full measurement name + + + + Total Height + Full measurement name + + + + Nape height + Full measurement name + + + + Nape to knee height + Full measurement name + + + + Waist height + Full measurement name + + + + HighHip height + Full measurement name + + + + Hip height + Full measurement name + + + + Waist to Hip height + Full measurement name + + + + Waist to Knee height + Full measurement name + + + + Crotch height/Inseam + Full measurement name + + + + Size + Full measurement name + Tamaño + + + Height front neck base point + Full measurement name + + + + Height base neck side point + Full measurement name + + + + Height shoulder point + Full measurement name + + + + Height nipple point + Full measurement name + + + + Height back angle axilla + Full measurement name + + + + Height scapular point + Full measurement name + + + + Height under buttock folds + Full measurement name + + + + Hips excluding protruding abdomen + Full measurement name + + + + Girth foot instep + Full measurement name + + + + Side waist to floor + Full measurement name + + + + Front waist to floor + Full measurement name + + + + Arc through groin area + Full measurement name + + + + Waist to plane seat + Full measurement name + + + + Neck to radial point + Full measurement name + + + + Neck to third finger + Full measurement name + + + + Neck to first line chest circumference + Full measurement name + + + + Front waist length + Full measurement name + + + + Arc through shoulder joint + Full measurement name + + + + Neck to back line chest circumference + Full measurement name + + + + Waist to neck side + Full measurement name + + + + Arc length upper body + Full measurement name + + + + Chest width + Full measurement name + + + + Anteroposterior diameter hands + Full measurement name + + + + Height clavicular point + Full measurement name + + + + Height armhole slash + Full measurement name + + + + Slash shoulder height + Full measurement name + + + + Half girth neck + Full measurement name + + + + Half girth neck for shirts + Full measurement name + + + + Half girth chest first + Full measurement name + + + + Half girth chest second + Full measurement name + + + + Half girth chest third + Full measurement name + + + + Half girth waist + Full measurement name + + + + Half girth hips considering protruding abdomen + Full measurement name + + + + Half girth hips excluding protruding abdomen + Full measurement name + + + + Girth knee flexed feet + Full measurement name + + + + Neck transverse diameter + Full measurement name + + + + Front slash shoulder height + Full measurement name + + + + Neck to front waist line + Full measurement name + + + + Hand vertical diameter + Full measurement name + + + + Neck to knee point + Full measurement name + + + + Waist to knee + Full measurement name + + + + Shoulder height + Full measurement name + + + + Head height + Full measurement name + + + + Body position + Full measurement name + + + + Arc behind shoulder girdle + Full measurement name + + + + Neck to neck base + Full measurement name + + + + Depth waist first + Full measurement name + + + + Depth waist second + Full measurement name + + + + + MoveLabel + + Move point label + + + + + MoveSPoint + + Move single point + + + + + MoveSpline + + Move spline + + + + + MoveSplinePath + + Move spline path + + + + + PathPage + + Open Directory + Abrir Directorio + + + Path that use Valentina + + + + Default + + + + Edit + Editar + + + Type + Tipo + + + Path + + + + Individual measurements + Medidas individuales + + + Patterns + Patrones + + + Standard measurements + + + + Layout + + + + + PatternPage + + User + Usuario + + + User name + Nombre de usuario + + + Graphical output + Salida gráfica + + + Use antialiasing + Usar antialiasing + + + Undo + Deshacer + + + Count steps (0 - no limit) + + + + + PostfixOperators + + cm + centimeter + cm + + + mm + millimeter + mm + + + in + inch + + + + + QCoreApplication + + Based on Qt %1 (%2, %3 bit) + + + + + QObject + + Create new pattern piece to start working. + Crear nueva pieza de patrón para comenzar a trabajar. + + + Add node + Añadir nodo + + + Move detail + Mover detalle + + + mm + mm + + + cm + cm + + + inch + pulgadas + + + Property + The text that appears in the first column header + Propiedad + + + Value + The text that appears in the second column header + Valor + + + px + + + + + QmuParserErrorMsg + + Unexpected token "$TOK$" found at position $POS$. + Math parser error messages. Left untouched "$TOK$" and $POS$ + + + + Internal error + Math parser error messages. + Error interno + + + Invalid function-, variable- or constant name: "$TOK$". + Math parser error messages. Left untouched "$TOK$" + + + + Invalid binary operator identifier: "$TOK$". + Math parser error messages. Left untouched "$TOK$" + + + + Invalid infix operator identifier: "$TOK$". + Math parser error messages. Left untouched "$TOK$" + + + + Invalid postfix operator identifier: "$TOK$". + Math parser error messages. Left untouched "$TOK$" + + + + Invalid pointer to callback function. + Math parser error messages. + + + + Expression is empty. + Math parser error messages. + La expresión está vacía. + + + Invalid pointer to variable. + Math parser error messages. + + + + Unexpected operator "$TOK$" found at position $POS$ + Math parser error messages. Left untouched "$TOK$" and $POS$ + + + + Unexpected end of expression at position $POS$ + Math parser error messages. Left untouched $POS$ + + + + Unexpected argument separator at position $POS$ + Math parser error messages. Left untouched $POS$ + + + + Unexpected parenthesis "$TOK$" at position $POS$ + Math parser error messages. Left untouched "$TOK$" and $POS$ + + + + Unexpected function "$TOK$" at position $POS$ + Math parser error messages. Left untouched "$TOK$" and $POS$ + + + + Unexpected value "$TOK$" found at position $POS$ + Math parser error messages. Left untouched "$TOK$" and $POS$ + + + + Unexpected variable "$TOK$" found at position $POS$ + Math parser error messages. Left untouched "$TOK$" and $POS$ + + + + Function arguments used without a function (position: $POS$) + Math parser error messages. Left untouched $POS$ + + + + Missing parenthesis + Math parser error messages. + Faltan paréntesis + + + Too many parameters for function "$TOK$" at expression position $POS$ + Math parser error messages. Left untouched "$TOK$" and $POS$ + + + + Too few parameters for function "$TOK$" at expression position $POS$ + Math parser error messages. Left untouched "$TOK$" and $POS$ + + + + Divide by zero + Math parser error messages. + División por cero + + + Domain error + Math parser error messages. + Error de dominio + + + Name conflict + Math parser error messages. + Conflicto en nombre + + + Invalid value for operator priority (must be greater or equal to zero). + Math parser error messages. + + + + user defined binary operator "$TOK$" conflicts with a built in operator. + Math parser error messages. Left untouched "$TOK$" + + + + Unexpected string token found at position $POS$. + Math parser error messages. Left untouched $POS$ + + + + Unterminated string starting at position $POS$. + Math parser error messages. Left untouched $POS$ + + + + String function called with a non string type of argument. + Math parser error messages. + + + + String value used where a numerical argument is expected. + Math parser error messages. + + + + No suitable overload for operator "$TOK$" at position $POS$. + Math parser error messages. Left untouched "$TOK$" and $POS$ + + + + Function result is a string. + Math parser error messages. + El resultado de la función es una cadena. + + + Parser error. + Math parser error messages. + + + + Decimal separator is identic to function argument separator. + Math parser error messages. + + + + If-then-else operator is missing an else clause + Math parser error messages. Do not translate operator name. + + + + Misplaced colon at position $POS$ + Math parser error messages. Left untouched $POS$ + + + + The "$TOK$" operator must be preceeded by a closing bracket. + Math parser error messages. Left untouched "$TOK$" + + + + + RenamePP + + Rename pattern piece + Renombrar pieza de patrón + + + + STDescriptions + + Standard figures of men 1st group, chest 100 cm + Standard table description + + + + + SaveDetailOptions + + Save detail option + + + + + SaveToolOptions + + Save tool option + Herramienta para opción de guardado + + + + TableWindow + + Create a layout + Crear una plantilla + + + toolBar + Barra de herramientas + + + Save + Guardar + + + Save layout + Guardar plantilla + + + Next + Siguiente + + + Next detail + Detalle siguiente + + + Stop + Parar + + + Stop laying + + + + Zoom In + + + + Zoom Out + + + + untitled + Sin título + + + Svg files (*.svg) + + + + PDF files (*.pdf) + + + + Images (*.png) + + + + PS files (*.ps) + + + + EPS files (*.eps) + + + + Creating file '%1' failed! %2 + + + + Critical error! + Error crítico!! + + + Wavefront OBJ (*.obj) + + + + Layout pages + + + + Layout + + + + + VAbstractConverter + + Error creation backup file: %1. + Error creando archivo de copia de seguridad: %1 + + + Couldn't get version information. + No se encuentra información de la versión. + + + Too many tags <%1> in file. + + + + Version "%1" invalid. + Versión "%1" no válida. + + + Version "0.0.0" invalid. + Versión "0.0.0" no válida. + + + Invalid version. Minimum supported version is %1 + Versión no válida. Versión mínima soportada es %1 + + + Invalid version. Maximum supported version is %1 + Versión no válida. Versión máxima soportada es %1 + + + Error no unique id. + + + + Could not change version. + + + + + VAbstractTool + + Confirm the deletion. + Confirmar borrado + + + Do you really want delete? + Realmente quiere borrarlo? + + + black + + + + green + + + + blue + + + + dark red + + + + dark green + + + + dark blue + + + + yellow + + + + + VApplication + + Error parsing file. Program will be terminated. + + + + Error bad id. Program will be terminated. + + + + Error can't convert value. Program will be terminated. + + + + Error empty parameter. Program will be terminated. + + + + Error wrong id. Program will be terminated. + + + + Something's wrong!! + + + + + VContainer + + Can't find object + No se encuentra objeto + + + Can't cast object + + + + Can't find object. Type mismatch. + No se encuentra objeto. Diferente tipo. + + + + VDomDocument + + Can't convert toUInt parameter + + + + Can't convert toBool parameter + + + + Got empty parameter + + + + Can't convert toDouble parameter + + + + Can't open file %1: +%2. + + + + Can't open schema file %1: +%2. + + + + Could not load schema file. + + + + Validation error file %3 in line %1 column %2 + + + + Parsing error file %3 in line %1 column %2 + + + + Couldn't get node + + + + Got wrong parameter id. Need only id > 0. + + + + This id is not unique. + + + + Could not copy temp file to document file + + + + Could not remove document file + + + + + VDrawTool + + Edit wrong formula + + + + Options + Opciones + + + Delete + Borrar + + + + VException + + Critical error! + Error crítico!! + + + + VFormula + + Error + Error + + + + VFormulaProperty + + Value + Valor + + + Formula + Fórmula + + + + VPE::VBoolProperty + + True + Verdadero + + + False + Falso + + + + VPE::VFileEditWidget + + Directory + Directorio + + + Open File + Abrir archivo + + + + VPattern + + Can't find tool in table. + + + + Error no unique id. + + + + Error parsing file. + + + + Error can't convert value. + Error no se puede convertir valor. + + + Error empty parameter. + Error parámetro vacío. + + + Error wrong id. + + + + Critical error! + Error crítico!! + + + Error parsing file (std::bad_alloc). + + + + Error creating or updating detail + Error creando o actualizando detalle + + + Error creating or updating single point + Error creando o actualizando punto sencillo + + + Error creating or updating point of end line + Error creando o actualizando punto de final de línea + + + Error creating or updating point along line + + + + Error creating or updating point of shoulder + + + + Error creating or updating point of normal + + + + Error creating or updating point of bisector + + + + Error creating or updating point of lineintersection + + + + Error creating or updating point of contact + Error creando o actualizando punto de contacto + + + Error creating or updating modeling point + + + + Error creating or updating height + + + + Error creating or updating triangle + Error creando o actualizando triángulo + + + Error creating or updating point of intersection + + + + Error creating or updating cut spline point + + + + Error creating or updating cut spline path point + + + + Error creating or updating cut arc point + + + + Error creating or updating point of intersection line and axis + + + + Error creating or updating point of intersection curve and axis + + + + Error creating or updating line + Error creando o actualizando línea + + + Error creating or updating simple curve + Error creando o actualizando curva simple + + + Error creating or updating curve path + Error creando o actualizando trazado curvo + + + Error creating or updating modeling simple curve + + + + Error creating or updating modeling curve path + + + + Error creating or updating simple arc + Error creando o actualizando arco simple + + + Error creating or updating modeling arc + + + + Error creating or updating union details + + + + File error. + Error en archivo. + + + + VPatternConverter + + Unexpected version "%1". + + + + Error restoring backup file: %1. + + + + + VSplinePath + + Not enough points to create the spline. + + + + This spline does not exist. + + + + Can't cut spline path with one point + + + + + VTableGraphicsView + + can't find detail + No se encuentra detalle + + + detail found + + + + + VToolDetail + + Options + Opciones + + + Delete + Borrar + + + + VToolOptionsPropertyBrowser + + Base point + Punto base + + + Point label + Etiqueta de punto + + + Position + Posición + + + Point at distance and angle + + + + Line type + + + + Length + Longitud + + + Angle + Ángulo + + + Point at distance along line + + + + Arc + Arco + + + Radius + Radios + + + First angle + Primer ángulo + + + Second angle + Segundo ángulo + + + Point along bisector + + + + Cut arc tool + Herramienta cortar arco. + + + Tool for segmenting a curve + + + + Tool segment a pathed curve + + + + Perpendicular point along line + + + + Line between points + + + + Point at line intersection + + + + Point along perpendicular + + + + Additional angle degrees + Grados adicionales de ángulo + + + Point at intersection of arc and line + + + + Tool to make point from x & y of two other points + + + + Special point on shoulder + + + + Curve tool + Herramienta curva + + + Curve factor + + + + Tool for path curve + Herramienta para trazado curvo + + + Tool triangle + Herramienta triángulo + + + Point intersection line and axis + + + + Line color + + + + Color + + + + Point intersection curve and axis + + + + + Variables + + Line_ + Left symbol _ in name + Línea_ + + + AngleLine_ + Left symbol _ in name + + + + Arc_ + Left symbol _ in name + + + + Spl_ + Left symbol _ in name + + + + SplPath + Do not add symbol _ to the end of name + + + + + VisToolCurveIntersectAxis + + <b>Intersection curve and axis</b>: angle = %1°; <b>Shift</b> - sticking angle, <b>Enter</b> - finish creation + + + + + VisToolEndLine + + <b>Point at distance and angle</b>: angle = %1°; <b>Shift</b> - sticking angle, <b>Enter</b> - finish creation + + + + + VisToolLineIntersectAxis + + <b>Intersection line and axis</b>: angle = %1°; <b>Shift</b> - sticking angle, <b>Enter</b> - finish creation + + + + + VisToolSplinePath + + <b>Curved path</b>: select three or more points + + + + <b>Curved path</b>: select three or more points, <b>Enter</b> - finish creation + + + + + main + + Pattern making program. + + + + Pattern file. + Archivo de patrón. + + + diff --git a/share/translations/valentina_fr_FR.ts b/share/translations/valentina_fr_FR.ts index 0bdb6ad8b..2aa41c31b 100644 --- a/share/translations/valentina_fr_FR.ts +++ b/share/translations/valentina_fr_FR.ts @@ -229,10 +229,6 @@ Contributors Contributeurs - - Based on Qt %2 (32 bit) - Fonctionne avec Qt %2 (32 bit) - Built on %3 at %4 Compilé le %3 à %4 @@ -258,7 +254,7 @@ DialogAlongLine Point along line - Point le long d'une ligne + Point le long d'une ligne Length @@ -270,7 +266,7 @@ Calculate value - Calculer valeur + Calculer valeur Value of length @@ -352,6 +348,14 @@ Select second point of line Choisir le deuxième point d'une ligne + + Point at distance along line + Point à distance le long d'un ligne + + + Line color + + DialogArc @@ -369,7 +373,7 @@ Calculate value - Calculer la valeur + Calculer la valeur Value of radius @@ -453,7 +457,7 @@ Value of angle of line. - valeur de l'Angle de la ligne. + valeur de l'Angle de la ligne. Error @@ -467,12 +471,16 @@ Angles equal + + Color + + DialogBisector Bisector - Bissectrice + Bissectrice Length @@ -484,7 +492,7 @@ Calculate value - Calculer valeur + Calculer valeur Value of length @@ -578,12 +586,20 @@ Select third point of angle Choisir le troisième point de l'angle + + Point along bisector + point le long d'une bissectrice + + + Line color + + DialogCurveIntersectAxis Curve intersect axis - Intersection courbe, axe + Intersection courbe, axe Angle @@ -591,7 +607,7 @@ Calculate value - Calculer la valeur + Calculer la valeur Value of angle @@ -607,7 +623,7 @@ First point of line - Premier point de la ligne + Premier point de la ligne Curve @@ -669,12 +685,24 @@ Select axis point Choisir un point d'axe + + Point intersect curve and axis + + + + Axis Point + + + + Line color + + DialogCutArc Cut arc - Couper l'arc + Couper l'arc Length @@ -682,7 +710,7 @@ Calculate value - Calculer valeur + Calculer valeur Value of length @@ -702,7 +730,7 @@ Selected curve - Courbe selectionnée + Courbe selectionnée Point label @@ -748,12 +776,24 @@ Variables - Click twice to insert into formula Variables - Double-cliquer pour ajouter à une formule + + Segment an arc + + + + Selected arc + + + + Color + + DialogCutSpline Cut curve - Couper la courbe + Couper la courbe Length @@ -761,7 +801,7 @@ Calculate value - Calculer valeur + Calculer valeur Value of length @@ -827,12 +867,20 @@ Variables - Click twice to insert into formula Variables - Double-cliquer pour ajouter à une formule + + Segmenting a simple curve + + + + Color + + DialogCutSplinePath Cut curve path - Couper le chemin de la courbe + Couper le chemin de la courbe Length @@ -840,7 +888,7 @@ Calculate value - Calculer valeur + Calculer valeur Value of length @@ -906,6 +954,14 @@ Variables - Click twice to insert into formula Variables - Double-cliquer pour ajouter à une formule + + Segment a curved path + + + + Color + + DialogDetail @@ -957,6 +1013,10 @@ Reverse + + Seam allowance tool + + DialogEditWrongFormula @@ -974,7 +1034,7 @@ Calculate value - Valeur calculée + Valeur calculée Value of first angle @@ -1033,7 +1093,7 @@ DialogEndLine Point in the end of a line - Point en fin de ligne + Point en fin de ligne Length @@ -1041,7 +1101,7 @@ Calculate value - Valeur calculée + Valeur calculée Value of length @@ -1119,12 +1179,20 @@ Variables Variables + + Point at distance and angle + Point à distance et angle + + + Line color + + DialogHeight Height - Stature + Stature Point label @@ -1158,6 +1226,18 @@ Select second point of line Choisir le deuxième point de la ligne + + Perpendicular point along line + Point perpendiculaire le long d'une ligne + + + Base Point + + + + Line color + + DialogHistory @@ -1404,6 +1484,22 @@ Can't save measurement Les mesures ne peuvent être enregistrées + + Tables of Variables + + + + Base size: %1 %3; Base height: %2 %3 + + + + Description: "%1" + + + + Data successfully saved. + + DialogIndividualMeasurements @@ -1476,11 +1572,121 @@ Pouces + + DialogLayoutProgress + + Creation a layout + + + + <html><head/><body><p>Finding best position for worpieces. Please, waite.</p></body></html> + + + + Couldn't prepare data for creation layout + + + + Critical error + + + + Wrong paper size + + + + Several workpieces left not arranged, but none of them match for paper + + + + + DialogLayoutSettings + + Creation a layout + + + + Paper size + + + + Templates: + + + + Width: + + + + Height: + + + + ... + ... + + + Rotate workpiece + + + + Rotate by + + + + degree + + + + Creation options + + + + Layout width: + + + + Shift length: + + + + Principle of choosing the next workpiece + + + + Three groups: big, middle, small + + + + Two groups: big, small + + + + Descending area + + + + Millimiters + Millimètres + + + Centimeters + Centimètres + + + Inches + Pouces + + + Pixels + + + DialogLine Line - Ligne + Ligne First point @@ -1502,12 +1708,20 @@ Select second point Choisir le deuxième point + + Line between points + Ligne entre plusieurs points + + + Line color + + DialogLineIntersect Intersection of lines - Intersection des lignes + Intersection des lignes Point label @@ -1541,12 +1755,16 @@ Select second point of second line Choisir le deuxième point de la deuxième ligne + + Point at line intersection + + DialogLineIntersectAxis Line intersect axis - Intersection ligne, axe + Intersection ligne, axe Angle @@ -1554,7 +1772,7 @@ Calculate value - Calcule la valeur + Calcule la valeur Value of angle @@ -1640,6 +1858,22 @@ Select axis point Choisir un point d'axe + + Point intersect line and axis + + + + Axis Point + + + + Second point of line + Deuxième point de la ligne + + + Line color + + DialogMeasurements @@ -1672,7 +1906,7 @@ DialogNormal Normal - Normal + Normal Length @@ -1684,7 +1918,7 @@ Calculate value - Calculer la valeur + Calculer la valeur Value of length @@ -1762,6 +1996,22 @@ Select second point of line Choisir le second point d'une ligne + + Point along perpendicular + Point le long d'une perpendiculaire + + + First point of line + Premier point de la ligne + + + Second point of line + Deuxième point de la ligne + + + Line color + + DialogPatternProperties @@ -1937,7 +2187,7 @@ DialogPointOfContact Point of contact - Point de contact + Point de contact Radius @@ -1949,7 +2199,7 @@ Calculate value - Calculer valeur + Calculer valeur Value of radius @@ -2023,12 +2273,16 @@ Select second point of line Choisir le second point d'une ligne + + Point at intersection of arc and line + Point à l'intersection d'un arc et d'une ligne + DialogPointOfIntersection Point of intersection - Point d'intersection + Point d'intersection Point label @@ -2036,7 +2290,7 @@ vertical point - Point vertical + Point vertical First point of angle @@ -2044,7 +2298,7 @@ horizontal point - point horizontal + point horizontal Second point of angle @@ -2052,14 +2306,30 @@ Select point horizontally - Choisir le point horizontalement + Choisir le point horizontalement + + + Point from X and Y of two other points + + + + X: vertical point + + + + Y: horizontal point + + + + Select point for Y value (horizontal) + DialogShoulderPoint Point of shoulder - Point d'épaule + Point d'épaule Length @@ -2071,7 +2341,7 @@ Calculate value - Calculer valeur + Calculer valeur Value of length @@ -2153,6 +2423,14 @@ Select second point of line Choisir le second point d'une ligne + + Special point on shoulder + Point spécial d'épaule + + + Line color + + DialogSinglePoint @@ -2185,7 +2463,7 @@ DialogSpline Curve - Courbe + Courbe First point @@ -2219,6 +2497,14 @@ Select last point of curve Choisir le dernier point de la courbe + + Simple curve + + + + Color + + DialogSplinePath @@ -2258,6 +2544,10 @@ Select point of curve path Choisir un point sur la courbe + + Color + + DialogStandardMeasurements @@ -2320,12 +2610,16 @@ Parser error: %1 + + Line Angle + + DialogTriangle Triangle - Triangle + Triangle Point label @@ -2363,6 +2657,22 @@ Select second point Choisir le deuxième point + + Triangle tool + + + + First point of the axis + + + + Second point of the axis + + + + Second point of line + Deuxième point de la ligne + DialogUndo @@ -2391,7 +2701,7 @@ DialogUnionDetails Union details - Détail d'union + Détail d'union <html><head/><body><p>Do you really want union details?</p></body></html> @@ -2413,6 +2723,10 @@ Select detail Choisir les détails + + Union tool + + Functions @@ -2570,11 +2884,11 @@ Special point on shoulder. - Point spécial d'épaule. + Point spécial d'épaule. Tool triangle. - Outil triangle. + Outil triangle. Perpendicular point along line @@ -2586,11 +2900,11 @@ Point at intersection of arc and line. - Point à l'intersection d'un arc et d'une ligne. + Point à l'intersection d'un arc et d'une ligne. Tool to make point from x & y of two other points. - Créer un nouveau point à partir des coordonnées x & y de deux points différents. + Créer un nouveau point à partir des coordonnées x & y de deux points différents. Point at distance and angle @@ -2602,7 +2916,7 @@ Point of intersection line and axis - Point à l'intersection d'un axe et d'une ligne + Point à l'intersection d'un axe et d'une ligne ... @@ -2635,19 +2949,19 @@ Curve tool. - Outils courbe. + Outils courbe. Tool for path curve. - Outil pour chemin de courbe. + Outil pour chemin de courbe. Tool for segmenting a curve. - Outil pour segmenter une courbe. + Outil pour segmenter une courbe. Tool segment a pathed curve. - Outil segment d'une courbe le long d'un chemin. + Outil segment d'une courbe le long d'un chemin. Tools for creating arcs. @@ -2659,11 +2973,11 @@ Arc tool. - Outil arc. + Outil arc. Cut arc tool. - Outil Coupe Arc. + Outil Coupe Arc. Tools for creating details. @@ -2675,11 +2989,11 @@ Tool new detail. - Outil nouveau détail. + Outil nouveau détail. Tool for union two details. - outil d'union de deux détails. + outil d'union de deux détails. &File @@ -3013,7 +3327,7 @@ Pour ouvrir un patron vous devez garder les deux fichiers: patron et mesures. Vo Select point vertically - Choisir le point verticallement + Choisir le point verticallement Select detail @@ -3173,6 +3487,82 @@ Voulez-vous sauvegarder les changements ? Individual measurements (*.vit) Mesures individuelles (*.vit) + + Special point on shoulder + Point spécial d'épaule + + + Triangle tool + + + + Point at intersection of arc and line + Point à l'intersection d'un arc et d'une ligne + + + Point from X and Y of two other points + + + + Point intersect line and axis + + + + Simple curve + + + + Curved path + Chemin de courbe + + + Segmenting a simple curve + + + + Segment a curved path + + + + Point intersect curve and axis + + + + Segment an arc + + + + Point intersect arc and axis + + + + Seam allowance tool + + + + Union tool + + + + toolBar + toolBar + + + Last Tool + + + + Activate last used tool again + + + + L + + + + Select point for X value (vertical) + + Measurements @@ -5240,6 +5630,14 @@ Voulez-vous sauvegarder les changements ? Patterns Patrons + + Standard measurements + + + + Layout + + PatternPage @@ -5329,6 +5727,10 @@ Voulez-vous sauvegarder les changements ? The text that appears in the second column header Valeur + + px + + QmuParserErrorMsg @@ -5562,19 +5964,19 @@ Voulez-vous sauvegarder les changements ? Next - Suivant + Suivant Next detail - Détail suivant + Détail suivant Turn - Tourner + Tourner Turn the detail 90 degrees - Tourne le détail de 90 degrés + Tourne le détail de 90 degrés Stop @@ -5586,23 +5988,23 @@ Voulez-vous sauvegarder les changements ? Enlarge letter - Grossier la lettre + Grossier la lettre Enlarge the length of the sheet - Augmenter la longueur de la feuille + Augmenter la longueur de la feuille Reduce sheet - Réduire la feuille + Réduire la feuille Reduce the length of the sheet - Réduire la longueur de la feuille + Réduire la longueur de la feuille Mirroring - Mise en miroir + Mise en miroir Zoom In @@ -5614,15 +6016,15 @@ Voulez-vous sauvegarder les changements ? 0 details left. - 0 détails restant. + 0 détails restant. Collisions not found. - Collisions non trouvées. + Collisions non trouvées. %1 details left. - %1 détails restant(s). + %1 détails restant(s). untitled @@ -5650,7 +6052,7 @@ Voulez-vous sauvegarder les changements ? Collisions found. - Collisions trouvées. + Collisions trouvées. Creating file '%1' failed! %2 @@ -5664,6 +6066,14 @@ Voulez-vous sauvegarder les changements ? Wavefront OBJ (*.obj) + + Layout pages + + + + Layout + + VAbstractConverter @@ -5714,6 +6124,34 @@ Voulez-vous sauvegarder les changements ? Do you really want delete? Voulez vous vraiment supprimer ? + + black + + + + green + + + + blue + + + + dark red + + + + dark green + + + + dark blue + + + + yellow + + VApplication @@ -5741,10 +6179,6 @@ Voulez-vous sauvegarder les changements ? Something's wrong!! Quel que chose ne va pas!! - - Could not remove document file - le fichier n'a pas pu etre supprimé - VContainer @@ -5808,11 +6242,11 @@ Voulez-vous sauvegarder les changements ? Got wrong parameter id. Need only id > 0. - Mauvais id . Seul les id > 0 sont autorisés. + This id is not unique. - Cet idientifiant n'est pas unique. + Could not copy temp file to document file @@ -5820,7 +6254,7 @@ Voulez-vous sauvegarder les changements ? Could not remove document file - le fichier n'a pas pu etre supprimé + @@ -6023,14 +6457,6 @@ Voulez-vous sauvegarder les changements ? Error creating or updating union details Erreur : Création ou mise à jour d'un union de détails - - Got wrong parameter id. Need only id > 0. - Mauvais id . Seul les id > 0 sont autorisés. - - - This id is not unique. - Cet idientifiant n'est pas unique. - File error. Erreur de fichier. @@ -6203,6 +6629,18 @@ Voulez-vous sauvegarder les changements ? Point intersection line and axis Point à l'intersection d'un axe et d'une ligne + + Line color + + + + Color + + + + Point intersection curve and axis + + Variables diff --git a/share/translations/valentina_he_IL.ts b/share/translations/valentina_he_IL.ts index c404d266f..2d2847b9d 100644 --- a/share/translations/valentina_he_IL.ts +++ b/share/translations/valentina_he_IL.ts @@ -252,10 +252,6 @@ DialogAlongLine - - Point along line - - Length אורך @@ -266,7 +262,7 @@ Calculate value - לחשב ערך + לחשב ערך Value of length @@ -348,6 +344,14 @@ Select second point of line + + Point at distance along line + + + + Line color + + DialogArc @@ -365,7 +369,7 @@ Calculate value - לחשב ערך + לחשב ערך Value of radius @@ -447,10 +451,6 @@ Variables - - Value of angle of line. - - Error @@ -463,13 +463,13 @@ Angles equal + + Color + + DialogBisector - - Bisector - - Length אורך @@ -480,7 +480,7 @@ Calculate value - לחשב ערך + לחשב ערך Value of length @@ -574,21 +574,21 @@ Select third point of angle + + Point along bisector + + + + Line color + + DialogCurveIntersectAxis - - Curve intersect axis - - Angle - - Calculate value - לחשב ערך - Value of angle @@ -601,10 +601,6 @@ Axis point - - First point of line - - Curve עקומה @@ -665,20 +661,28 @@ Select axis point + + Point intersect curve and axis + + + + Axis Point + + + + Line color + + DialogCutArc - - Cut arc - - Length אורך Calculate value - לחשב ערך + לחשב ערך Value of length @@ -696,10 +700,6 @@ Arc - - Selected curve - - Point label תווית הנקודה @@ -744,20 +744,28 @@ Variables - Click twice to insert into formula + + Segment an arc + + + + Selected arc + + + + Color + + DialogCutSpline - - Cut curve - - Length אורך Calculate value - לחשב ערך + לחשב ערך Value of length @@ -823,20 +831,24 @@ Variables - Click twice to insert into formula + + Segmenting a simple curve + + + + Color + + DialogCutSplinePath - - Cut curve path - - Length אורך Calculate value - לחשב ערך + לחשב ערך Value of length @@ -902,6 +914,14 @@ Variables - Click twice to insert into formula + + Segment a curved path + + + + Color + + DialogDetail @@ -953,6 +973,10 @@ Reverse + + Seam allowance tool + + DialogEditWrongFormula @@ -968,10 +992,6 @@ Insert variable into formula - - Calculate value - לחשב ערך - Value of first angle @@ -1027,17 +1047,13 @@ DialogEndLine - - Point in the end of a line - - Length אורך Calculate value - לחשב ערך + לחשב ערך Value of length @@ -1115,13 +1131,17 @@ Variables + + Point at distance and angle + + + + Line color + + DialogHeight - - Height - - Point label תווית הנקודה @@ -1154,6 +1174,18 @@ Select second point of line + + Perpendicular point along line + + + + Base Point + + + + Line color + + DialogHistory @@ -1400,6 +1432,22 @@ Can't save measurement + + Tables of Variables + + + + Base size: %1 %3; Base height: %2 %3 + + + + Description: "%1" + + + + Data successfully saved. + + DialogIndividualMeasurements @@ -1472,11 +1520,117 @@ + + DialogLayoutProgress + + Creation a layout + + + + <html><head/><body><p>Finding best position for worpieces. Please, waite.</p></body></html> + + + + Couldn't prepare data for creation layout + + + + Critical error + + + + Wrong paper size + + + + Several workpieces left not arranged, but none of them match for paper + + + + + DialogLayoutSettings + + Creation a layout + + + + Paper size + + + + Templates: + + + + Width: + + + + Height: + + + + Rotate workpiece + + + + Rotate by + + + + degree + + + + Creation options + + + + Layout width: + + + + Shift length: + + + + Principle of choosing the next workpiece + + + + Three groups: big, middle, small + + + + Two groups: big, small + + + + Descending area + + + + Millimiters + + + + Centimeters + + + + Inches + + + + Pixels + + + DialogLine Line - קו + קו First point @@ -1498,12 +1652,20 @@ Select second point לבחור נקודה שנייה + + Line between points + + + + Line color + + DialogLineIntersect Intersection of lines - הצטלבות של קווים + הצטלבות של קווים Point label @@ -1537,21 +1699,17 @@ Select second point of second line + + Point at line intersection + + DialogLineIntersectAxis - - Line intersect axis - - Angle - - Calculate value - לחשב ערך - Value of angle @@ -1636,6 +1794,22 @@ Select axis point + + Point intersect line and axis + + + + Axis Point + + + + Second point of line + + + + Line color + + DialogMeasurements @@ -1666,10 +1840,6 @@ DialogNormal - - Normal - - Length אורך @@ -1680,7 +1850,7 @@ Calculate value - לחשב ערך + לחשב ערך Value of length @@ -1758,6 +1928,22 @@ Select second point of line + + Point along perpendicular + + + + First point of line + + + + Second point of line + + + + Line color + + DialogPatternProperties @@ -1931,10 +2117,6 @@ DialogPointOfContact - - Point of contact - - Radius רדיוס @@ -1945,7 +2127,7 @@ Calculate value - לחשב ערך + לחשב ערך Value of radius @@ -2019,44 +2201,44 @@ Select second point of line + + Point at intersection of arc and line + + DialogPointOfIntersection - - Point of intersection - - Point label תווית הנקודה - - vertical point - - First point of angle - - horizontal point - - Second point of angle - Select point horizontally + Point from X and Y of two other points + + + + X: vertical point + + + + Y: horizontal point + + + + Select point for Y value (horizontal) DialogShoulderPoint - - Point of shoulder - - Length אורך @@ -2067,7 +2249,7 @@ Calculate value - לחשב ערך + לחשב ערך Value of length @@ -2149,6 +2331,14 @@ Select second point of line + + Special point on shoulder + + + + Line color + + DialogSinglePoint @@ -2181,7 +2371,7 @@ DialogSpline Curve - עקומה + עקומה First point @@ -2215,6 +2405,14 @@ Select last point of curve + + Simple curve + + + + Color + + DialogSplinePath @@ -2254,6 +2452,10 @@ Select point of curve path + + Color + + DialogStandardMeasurements @@ -2316,13 +2518,13 @@ Parser error: %1 + + Line Angle + + DialogTriangle - - Triangle - - Point label תווית הנקודה @@ -2359,6 +2561,22 @@ Select second point לבחור נקודה שנייה + + Triangle tool + + + + First point of the axis + + + + Second point of the axis + + + + Second point of line + + DialogUndo @@ -2385,10 +2603,6 @@ DialogUnionDetails - - Union details - - <html><head/><body><p>Do you really want union details?</p></body></html> @@ -2409,6 +2623,10 @@ Select detail + + Union tool + + Functions @@ -2563,14 +2781,6 @@ Point along perpendicular - - Special point on shoulder. - - - - Tool triangle. - - Perpendicular point along line @@ -2579,14 +2789,6 @@ Point along bisector - - Point at intersection of arc and line. - - - - Tool to make point from x & y of two other points. - - Point at distance and angle @@ -2595,10 +2797,6 @@ Point at distance along line - - Point of intersection line and axis - - ... @@ -2627,22 +2825,6 @@ Curve עקומה - - Curve tool. - - - - Tool for path curve. - - - - Tool for segmenting a curve. - - - - Tool segment a pathed curve. - - Tools for creating arcs. @@ -2651,14 +2833,6 @@ Arc - - Arc tool. - - - - Cut arc tool. - - Tools for creating details. @@ -2667,14 +2841,6 @@ Detail - - Tool new detail. - - - - Tool for union two details. - - &File @@ -3004,10 +3170,6 @@ For opening pattern need keep both files: pattern and measurements. Do you want Select first point of axis - - Select point vertically - - Select detail @@ -3165,6 +3327,82 @@ Do you want to save your changes? Individual measurements (*.vit) + + Special point on shoulder + + + + Triangle tool + + + + Point at intersection of arc and line + + + + Point from X and Y of two other points + + + + Point intersect line and axis + + + + Simple curve + + + + Curved path + + + + Segmenting a simple curve + + + + Segment a curved path + + + + Point intersect curve and axis + + + + Segment an arc + + + + Point intersect arc and axis + + + + Seam allowance tool + + + + Union tool + + + + toolBar + + + + Last Tool + + + + Activate last used tool again + + + + L + + + + Select point for X value (vertical) + + Measurements @@ -5232,6 +5470,14 @@ Do you want to save your changes? Patterns + + Standard measurements + + + + Layout + + PatternPage @@ -5321,6 +5567,10 @@ Do you want to save your changes? The text that appears in the second column header + + px + + QmuParserErrorMsg @@ -5552,22 +5802,6 @@ Do you want to save your changes? Save layout - - Next - - - - Next detail - - - - Turn - - - - Turn the detail 90 degrees - - Stop @@ -5576,26 +5810,6 @@ Do you want to save your changes? Stop laying - - Enlarge letter - - - - Enlarge the length of the sheet - - - - Reduce sheet - - - - Reduce the length of the sheet - - - - Mirroring - - Zoom In @@ -5604,18 +5818,6 @@ Do you want to save your changes? Zoom Out - - 0 details left. - - - - Collisions not found. - - - - %1 details left. - - untitled @@ -5640,10 +5842,6 @@ Do you want to save your changes? EPS files (*.eps) - - Collisions found. - - Creating file '%1' failed! %2 @@ -5656,6 +5854,14 @@ Do you want to save your changes? Wavefront OBJ (*.obj) + + Layout pages + + + + Layout + + VAbstractConverter @@ -5706,6 +5912,34 @@ Do you want to save your changes? Do you really want delete? + + black + + + + green + + + + blue + + + + dark red + + + + dark green + + + + dark blue + + + + yellow + + VApplication @@ -6181,6 +6415,18 @@ Do you want to save your changes? Point intersection line and axis + + Line color + + + + Color + + + + Point intersection curve and axis + + Variables diff --git a/share/translations/valentina_id_ID.ts b/share/translations/valentina_id_ID.ts index 44fd724af..b87094384 100644 --- a/share/translations/valentina_id_ID.ts +++ b/share/translations/valentina_id_ID.ts @@ -4,7 +4,6 @@ AddDet - Add detail tambahkan detail @@ -12,7 +11,6 @@ AddPatternPiece - Add pattern piece %1 Tambahkan Potongan Pola %1 @@ -20,7 +18,6 @@ AddToCalc - Add object tambahkan obyek @@ -28,7 +25,6 @@ AddUnionDetails - Add union details Tambah rincian himpunan @@ -36,67 +32,54 @@ CommunityPage - Server Server - Server name/IP Nama Server/IP - Secure connection Sambungan Aman - Proxy settings Setingan Proxy - Use Proxy Gunakan Proxy - Proxy address Alamat Proxy - Proxy port Saluran Proxy - Proxy user Pengguna Proxy - Proxy pass - User settings Pengaturan Pengguna - User Name Nama Pengguna - Save password Simpan sandi - Password Sandi @@ -104,42 +87,34 @@ ConfigDialog - Apply Terapkan - &Cancel &Batalkan - &Ok &Ok - Config Dialog Dialog konfigurasi - Configuration Konfigurasi - Pattern Pola - Community Komunitas - Paths @@ -147,92 +122,74 @@ ConfigurationPage - Setup user interface language updated and will be used the next time start Pengaturan bahasa antarmuka pengguna diperbarui dan akan digunakan waktu mulai berikutnya - Default unit updated and will be used the next pattern creation Unit standar diperbarui dan akan digunakan pada pembuatan pola berikutnya - Save Simpan - Auto-save modified pattern Simpan otomatis Pola yang telah dimodifikasi - - Interval: - selang waktu - - - min minimal - + Interval: + selang waktu + + Language Bahasa - GUI language Bahasa GUI - Decimal separator parts komponen pemisah desimal - With OS options (%1) dengan pilihan OS (%1) - Default unit Unit Standar - Centimeters Centimeter - Millimiters Milimeter - Inches Inchi - Label language label bahasa - Send crash reports Kirim laporan kerusakan - Send crash reports (recommended) Kirim laporan kerusakan (disarankan) - After each crash Valentina collect information that may help us fix a problem. We do not collect any personal information. Find more about what <a href="https://bitbucket.org/dismine/valentina/wiki/manual/Crash_reports">kind of information</a> we collect. Setelah setiap kerusakan Valentina mengumpulkan informasi yang dapat membantu kami memperbaiki suatu masalah. Kami tidak mengumpulkan informasi pribadi apapun. Temukan lebih lanjut tentang apa <a href="https://bitbucket.org/dismine/valentina/wiki/manual/Crash_reports"> jenis informasi </a> kami kumpulkan. @@ -240,7 +197,6 @@ DelTool - Delete tool Hapus alat bantu @@ -248,7 +204,6 @@ DeleteDetail - Delete tool Hapus alat bantu @@ -256,7 +211,6 @@ DeletePatternPiece - Delete pattern piece %1 Hapus bagian pola % 1 @@ -264,1020 +218,870 @@ DialogAboutApp - About Valentina Mengenai Valentina - Valentina version Versi Valentina - - Build revision: - - - - Contributors para kontributor - Based on Qt %2 (32 bit) - Berdasarkan pada Qt %2 (32 bit) - - - Built on %3 at %4 Dibuat pada %3 at %4 - Web site : %1 Situs web : % 1 - Warning peringatan - Cannot open your default browser Tidak dapat membuka peramban bawaan Anda + + Build revision: + + DialogAlongLine - Point along line - Titik di sepanjang garis + Titik di sepanjang garis - Length panjang - Insert variable into the formula Masukkan variabel ke dalam rumus - Calculate value - Hitung nilai + Hitung nilai - Value of length Nilai panjang - <html><head/><body><p>Show full calculation in message box</p></body></html> <html><head/><body><p>Tampilkan penuh perhitungan dalam kotak pesan</p></body></html> - Point label label titik - First point Titik pertama - First point of line Titik pertama dari baris - Second point titik kedua - Second point of line titik kedua dari baris - Type of line Jenis baris - Show line from first point to this point Tampilkan garis dari titik pertama ke titik ini - Input data masukkan data - Size and height Ukuran dan tinggi - Measurements pengukuran - Increments penambahan - Length of lines Panjang garis - Length of arcs Panjang busur - Length of curves Panjang kurva - Angle of lines Sudut garis - Hide empty measurements Sembunyikan pengukuran kosong - Variables - Click twice to insert into formula Variabel - Klik dua kali untuk menyisipkan ke dalam rumus - Select second point of line Pilih titik kedua dari garis + + Point at distance along line + + + + Line color + + DialogArc - Arc busur - Radius radius - Insert variable into the formula sisipkan variabel ke dalam formula - - - Calculate value - hitung nilai + hitung nilai - Value of radius nilai radius - - - <html><head/><body><p>Show full calculation in message box</p></body></html> <html><head/><body><p>Tampilkan perhitungan penuh dalam kotak pesa</p></body></html> - - Insert variable into formula - sisipkan variabel ke dalam formula - - - - Value of first angle - nilai dari sudut pertama - - - - Measurements - pengukuran - - - First angle sudut pertama - + Insert variable into formula + sisipkan variabel ke dalam formula + + + Value of first angle + nilai dari sudut pertama + + Second angle sudut kedua - Insert marked variable into formula sisipkan variabel yang ditandai ke dalam formula - Value of second angle nilai dari sudut kedua - Center point titik tengah - Select point of center of arc pilih titik tengah dari busur - Input data masukkan data - Size and height ukuran dan tinggi - + Measurements + pengukuran + + Increments tambahan - Length of lines panjang garis - Length of arcs panjang busur - Length of curves panjang kurva - Angle of lines sudut garis - Hide empty measurements sembunyikan pengukuran yang kosong - Variables variabel - Value of angle of line. - nilai sudut garis + nilai sudut garis - - - Error - Radius can't be negative - - Angles equal + + Color + + DialogBisector - - Bisector - - - - Length panjang - Insert marked variable into the formula sisipkan variabel yang ditandai ke dalam rumus - Calculate value - hitung nilai + hitung nilai - Value of length nilai panjang - <html><head/><body><p>Show full calculation in message box</p></body></html> <html><head/><body><p>Tampilkan penuh perhitungan dalam kotak pesan</p></body></html> - Point label label titik - First point Titik pertama - First point of angle Titik pertama dari sudut - Second point titik kedua - Second point of angle titik kedua dari sudut - Third point titik ketiga - Third point of angle titik ketiga dari sudut - Type of line Jenis baris - Show line from second point to this point Tampilkan garis dari titik kedua ke titik ini - Input data masukan data - Size and height ukuran dan panjang - Measurements pengukuran - Increments tambahan - Length of lines Panjang garis - Length of arcs Panjang busur - Length of curves Panjang kurva - Angle of lines Sudut garis - Hide empty measurements Sembunyikan pengukuran kosong - Variables - Click twice to insert into formula Variabel - Klik dua kali untuk menyisipkan ke dalam rumus - Select second point of angle Pilih titik kedua dari sudut - Select third point of angle Pilih titik ketiga dari garis + + Point along bisector + + + + Line color + + DialogCurveIntersectAxis - Curve intersect axis - sumbu perpotongan kurva + sumbu perpotongan kurva - Angle sudut - Calculate value - Hitung nilai + Hitung nilai - Value of angle nilai dari sudut - <html><head/><body><p>Show full calculation in message box</p></body></html> <html><head/><body><p>Tampilkan penuh perhitungan dalam kotak pesan</p></body></html> - Axis point titik sumbu - - First point of line - Titik pertama dari baris + Titik pertama dari baris - Curve kurva - Point label label titik - Type of line Jenis baris - Show line from first point to this point Tampilkan garis dari titik pertama ke titik ini - Input data masukan data - Size and height ukuran dan panjang - Measurements pengukuran - Increments tambahan - Length of lines panjang garis - Length of arcs panjang busur - Length of curves Panjang kurva - Angle of lines Sudut garis - Hide empty measurements Sembunyikan pengukuran kosong - Variables variabel - Select axis point pilih titik sumbu + + Point intersect curve and axis + + + + Axis Point + + + + Line color + + DialogCutArc - + Cut arc + potong busur + + Length panjang - - Cut arc - potong busur - - - Calculate value - Hitung nilai + Hitung nilai - Value of length Nilai panjang - _ - - <html><head/><body><p>Show full calculation in message box</p></body></html> <html><head/><body><p>Tampilkan perhitungan penuh dalam kotak pesan</p></body></html> - Arc busur - Selected curve - kurva yang telah dipilih + kurva yang telah dipilih - Point label label titik - Input data masukan data - Size and height ukuran dan panjang - Measurements pengukuran - Increments tambahan - Length of lines panjang garis - Length of arcs panjang busur - Length of curves Panjang kurva - Angle of lines Sudut garis - Hide empty measurements Sembunyikan pengukuran kosong - Variables - Click twice to insert into formula Variabel - Klik dua kali untuk menyisipkan ke dalam rumus + + Segment an arc + + + + Selected arc + + + + Color + + DialogCutSpline - + Cut curve + potong kurva + + Length panjang - - Cut curve - potong kurva - - - Calculate value - Hitung nilai + Hitung nilai - Value of length Nilai panjang - _ _ - <html><head/><body><p>Show full calculation in message box</p></body></html> <html><head/><body><p>Tampilkan perhitungan penuh dalam kotak pesan</p></body></html> - Curve kurva - Selected curve kurva yang telah dipilih - Point label label titik - Input data masukan data - Size and height ukuran dan panjang - Measurements pengukuran - Increments tambahan - Length of lines panjang garis - Length of arcs panjang busur - Length of curves Panjang kurva - Angle of lines Sudut garis - Hide empty measurements Sembunyikan pengukuran kosong - Variables - Click twice to insert into formula Variabel - Klik dua kali untuk menyisipkan ke dalam rumus + + Segmenting a simple curve + + + + Color + + DialogCutSplinePath - + Cut curve path + potong jalur curva + + Length panjang - - Cut curve path - potong jalur curva - - - Calculate value - Hitung nilai + Hitung nilai - Value of length Nilai panjang - _ _ - <html><head/><body><p>Show full calculation in message box</p></body></html> <html><head/><body><p>Tampilkan perhitungan penuh dalam kotak pesan</p></body></html> - Curve kurva - Selected curve path jalur kurva yang telah dipilih - Point label label titik - Input data masukan data - Size and height ukuran dan panjang - Measurements pengukuran - Increments tambahan - Length of lines panjang garis - Length of arcs panjang busur - Length of curves Panjang kurva - Angle of lines Sudut garis - Hide empty measurements Sembunyikan pengukuran kosong - Variables - Click twice to insert into formula Variabel - Klik dua kali untuk menyisipkan ke dalam rumus + + Segment a curved path + + + + Color + + DialogDetail - - Detail rincial - Bias X - - - cm cm - Bias Y - - Reverse - - - - Options pilihan - Name of detail nama rincian - Seam allowance kampuh - Width lebar - Closed tertutup - Delete hapus - Got wrong scene object. Ignore. + + Reverse + + + + Seam allowance tool + + DialogEditWrongFormula - Edit formula edit rumus - Formula rumus - Insert variable into formula sisipkan variabel ke dalam rumus - Calculate value - Hitung nilai + Hitung nilai - Value of first angle nilai dari sudut pertama - _ _ - <html><head/><body><p>Show full calculation in message box</p></body></html> <html><head/><body><p>Tampilkan perhitungan penuh dalam kotak pesan</p></body></html> - Input data masukan data - Size and height ukuran dan panjang - Measurements pengukuran - Increments tambahan - Length of lines panjang garis - Length of arcs panjang busur - Length of curves Panjang kurva - Angle of lines Sudut garis - Hide empty measurements Sembunyikan pengukuran kosong - Variables variabel @@ -1285,284 +1089,228 @@ DialogEndLine - - Point in the end of a line - - - - Length panjang - - - Calculate value - - - - Value of length - - <html><head/><body><p>Show full calculation in message box</p></body></html> - Angle sudut - Value of angle nilai dari sudut - Base point - First point of line Titik pertama dari baris - Point label label titik - Type of line Jenis baris - Show line from first point to this point Tampilkan garis dari titik pertama ke titik ini - Input data - Size and height - Measurements pengukuran - Increments - Length of lines - Length of arcs - Length of curves - Angle of lines - Hide empty measurements - Variables variabel + + Point at distance and angle + + + + Line color + + DialogHeight - - Height - - - - Point label label titik - Base point - - - - First point of line Titik pertama dari baris - Second point of line titik kedua dari baris - Type of line Jenis baris - Show line from first point to our point - Select first point of line - Select second point of line Pilih titik kedua dari garis + + Perpendicular point along line + + + + Base Point + + + + Line color + + DialogHistory - History - - Tool - - - - - Can't create record. - %1 - Base point - - %1_%2 - Line from point %1 to point %2 - %3 - Point along line %1_%2 - %1 - Point of shoulder - %3 - normal to line %1_%2 - %4 - bisector of angle %1_%2_%3 - %5 - intersection of lines %1_%2 and %3_%4 - Curve %1_%2 - Arc with center in point %1 - Curve point %1 - %4 - point of contact of arc with the center in point %1 and line %2_%3 - Point of perpendicular from point %1 to line %2_%3 - Triangle: axis %1_%2, points %3 and %4 - %1 - point of intersection %2 and %3 - %1 - cut arc with center %2 - %1 - cut curve %2_%3 - %1 - cut curve path %2 - %1 - point of intersection line %2_%3 and axis through point %4 - %1 - point of intersection curve and axis through point %2 @@ -1570,539 +1318,551 @@ DialogIncrements - - Increments - - Email - Surel - - - - - Name - Nama - - - - - The calculated value - - - - - - Base value - - - - - - In sizes - - - - - - - Description - - - - - Measurements pengukuran - Load another measurements table - Personal information - Given name - Family name - Birth date - Sex - + Email + Surel + + Hide empty measurements - - + Name + Nama + + + The calculated value + + + + Base value + + + + In sizes + + + In heights - + Description + + + Lines - Line - - - Length panjang - Curves - Curve kurva - Arcs - Arc busur - - - File error. - male - female - Could not save GivenName - Could not save FamilyName - Could not save Email - Could not save Sex - Could not save BirthDate - Measurements use different units than pattern. This pattern required measurements in %1 - Individual measurements (*.vit) - - Open file Buka file - - Wrong units. - Standard measurements (*.vst) - Name_%1 - Can't save measurement + + Tables of Variables + + + + Base size: %1 %3; Base height: %2 %3 + + + + Description: "%1" + + + + Data successfully saved. + + DialogIndividualMeasurements - Individual measurements - Pattern piece name Nama potongan pola - Exist measurements - - Path: - Given name: - Family name: - New measurements - Units: - Could not create measurements file - Please try again or change file - - File error. - - Individual measurements (*.vit) - Open file - Where save measurements? - Centimeters Centimeter - Millimiters Milimeter - Inches Inchi - DialogLine + DialogLayoutProgress - - Line + Creation a layout - + <html><head/><body><p>Finding best position for worpieces. Please, waite.</p></body></html> + + + + Couldn't prepare data for creation layout + + + + Critical error + + + + Wrong paper size + + + + Several workpieces left not arranged, but none of them match for paper + + + + + DialogLayoutSettings + + Creation a layout + + + + Paper size + + + + Templates: + + + + Width: + + + + Height: + + + + Rotate workpiece + + + + Rotate by + + + + degree + + + + Creation options + + + + Layout width: + + + + Shift length: + + + + Principle of choosing the next workpiece + + + + Three groups: big, middle, small + + + + Two groups: big, small + + + + Descending area + + + + Millimiters + Milimeter + + + Centimeters + Centimeter + + + Inches + Inchi + + + Pixels + + + + + DialogLine + First point Titik pertama - Second point titik kedua - Type of line Jenis baris - Show line from first point to this point Tampilkan garis dari titik pertama ke titik ini - Select second point + + Line between points + + + + Line color + + DialogLineIntersect - - Intersection of lines - - - - Point label label titik - First line - - First point Titik pertama - - Second point titik kedua - Second line - Select second point of first line - Select first point of second line - Select second point of second line + + Point at line intersection + + DialogLineIntersectAxis - - Line intersect axis - - - - Angle sudut - - Calculate value - - - - Value of angle nilai dari sudut - <html><head/><body><p>Show full calculation in message box</p></body></html> - Axis point titik sumbu - - - First point of line Titik pertama dari baris - First line point - Second line point - Point label label titik - Type of line Jenis baris - Show line from first point to this point Tampilkan garis dari titik pertama ke titik ini - Input data - Size and height - Measurements pengukuran - Increments - Length of lines - Length of arcs - Length of curves - Angle of lines - Hide empty measurements - Variables variabel - Select second point of line Pilih titik kedua dari garis - Select axis point pilih titik sumbu + + Point intersect line and axis + + + + Axis Point + + + + Second point of line + titik kedua dari baris + + + Line color + + DialogMeasurements - Measurements pengukuran - <html><head/><body><p><span style=" font-size:18pt;">Please, choose pattern type.</span></p></body></html> - Graduation - Use for creation pattern standard measurement table - Individual - Use for creation pattern individual measurements @@ -2110,160 +1870,137 @@ DialogNormal - - Normal - - - - Length panjang - Insert variable into formula - - Calculate value - - - - Value of length - <html><head/><body><p>Show full calculation in message box</p></body></html> - Point label label titik - First point Titik pertama - Second point titik kedua - Additional angle degrees - Type of line Jenis baris - Show line from first point to this point Tampilkan garis dari titik pertama ke titik ini - Input data - Size and height - Measurements pengukuran - Increments - Length of lines - Length of arcs - Length of curves - Angle of lines - Hide empty measurements - Variables - Click twice to insert into formula Variabel - Klik dua kali untuk menyisipkan ke dalam rumus - Select second point of line Pilih titik kedua dari garis + + Point along perpendicular + + + + First point of line + Titik pertama dari baris + + + Second point of line + titik kedua dari baris + + + Line color + + DialogPatternProperties - Pattern properties - Description - Author name Nama Pembuat - Pattern description Keterangan Pola - For technical notes. Untuk catatan teknis - Heights and Sizes - All heights (cm) - All sizes (cm) @@ -2271,174 +2008,134 @@ DialogPatternXmlEdit - XML Editor - Value : - Name : - <No selection> - Type : - Add attribute - Add son - Remove attribute - Remove node - Set - Cancel - Apply changes - Undo last - Immediate apply - Base selection - All pattern pieces - - - - No changes - Cannot delete previously created node - No changes left - Cannot undo change - - <no value> - - Unchanged - Cannot delete previously created attribute - Node Name - - Name: - Node Value (may be empty) - - Value: - Attribute Name - Attribute Value - No selection - Root node - Node - Attribute @@ -2446,308 +2143,244 @@ DialogPointOfContact - - Point of contact - - - - Radius radius - Insert variable into formula - - Calculate value - - - - Value of radius nilai radius - <html><head/><body><p>Show full calculation in message box</p></body></html> - Point label label titik - Center of arc - - Select point of center of arc pilih titik tengah dari busur - Top of the line - End of the line - Input data - Size and height - Measurements pengukuran - Increments - Length of lines - Length of arcs - Length of curves - Angle of lines - Hide empty measurements - Variables - Click twice to insert into formula. - Select second point of line Pilih titik kedua dari garis + + Point at intersection of arc and line + + DialogPointOfIntersection - - Point of intersection - - - - Point label label titik - - vertical point - - - - First point of angle Titik pertama dari sudut - - horizontal point - - - - Second point of angle titik kedua dari sudut - - Select point horizontally + Point from X and Y of two other points + + + + X: vertical point + + + + Y: horizontal point + + + + Select point for Y value (horizontal) DialogShoulderPoint - - Point of shoulder - - - - Length panjang - Insert variable into formula - - Calculate value - - - - Value of length - <html><head/><body><p>Show full calculation in message box</p></body></html> - Point label label titik - First point Titik pertama - Second point titik kedua - Third point titik ketiga - Type of line Jenis baris - Show line from first point to our point - Input data - Size and height - Measurements pengukuran - Increments - Length of lines - Length of arcs - Length of curves - Angle of lines - Hide empty measurements - Variables - Click twice to insert into formula Variabel - Klik dua kali untuk menyisipkan ke dalam rumus - Select first point of line - Select second point of line Pilih titik kedua dari garis + + Special point on shoulder + + + + Line color + + DialogSinglePoint - Single point - Coordinates on the sheet - Coordinates - Y coordinate - X coordinate - Point label label titik @@ -2755,118 +2388,104 @@ DialogSpline - - Curve - kurva - - - First point Titik pertama - Length ratio of the first control point - The angle of the first control point - Second point titik kedua - Length ratio of the second control point - The angle of the second control point - Coefficient of curvature of the curve - Select last point of curve + + Simple curve + + + + Color + + DialogSplinePath - Curved path - Point of curve - Length ratio of the first control point - The angle of the first control point - Length ratio of the second control point - The angle of the second control point - List of points - Coefficient of curvature of the curve - Select point of curve path + + Color + + DialogStandardMeasurements - Standard table - Pattern piece name Nama potongan pola - Standard measurements table - File error. @@ -2874,143 +2493,124 @@ DialogTool - - - - - Error - - - Empty field - Value can't be 0 - Value - - - Parser error: %1 - - - - Height - Size - Line length - Arc length - Curve length + + Parser error: %1 + + + + Line Angle + + DialogTriangle - - Triangle - - - - Point label label titik - First point of axis - - - - First point of line Titik pertama dari baris - Second point of axis - First point Titik pertama - Second point titik kedua - Select second point of axis - Select first point - Select second point + + Triangle tool + + + + First point of the axis + + + + Second point of the axis + + + + Second point of line + titik kedua dari baris + DialogUndo - Broken formula - Error while calculation formula. You can try undo last operation or fix broken formula. - &Undo - &Fix formula - &Cancel &Batalkan @@ -3018,185 +2618,153 @@ DialogUnionDetails - + <html><head/><body><p>Do you really want union details?</p></body></html> + + + Select first point - Select second point - - Select another second point - Select detail - - Union details - - - - - <html><head/><body><p>Do you really want union details?</p></body></html> + Union tool Functions - sin sine function - cos cosine function - tan tangens function - asin arcus sine function - acos arcus cosine function - atan arcus tangens function - sinh hyperbolic sine function - cosh hyperbolic cosine - tanh hyperbolic tangens function - asinh hyperbolic arcus sine function - acosh hyperbolic arcus tangens function - atanh hyperbolic arcur tangens function - log2 logarithm to the base 2 - log10 logarithm to the base 10 - log logarithm to the base 10 - ln logarithm to base e (2.71828...) - exp e raised to the power of x - sqrt square root of a value - sign sign function -1 if x<0; 1 if x>0 - rint round to nearest integer - abs absolute value - min min of all arguments minimal - max max of all arguments - sum sum of all arguments - avg mean value of all arguments @@ -3205,7 +2773,6 @@ InternalStrings - The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -3213,1589 +2780,1308 @@ MainWindow - Valentina - Tools for creating points. - Point - - Point at distance and angle - - - - - Special point on shoulder. - - - - - Point at intersection of arc and line. - - - - - Point along bisector - - - - Point along perpendicular - - Point at distance along line - - - - Perpendicular point along line - - Tool triangle. + Point along bisector - - Tool to make point from x & y of two other points. + Point at distance and angle - - Tools for creating lines. + Point at distance along line - - Line - - - - - Line between points - - - - - Point at line intersection - - - - - Tools for creating curves. - - - - - Curve - kurva - - - - Curve tool. - - - - - Tool for path curve. - - - - - Tool segment a pathed curve. - - - - - Tool for segmenting a curve. - - - - - Point of intersection line and axis - - - - - - ... - + Tools for creating lines. + + + + Line + + + + Line between points + + + + Point at line intersection + + + + Tools for creating curves. + + + + Curve + kurva + + Tools for creating arcs. - Arc busur - - Arc tool. - - - - - Cut arc tool. - - - - Tools for creating details. - Detail rincial - - Tool new detail. - - - - - Tool for union two details. - - - - &File - &Help - &Pattern piece - Measurements pengukuran - Window - Toolbar files - ToolBar modes - Toolbar pattern - Toolbar options - Toolbar tools - Tool options - - Save &As... - - - - - Export pattern (layout) - - - - - About &Qt - - - - - &About Valentina - - - - - E&xit - - - - - Exit the application - - - - - Preferences - - - - - Zoom in - - - - - Original zoom - - - - - Original Zoom - - - - - Zoom fit best - - - - - Ctrl+= - - - - - Stop - - - - - Stop using tool - - - - - Repot Bug... - - - - - Report bug - - - - - Close window - - - - - Online help - - - - - Show online help - - - - - zoom in - - - - - - Zoom out - - - - - Edit pattern XML code - - - - - Pattern properties - - - - New - &New - Create a new pattern - Ctrl+N - Open - &Open - Open file with pattern - Save Simpan - &Save - Save pattern - Ctrl+S - - Save as + Save &As... - Save not yet saved pattern - Ctrl+Shift+S - Draw - Draw mode - Ctrl+W - Details - Details mode - Ctrl+E - - Pointer tools - New pattern piece - Add new pattern piece - Ctrl+Shift+N - - Change the label of pattern piece - Table of variables - Tables of variables - Ctrl+T - History - Ctrl+H - + Export pattern (layout) + + + Create layout - Ctrl+L - - About Qt + About &Qt + + + + &About Valentina + + + + E&xit + + + + Exit the application - Ctrl+Q - + Preferences + + + + Pattern properties + + + + Zoom in + + + + zoom in + + + + Zoom out + + + + Edit pattern XML code + + + + Original zoom + + + + Original Zoom + + + + Zoom fit best + + + + Ctrl+= + + + + Stop + + + + Stop using tool + + + + Repot Bug... + + + + Report bug + + + + Close window + + + + Online help + + + + Show online help + + + Pattern piece %1 - - Pattern piece: - - - - - Enter a new label for the pattern piece. - - - - - - - Select point - - - - Individual measurements is under development - There is no way create individual measurements file independent on the pattern file. For opening pattern need keep both files: pattern and measurements. Do you want continue? - + Select point + + + Select first point - - - Select first point of line - Select first point of angle - Select first point of first line - Select first point curve - Select simple curve - Select point of center of arc pilih titik tengah dari busur - Select point of curve path - Select curve path - Select points, arcs, curves clockwise. - Select base point - Select first point of axis - - Select point vertically - - - - Select detail - Select arc - Select curve - - Size: + About Qt - - pattern - - - - - Critical error! - - - - - Error parsing file (std::bad_alloc). - - - - - Bad id. - - - - - - Could not save file - - - - - &Undo - - - - - &Redo - - - - - This file already opened in another window. - - - - - Wrong units. - - - - - Application doesn't support standard table with inches. - - - - - File error. - - - - - Valentina didn't shut down correctly. Do you want reopen files (%1) you had open? - - - - - Reopen files. - - - - - The measurements file <br/><br/> <b>%1</b> <br/><br/> %3 - - - - - could not be found. Do you want to update the file location - - - - - Standard measurements (*.vst) - - - - - Individual measurements (*.vit) - - - - - File loaded - - - - Height: - + Size: + + + Pattern Piece: - - Pattern files (*.val) - + pattern + + + /pattern.val /Pola.val - + Save as + + + + Could not save file + + + + Open file + Buka File + + + Error parsing file. + + + + Error can't convert value. + + + + Error empty parameter. + + + + Error wrong id. + + + + Critical error! + + + + Error parsing file (std::bad_alloc). + + + + Bad id. + + + File saved File telah disimpan - untitled.val tanpajudul.val - Unsaved change Perubahan belum disimpan - The pattern has been modified. Do you want to save your changes? Pola telah dimodiikasi Apakah anda ingin menyimpan perubahan anda? - - - Open file - Buka File - - - - - Error parsing file. + &Undo - - Error can't convert value. + &Redo - - - Error empty parameter. + Pattern piece: - - Error wrong id. + Enter a new label for the pattern piece. + + + + This file already opened in another window. + + + + Wrong units. + + + + Application doesn't support standard table with inches. + + + + File error. + + + + File loaded + + + + Valentina didn't shut down correctly. Do you want reopen files (%1) you had open? + + + + Reopen files. + + + + The measurements file <br/><br/> <b>%1</b> <br/><br/> %3 + + + + could not be found. Do you want to update the file location + + + + Standard measurements (*.vst) + + + + Individual measurements (*.vit) + + + + Special point on shoulder + + + + Triangle tool + + + + Point at intersection of arc and line + + + + Point from X and Y of two other points + + + + Point intersect line and axis + + + + Simple curve + + + + Curved path + + + + Segmenting a simple curve + + + + Segment a curved path + + + + Point intersect curve and axis + + + + Segment an arc + + + + Point intersect arc and axis + + + + Seam allowance tool + + + + Union tool + + + + toolBar + + + + Last Tool + + + + Activate last used tool again + + + + L + + + + Select point for X value (vertical) Measurements - head_girth Short measurement name. Don't use math symbols in name!!!! Lingkar Kepala - mid_neck_girth Short measurement name. Don't use math symbols in name!!!! Setengah Lingkar Leher - neck_base_girth Short measurement name. Don't use math symbols in name!!!! Lingkar Leher Bawah - head_and_neck_length Short measurement name. Don't use math symbols in name!!!! Panjang Leher dan Kepala - center_front_waist_length Short measurement name. Don't use math symbols in name!!!! - center_back_waist_length Short measurement name. Don't use math symbols in name!!!! - shoulder_length Short measurement name. Don't use math symbols in name!!!! Panjang Bahu - side_waist_length Short measurement name. Don't use math symbols in name!!!! Panjang Sisi Pinggang - trunk_length Short measurement name. Don't use math symbols in name!!!! Panjang Badan - shoulder_girth Short measurement name. Don't use math symbols in name!!!! Lingkar Bahu - upper_chest_girth Short measurement name. Don't use math symbols in name!!!! Lingkar data atas - bust_girth Short measurement name. Don't use math symbols in name!!!! Lingkar dada/payudara - under_bust_girth Short measurement name. Don't use math symbols in name!!!! lingkar bawah payudara - waist_girth Short measurement name. Don't use math symbols in name!!!! Lingkar Pinggang - high_hip_girth Short measurement name. Don't use math symbols in name!!!! Tinggi Lingkar Pinggul - hip_girth Short measurement name. Don't use math symbols in name!!!! Lingkar Pinggul - upper_front_chest_width Short measurement name. Don't use math symbols in name!!!! Lebar dada depan atas - front_chest_width Short measurement name. Don't use math symbols in name!!!! Lebar dada depan - across_front_shoulder_width Short measurement name. Don't use math symbols in name!!!! - across_back_shoulder_width Short measurement name. Don't use math symbols in name!!!! - upper_back_width Short measurement name. Don't use math symbols in name!!!! - back_width Short measurement name. Don't use math symbols in name!!!! - bustpoint_to_bustpoint Short measurement name. Don't use math symbols in name!!!! - halter_bustpoint_to_bustpoint Short measurement name. Don't use math symbols in name!!!! - neck_to_bustpoint Short measurement name. Don't use math symbols in name!!!! - crotch_length Short measurement name. Don't use math symbols in name!!!! - rise_height Short measurement name. Don't use math symbols in name!!!! - shoulder_drop Short measurement name. Don't use math symbols in name!!!! - shoulder_slope_degrees Short measurement name. Don't use math symbols in name!!!! - front_shoulder_slope_length Short measurement name. Don't use math symbols in name!!!! - back_shoulder_slope_length Short measurement name. Don't use math symbols in name!!!! - front_shoulder_to_waist_length Short measurement name. Don't use math symbols in name!!!! - back_shoulder_to_waist_length Short measurement name. Don't use math symbols in name!!!! - front_neck_arc Short measurement name. Don't use math symbols in name!!!! - back_neck_arc Short measurement name. Don't use math symbols in name!!!! - front_upper_chest_arc Short measurement name. Don't use math symbols in name!!!! - back_upper_chest_arc Short measurement name. Don't use math symbols in name!!!! - front_waist_arc Short measurement name. Don't use math symbols in name!!!! - back_waist_arc Short measurement name. Don't use math symbols in name!!!! - front_upper_hip_arc Short measurement name. Don't use math symbols in name!!!! - back_upper_hip_arc Short measurement name. Don't use math symbols in name!!!! - front_hip_arc Short measurement name. Don't use math symbols in name!!!! - back_hip_arc Short measurement name. Don't use math symbols in name!!!! - chest_slope Short measurement name. Don't use math symbols in name!!!! - back_slope Short measurement name. Don't use math symbols in name!!!! - front_waist_slope Short measurement name. Don't use math symbols in name!!!! - back_waist_slope Short measurement name. Don't use math symbols in name!!!! - front_neck_to_upper_chest_height Short measurement name. Don't use math symbols in name!!!! - front_neck_to_bust_height Short measurement name. Don't use math symbols in name!!!! - front_waist_to_upper_chest Short measurement name. Don't use math symbols in name!!!! - front_waist_to_lower_breast Short measurement name. Don't use math symbols in name!!!! - back_waist_to_upper_chest Short measurement name. Don't use math symbols in name!!!! - strap_length Short measurement name. Don't use math symbols in name!!!! - armscye_girth Short measurement name. Don't use math symbols in name!!!! - elbow_girth Short measurement name. Don't use math symbols in name!!!! - upper_arm_girth Short measurement name. Don't use math symbols in name!!!! - wrist_girth Short measurement name. Don't use math symbols in name!!!! - scye_depth Short measurement name. Don't use math symbols in name!!!! - shoulder_and_arm_length Short measurement name. Don't use math symbols in name!!!! - underarm_length Short measurement name. Don't use math symbols in name!!!! - cervicale_to_wrist_length Short measurement name. Don't use math symbols in name!!!! - shoulder_to_elbow_length Short measurement name. Don't use math symbols in name!!!! - arm_length Short measurement name. Don't use math symbols in name!!!! - hand_width Short measurement name. Don't use math symbols in name!!!! - hand_length Short measurement name. Don't use math symbols in name!!!! - hand_girth Short measurement name. Don't use math symbols in name!!!! - thigh_girth Short measurement name. Don't use math symbols in name!!!! - mid_thigh_girth Short measurement name. Don't use math symbols in name!!!! - knee_girth Short measurement name. Don't use math symbols in name!!!! - calf_girth Short measurement name. Don't use math symbols in name!!!! - ankle_girth Short measurement name. Don't use math symbols in name!!!! - knee_height Short measurement name. Don't use math symbols in name!!!! - ankle_height Short measurement name. Don't use math symbols in name!!!! - foot_width Short measurement name. Don't use math symbols in name!!!! - foot_length Short measurement name. Don't use math symbols in name!!!! - height Short measurement name. Don't use math symbols in name!!!! - cervicale_height Short measurement name. Don't use math symbols in name!!!! - cervicale_to_knee_height Short measurement name. Don't use math symbols in name!!!! - waist_height Short measurement name. Don't use math symbols in name!!!! - high_hip_height Short measurement name. Don't use math symbols in name!!!! - hip_height Short measurement name. Don't use math symbols in name!!!! - waist_to_hip_height Short measurement name. Don't use math symbols in name!!!! - waist_to_knee_height Short measurement name. Don't use math symbols in name!!!! - crotch_height Short measurement name. Don't use math symbols in name!!!! - size Short measurement name. Don't use math symbols in name!!!! - height_front_neck_base_point Short measurement name. Don't use math symbols in name!!!! - height_base_neck_side_point Short measurement name. Don't use math symbols in name!!!! - height_shoulder_point Short measurement name. Don't use math symbols in name!!!! - height_nipple_point Short measurement name. Don't use math symbols in name!!!! - height_back_angle_axilla Short measurement name. Don't use math symbols in name!!!! - height_scapular_point Short measurement name. Don't use math symbols in name!!!! - height_under_buttock_folds Short measurement name. Don't use math symbols in name!!!! - hips_excluding_protruding_abdomen Short measurement name. Don't use math symbols in name!!!! - girth_foot_instep Short measurement name. Don't use math symbols in name!!!! - side_waist_to_floor Short measurement name. Don't use math symbols in name!!!! - front_waist_to_floor Short measurement name. Don't use math symbols in name!!!! - arc_through_groin_area Short measurement name. Don't use math symbols in name!!!! - waist_to_plane_seat Short measurement name. Don't use math symbols in name!!!! - neck_to_radial_point Short measurement name. Don't use math symbols in name!!!! - neck_to_third_finger Short measurement name. Don't use math symbols in name!!!! - neck_to_first_line_chest_circumference Short measurement name. Don't use math symbols in name!!!! - front_waist_length Short measurement name. Don't use math symbols in name!!!! - arc_through_shoulder_joint Short measurement name. Don't use math symbols in name!!!! - neck_to_back_line_chest_circumference Short measurement name. Don't use math symbols in name!!!! - waist_to_neck_side Short measurement name. Don't use math symbols in name!!!! - arc_length_upper_body Short measurement name. Don't use math symbols in name!!!! - chest_width Short measurement name. Don't use math symbols in name!!!! - anteroposterior_diameter_hands Short measurement name. Don't use math symbols in name!!!! - height_clavicular_point Short measurement name. Don't use math symbols in name!!!! - height_armhole_slash Short measurement name. Don't use math symbols in name!!!! - slash_shoulder_height Short measurement name. Don't use math symbols in name!!!! - half_girth_neck Short measurement name. Don't use math symbols in name!!!! - half_girth_neck_for_shirts Short measurement name. Don't use math symbols in name!!!! - half_girth_chest_first Short measurement name. Don't use math symbols in name!!!! - half_girth_chest_second Short measurement name. Don't use math symbols in name!!!! - half_girth_chest_third Short measurement name. Don't use math symbols in name!!!! - half_girth_waist Short measurement name. Don't use math symbols in name!!!! - half_girth_hips_considering_protruding_abdomen Short measurement name. Don't use math symbols in name!!!! - half_girth_hips_excluding_protruding_abdomen Short measurement name. Don't use math symbols in name!!!! - girth_knee_flexed_feet Short measurement name. Don't use math symbols in name!!!! - neck_transverse_diameter Short measurement name. Don't use math symbols in name!!!! - front_slash_shoulder_height Short measurement name. Don't use math symbols in name!!!! - neck_to_front_waist_line Short measurement name. Don't use math symbols in name!!!! - hand_vertical_diameter Short measurement name. Don't use math symbols in name!!!! - neck_to_knee_point Short measurement name. Don't use math symbols in name!!!! - waist_to_knee Short measurement name. Don't use math symbols in name!!!! - shoulder_height Short measurement name. Don't use math symbols in name!!!! - head_height Short measurement name. Don't use math symbols in name!!!! - body_position Short measurement name. Don't use math symbols in name!!!! - arc_behind_shoulder_girdle Short measurement name. Don't use math symbols in name!!!! - neck_to_neck_base Short measurement name. Don't use math symbols in name!!!! - depth_waist_first Short measurement name. Don't use math symbols in name!!!! - depth_waist_second Short measurement name. Don't use math symbols in name!!!! @@ -4804,799 +4090,666 @@ Apakah anda ingin menyimpan perubahan anda? MeasurementsDescriptions - Around fullest part of Head Full measurement description - Around middle part of Neck Full measurement description - Around Neck at base Full measurement description - Vertical Distance from Crown to Nape Full measurement description - Front Neck Center over tape at Bustline to Front Waist Center Full measurement description - Back Neck Center to Back Waist Center Full measurement description - NeckPoint to ShoulderTip Full measurement description - Armpit to Waist side Full measurement description - Around Body from middle of Shoulder length to BustPoint to Crotch up back to beginning point Full measurement description - Around Arms and Torso, at bicep level parallel to floor, with arms hanging at the sides Full measurement description - Around Chest at Armfold level, will be parallel to floor across back, will not be parallel to floor across front chest Full measurement description - Around fullest part of Bust, parallel to floor Full measurement description - Around Chest below the Bust, parallel to floor Full measurement description - Tie a string around smallest part of waist, keep string tied while taking meaasurements. Not usually parallel to floor for front waist or back waist. Full measurement description - Around HighHip, parallel to floor Full measurement description - Around Hip, parallel to floor Full measurement description - Across Front UpperChest, smallest width from armscye to armscye Full measurement description - Across Front Chest, from armfold to armfold Full measurement description - From ShoulderTip to ShoulderTip, across Front Full measurement description - From ShoulderTip to ShoulderTip, across Back Full measurement description - Across Back UpperChest, smallest width from armscye to armscye Full measurement description - Across Back Chest, from armfold to armfold Full measurement description - Distance between BustPoints, across Chest Full measurement description - Distance from Bustpoint, behind neck, down to Bustpoint Full measurement description - From NeckPoint to BustPoint Full measurement description - From Front Waist Center, down to crotch, up to Back Waist Center Full measurement description - Sit on hard chair, measure from side waist straight down to chair bottom Full measurement description - Vertical Distance from NeckPoint level to ShoulderTip level Full measurement description - Degrees of angle from NeckPoint to ShoulderTip – requires goniometer Full measurement description - ShoulderTip to Front Waist Center Full measurement description - ShoulderTip to Back Waist Center Full measurement description - NeckPoint straight down front chest to Waistline Full measurement description - Back NeckPoint straight down back chest to Waistline Full measurement description - NeckPoint to NeckPoint through Front Neck Center Full measurement description - NeckPoint to NeckPoint across Nape Full measurement description - Front upper-bust arc Full measurement description - Back UpperBust side to side Full measurement description - Front Waist side to side Full measurement description - Back Waist side to side Full measurement description - Front UpperHip side to side Full measurement description - Back UpperHip side to side Full measurement description - Front Hip side to side Full measurement description - Back Hip side to side Full measurement description - NeckPoint to Front ArmfoldPoint Full measurement description - NeckPoint to Back ArmfoldPoint Full measurement description - NeckPoint across Front Chest to Waist side Full measurement description - NeckPoint across Back Chest to Waist side Full measurement description - Front Neck Center straight down to UpperChest line Full measurement description - Front Neck Center straight down to Bust line Full measurement description - Front Upper chest waist Full measurement description - Front waist to lower breast Full measurement description - Back waist to upper chest Full measurement description - Strap length Full measurement description - Around Armscye Full measurement description - Around Elbow with elbow bent Full measurement description - Around UpperArm Full measurement description - Around Wrist Full measurement description - Nape straight down to UnderBust line (same as Back UpperBust height) Full measurement description - NeckPoint to ShoulderTip to Wrist, with elbow bent and hand on hip Full measurement description - Armpit to Wrist, with arm straight and hanging at side Full measurement description - Nape to Wrist, with elbow bent and hand on hip Full measurement description - ShoulderTip to Elbow, with elbow bent and hand on hip Full measurement description - ShoulderTip to Wrist, with elbow bent and hand on hip Full measurement description - Hand side to side Full measurement description - Hand Middle Finger tip to wrist Full measurement description - Around Hand Full measurement description - Around Thigh Full measurement description - Around MidThigh Full measurement description - Around Knee Full measurement description - Around Calf Full measurement description - Around Ankle Full measurement description - Knee to Floor Full measurement description - Ankle to Floor Full measurement description - Widest part of Foot side to side Full measurement description - Tip of Longest Toe straight to back of heel Full measurement description - Top of head to floor Full measurement description - Nape to Floor Full measurement description - Nape to Knee Full measurement description - Waist side to floor Full measurement description - HighHip side to Floor Full measurement description - Hip side to Floor Full measurement description - Waist side to Hip Full measurement description - Waist side to Knee Full measurement description - Crotch to Floor along inside leg Full measurement description - Size Full measurement description - Height of the point base of the neck in front Full measurement description - Height of the base of the neck side point Full measurement description - The height of the shoulder point Full measurement description - Height nipple point Full measurement description - Height back angle axilla Full measurement description - Height scapular point Full measurement description - Height under buttock folds Full measurement description - Hips excluding protruding abdomen Full measurement description - Girth foot instep Full measurement description - The distance from the side waist to floor Full measurement description - The distance from the front waist to floor Full measurement description - Arc through groin area Full measurement description - The distance from the waist to the plane seat Full measurement description - The distance from the base of the neck to the side of the radial point Full measurement description - Distance from the base of the neck side point to the end of the third finger Full measurement description - The distance from the base of the neck to the side of the first line in front of chest circumference Full measurement description - The distance from the base of the neck to the waist side front (waist length in the front) Full measurement description - Arc through the highest point of the shoulder joint Full measurement description - The distance from the base of the neck to the back line of chest circumference of the first and the second based on ledge vanes Full measurement description - The distance from the waist to the back base of the neck side point Full measurement description - Arc length of the upper body through the base of the neck side point Full measurement description - Chest width Full measurement description - Anteroposterior diameter of the hands Full measurement description - Height clavicular point Full measurement description - The distance from the point to the cervical level of the posterior angle of the front armpit (underarm height oblique) Full measurement description - Slash shoulder height Full measurement description - Half girth neck Full measurement description - Half girth neck for shirts Full measurement description - Half girth chest first Full measurement description - Half girth chest second Full measurement description - Half girth chest third Full measurement description - Half girth waist Full measurement description - Half girth hips considering protruding abdomen Full measurement description - Half girth hips excluding protruding abdomen Full measurement description - Girth knee flexed feet Full measurement description - Neck transverse diameter Full measurement description - Front slash shoulder height Full measurement description - The distance from the base of the neck to the waist line front Full measurement description - Hand vertical diameter Full measurement description - Distance from neck to knee point Full measurement description - The distance from the waist to the knee Full measurement description - Shoulder height Full measurement description - Head height Full measurement description - Body position Full measurement description - Arc behind the shoulder girdle Full measurement description - Distance from neck point to point on the base of the neck side neck girth measurement line Full measurement description - Depth waist first Full measurement description - Depth waist second Full measurement description @@ -5605,799 +4758,666 @@ Apakah anda ingin menyimpan perubahan anda? MeasurementsFullNames - Head girth Full measurement name - Mid-neck girth Full measurement name - Neck Base girth Full measurement name - Head and Neck length Full measurement name - Front Center length Full measurement name - Back Center length Full measurement name - Shoulder length Full measurement name - Side Waist length Full measurement name - Trunk length Full measurement name - Shoulder girth Full measurement name - Upper Chest girth Full measurement name - Bust girth Full measurement name - Under Bust girth Full measurement name - Waist girth Full measurement name - HighHip girth Full measurement name - Hip girth Full measurement name - Front Upper Chest width Full measurement name - Front Chest width Full measurement name - Front Across Shoulder width Full measurement name - Back Across Shoulder width Full measurement name - Back Upper Chest width Full measurement name - Back Chest width Full measurement name - BustPoint to BustPoint Full measurement name - Halter Bustpoint to Bustpoint Full measurement name - NeckPoint to BustPoint Full measurement name - Crotch length Full measurement name - Rise height Full measurement name - Shoulder Drop Full measurement name - Shoulder Slope degrees Full measurement name - Front Shoulder Balance Full measurement name - Back Shoulder Balance Full measurement name - Front Full Length Full measurement name - Back Full Length Full measurement name - Front Neck arc Full measurement name - Back Neck arc Full measurement name - Front upper-bust arc Full measurement name - Back UpperBust arc Full measurement name - Front Waist arc Full measurement name - Back Waist arc Full measurement name - Front UpperHip arc Full measurement name - Back UpperHip arc Full measurement name - Front Hip arc Full measurement name - Back Hip arc Full measurement name - Chest Balance Full measurement name - Back Balance Full measurement name - Front Waist Balance Full measurement name - Back Waist Balance Full measurement name - Front UpperChest height Full measurement name - Bust height Full measurement name - Front Upper chest waist Full measurement name - Front waist to lower breast Full measurement name - Back waist to upper chest Full measurement name - Strap length Full measurement name - Armscye Girth Full measurement name - Elbow Girth Full measurement name - Upperarm Girth Full measurement name - Wrist girth Full measurement name - Armscye depth Full measurement name - Shoulder and Arm length Full measurement name - Underarm length Full measurement name - Nape to wrist length Full measurement name - Elbow length Full measurement name - Arm length Full measurement name - Hand width Full measurement name - Hand length Full measurement name - Hand girth Full measurement name - Thigh girth Full measurement name - Midthigh girth Full measurement name - Knee girth Full measurement name - Calf girth Full measurement name - Ankle girth Full measurement name - Knee height Full measurement name - Ankle height Full measurement name - Foot width Full measurement name - Foot length Full measurement name - Total Height Full measurement name - Nape height Full measurement name - Nape to knee height Full measurement name - Waist height Full measurement name - HighHip height Full measurement name - Hip height Full measurement name - Waist to Hip height Full measurement name - Waist to Knee height Full measurement name - Crotch height/Inseam Full measurement name - Size Full measurement name - Height front neck base point Full measurement name - Height base neck side point Full measurement name - Height shoulder point Full measurement name - Height nipple point Full measurement name - Height back angle axilla Full measurement name - Height scapular point Full measurement name - Height under buttock folds Full measurement name - Hips excluding protruding abdomen Full measurement name - Girth foot instep Full measurement name - Side waist to floor Full measurement name - Front waist to floor Full measurement name - Arc through groin area Full measurement name - Waist to plane seat Full measurement name - Neck to radial point Full measurement name - Neck to third finger Full measurement name - Neck to first line chest circumference Full measurement name - Front waist length Full measurement name - Arc through shoulder joint Full measurement name - Neck to back line chest circumference Full measurement name - Waist to neck side Full measurement name - Arc length upper body Full measurement name - Chest width Full measurement name - Anteroposterior diameter hands Full measurement name - Height clavicular point Full measurement name - Height armhole slash Full measurement name - Slash shoulder height Full measurement name - Half girth neck Full measurement name - Half girth neck for shirts Full measurement name - Half girth chest first Full measurement name - Half girth chest second Full measurement name - Half girth chest third Full measurement name - Half girth waist Full measurement name - Half girth hips considering protruding abdomen Full measurement name - Half girth hips excluding protruding abdomen Full measurement name - Girth knee flexed feet Full measurement name - Neck transverse diameter Full measurement name - Front slash shoulder height Full measurement name - Neck to front waist line Full measurement name - Hand vertical diameter Full measurement name - Neck to knee point Full measurement name - Waist to knee Full measurement name - Shoulder height Full measurement name - Head height Full measurement name - Body position Full measurement name - Arc behind shoulder girdle Full measurement name - Neck to neck base Full measurement name - Depth waist first Full measurement name - Depth waist second Full measurement name @@ -6406,7 +5426,6 @@ Apakah anda ingin menyimpan perubahan anda? MoveLabel - Move point label @@ -6414,7 +5433,6 @@ Apakah anda ingin menyimpan perubahan anda? MoveSPoint - Move single point @@ -6422,7 +5440,6 @@ Apakah anda ingin menyimpan perubahan anda? MoveSpline - Move spline @@ -6430,7 +5447,6 @@ Apakah anda ingin menyimpan perubahan anda? MoveSplinePath - Move spline path @@ -6438,75 +5454,69 @@ Apakah anda ingin menyimpan perubahan anda? PathPage - Open Directory - Path that use Valentina - Default - Edit - Type - Path - Individual measurements - Patterns + + Standard measurements + + + + Layout + + PatternPage - User - User name - Graphical output - Use antialiasing - Undo - Count steps (0 - no limit) @@ -6514,19 +5524,16 @@ Apakah anda ingin menyimpan perubahan anda? PostfixOperators - cm centimeter cm - mm millimeter - in inch @@ -6535,7 +5542,6 @@ Apakah anda ingin menyimpan perubahan anda? QCoreApplication - Based on Qt %1 (%2, %3 bit) @@ -6543,272 +5549,230 @@ Apakah anda ingin menyimpan perubahan anda? QObject - Create new pattern piece to start working. - Add node - Move detail - mm - - cm cm - inch - Property The text that appears in the first column header - Value The text that appears in the second column header + + px + + QmuParserErrorMsg - Unexpected token "$TOK$" found at position $POS$. Math parser error messages. Left untouched "$TOK$" and $POS$ - Internal error Math parser error messages. - Invalid function-, variable- or constant name: "$TOK$". Math parser error messages. Left untouched "$TOK$" - Invalid binary operator identifier: "$TOK$". Math parser error messages. Left untouched "$TOK$" - Invalid infix operator identifier: "$TOK$". Math parser error messages. Left untouched "$TOK$" - Invalid postfix operator identifier: "$TOK$". Math parser error messages. Left untouched "$TOK$" - Invalid pointer to callback function. Math parser error messages. - Expression is empty. Math parser error messages. - Invalid pointer to variable. Math parser error messages. - Unexpected operator "$TOK$" found at position $POS$ Math parser error messages. Left untouched "$TOK$" and $POS$ - Unexpected end of expression at position $POS$ Math parser error messages. Left untouched $POS$ - Unexpected argument separator at position $POS$ Math parser error messages. Left untouched $POS$ - Unexpected parenthesis "$TOK$" at position $POS$ Math parser error messages. Left untouched "$TOK$" and $POS$ - Unexpected function "$TOK$" at position $POS$ Math parser error messages. Left untouched "$TOK$" and $POS$ - Unexpected value "$TOK$" found at position $POS$ Math parser error messages. Left untouched "$TOK$" and $POS$ - Unexpected variable "$TOK$" found at position $POS$ Math parser error messages. Left untouched "$TOK$" and $POS$ - Function arguments used without a function (position: $POS$) Math parser error messages. Left untouched $POS$ - Missing parenthesis Math parser error messages. - Too many parameters for function "$TOK$" at expression position $POS$ Math parser error messages. Left untouched "$TOK$" and $POS$ - Too few parameters for function "$TOK$" at expression position $POS$ Math parser error messages. Left untouched "$TOK$" and $POS$ - Divide by zero Math parser error messages. - Domain error Math parser error messages. - Name conflict Math parser error messages. - Invalid value for operator priority (must be greater or equal to zero). Math parser error messages. - user defined binary operator "$TOK$" conflicts with a built in operator. Math parser error messages. Left untouched "$TOK$" - Unexpected string token found at position $POS$. Math parser error messages. Left untouched $POS$ - Unterminated string starting at position $POS$. Math parser error messages. Left untouched $POS$ - String function called with a non string type of argument. Math parser error messages. - String value used where a numerical argument is expected. Math parser error messages. - No suitable overload for operator "$TOK$" at position $POS$. Math parser error messages. Left untouched "$TOK$" and $POS$ - Function result is a string. Math parser error messages. - Parser error. Math parser error messages. - Decimal separator is identic to function argument separator. Math parser error messages. - - The "$TOK$" operator must be preceeded by a closing bracket. - Math parser error messages. Left untouched "$TOK$" - - - - If-then-else operator is missing an else clause Math parser error messages. Do not translate operator name. - Misplaced colon at position $POS$ Math parser error messages. Left untouched $POS$ + + The "$TOK$" operator must be preceeded by a closing bracket. + Math parser error messages. Left untouched "$TOK$" + + RenamePP - Rename pattern piece @@ -6816,7 +5780,6 @@ Apakah anda ingin menyimpan perubahan anda? STDescriptions - Standard figures of men 1st group, chest 100 cm Standard table description @@ -6825,7 +5788,6 @@ Apakah anda ingin menyimpan perubahan anda? SaveDetailOptions - Save detail option @@ -6833,7 +5795,6 @@ Apakah anda ingin menyimpan perubahan anda? SaveToolOptions - Save tool option @@ -6841,205 +5802,117 @@ Apakah anda ingin menyimpan perubahan anda? TableWindow - Create a layout - toolBar - Save Simpan - - Save layout - - Next - - - - - Next detail - - - - - Turn - - - - - Turn the detail 90 degrees - - - - Stop - Stop laying - - Enlarge letter - - - - - Enlarge the length of the sheet - - - - - Reduce sheet - - - - - Reduce the length of the sheet - - - - - - Mirroring - - - - - Zoom In - - Zoom Out - - 0 details left. - - - - - - Collisions not found. - - - - - %1 details left. - - - - untitled - Svg files (*.svg) - PDF files (*.pdf) - Images (*.png) - - Wavefront OBJ (*.obj) - - - - PS files (*.ps) - EPS files (*.eps) - - Collisions found. - - - - Creating file '%1' failed! %2 - Critical error! + + Wavefront OBJ (*.obj) + + + + Layout pages + + + + Layout + + VAbstractConverter - Error creation backup file: %1. - Couldn't get version information. - Too many tags <%1> in file. - Version "%1" invalid. - Version "0.0.0" invalid. - Invalid version. Minimum supported version is %1 - Invalid version. Maximum supported version is %1 - Error no unique id. - Could not change version. @@ -7047,45 +5920,65 @@ Apakah anda ingin menyimpan perubahan anda? VAbstractTool - Confirm the deletion. - Do you really want delete? + + black + + + + green + + + + blue + + + + dark red + + + + dark green + + + + dark blue + + + + yellow + + VApplication - Error parsing file. Program will be terminated. - Error bad id. Program will be terminated. - Error can't convert value. Program will be terminated. - Error empty parameter. Program will be terminated. - Error wrong id. Program will be terminated. - Something's wrong!! @@ -7093,21 +5986,14 @@ Apakah anda ingin menyimpan perubahan anda? VContainer - - - - Can't find object - - Can't cast object - Can't find object. Type mismatch. @@ -7115,75 +6001,60 @@ Apakah anda ingin menyimpan perubahan anda? VDomDocument - Can't convert toUInt parameter - Can't convert toBool parameter - Got empty parameter - Can't convert toDouble parameter - - Got wrong parameter id. Need only id > 0. - - - - - This id is not unique. - - - - - Can't open file %1: %2. - Can't open schema file %1: %2. - Could not load schema file. - Validation error file %3 in line %1 column %2 - Parsing error file %3 in line %1 column %2 - Couldn't get node - + Got wrong parameter id. Need only id > 0. + + + + This id is not unique. + + + Could not copy temp file to document file - Could not remove document file @@ -7191,25 +6062,21 @@ Apakah anda ingin menyimpan perubahan anda? VDrawTool - + Edit wrong formula + + + Options pilihan - Delete hapus - - - Edit wrong formula - - VException - Critical error! @@ -7217,10 +6084,6 @@ Apakah anda ingin menyimpan perubahan anda? VFormula - - - - Error @@ -7228,12 +6091,10 @@ Apakah anda ingin menyimpan perubahan anda? VFormulaProperty - Value - Formula rumus @@ -7241,12 +6102,10 @@ Apakah anda ingin menyimpan perubahan anda? VPE::VBoolProperty - True - False @@ -7254,12 +6113,10 @@ Apakah anda ingin menyimpan perubahan anda? VPE::VFileEditWidget - Directory - Open File @@ -7267,190 +6124,142 @@ Apakah anda ingin menyimpan perubahan anda? VPattern - Can't find tool in table. - Error no unique id. - - Error parsing file. - Error can't convert value. - Error empty parameter. - Error wrong id. - Critical error! - Error parsing file (std::bad_alloc). - Error creating or updating detail - Error creating or updating single point - - Error creating or updating point of end line - - Error creating or updating point along line - - Error creating or updating point of shoulder - - Error creating or updating point of normal - - Error creating or updating point of bisector - Error creating or updating point of lineintersection - - Error creating or updating point of contact - Error creating or updating modeling point - Error creating or updating height - Error creating or updating triangle - Error creating or updating point of intersection - - Error creating or updating cut spline point - - Error creating or updating cut spline path point - - Error creating or updating cut arc point - - Error creating or updating point of intersection line and axis - - Error creating or updating point of intersection curve and axis - Error creating or updating line - Error creating or updating simple curve - Error creating or updating curve path - Error creating or updating modeling simple curve - Error creating or updating modeling curve path - - Error creating or updating simple arc - Error creating or updating modeling arc - Error creating or updating union details - File error. @@ -7458,12 +6267,10 @@ Apakah anda ingin menyimpan perubahan anda? VPatternConverter - Unexpected version "%1". - Error restoring backup file: %1. @@ -7471,19 +6278,14 @@ Apakah anda ingin menyimpan perubahan anda? VSplinePath - Not enough points to create the spline. - - - This spline does not exist. - Can't cut spline path with one point @@ -7491,12 +6293,10 @@ Apakah anda ingin menyimpan perubahan anda? VTableGraphicsView - can't find detail - detail found @@ -7504,12 +6304,10 @@ Apakah anda ingin menyimpan perubahan anda? VToolDetail - Options pilihan - Delete hapus @@ -7517,215 +6315,158 @@ Apakah anda ingin menyimpan perubahan anda? VToolOptionsPropertyBrowser - Base point - - - - - - - - - - - - - - - - Point label label titik - Position - Point at distance and angle - - - - - - - - - Line type - - - - - - - - Length panjang - - - Angle sudut - Point at distance along line - Arc busur - - Radius radius - First angle sudut pertama - Second angle sudut kedua - Point along bisector - Cut arc tool - Tool for segmenting a curve - Tool segment a pathed curve - Perpendicular point along line - Line between points - Point at line intersection - Point along perpendicular - Additional angle degrees - Point at intersection of arc and line - Tool to make point from x & y of two other points - Special point on shoulder - Curve tool - - Curve factor - Tool for path curve - Tool triangle - - Point intersection line and axis + + Line color + + + + Color + + + + Point intersection curve and axis + + Variables - Line_ Left symbol _ in name - AngleLine_ Left symbol _ in name - Arc_ Left symbol _ in name - Spl_ Left symbol _ in name - SplPath Do not add symbol _ to the end of name @@ -7734,7 +6475,6 @@ Apakah anda ingin menyimpan perubahan anda? VisToolCurveIntersectAxis - <b>Intersection curve and axis</b>: angle = %1°; <b>Shift</b> - sticking angle, <b>Enter</b> - finish creation @@ -7742,7 +6482,6 @@ Apakah anda ingin menyimpan perubahan anda? VisToolEndLine - <b>Point at distance and angle</b>: angle = %1°; <b>Shift</b> - sticking angle, <b>Enter</b> - finish creation @@ -7750,7 +6489,6 @@ Apakah anda ingin menyimpan perubahan anda? VisToolLineIntersectAxis - <b>Intersection line and axis</b>: angle = %1°; <b>Shift</b> - sticking angle, <b>Enter</b> - finish creation @@ -7758,12 +6496,10 @@ Apakah anda ingin menyimpan perubahan anda? VisToolSplinePath - <b>Curved path</b>: select three or more points - <b>Curved path</b>: select three or more points, <b>Enter</b> - finish creation @@ -7771,12 +6507,10 @@ Apakah anda ingin menyimpan perubahan anda? main - Pattern making program. program pembuat pola - Pattern file. Berkas pola. diff --git a/share/translations/valentina_it_IT.ts b/share/translations/valentina_it_IT.ts index 51ae471d1..0027abea1 100644 --- a/share/translations/valentina_it_IT.ts +++ b/share/translations/valentina_it_IT.ts @@ -260,10 +260,6 @@ _ _ - - Point along line - - Length @@ -272,10 +268,6 @@ Insert variable into the formula - - Calculate value - - Value of length @@ -356,6 +348,14 @@ Select second point of line + + Point at distance along line + + + + Line color + + DialogArc @@ -379,10 +379,6 @@ Insert variable into the formula - - Calculate value - - Value of radius @@ -463,10 +459,6 @@ Variables - - Value of angle of line. - - Error @@ -479,6 +471,10 @@ Angles equal + + Color + + DialogBisector @@ -490,10 +486,6 @@ _ _ - - Bisector - - Length @@ -502,10 +494,6 @@ Insert marked variable into the formula - - Calculate value - - Value of length @@ -598,21 +586,21 @@ Select third point of angle + + Point along bisector + + + + Line color + + DialogCurveIntersectAxis - - Curve intersect axis - - Angle - - Calculate value - - Value of angle @@ -625,10 +613,6 @@ Axis point - - First point of line - - Curve @@ -689,6 +673,18 @@ Select axis point + + Point intersect curve and axis + + + + Axis Point + + + + Line color + + DialogCutArc @@ -700,18 +696,10 @@ _ _ - - Cut arc - - Length - - Calculate value - - Value of length @@ -724,10 +712,6 @@ Arc - - Selected curve - - Point label @@ -772,6 +756,18 @@ Variables - Click twice to insert into formula + + Segment an arc + + + + Selected arc + + + + Color + + DialogCutSpline @@ -783,18 +779,10 @@ _ _ - - Cut curve - - Length - - Calculate value - - Value of length @@ -855,6 +843,14 @@ Variables - Click twice to insert into formula + + Segmenting a simple curve + + + + Color + + DialogCutSplinePath @@ -866,18 +862,10 @@ _ _ - - Cut curve path - - Length - - Calculate value - - Value of length @@ -938,6 +926,14 @@ Variables - Click twice to insert into formula + + Segment a curved path + + + + Color + + DialogDetail @@ -989,6 +985,10 @@ Reverse + + Seam allowance tool + + DialogEditWrongFormula @@ -1012,10 +1012,6 @@ Insert variable into formula - - Calculate value - - Value of first angle @@ -1075,18 +1071,10 @@ _ _ - - Point in the end of a line - - Length - - Calculate value - - Value of length @@ -1163,13 +1151,17 @@ Variables + + Point at distance and angle + + + + Line color + + DialogHeight - - Height - - Point label @@ -1202,6 +1194,18 @@ Select second point of line + + Perpendicular point along line + + + + Base Point + + + + Line color + + DialogHistory @@ -1452,6 +1456,22 @@ Can't save measurement + + Tables of Variables + + + + Base size: %1 %3; Base height: %2 %3 + + + + Description: "%1" + + + + Data successfully saved. + + DialogIndividualMeasurements @@ -1529,11 +1549,117 @@ - DialogLine + DialogLayoutProgress - Line + Creation a layout + + <html><head/><body><p>Finding best position for worpieces. Please, waite.</p></body></html> + + + + Couldn't prepare data for creation layout + + + + Critical error + + + + Wrong paper size + + + + Several workpieces left not arranged, but none of them match for paper + + + + + DialogLayoutSettings + + Creation a layout + + + + Paper size + + + + Templates: + + + + Width: + + + + Height: + + + + ... + ... + + + Rotate workpiece + + + + Rotate by + + + + degree + + + + Creation options + + + + Layout width: + + + + Shift length: + + + + Principle of choosing the next workpiece + + + + Three groups: big, middle, small + + + + Two groups: big, small + + + + Descending area + + + + Millimiters + + + + Centimeters + + + + Inches + + + + Pixels + + + + + DialogLine First point @@ -1554,13 +1680,17 @@ Select second point + + Line between points + + + + Line color + + DialogLineIntersect - - Intersection of lines - - Point label @@ -1593,21 +1723,17 @@ Select second point of second line + + Point at line intersection + + DialogLineIntersectAxis - - Line intersect axis - - Angle - - Calculate value - - Value of angle @@ -1692,6 +1818,22 @@ Select axis point + + Point intersect line and axis + + + + Axis Point + + + + Second point of line + + + + Line color + + DialogMeasurements @@ -1730,10 +1872,6 @@ _ _ - - Normal - - Length @@ -1742,10 +1880,6 @@ Insert variable into formula - - Calculate value - - Value of length @@ -1822,6 +1956,22 @@ Select second point of line + + Point along perpendicular + + + + First point of line + + + + Second point of line + + + + Line color + + DialogPatternProperties @@ -2003,10 +2153,6 @@ _ _ - - Point of contact - - Radius @@ -2015,10 +2161,6 @@ Insert variable into formula - - Calculate value - - Value of radius @@ -2091,35 +2233,39 @@ Select second point of line + + Point at intersection of arc and line + + DialogPointOfIntersection - - Point of intersection - - Point label - - vertical point - - First point of angle - - horizontal point - - Second point of angle - Select point horizontally + Point from X and Y of two other points + + + + X: vertical point + + + + Y: horizontal point + + + + Select point for Y value (horizontal) @@ -2133,10 +2279,6 @@ _ _ - - Point of shoulder - - Length @@ -2145,10 +2287,6 @@ Insert variable into formula - - Calculate value - - Value of length @@ -2229,6 +2367,14 @@ Select second point of line + + Special point on shoulder + + + + Line color + + DialogSinglePoint @@ -2259,10 +2405,6 @@ DialogSpline - - Curve - - First point @@ -2295,6 +2437,14 @@ Select last point of curve + + Simple curve + + + + Color + + DialogSplinePath @@ -2334,6 +2484,10 @@ Select point of curve path + + Color + + DialogStandardMeasurements @@ -2396,13 +2550,13 @@ Parser error: %1 + + Line Angle + + DialogTriangle - - Triangle - - Point label @@ -2439,6 +2593,22 @@ Select second point + + Triangle tool + + + + First point of the axis + + + + Second point of the axis + + + + Second point of line + + DialogUndo @@ -2465,10 +2635,6 @@ DialogUnionDetails - - Union details - - <html><head/><body><p>Do you really want union details?</p></body></html> @@ -2489,6 +2655,10 @@ Select detail + + Union tool + + Functions @@ -2675,14 +2845,6 @@ Point along perpendicular - - Special point on shoulder. - - - - Tool triangle. - - Perpendicular point along line @@ -2691,14 +2853,6 @@ Point along bisector - - Point at intersection of arc and line. - - - - Tool to make point from x & y of two other points. - - Point at distance and angle @@ -2707,10 +2861,6 @@ Point at distance along line - - Point of intersection line and axis - - Tools for creating lines. @@ -2735,22 +2885,6 @@ Curve - - Curve tool. - - - - Tool for path curve. - - - - Tool for segmenting a curve. - - - - Tool segment a pathed curve. - - Tools for creating arcs. @@ -2759,14 +2893,6 @@ Arc - - Arc tool. - - - - Cut arc tool. - - Tools for creating details. @@ -2775,14 +2901,6 @@ Detail - - Tool new detail. - - - - Tool for union two details. - - &File @@ -3088,10 +3206,6 @@ For opening pattern need keep both files: pattern and measurements. Do you want Select first point of axis - - Select point vertically - - Select detail @@ -3249,6 +3363,82 @@ Do you want to save your changes? Individual measurements (*.vit) + + Special point on shoulder + + + + Triangle tool + + + + Point at intersection of arc and line + + + + Point from X and Y of two other points + + + + Point intersect line and axis + + + + Simple curve + + + + Curved path + + + + Segmenting a simple curve + + + + Segment a curved path + + + + Point intersect curve and axis + + + + Segment an arc + + + + Point intersect arc and axis + + + + Seam allowance tool + + + + Union tool + + + + toolBar + + + + Last Tool + + + + Activate last used tool again + + + + L + + + + Select point for X value (vertical) + + Measurements @@ -5316,6 +5506,14 @@ Do you want to save your changes? Patterns + + Standard measurements + + + + Layout + + PatternPage @@ -5405,6 +5603,10 @@ Do you want to save your changes? The text that appears in the second column header + + px + + QmuParserErrorMsg @@ -5636,22 +5838,6 @@ Do you want to save your changes? Save layout - - Next - - - - Next detail - - - - Turn - - - - Turn the detail 90 degrees - - Stop @@ -5660,26 +5846,6 @@ Do you want to save your changes? Stop laying - - Enlarge letter - - - - Enlarge the length of the sheet - - - - Reduce sheet - - - - Reduce the length of the sheet - - - - Mirroring - - Zoom In @@ -5688,18 +5854,6 @@ Do you want to save your changes? Zoom Out - - 0 details left. - - - - Collisions not found. - - - - %1 details left. - - untitled @@ -5724,10 +5878,6 @@ Do you want to save your changes? EPS files (*.eps) - - Collisions found. - - Creating file '%1' failed! %2 @@ -5740,6 +5890,14 @@ Do you want to save your changes? Wavefront OBJ (*.obj) + + Layout pages + + + + Layout + + VAbstractConverter @@ -5790,6 +5948,34 @@ Do you want to save your changes? Do you really want delete? + + black + + + + green + + + + blue + + + + dark red + + + + dark green + + + + dark blue + + + + yellow + + VApplication @@ -6283,6 +6469,18 @@ Do you want to save your changes? Point intersection line and axis + + Line color + + + + Color + + + + Point intersection curve and axis + + Variables diff --git a/share/translations/valentina_nl_NL.ts b/share/translations/valentina_nl_NL.ts index 3abffcb12..3c823f6b4 100644 --- a/share/translations/valentina_nl_NL.ts +++ b/share/translations/valentina_nl_NL.ts @@ -229,10 +229,6 @@ Contributors Bijdragers - - Based on Qt %2 (32 bit) - Gebaseerd op Qt %2 (32 bit) - Built on %3 at %4 Gebouwd op %3 op %4 @@ -251,14 +247,14 @@ Build revision: - + Herziene uitgave gebouwd DialogAlongLine Point along line - Punt langs de lijn + Punt langs de lijn Length @@ -270,7 +266,7 @@ Calculate value - Bereken waarde + Bereken waarde Value of length @@ -352,6 +348,14 @@ Select second point of line Selecteer tweede punt van lijn + + Point at distance along line + Punt op afstand langs lijn + + + Line color + + DialogArc @@ -369,7 +373,7 @@ Calculate value - Bereken waarde + Bereken waarde Value of radius @@ -453,7 +457,7 @@ Value of angle of line. - Waarde van hoek van de lijn + Waarde van hoek van de lijn Error @@ -467,12 +471,16 @@ Angles equal Gelijke zijden + + Color + + DialogBisector Bisector - Bisector + Bisector Length @@ -484,7 +492,7 @@ Calculate value - Bereken waarde + Bereken waarde Value of length @@ -578,12 +586,20 @@ Select third point of angle Selecteer derde punt van lijn + + Point along bisector + Punt langs bisector + + + Line color + + DialogCurveIntersectAxis Curve intersect axis - Kromming doorkruist as + Kromming doorkruist as Angle @@ -591,7 +607,7 @@ Calculate value - Bereken waarde + Bereken waarde Value of angle @@ -607,7 +623,7 @@ First point of line - Eerste punt van de lijn + Eerste punt van de lijn Curve @@ -669,12 +685,24 @@ Select axis point Selecteer as punt + + Point intersect curve and axis + + + + Axis Point + + + + Line color + + DialogCutArc Cut arc - Knip boog + Knip boog Length @@ -682,7 +710,7 @@ Calculate value - Bereken waarde + Bereken waarde Value of length @@ -702,7 +730,7 @@ Selected curve - Geselecteerde kromming + Geselecteerde kromming Point label @@ -748,12 +776,24 @@ Variables - Click twice to insert into formula Variabelen - Klik 2 keer om formule in te voeren + + Segment an arc + + + + Selected arc + + + + Color + + DialogCutSpline Cut curve - Knip kromming + Knip kromming Length @@ -761,7 +801,7 @@ Calculate value - Bereken waarde + Bereken waarde Value of length @@ -827,12 +867,20 @@ Variables - Click twice to insert into formula Variabelen - Klik 2 keer om formule in te voeren + + Segmenting a simple curve + + + + Color + + DialogCutSplinePath Cut curve path - Knip kromming + Knip kromming Length @@ -840,7 +888,7 @@ Calculate value - Bereken waarde + Bereken waarde Value of length @@ -906,6 +954,14 @@ Variables - Click twice to insert into formula Variabelen - Klik 2 keer om formule in te voeren + + Segment a curved path + + + + Color + + DialogDetail @@ -955,6 +1011,10 @@ Reverse + Omgekeerde + + + Seam allowance tool @@ -974,7 +1034,7 @@ Calculate value - Bereken waarde + Bereken waarde Value of first angle @@ -1033,7 +1093,7 @@ DialogEndLine Point in the end of a line - Punt aan het einde van een lijn + Punt aan het einde van een lijn Length @@ -1041,7 +1101,7 @@ Calculate value - Bereken waarde + Bereken waarde Value of length @@ -1119,12 +1179,20 @@ Variables Variabelen + + Point at distance and angle + + + + Line color + + DialogHeight Height - Hoogte + Hoogte Point label @@ -1158,6 +1226,18 @@ Select second point of line Selecteer tweede punt van lijn + + Perpendicular point along line + Haakse hoek punt langs lijn + + + Base Point + + + + Line color + + DialogHistory @@ -1195,7 +1275,7 @@ %4 - bisector of angle %1_%2_%3 - + %4 - bisector of angle %1_%2_%3 %5 - intersection of lines %1_%2 and %3_%4 @@ -1404,6 +1484,22 @@ Can't save measurement Kan maten niet opslaan + + Tables of Variables + + + + Base size: %1 %3; Base height: %2 %3 + + + + Description: "%1" + + + + Data successfully saved. + + DialogIndividualMeasurements @@ -1476,11 +1572,121 @@ Inches + + DialogLayoutProgress + + Creation a layout + + + + <html><head/><body><p>Finding best position for worpieces. Please, waite.</p></body></html> + + + + Couldn't prepare data for creation layout + + + + Critical error + + + + Wrong paper size + + + + Several workpieces left not arranged, but none of them match for paper + + + + + DialogLayoutSettings + + Creation a layout + + + + Paper size + + + + Templates: + + + + Width: + + + + Height: + + + + ... + ... + + + Rotate workpiece + + + + Rotate by + + + + degree + + + + Creation options + + + + Layout width: + + + + Shift length: + + + + Principle of choosing the next workpiece + + + + Three groups: big, middle, small + + + + Two groups: big, small + + + + Descending area + + + + Millimiters + Millimiters + + + Centimeters + Centimeters + + + Inches + Inches + + + Pixels + + + DialogLine Line - Lijn + Lijn First point @@ -1502,12 +1708,20 @@ Select second point Selecteer tweede punt + + Line between points + Lijn tussen punten + + + Line color + + DialogLineIntersect Intersection of lines - Kruispunt van lijnen + Kruispunt van lijnen Point label @@ -1541,12 +1755,16 @@ Select second point of second line Selecteer tweede punt van tweede lijn + + Point at line intersection + Punt op lijnkruising + DialogLineIntersectAxis Line intersect axis - Lijn kruist de as + Lijn kruist de as Angle @@ -1554,7 +1772,7 @@ Calculate value - Bereken waarde + Bereken waarde Value of angle @@ -1640,6 +1858,22 @@ Select axis point Selecteer as punt + + Point intersect line and axis + + + + Axis Point + + + + Second point of line + Tweede punt van de lijn + + + Line color + + DialogMeasurements @@ -1672,7 +1906,7 @@ DialogNormal Normal - Normaal + Normaal Length @@ -1684,7 +1918,7 @@ Calculate value - Bereken waarde + Bereken waarde Value of length @@ -1762,6 +1996,22 @@ Select second point of line Selecteer tweede punt van lijn + + Point along perpendicular + + + + First point of line + Eerste punt van de lijn + + + Second point of line + Tweede punt van de lijn + + + Line color + + DialogPatternProperties @@ -1937,7 +2187,7 @@ DialogPointOfContact Point of contact - Contactpunt + Contactpunt Radius @@ -1949,7 +2199,7 @@ Calculate value - Bereken waarde + Bereken waarde Value of radius @@ -2023,12 +2273,16 @@ Select second point of line Selecteer tweede punt van lijn + + Point at intersection of arc and line + Kruispunt van boog en lijn + DialogPointOfIntersection Point of intersection - Kruispunt + Kruispunt Point label @@ -2036,7 +2290,7 @@ vertical point - Verticaal punt + Verticaal punt First point of angle @@ -2044,7 +2298,7 @@ horizontal point - Horizontaal punt + Horizontaal punt Second point of angle @@ -2052,14 +2306,30 @@ Select point horizontally - Selecteer punt horzontaal + Selecteer punt horzontaal + + + Point from X and Y of two other points + + + + X: vertical point + + + + Y: horizontal point + + + + Select point for Y value (horizontal) + DialogShoulderPoint Point of shoulder - Schouderpunt + Schouderpunt Length @@ -2071,7 +2341,7 @@ Calculate value - Bereken waarde + Bereken waarde Value of length @@ -2153,6 +2423,14 @@ Select second point of line Selecteer tweede punt van lijn + + Special point on shoulder + Speciaal punt op schouder + + + Line color + + DialogSinglePoint @@ -2185,7 +2463,7 @@ DialogSpline Curve - Kromming + Kromming First point @@ -2219,6 +2497,14 @@ Select last point of curve Selecteer laatste punt van de krommming + + Simple curve + + + + Color + + DialogSplinePath @@ -2258,6 +2544,10 @@ Select point of curve path Selecteer punt van krommingspad + + Color + + DialogStandardMeasurements @@ -2320,12 +2610,16 @@ Parser error: %1 Fout bij uitpakken: %1 + + Line Angle + + DialogTriangle Triangle - Driehoek + Driehoek Point label @@ -2363,6 +2657,22 @@ Select second point Selecteer tweede punt + + Triangle tool + + + + First point of the axis + + + + Second point of the axis + + + + Second point of line + Tweede punt van de lijn + DialogUndo @@ -2391,7 +2701,7 @@ DialogUnionDetails Union details - Gezamenlijke details + Gezamenlijke details <html><head/><body><p>Do you really want union details?</p></body></html> @@ -2413,6 +2723,10 @@ Select detail Selecteer een detail + + Union tool + + Functions @@ -2546,7 +2860,7 @@ InternalStrings The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - + The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -2569,11 +2883,11 @@ Special point on shoulder. - Speciaal punt op schouder + Speciaal punt op schouder Tool triangle. - Driehoek gereedschap + Driehoek gereedschap Perpendicular point along line @@ -2585,11 +2899,11 @@ Point at intersection of arc and line. - Kruispunt van boog en lijn + Kruispunt van boog en lijn Tool to make point from x & y of two other points. - Gereedschap om een punt te maken van X & Y van twee andere punten + Gereedschap om een punt te maken van X & Y van twee andere punten Point at distance and angle @@ -2601,7 +2915,7 @@ Point of intersection line and axis - Kruispunt tussen lijn en as + Kruispunt tussen lijn en as ... @@ -2633,19 +2947,19 @@ Curve tool. - Krommingsgereedschap + Krommingsgereedschap Tool for path curve. - Gereedschap voorkrommingspad + Gereedschap voorkrommingspad Tool for segmenting a curve. - Gereedschap om een kromming in segmenten te delen + Gereedschap om een kromming in segmenten te delen Tool segment a pathed curve. - Gereedschap segmenteerd een krommingspad + Gereedschap segmenteerd een krommingspad Tools for creating arcs. @@ -2657,11 +2971,11 @@ Arc tool. - Boog gereedschap + Boog gereedschap Cut arc tool. - Knip een boog gereedschap + Knip een boog gereedschap Tools for creating details. @@ -2673,11 +2987,11 @@ Tool new detail. - Gereedschap nieuw detail + Gereedschap nieuw detail Tool for union two details. - Gereedschap om twee details te verenigen. + Gereedschap om twee details te verenigen. &File @@ -3010,7 +3324,7 @@ For opening pattern need keep both files: pattern and measurements. Do you want Select point vertically - Selecteer punt verticaal + Selecteer punt verticaal Select detail @@ -3169,6 +3483,82 @@ Do you want to save your changes? Individual measurements (*.vit) Individuele maten(*.vit) + + Special point on shoulder + Speciaal punt op schouder + + + Triangle tool + + + + Point at intersection of arc and line + Kruispunt van boog en lijn + + + Point from X and Y of two other points + + + + Point intersect line and axis + + + + Simple curve + + + + Curved path + Krommingspad + + + Segmenting a simple curve + + + + Segment a curved path + + + + Point intersect curve and axis + + + + Segment an arc + + + + Point intersect arc and axis + + + + Seam allowance tool + + + + Union tool + + + + toolBar + Werkbalk + + + Last Tool + + + + Activate last used tool again + + + + L + + + + Select point for X value (vertical) + + Measurements @@ -5178,7 +5568,7 @@ Do you want to save your changes? MoveLabel Move point label - + Verplaats punt merk @@ -5236,6 +5626,14 @@ Do you want to save your changes? Patterns Patronen + + Standard measurements + + + + Layout + + PatternPage @@ -5286,7 +5684,7 @@ Do you want to save your changes? QCoreApplication Based on Qt %1 (%2, %3 bit) - + Gebaseerd op Qt %1 (%2, %3 bit) @@ -5325,6 +5723,10 @@ Do you want to save your changes? The text that appears in the second column header Waarde + + px + + QmuParserErrorMsg @@ -5558,19 +5960,19 @@ Do you want to save your changes? Next - Volgende + Volgende Next detail - Volgend detail + Volgend detail Turn - Omdraaien + Omdraaien Turn the detail 90 degrees - Draai het detail 90 graden + Draai het detail 90 graden Stop @@ -5582,23 +5984,23 @@ Do you want to save your changes? Enlarge letter - Vergroot letter + Vergroot letter Enlarge the length of the sheet - Vergroot de lengte van het werkblad + Vergroot de lengte van het werkblad Reduce sheet - Verklein werkblad + Verklein werkblad Reduce the length of the sheet - Verklein de lengte van het werkblad + Verklein de lengte van het werkblad Mirroring - Spiegelen + Spiegelen Zoom In @@ -5610,15 +6012,15 @@ Do you want to save your changes? 0 details left. - 0 details over. + 0 details over. Collisions not found. - Conflicten niet gevonden + Conflicten niet gevonden %1 details left. - %1 details over + %1 details over untitled @@ -5646,7 +6048,7 @@ Do you want to save your changes? Collisions found. - Conflicten gevonden + Conflicten gevonden Creating file '%1' failed! %2 @@ -5658,6 +6060,14 @@ Do you want to save your changes? Wavefront OBJ (*.obj) + Wavefront OBJ (*.obj) + + + Layout pages + + + + Layout @@ -5665,39 +6075,39 @@ Do you want to save your changes? VAbstractConverter Error creation backup file: %1. - + Fout bij het maken van reserve bestand: %1. Couldn't get version information. - + Kon geen versie informatie krijgen. Too many tags <%1> in file. - + Te veel etiketten <%1> in bestand. Version "%1" invalid. - + Versie "%1" ongeldig. Version "0.0.0" invalid. - + Versie "0.0.0" ongeldig. Invalid version. Minimum supported version is %1 - + Ongeldige versie. Minimale ondersteunde versie is %1 Invalid version. Maximum supported version is %1 - + Ongeldige versie. Maximale ondersteunde versie is %1 Error no unique id. - Fout geen unieke ID. + Fout geen unieke ID. Could not change version. - + kon de versie niet veranderen. @@ -5710,6 +6120,34 @@ Do you want to save your changes? Do you really want delete? Wil je echt verwijderen? + + black + + + + green + + + + blue + + + + dark red + + + + dark green + + + + dark blue + + + + yellow + + VApplication @@ -5737,14 +6175,6 @@ Do you want to save your changes? Something's wrong!! Er gaat iets verkeerd! - - Could not copy temp file to document file - Kon temp bestand niet kopiren naar document bestand - - - Could not remove document file - Kon document bestand niet verwijderen - VContainer @@ -5809,19 +6239,19 @@ Do you want to save your changes? Got wrong parameter id. Need only id > 0. - Heeft verkeerde parameter ID. Heeft alleen nodig ID > 0 + Krijg de verkeerde parameter ID. Gebruik alleen ID > 0. This id is not unique. - Deze ID is niet uniek. + Deze ID is niet uniek. Could not copy temp file to document file - Kon temp bestand niet kopiren naar document bestand + Kon temp bestand niet kopieëren naar document bestand Could not remove document file - Kon document bestand niet verwijderen + Kon document bestand niet verwijderen @@ -6024,14 +6454,6 @@ Do you want to save your changes? Error creating or updating union details Fout bij het maken of bijwerken van gezamelijke details - - Got wrong parameter id. Need only id > 0. - Heeft verkeerde parameter ID. Heeft alleen nodig ID > 0 - - - This id is not unique. - Deze ID is niet uniek. - File error. Bestandsfout @@ -6041,11 +6463,11 @@ Do you want to save your changes? VPatternConverter Unexpected version "%1". - + Onverwachte versie "%1". Error restoring backup file: %1. - + Fout met het heropslaan van reserve bestand: %1. @@ -6203,6 +6625,18 @@ Do you want to save your changes? Point intersection line and axis Kruispunt tussen lijn en as + + Line color + + + + Color + + + + Point intersection curve and axis + + Variables @@ -6236,32 +6670,32 @@ Do you want to save your changes? VisToolCurveIntersectAxis <b>Intersection curve and axis</b>: angle = %1°; <b>Shift</b> - sticking angle, <b>Enter</b> - finish creation - + <b>Kruising tussen kromming en as</b>: hoek = %1°; <b>Shift</b> - klevende hoek, <b>Enter</b> - voltooi creatie VisToolEndLine <b>Point at distance and angle</b>: angle = %1°; <b>Shift</b> - sticking angle, <b>Enter</b> - finish creation - + <b>Punt op afstand en hoek</b>: hoek = %1°; <b>Shift</b> - klevende hoek, <b>Enter</b> - voltooi creatie VisToolLineIntersectAxis <b>Intersection line and axis</b>: angle = %1°; <b>Shift</b> - sticking angle, <b>Enter</b> - finish creation - + <b>Kruising tussen lijn en as</b>: hoek = %1°; <b>Shift</b> - klevende hoek, <b>Enter</b> - voltooi creatie VisToolSplinePath <b>Curved path</b>: select three or more points - + <b>Krommings pad</b>: selecteer drie of meer punten <b>Curved path</b>: select three or more points, <b>Enter</b> - finish creation - + <b>Krommings pad</b>: selecteer drie of meer punten, <b>Enter</b> - voltooi creatie diff --git a/share/translations/valentina_ru_RU.ts b/share/translations/valentina_ru_RU.ts index 88e81d194..200de19d5 100644 --- a/share/translations/valentina_ru_RU.ts +++ b/share/translations/valentina_ru_RU.ts @@ -266,7 +266,7 @@ DialogAlongLine Point along line - Точка вдоль линии + Точка вдоль линии Length @@ -290,7 +290,7 @@ Calculate value - Расчитать значение + Расчитать значение Point label @@ -380,6 +380,14 @@ Select second point of line Выберить вторую точку линии + + Point at distance along line + Точка вдоль линии + + + Line color + Цвет линии + DialogArc @@ -405,7 +413,7 @@ Calculate value - Расчитать значение + Расчитать значение Value of radius @@ -517,7 +525,7 @@ Value of angle of line. - Значение угла линии. + Значение угла линии. Error @@ -531,12 +539,16 @@ Angles equal Углы равны + + Color + Цвет + DialogBisector Bisector - Бисектриса + Бисектриса Length @@ -564,7 +576,7 @@ Calculate value - Расчитать значение + Расчитать значение <html><head/><body><p>Show full calculation in message box</p></body></html> @@ -662,12 +674,20 @@ Select third point of angle Выберить третью точку угла + + Point along bisector + Точка вдоль бисектрисы + + + Line color + Цвет линии + DialogCurveIntersectAxis Curve intersect axis - Пересичение кривой и оси + Пересичение кривой и оси Angle @@ -675,7 +695,7 @@ Calculate value - Расчитать значение + Расчитать значение Value of angle @@ -691,7 +711,7 @@ First point of line - Первая точка линии + Первая точка линии Curve @@ -753,6 +773,18 @@ Select axis point Выберить точку оси + + Point intersect curve and axis + Точка пересечения кривой и оси + + + Axis Point + Точка оси + + + Line color + Цвет линии + DialogCutArc @@ -770,7 +802,7 @@ Cut arc - Разрезать дугу + Разрезать дугу ... @@ -778,7 +810,7 @@ Calculate value - Расчитать значение + Расчитать значение Value of length @@ -798,7 +830,7 @@ Selected curve - Выбраная кривая + Выбраная кривая Point label @@ -848,6 +880,18 @@ Variables - Click twice to insert into formula Переменные - кликнете дважды для вставки в формулу + + Segment an arc + Разделить дугу + + + Selected arc + Выбраная дуга + + + Color + Цвет + DialogCutSpline @@ -865,7 +909,7 @@ Cut curve - Разрезать кривую + Разрезать кривую ... @@ -873,7 +917,7 @@ Calculate value - Расчитать значение + Расчитать значение Value of length @@ -943,6 +987,14 @@ Variables - Click twice to insert into formula Переменные - кликнете дважды для вставки в формулу + + Segmenting a simple curve + Разделение простой кривой + + + Color + Цвет + DialogCutSplinePath @@ -960,7 +1012,7 @@ Cut curve path - Разрезать сложную кривую + Разрезать сложную кривую ... @@ -968,7 +1020,7 @@ Calculate value - Расчитать значение + Расчитать значение Value of length @@ -1038,6 +1090,14 @@ Variables - Click twice to insert into formula Переменные - кликнете дважды для вставки в формулу + + Segment a curved path + Разделить сложною кривую + + + Color + Цвет + DialogDetail @@ -1093,6 +1153,10 @@ Reverse Изменить направление + + Seam allowance tool + Деталь + DialogEditWrongFormula @@ -1114,7 +1178,7 @@ Calculate value - Расчитать значение + Расчитать значение Value of first angle @@ -1181,7 +1245,7 @@ Point in the end of a line - Точка на конце отрезка + Точка на конце отрезка Formula for calculation of length of line @@ -1189,7 +1253,7 @@ Calculate value - Расчитать значение + Расчитать значение ... @@ -1295,6 +1359,14 @@ Length of curves Длина кривых + + Point at distance and angle + Точка на конце отрезка + + + Line color + Цвет линии + DialogHeight @@ -1304,7 +1376,7 @@ Height - Рост + Рост Point label @@ -1338,6 +1410,18 @@ Select second point of line Выберить вторую точку линии + + Perpendicular point along line + Перпендикулярная точка вдоль линии + + + Base Point + Базовая точка + + + Line color + Цвет линии + DialogHistory @@ -1636,6 +1720,22 @@ Length Длина + + Tables of Variables + Таблици переменных + + + Base size: %1 %3; Base height: %2 %3 + Базовый размер: %1 %3; Базовый рост: %2 %3 + + + Description: "%1" + Описание: "%1" + + + Data successfully saved. + Данные успешно сохранены. + DialogIndividualMeasurements @@ -1728,11 +1828,121 @@ дюймы + + DialogLayoutProgress + + Creation a layout + Создание раскладки + + + <html><head/><body><p>Finding best position for worpieces. Please, waite.</p></body></html> + <html><head/><body><p>Поиск лутшей позиции для детали. Пожайлуста, подождите.</p></body></html> + + + Couldn't prepare data for creation layout + Не удалось подготовить данные для создания лекала + + + Critical error + Критическая ошибка + + + Wrong paper size + Не правильный размер листа + + + Several workpieces left not arranged, but none of them match for paper + Несколько деталей остались не уложеными, но никто из них не подходит для листа + + + + DialogLayoutSettings + + Creation a layout + Создание раскладки + + + Paper size + Размер листа: + + + Templates: + Шаблоны: + + + Width: + Ширина: + + + Height: + Выстора: + + + ... + ... + + + Rotate workpiece + Поворачивать детали + + + Rotate by + Поворачивать на + + + degree + градусы + + + Creation options + Опции создания + + + Layout width: + Ширина раскладки: + + + Shift length: + Длина смещения: + + + Principle of choosing the next workpiece + Прицип выбора очередной детали + + + Three groups: big, middle, small + Три групы: большие, средние, малые + + + Two groups: big, small + Две группы: большие, малые + + + Descending area + По убыванию площади + + + Millimiters + Миллиметры + + + Centimeters + Сантиметры + + + Inches + Дюймы + + + Pixels + Пиксели + + DialogLine Line - Линия + Линия First point @@ -1754,6 +1964,14 @@ Select second point Выберить вторую точку + + Line between points + Линия между точками + + + Line color + Цвет линии + DialogLineIntersect @@ -1763,7 +1981,7 @@ Intersection of lines - Пересичение линий + Пересичение линий Point label @@ -1797,12 +2015,16 @@ Select second point of second line Выберить вторую точку второй линии + + Point at line intersection + Точка пересичения линий + DialogLineIntersectAxis Line intersect axis - Пересечение линии и оси + Пересечение линии и оси Angle @@ -1810,7 +2032,7 @@ Calculate value - Расчитать значение + Расчитать значение Value of angle @@ -1896,6 +2118,22 @@ Select axis point Выберить точку оси + + Point intersect line and axis + Точка пересечения линии и оси + + + Axis Point + Точка оси + + + Second point of line + Вторая точка линии + + + Line color + Цвет линии + DialogMeasurements @@ -1928,7 +2166,7 @@ DialogNormal Normal - Перпендикуляр + Перпендикуляр Length @@ -1972,7 +2210,7 @@ Calculate value - Расчитать значение + Расчитать значение Point label @@ -2038,6 +2276,22 @@ Select second point of line Выберить вторую точку линии + + Point along perpendicular + Инструмент точка перпендикуляра + + + First point of line + Первая точка линии + + + Second point of line + Вторая точка линии + + + Line color + Цвет линии + DialogPatternProperties @@ -2361,7 +2615,7 @@ DialogPointOfContact Point of contact - Точка касания + Точка касания Radius @@ -2393,7 +2647,7 @@ Calculate value - Расчитать значение + Расчитать значение Point label @@ -2467,6 +2721,10 @@ Select point of center of arc Выберите точку центра дуги + + Point at intersection of arc and line + Точка на пересечении дуги и линии + DialogPointOfIntersection @@ -2480,11 +2738,11 @@ vertical point - Точка вертикали + Точка вертикали horizontal point - Точка горизонтали + Точка горизонтали First point of angle @@ -2492,7 +2750,7 @@ Point of intersection - Точка пересечения + Точка пересечения Second point of angle @@ -2500,6 +2758,22 @@ Select point horizontally + Выберить точку по горозинтали + + + Point from X and Y of two other points + Точка из Х и Y координат двух других точек + + + X: vertical point + Х: вертикальная точка + + + Y: horizontal point + Y: горизонтальная точка + + + Select point for Y value (horizontal) Выберить точку по горозинтали @@ -2507,7 +2781,7 @@ DialogShoulderPoint Point of shoulder - Точка плеча + Точка плеча Length @@ -2531,7 +2805,7 @@ Calculate value - Расчитать значение + Расчитать значение Point label @@ -2625,6 +2899,14 @@ Select point of shoulder Выберить точку плеча + + Special point on shoulder + Специальная точка на плече + + + Line color + Цвет линии + DialogSinglePoint @@ -2657,7 +2939,7 @@ DialogSpline Curve - Кривая + Кривая First point @@ -2691,6 +2973,14 @@ Select last point of curve Выберить последнюю точку кривой + + Simple curve + Простая кривая + + + Color + Цвет + DialogSplinePath @@ -2734,6 +3024,10 @@ Select point of curve path Выберить точку сложной кривой + + Color + Цвет + DialogStandardMeasurements @@ -2836,6 +3130,10 @@ Parser error: %1 Ошибка синтаксического анализа: %1 + + Line Angle + Угол линии + DialogTriangle @@ -2845,7 +3143,7 @@ Triangle - Треугольник + Треугольник Point label @@ -2883,6 +3181,22 @@ Select second point Выберить вторую точку + + Triangle tool + Инструмент треугольник + + + First point of the axis + Первая точка оси + + + Second point of the axis + Вторая точка оси + + + Second point of line + Вторая точка линии + DialogUndo @@ -2935,12 +3249,16 @@ Union details - Объединение деталей + Объединение деталей <html><head/><body><p>Do you really want union details?</p></body></html> <html><head/><body><р>Показать полный расчет в окне сообщения</p></body></html> + + Union tool + Инструмент объединения деталей + Functions @@ -3101,7 +3419,7 @@ Special point on shoulder. - Инструмент точка плеча. + Инструмент точка плеча. Point at distance and angle @@ -3117,7 +3435,7 @@ Point at intersection of arc and line. - Инструмент точка касания. + Инструмент точка касания. Tool point of height. @@ -3125,7 +3443,7 @@ Tool triangle. - Инструмент угольник. + Инструмент угольник. Tools for creating lines. @@ -3181,7 +3499,7 @@ Tool new detail. - Инструмент новая деталь. + Инструмент новая деталь. File @@ -3217,7 +3535,7 @@ Tool to make point from x & y of two other points. - Инструмент, чтобы сделать точку от х и у двух других точек. + Инструмент, чтобы сделать точку от х и у двух других точек. Line between points @@ -3229,35 +3547,35 @@ Curve tool. - Инструмент кривая. + Инструмент кривая. Tool for path curve. - Инструмент сложная кривая. + Инструмент сложная кривая. Tool segment a pathed curve. - Инструмент разрезания сложной кривой. + Инструмент разрезания сложной кривой. Tool for segmenting a curve. - Инструмент разрезания кривой. + Инструмент разрезания кривой. Point of intersection line and axis - Точка пересечения линии и оси + Точка пересечения линии и оси Arc tool. - Инструмент дуга. + Инструмент дуга. Cut arc tool. - Инструмент разрезания дуги. + Инструмент разрезания дуги. Tool for union two details. - Инструмент объединения двух деталей. + Инструмент объединения двух деталей. &File @@ -3863,7 +4181,7 @@ Do you want to save your changes? Select point vertically - Выберить точку по вертикали + Выберить точку по вертикали Based on Qt %2 (32 bit) @@ -3941,6 +4259,82 @@ Do you want to save your changes? This file already opened in another window. Этот файл уже открыт в другом окне. + + Special point on shoulder + Специальная точка на плече + + + Triangle tool + Инструмент треугольник + + + Point at intersection of arc and line + Точка на пересечении дуги и линии + + + Point from X and Y of two other points + Точка из Х и Y координат двух других точек + + + Point intersect line and axis + Точка пересечения линии и оси + + + Simple curve + Простая кривая + + + Curved path + Сложная кривая + + + Segmenting a simple curve + Разделение простой кривой + + + Segment a curved path + Разделение сложной кривой + + + Point intersect curve and axis + Точка пересечения кривой и оси + + + Segment an arc + Разделить дугу + + + Point intersect arc and axis + Точка пересечения дуги и оси + + + Seam allowance tool + Деталь + + + Union tool + Инструмент объединения деталей + + + toolBar + Панель инструментов + + + Last Tool + Последний инструмент + + + Activate last used tool again + Активировать снова последний использованый инструмент + + + L + L + + + Select point for X value (vertical) + Выберить точку по вертикали + Measurements @@ -6828,6 +7222,14 @@ Do you want to save your changes? Patterns Лекала + + Standard measurements + Стандартная таблица мерок + + + Layout + Роскладка + PatternPage @@ -6973,6 +7375,10 @@ Do you want to save your changes? The text that appears in the second column header Значение + + px + px + QmuParserErrorMsg @@ -7206,19 +7612,19 @@ Do you want to save your changes? Next - Следующая + Следующая Next detail - Следующая деталь + Следующая деталь Turn - Перевернуть + Перевернуть Turn the detail 90 degrees - Перевернуть детальна на 90 градусов + Перевернуть детальна на 90 градусов Turn the detail 180 degrees @@ -7230,11 +7636,11 @@ Do you want to save your changes? Enlarge letter - Увеличить лист + Увеличить лист Enlarge the length of the sheet - Увеличить длину листа + Увеличить длину листа Enlarge the length of sheet @@ -7242,15 +7648,15 @@ Do you want to save your changes? Reduce sheet - Уменьшить лист + Уменьшить лист Reduce the length of the sheet - Уменьшить длину листа + Уменьшить длину листа Mirroring - Отражение + Отражение Zoom In @@ -7266,15 +7672,15 @@ Do you want to save your changes? 0 details left. - 0 деталей осталось. + 0 деталей осталось. Collisions not found. - Колизии не обнаружены. + Колизии не обнаружены. %1 details left. - %1 деталей осталось. + %1 деталей осталось. untitled @@ -7302,7 +7708,7 @@ Do you want to save your changes? Collisions found. - Найдены колизии. + Найдены колизии. Creating file '%1' failed! %2 @@ -7324,6 +7730,14 @@ Do you want to save your changes? Wavefront OBJ (*.obj) Wavefront OBJ (*.obj) + + Layout pages + Страницы роскладки + + + Layout + Роскладка + VAbstractConverter @@ -7381,6 +7795,34 @@ Do you want to save your changes? Do you really want delete? Вы точно хотите удалить? + + black + черный + + + green + зеленый + + + blue + синий + + + dark red + темно красный + + + dark green + темно зеленый + + + dark blue + темно синий + + + yellow + желтый + VApplication @@ -8057,6 +8499,18 @@ Do you want to save your changes? Point intersection line and axis Точка пересечения линии и оси + + Line color + Цвет линии + + + Color + Цвет + + + Point intersection curve and axis + Точка пересечения кривой и оси + VToolTriangle diff --git a/share/translations/valentina_uk_UA.ts b/share/translations/valentina_uk_UA.ts index c031dcfec..f5cb5fb7e 100644 --- a/share/translations/valentina_uk_UA.ts +++ b/share/translations/valentina_uk_UA.ts @@ -262,7 +262,7 @@ DialogAlongLine Point along line - Точка вздовж лінії + Точка вздовж лінії Length @@ -278,7 +278,7 @@ Calculate value - Розрахунок довжини + Розрахунок довжини Point label @@ -368,6 +368,14 @@ Select second point of line Виберіть другу точку лінії + + Point at distance along line + Точка вздовж лінії + + + Line color + Колір лінії + DialogArc @@ -389,7 +397,7 @@ Calculate value - Розрахувати значення + Розрахувати значення Value of radius @@ -497,7 +505,7 @@ Value of angle of line. - Значення кута лінії. + Значення кута лінії. Error @@ -511,12 +519,16 @@ Angles equal Кути однакові + + Color + Колір + DialogBisector Bisector - Бісектриса + Бісектриса Length @@ -536,7 +548,7 @@ Calculate value - Розрахувати значення + Розрахувати значення <html><head/><body><p>Show full calculation in message box</p></body></html> @@ -638,12 +650,20 @@ _ _ + + Point along bisector + Точка бісектриси кута + + + Line color + Колір лінії + DialogCurveIntersectAxis Curve intersect axis - Перетин кривої і осі + Перетин кривої і осі Angle @@ -651,7 +671,7 @@ Calculate value - Розрахувати значення + Розрахувати значення Value of angle @@ -667,7 +687,7 @@ First point of line - Перша точка лінії + Перша точка лінії Curve @@ -729,6 +749,18 @@ Select axis point Виберіть точку осі + + Point intersect curve and axis + Точка перениту кривої і вісі + + + Axis Point + Точка осі + + + Line color + Колір лінії + DialogCutArc @@ -746,7 +778,7 @@ Cut arc - Розрізати дугу + Розрізати дугу ... @@ -754,7 +786,7 @@ Calculate value - Розрахувати значення + Розрахувати значення Value of length @@ -774,7 +806,7 @@ Selected curve - Вибрана крива + Вибрана крива Point label @@ -824,6 +856,18 @@ Variables - Click twice to insert into formula Змінні - клікніть двічі для вставки в формулу + + Segment an arc + Сегмент дуги + + + Selected arc + Виберіть дугу + + + Color + Колір + DialogCutSpline @@ -841,7 +885,7 @@ Cut curve - Розрізат криву + Розрізат криву ... @@ -849,7 +893,7 @@ Calculate value - Розрахувати значення + Розрахувати значення Value of length @@ -919,6 +963,14 @@ Variables - Click twice to insert into formula Змінні - клікніть двічі для вставки в формулу + + Segmenting a simple curve + Сегментація простої кривої + + + Color + Колір + DialogCutSplinePath @@ -936,7 +988,7 @@ Cut curve path - Розрізати складну криву + Розрізати складну криву ... @@ -944,7 +996,7 @@ Calculate value - Розрахувати значення + Розрахувати значення Value of length @@ -1014,6 +1066,14 @@ Variables - Click twice to insert into formula Змінні - клікніть двічі для вставки в формулу + + Segment a curved path + Сегментація складної кривої + + + Color + Колір + DialogDetail @@ -1069,6 +1129,10 @@ Reverse Протилежний напрямок + + Seam allowance tool + Деталь + DialogEditWrongFormula @@ -1090,7 +1154,7 @@ Calculate value - Розрахувати значення + Розрахувати значення Value of first angle @@ -1157,7 +1221,7 @@ Point in the end of a line - Точка на кінці відрізку + Точка на кінці відрізку Formula for calculation of length of line @@ -1165,7 +1229,7 @@ Calculate value - Розрахувати значення + Розрахувати значення Value of length @@ -1263,6 +1327,14 @@ Length of curves Довжина кривих + + Point at distance and angle + Точка на кінці лінії + + + Line color + Колір лінії + DialogHeight @@ -1272,7 +1344,7 @@ Height - Зріст + Зріст Point label @@ -1306,6 +1378,18 @@ Select second point of line Виберіть другу точку лінії + + Perpendicular point along line + Перпендикулярна точка вздовж лінії + + + Base Point + Базова точка + + + Line color + Колір лінії + DialogHistory @@ -1600,6 +1684,22 @@ Length Довжина + + Tables of Variables + Таблиці змінних + + + Base size: %1 %3; Base height: %2 %3 + Базовий розмір: %1 %3; Базовий зріст: %2 %3 + + + Description: "%1" + Опис: "%1" + + + Data successfully saved. + Данні успішно збережені. + DialogIndividualMeasurements @@ -1680,11 +1780,121 @@ Дюйми + + DialogLayoutProgress + + Creation a layout + Створення розкладки + + + <html><head/><body><p>Finding best position for worpieces. Please, waite.</p></body></html> + <html><head/><body><p>Зачекайте, відбувається пошук найкращої позиції для деталі.</p></body></html> + + + Couldn't prepare data for creation layout + Не вдалося підготувати данні для створення розкладки + + + Critical error + Критична помилка + + + Wrong paper size + Не правильний розмір паперу + + + Several workpieces left not arranged, but none of them match for paper + Декілька деталей залишилися укладеними, але жодна з них не підійшла для листа + + + + DialogLayoutSettings + + Creation a layout + Створення розкладки + + + Paper size + Розмір паперу + + + Templates: + Шаблони: + + + Width: + Ширина: + + + Height: + Висота: + + + ... + ... + + + Rotate workpiece + Повертати деталі + + + Rotate by + Повертати на + + + degree + градуси + + + Creation options + Опції створення + + + Layout width: + Ширина розкладки: + + + Shift length: + Довжина зміщення: + + + Principle of choosing the next workpiece + Принцип вибору настпної деталі + + + Three groups: big, middle, small + Три групи: великі, середні, малі + + + Two groups: big, small + Дві групи: великі, малі + + + Descending area + За спаданням площі + + + Millimiters + Міліметри + + + Centimeters + Сантиметри + + + Inches + Дюйми + + + Pixels + Пікселі + + DialogLine Line - Лінія + Лінія First point @@ -1706,6 +1916,14 @@ Select second point Виберіть другу точку + + Line between points + Лінія між двома точками + + + Line color + Колір лінії + DialogLineIntersect @@ -1715,7 +1933,7 @@ Intersection of lines - Перетин ліній + Перетин ліній Point label @@ -1749,12 +1967,16 @@ Select second point of second line Виберіть другу точку другої лінії + + Point at line intersection + Точка перетину ліній + DialogLineIntersectAxis Line intersect axis - Перетин лінії і осі + Перетин лінії і осі Angle @@ -1762,7 +1984,7 @@ Calculate value - Розрахувати значення + Розрахувати значення Value of angle @@ -1848,6 +2070,22 @@ Select axis point Виберіть точку осі + + Point intersect line and axis + Точка на перетині лінії і осі + + + Axis Point + Точка осі + + + Second point of line + Друга точка лінії + + + Line color + Колір лінії + DialogMeasurements @@ -1880,7 +2118,7 @@ DialogNormal Normal - Перпендикуляр + Перпендикуляр Length @@ -1920,7 +2158,7 @@ Calculate value - Розрахувати значення + Розрахувати значення Point label @@ -1982,6 +2220,22 @@ Select second point of line Виберіть другу точку лінії + + Point along perpendicular + Інструмент точка перпендикуляра + + + First point of line + Перша точка лінії + + + Second point of line + Друга точка лінії + + + Line color + Колір лінії + DialogPatternProperties @@ -2157,7 +2411,7 @@ DialogPointOfContact Point of contact - Точка дотику + Точка дотику Radius @@ -2181,7 +2435,7 @@ Calculate value - Розрахувати значення + Розрахувати значення Point label @@ -2255,6 +2509,10 @@ Select point of center of arc Виберіть точку центру дуги + + Point at intersection of arc and line + Точка на перетині дуги та лінії + DialogPointOfIntersection @@ -2268,11 +2526,11 @@ vertical point - Точка по вертикалі + Точка по вертикалі horizontal point - Точка по горизонталі + Точка по горизонталі First point of angle @@ -2280,7 +2538,7 @@ Point of intersection - Точка перетину + Точка перетину Second point of angle @@ -2288,14 +2546,30 @@ Select point horizontally - Виберіть точку горизонталі + Виберіть точку горизонталі + + + Point from X and Y of two other points + Точка на перетині Х і Y коодринат двох інших точок + + + X: vertical point + Х: вертикальна точка + + + Y: horizontal point + Y: горизонтальна точка + + + Select point for Y value (horizontal) + Виберіть точку на горизонталі DialogShoulderPoint Point of shoulder - Точка плеча + Точка плеча Length @@ -2311,7 +2585,7 @@ Calculate value - Розрахувати значення + Розрахувати значення Point label @@ -2405,6 +2679,14 @@ Select point of shoulder Виберіть точку плеча + + Special point on shoulder + Спеціальна точка на плече + + + Line color + Колір лінії + DialogSinglePoint @@ -2437,7 +2719,7 @@ DialogSpline Curve - Крива + Крива First point @@ -2471,6 +2753,14 @@ Select last point of curve Виберість останню точку кривої + + Simple curve + Проста крива + + + Color + Колір + DialogSplinePath @@ -2514,6 +2804,10 @@ Select point of curve path Виберіть точку складної кривої + + Color + Колір + DialogStandardMeasurements @@ -2616,6 +2910,10 @@ Parser error: %1 Помилка синтаксичного аналізу: %1 + + Line Angle + Кут лінії + DialogTriangle @@ -2625,7 +2923,7 @@ Triangle - Трикутник + Трикутник Point label @@ -2663,6 +2961,22 @@ Select second point Виберіть другу точку + + Triangle tool + Інструмент трикутник + + + First point of the axis + Перша точка вісі + + + Second point of the axis + Друга точка вісі + + + Second point of line + Друга точка лінії + DialogUndo @@ -2715,12 +3029,16 @@ Union details - Обєднання деталей + Обєднання деталей <html><head/><body><p>Do you really want union details?</p></body></html> <html><head/><body><р>Показати повний розрахунок у вікні повідомлення</p></body</html> + + Union tool + Інструмент об'єднання + Functions @@ -2877,7 +3195,7 @@ Special point on shoulder. - Інструмент точка плеча. + Інструмент точка плеча. Point at distance and angle @@ -2893,7 +3211,7 @@ Point at intersection of arc and line. - Інструмент точка дотику. + Інструмент точка дотику. Tool point of height. @@ -2901,7 +3219,7 @@ Tool triangle. - Інструмент трикутник. + Інструмент трикутник. Tools for creating lines. @@ -2957,7 +3275,7 @@ Tool new detail. - Інструмент нова деталь. + Інструмент нова деталь. File @@ -2993,7 +3311,7 @@ Tool to make point from x & y of two other points. - Інструменд для створення точки з двух х и у координат двух інших точок. + Інструменд для створення точки з двух х и у координат двух інших точок. Line between points @@ -3005,23 +3323,23 @@ Curve tool. - Інструмент крива. + Інструмент крива. Tool for path curve. - Інструмент складна крива. + Інструмент складна крива. Tool segment a pathed curve. - Інструмент розрізання складної кривої. + Інструмент розрізання складної кривої. Tool for segmenting a curve. - Інструмент розрізання кривої. + Інструмент розрізання кривої. Point of intersection line and axis - Точка на перетині лінії і осі + Точка на перетині лінії і осі ... @@ -3029,15 +3347,15 @@ Arc tool. - Інструмент дуга. + Інструмент дуга. Cut arc tool. - Інструмент розрізання дуги. + Інструмент розрізання дуги. Tool for union two details. - Інструмент обєднання двух деталей. + Інструмент обєднання двух деталей. &File @@ -3583,7 +3901,7 @@ For opening pattern need keep both files: pattern and measurements. Do you want Select point vertically - Виберіть точку по вертикалі + Виберіть точку по вертикалі Select detail @@ -3711,6 +4029,82 @@ Do you want to save your changes? This file already opened in another window. Цей файл вже відкрито в іншому вікні. + + Special point on shoulder + Спеціальна точка на плечі + + + Triangle tool + Інструмент трикутник + + + Point at intersection of arc and line + Точка на перетині дуги та лінії + + + Point from X and Y of two other points + Точка на перетині Х і Y коодринат двох інших точок + + + Point intersect line and axis + Точка на перетині лінії і осі + + + Simple curve + Проста крива + + + Curved path + Складна крива + + + Segmenting a simple curve + Сегментація простої кривої + + + Segment a curved path + Сегментація складної кривої + + + Point intersect curve and axis + Точка перениту кривої і вісі + + + Segment an arc + Сегмент дуги + + + Point intersect arc and axis + Точка перетину дуги і вісі + + + Seam allowance tool + Деталь + + + Union tool + Інструмент об'єднання + + + toolBar + Панель інструментів + + + Last Tool + Останній інструмент + + + Activate last used tool again + Активувати останній використаний інструмент знову + + + L + L + + + Select point for X value (vertical) + Виберіть точку по вертикалі + Measurements @@ -5793,6 +6187,14 @@ Do you want to save your changes? Patterns Лекала + + Standard measurements + Стандартна таблиця мірок + + + Layout + Розкладка + PatternPage @@ -5933,6 +6335,10 @@ Do you want to save your changes? The text that appears in the second column header Значення + + px + піксел + QmuParserErrorMsg @@ -6167,19 +6573,19 @@ Do you want to save your changes? Next - Наступний + Наступний Next detail - Наступна деталь + Наступна деталь Turn - Повернути + Повернути Turn the detail 90 degrees - Повернути деталь на 90 градусів + Повернути деталь на 90 градусів Turn the detail 180 degrees @@ -6191,11 +6597,11 @@ Do you want to save your changes? Enlarge letter - Збільшити аркуш + Збільшити аркуш Enlarge the length of the sheet - Збільшити довжину аркушу + Збільшити довжину аркушу Enlarge the length of sheet @@ -6203,15 +6609,15 @@ Do you want to save your changes? Reduce sheet - Зменшити аркуш + Зменшити аркуш Reduce the length of the sheet - Зменшити довжину аркушу + Зменшити довжину аркушу Mirroring - Дзеркальне відображення + Дзеркальне відображення Zoom In @@ -6227,15 +6633,15 @@ Do you want to save your changes? 0 details left. - 0 деталей залишилось. + 0 деталей залишилось. Collisions not found. - Колізії не знайдено. + Колізії не знайдено. %1 details left. - %1 деталей залишилось. + %1 деталей залишилось. untitled @@ -6263,7 +6669,7 @@ Do you want to save your changes? Collisions found. - Знайдено колізії. + Знайдено колізії. Creating file '%1' failed! %2 @@ -6281,6 +6687,14 @@ Do you want to save your changes? Wavefront OBJ (*.obj) Wavefront OBJ (*.obj) + + Layout pages + Сторінки розкладки + + + Layout + Розкладка + VAbstractConverter @@ -6338,6 +6752,34 @@ Do you want to save your changes? Do you really want delete? Ви дійсно хочете видалити? + + black + чорний + + + green + зелений + + + blue + синій + + + dark red + темно червоний + + + dark green + темно зелений + + + dark blue + темно синій + + + yellow + жовтий + VApplication @@ -7006,6 +7448,18 @@ Do you want to save your changes? Point intersection line and axis Точка на перетині лінії і осі + + Line color + Колір лінії + + + Color + Колір + + + Point intersection curve and axis + Точка перениту кривої і вісі + VToolTriangle diff --git a/src/app/app.pro b/src/app/app.pro index ac7295cd3..d60c7f765 100644 --- a/src/app/app.pro +++ b/src/app/app.pro @@ -181,7 +181,8 @@ INSTALL_TRANSLATIONS += \ $${TRANSLATIONS_PATH}/valentina_fr_FR.qm \ $${TRANSLATIONS_PATH}/valentina_it_IT.qm \ $${TRANSLATIONS_PATH}/valentina_nl_NL.qm \ - $${TRANSLATIONS_PATH}/valentina_id_ID.qm + $${TRANSLATIONS_PATH}/valentina_id_ID.qm \ + $${TRANSLATIONS_PATH}/valentina_es_ES.qm # Set "make install" command for Unix-like systems. unix{ @@ -306,6 +307,14 @@ unix{ QMAKE_BUNDLE_DATA += TRANSLATION_id_ID } + exists($${TRANSLATIONS_PATH}/valentina_es_ES.qm){ + TRANSLATION_es_ES.files += \ + $${TRANSLATIONS_PATH}/valentina_es_ES.qm \ + $${TRANSLATIONS_PATH}/Localizable.strings + TRANSLATION_es_ES.path = "$$RESOURCES_DIR/translations/es_ES.lproj" + QMAKE_BUNDLE_DATA += TRANSLATION_es_ES + } + # Symlinks also good names for copying. Make will take origin file and copy them with using symlink name. # For bundle this names more then enough. We don't need care much about libraries versions. libraries.path = $$FRAMEWORKS_DIR diff --git a/src/app/dialogs/app/dialoglayoutsettings.ui b/src/app/dialogs/app/dialoglayoutsettings.ui index 2fae9b45c..fd0f71ca6 100644 --- a/src/app/dialogs/app/dialoglayoutsettings.ui +++ b/src/app/dialogs/app/dialoglayoutsettings.ui @@ -135,7 +135,7 @@ - TextLabel + TextLabel @@ -144,7 +144,7 @@ - ... + ... @@ -167,7 +167,7 @@ - ... + ... @@ -511,7 +511,7 @@ - + diff --git a/src/app/mainwindow.ui b/src/app/mainwindow.ui index fd436d417..8cff5bbc0 100644 --- a/src/app/mainwindow.ui +++ b/src/app/mainwindow.ui @@ -48,7 +48,7 @@ 0 0 105 - 262 + 272 @@ -335,7 +335,7 @@ 0 0 105 - 56 + 58 @@ -411,7 +411,7 @@ 0 0 105 - 150 + 156 @@ -565,7 +565,7 @@ 0 0 105 - 100 + 104 @@ -667,7 +667,7 @@ 0 0 105 - 56 + 58 @@ -763,7 +763,7 @@ 0 0 1100 - 21 + 25 diff --git a/src/app/share/resources/flags.qrc b/src/app/share/resources/flags.qrc index 5a33e6161..f7d9efe87 100644 --- a/src/app/share/resources/flags.qrc +++ b/src/app/share/resources/flags.qrc @@ -10,5 +10,6 @@ flags/Russia.png flags/Ukraine.png flags/UnitedStates.png + flags/Spain.png diff --git a/src/app/share/resources/flags/Spain.png b/src/app/share/resources/flags/Spain.png new file mode 100644 index 0000000000000000000000000000000000000000..cf53a8d6527b37d82de24a9f5c6d42fbbfa500f1 GIT binary patch literal 312 zcmV-80muG{P)X1e}ARLB3n%SH14WDn*4C(C61pP%Ob|JNQ$Edb)bhZ+BGTWkC!>Z%xtof3BVX|CZ%;|Nk6fqEafN79Ku1dFWd(^lP*sZ2 Date: Thu, 26 Feb 2015 16:29:32 +0200 Subject: [PATCH 177/186] Prevent deletion uninitialized pointer. --HG-- branch : develop --- src/app/dialogs/app/dialogincrements.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app/dialogs/app/dialogincrements.cpp b/src/app/dialogs/app/dialogincrements.cpp index 3060e10db..45b60080d 100644 --- a/src/app/dialogs/app/dialogincrements.cpp +++ b/src/app/dialogs/app/dialogincrements.cpp @@ -102,7 +102,7 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par ui->toolBoxMeasurements->setItemEnabled(0, false); const QString filePath = doc->MPath(); - VStandardMeasurements *mSt; + VStandardMeasurements *mSt = nullptr; try { VDomDocument::ValidateXML("://schema/standard_measurements.xsd", filePath); @@ -117,7 +117,10 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par catch (VException &e) { e.CriticalMessageBox(tr("File error."), this); - delete mSt; + if (mSt != nullptr) + { + delete mSt; + } emit DialogClosed(QDialog::Rejected); return; } From 13dcebb082ee56357e016b2aa6a9e283488b2f4c Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 26 Feb 2015 17:06:19 +0200 Subject: [PATCH 178/186] Fixed unable setting AboutValentina dialog size on Windows. --HG-- branch : develop --- src/app/dialogs/app/dialogaboutapp.ui | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/dialogs/app/dialogaboutapp.ui b/src/app/dialogs/app/dialogaboutapp.ui index d17d84aa8..01d4c4bd1 100644 --- a/src/app/dialogs/app/dialogaboutapp.ui +++ b/src/app/dialogs/app/dialogaboutapp.ui @@ -10,7 +10,7 @@ 0 0 583 - 480 + 524 @@ -22,13 +22,13 @@ 573 - 480 + 524 583 - 480 + 524 From 018fae459a98a3e2aa53d455b2fb42871b00f232 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 26 Feb 2015 22:18:52 +0200 Subject: [PATCH 179/186] Build on Mac OS. --HG-- branch : develop --- src/app/app.pro | 2 +- src/app/geometry/vsplinepath.cpp | 2 ++ src/app/tools/drawTools/vtoolsplinepath.cpp | 2 ++ src/app/tools/nodeDetails/vabstractnode.h | 2 ++ src/app/tools/vabstracttool.cpp | 4 +++- src/libs/qmuparser/qmuparserdef.h | 1 + src/libs/vlayout/vabstractdetail.cpp | 1 + src/libs/vlayout/vabstractdetail_p.h | 1 + src/libs/vlayout/vbank.h | 2 +- src/libs/vlayout/vcontour.cpp | 1 + src/libs/vlayout/vposition.cpp | 2 ++ 11 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/app/app.pro b/src/app/app.pro index d60c7f765..0d23a1ae2 100644 --- a/src/app/app.pro +++ b/src/app/app.pro @@ -319,7 +319,7 @@ unix{ # For bundle this names more then enough. We don't need care much about libraries versions. libraries.path = $$FRAMEWORKS_DIR libraries.files += $${OUT_PWD}/../libs/qmuparser/$${DESTDIR}/libqmuparser.2.dylib - libraries.files = $${OUT_PWD}/../libs/vpropertyexplorer/$${DESTDIR}/libvpropertyexplorer.1.dylib + libraries.files += $${OUT_PWD}/../libs/vpropertyexplorer/$${DESTDIR}/libvpropertyexplorer.1.dylib # logo on macx. diff --git a/src/app/geometry/vsplinepath.cpp b/src/app/geometry/vsplinepath.cpp index 635653333..2170ffbf0 100644 --- a/src/app/geometry/vsplinepath.cpp +++ b/src/app/geometry/vsplinepath.cpp @@ -30,6 +30,8 @@ #include "vsplinepath_p.h" #include "../libs/ifc/exception/vexception.h" +#include + //--------------------------------------------------------------------------------------------------------------------- VSplinePath::VSplinePath(qreal kCurve, quint32 idObject, Draw mode) : VAbstractCurve(GOType::SplinePath, idObject, mode), d(new VSplinePathData(kCurve)) diff --git a/src/app/tools/drawTools/vtoolsplinepath.cpp b/src/app/tools/drawTools/vtoolsplinepath.cpp index 3d1c18e5a..612cd6e38 100644 --- a/src/app/tools/drawTools/vtoolsplinepath.cpp +++ b/src/app/tools/drawTools/vtoolsplinepath.cpp @@ -31,6 +31,8 @@ #include "../../undocommands/movesplinepath.h" #include "../../visualization/vistoolsplinepath.h" +#include + const QString VToolSplinePath::ToolType = QStringLiteral("path"); //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/tools/nodeDetails/vabstractnode.h b/src/app/tools/nodeDetails/vabstractnode.h index 95a668378..e8d41eaa4 100644 --- a/src/app/tools/nodeDetails/vabstractnode.h +++ b/src/app/tools/nodeDetails/vabstractnode.h @@ -31,6 +31,8 @@ #include "../vabstracttool.h" +#include + /** * @brief The VAbstractNode class parent class for all detail node. */ diff --git a/src/app/tools/vabstracttool.cpp b/src/app/tools/vabstracttool.cpp index 2a7a738c5..27861636d 100644 --- a/src/app/tools/vabstracttool.cpp +++ b/src/app/tools/vabstracttool.cpp @@ -28,13 +28,15 @@ #include "vabstracttool.h" #include +#include #include +#include + #include "../undocommands/deltool.h" #include "../core/vapplication.h" #include "../geometry/vpointf.h" #include "../undocommands/savetooloptions.h" #include "../widgets/vmaingraphicsview.h" -#include const QString VAbstractTool::AttrType = QStringLiteral("type"); const QString VAbstractTool::AttrMx = QStringLiteral("mx"); diff --git a/src/libs/qmuparser/qmuparserdef.h b/src/libs/qmuparser/qmuparserdef.h index a74d29d00..f52723335 100644 --- a/src/libs/qmuparser/qmuparserdef.h +++ b/src/libs/qmuparser/qmuparserdef.h @@ -25,6 +25,7 @@ #include #include +#include #include "qmuparserfixes.h" diff --git a/src/libs/vlayout/vabstractdetail.cpp b/src/libs/vlayout/vabstractdetail.cpp index 89bdddc8b..9adbd8126 100644 --- a/src/libs/vlayout/vabstractdetail.cpp +++ b/src/libs/vlayout/vabstractdetail.cpp @@ -32,6 +32,7 @@ #include #include #include +#include //--------------------------------------------------------------------------------------------------------------------- /** diff --git a/src/libs/vlayout/vabstractdetail_p.h b/src/libs/vlayout/vabstractdetail_p.h index 17826ed76..15bf4a31b 100644 --- a/src/libs/vlayout/vabstractdetail_p.h +++ b/src/libs/vlayout/vabstractdetail_p.h @@ -30,6 +30,7 @@ #define VABSTRACTDETAIL_P_H #include +#include #ifdef Q_CC_GNU #pragma GCC diagnostic push diff --git a/src/libs/vlayout/vbank.h b/src/libs/vlayout/vbank.h index fd55dadcd..2222fe323 100644 --- a/src/libs/vlayout/vbank.h +++ b/src/libs/vlayout/vbank.h @@ -31,10 +31,10 @@ #include #include +#include class QPointF; class VLayoutDetail; -class QRectF; enum class Cases : char { CaseThreeGroup, CaseTwoGroup, CaseDesc}; diff --git a/src/libs/vlayout/vcontour.cpp b/src/libs/vlayout/vcontour.cpp index f28d9a9e8..0358347e7 100644 --- a/src/libs/vlayout/vcontour.cpp +++ b/src/libs/vlayout/vcontour.cpp @@ -32,6 +32,7 @@ #include #include +#include //--------------------------------------------------------------------------------------------------------------------- VContour::VContour() diff --git a/src/libs/vlayout/vposition.cpp b/src/libs/vlayout/vposition.cpp index 23c977cf3..8a5ab17db 100644 --- a/src/libs/vlayout/vposition.cpp +++ b/src/libs/vlayout/vposition.cpp @@ -36,6 +36,8 @@ #include #include #include +#include +#include //--------------------------------------------------------------------------------------------------------------------- VPosition::VPosition(const VContour &gContour, int j, const VLayoutDetail &detail, int i, bool *stop, bool rotate, From 6ad6eda04a3b95a5b094c119a34351f88c5cd23a Mon Sep 17 00:00:00 2001 From: Felix Ulber Date: Thu, 26 Feb 2015 22:34:33 +0100 Subject: [PATCH 180/186] Some code corrections on fix of issue #235 --HG-- branch : develop --- src/app/core/vsettings.cpp | 58 +++++++++---------- src/app/tools/vabstracttool.cpp | 6 +- .../vpropertyexplorer/checkablemessagebox.cpp | 31 +++------- .../vpropertyexplorer/checkablemessagebox.h | 31 +++------- 4 files changed, 52 insertions(+), 74 deletions(-) diff --git a/src/app/core/vsettings.cpp b/src/app/core/vsettings.cpp index 456fffd5b..199f1ce36 100644 --- a/src/app/core/vsettings.cpp +++ b/src/app/core/vsettings.cpp @@ -33,39 +33,39 @@ #include #include -const QString VSettings::SettingConfigurationOsSeparator = QStringLiteral("configuration/osSeparator"); -const QString VSettings::SettingConfigurationAutosaveState = QStringLiteral("configuration/autosave/state"); -const QString VSettings::SettingConfigurationAutosaveTime = QStringLiteral("configuration/autosave/time"); -const QString VSettings::SettingConfigurationSendReportState = QStringLiteral("configuration/send_report/state"); -const QString VSettings::SettingConfigurationLocale = QStringLiteral("configuration/locale"); -const QString VSettings::SettingConfigurationUnit = QStringLiteral("configuration/unit"); -const QString VSettings::SettingConfigurationLabelLanguage = QStringLiteral("configuration/label_language"); -const QString VSettings::SettingConfigurationConfirmItemDeletion= QStringLiteral("configuration/confirm_item_deletion"); +const QString VSettings::SettingConfigurationOsSeparator = QStringLiteral("configuration/osSeparator"); +const QString VSettings::SettingConfigurationAutosaveState = QStringLiteral("configuration/autosave/state"); +const QString VSettings::SettingConfigurationAutosaveTime = QStringLiteral("configuration/autosave/time"); +const QString VSettings::SettingConfigurationSendReportState = QStringLiteral("configuration/send_report/state"); +const QString VSettings::SettingConfigurationLocale = QStringLiteral("configuration/locale"); +const QString VSettings::SettingConfigurationUnit = QStringLiteral("configuration/unit"); +const QString VSettings::SettingConfigurationLabelLanguage = QStringLiteral("configuration/label_language"); +const QString VSettings::SettingConfigurationConfirmItemDeletion = QStringLiteral("configuration/confirm_item_deletion"); -const QString VSettings::SettingPathsIndividualMeasurements = QStringLiteral("paths/individual_measurements"); -const QString VSettings::SettingPathsStandardMeasurements = QStringLiteral("paths/standard_measurements"); -const QString VSettings::SettingPathsPattern = QStringLiteral("paths/pattern"); -const QString VSettings::SettingPathsLayout = QStringLiteral("paths/layout"); +const QString VSettings::SettingPathsIndividualMeasurements = QStringLiteral("paths/individual_measurements"); +const QString VSettings::SettingPathsStandardMeasurements = QStringLiteral("paths/standard_measurements"); +const QString VSettings::SettingPathsPattern = QStringLiteral("paths/pattern"); +const QString VSettings::SettingPathsLayout = QStringLiteral("paths/layout"); -const QString VSettings::SettingPatternUser = QStringLiteral("pattern/user"); -const QString VSettings::SettingPatternGraphicalOutput = QStringLiteral("pattern/graphicalOutput"); -const QString VSettings::SettingPatternUndo = QStringLiteral("pattern/undo"); +const QString VSettings::SettingPatternUser = QStringLiteral("pattern/user"); +const QString VSettings::SettingPatternGraphicalOutput = QStringLiteral("pattern/graphicalOutput"); +const QString VSettings::SettingPatternUndo = QStringLiteral("pattern/undo"); -const QString VSettings::SettingGeneralRecentFileList = QStringLiteral("recentFileList"); -const QString VSettings::SettingGeneralRestoreFileList = QStringLiteral("restoreFileList"); -const QString VSettings::SettingGeneralGeometry = QStringLiteral("geometry"); -const QString VSettings::SettingGeneralWindowState = QStringLiteral("windowState"); +const QString VSettings::SettingGeneralRecentFileList = QStringLiteral("recentFileList"); +const QString VSettings::SettingGeneralRestoreFileList = QStringLiteral("restoreFileList"); +const QString VSettings::SettingGeneralGeometry = QStringLiteral("geometry"); +const QString VSettings::SettingGeneralWindowState = QStringLiteral("windowState"); -const QString VSettings::SettingCommunityServer = QStringLiteral("community/server"); -const QString VSettings::SettingCommunityServerSecure = QStringLiteral("community/serverSecure"); -const QString VSettings::SettingCommunityUseProxy = QStringLiteral("community/useProxy"); -const QString VSettings::SettingCommunityProxyAddress = QStringLiteral("community/proxyAddress"); -const QString VSettings::SettingCommunityProxyPort = QStringLiteral("community/proxyPort"); -const QString VSettings::SettingCommunityProxyUser = QStringLiteral("community/proxyUser"); -const QString VSettings::SettingCommunityProxyPass = QStringLiteral("community/proxyPass"); -const QString VSettings::SettingCommunityUsername = QStringLiteral("community/username"); -const QString VSettings::SettingCommunitySavePassword = QStringLiteral("community/savePassword"); -const QString VSettings::SettingCommunityUserPassword = QStringLiteral("community/userpassword"); +const QString VSettings::SettingCommunityServer = QStringLiteral("community/server"); +const QString VSettings::SettingCommunityServerSecure = QStringLiteral("community/serverSecure"); +const QString VSettings::SettingCommunityUseProxy = QStringLiteral("community/useProxy"); +const QString VSettings::SettingCommunityProxyAddress = QStringLiteral("community/proxyAddress"); +const QString VSettings::SettingCommunityProxyPort = QStringLiteral("community/proxyPort"); +const QString VSettings::SettingCommunityProxyUser = QStringLiteral("community/proxyUser"); +const QString VSettings::SettingCommunityProxyPass = QStringLiteral("community/proxyPass"); +const QString VSettings::SettingCommunityUsername = QStringLiteral("community/username"); +const QString VSettings::SettingCommunitySavePassword = QStringLiteral("community/savePassword"); +const QString VSettings::SettingCommunityUserPassword = QStringLiteral("community/userpassword"); //--------------------------------------------------------------------------------------------------------------------- VSettings::VSettings(Format format, Scope scope, const QString &organization, const QString &application, diff --git a/src/app/tools/vabstracttool.cpp b/src/app/tools/vabstracttool.cpp index 38f2b3630..e79fb59e2 100644 --- a/src/app/tools/vabstracttool.cpp +++ b/src/app/tools/vabstracttool.cpp @@ -30,7 +30,7 @@ #include #include #include -#include "checkablemessagebox.h" +#include "../../libs/vpropertyexplorer/checkablemessagebox.h" #include "../undocommands/deltool.h" #include "../core/vapplication.h" #include "../geometry/vpointf.h" @@ -174,7 +174,9 @@ void VAbstractTool::DeleteTool(bool ask) int VAbstractTool::ConfirmDeletion() { if (false == qApp->getSettings()->GetConfirmItemDelete()) + { return QMessageBox::Yes; + } Utils::CheckableMessageBox msgBox(qApp->getMainWindow()); msgBox.setWindowTitle(tr("Confirm deletion")); @@ -186,7 +188,9 @@ int VAbstractTool::ConfirmDeletion() int dialogResult = msgBox.exec(); if (dialogResult == QDialog::Accepted) + { qApp->getSettings()->SetConfirmItemDelete(not msgBox.isChecked()); + } return dialogResult == QDialog::Accepted ? QMessageBox::Yes : QMessageBox::No; } diff --git a/src/libs/vpropertyexplorer/checkablemessagebox.cpp b/src/libs/vpropertyexplorer/checkablemessagebox.cpp index 205d07b67..9454417df 100644 --- a/src/libs/vpropertyexplorer/checkablemessagebox.cpp +++ b/src/libs/vpropertyexplorer/checkablemessagebox.cpp @@ -2,30 +2,17 @@ ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal -** Modified work Copyright 2015 Felix Ulber +** Modified work Copyright (C) 2015 Felix Ulber ** -** This file is part of Qt Creator. +** All rights reserved. This program and the accompanying materials are made +** available under the terms of the GNU Lesser General Public License (LGPL) +** version 2.1 which accompanies this distribution, and is available at +** http://www.gnu.org/licenses/lgpl-2.1.html ** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://www.qt.io/licensing. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** This library is distributed in the hope that it will be useful, but WITHOUT +** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +** FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License +** for more details. ** ****************************************************************************/ diff --git a/src/libs/vpropertyexplorer/checkablemessagebox.h b/src/libs/vpropertyexplorer/checkablemessagebox.h index 233b505d6..3e209a987 100644 --- a/src/libs/vpropertyexplorer/checkablemessagebox.h +++ b/src/libs/vpropertyexplorer/checkablemessagebox.h @@ -2,30 +2,17 @@ ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal -** Modified work Copyright 2015 Felix Ulber +** Modified work Copyright (C) 2015 Felix Ulber ** -** This file is part of Qt Creator. +** All rights reserved. This program and the accompanying materials are made +** available under the terms of the GNU Lesser General Public License (LGPL) +** version 2.1 which accompanies this distribution, and is available at +** http://www.gnu.org/licenses/lgpl-2.1.html ** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://www.qt.io/licensing. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** This library is distributed in the hope that it will be useful, but WITHOUT +** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +** FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License +** for more details. ** ****************************************************************************/ From 12c66e873f5c0a6c0520a7c8b5423d42fc5886c7 Mon Sep 17 00:00:00 2001 From: Felix Ulber Date: Thu, 26 Feb 2015 22:48:52 +0100 Subject: [PATCH 181/186] Corrections on license text --HG-- branch : develop --- src/libs/vpropertyexplorer/checkablemessagebox.cpp | 1 - src/libs/vpropertyexplorer/checkablemessagebox.h | 1 - 2 files changed, 2 deletions(-) diff --git a/src/libs/vpropertyexplorer/checkablemessagebox.cpp b/src/libs/vpropertyexplorer/checkablemessagebox.cpp index 9454417df..df285e0b7 100644 --- a/src/libs/vpropertyexplorer/checkablemessagebox.cpp +++ b/src/libs/vpropertyexplorer/checkablemessagebox.cpp @@ -2,7 +2,6 @@ ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal -** Modified work Copyright (C) 2015 Felix Ulber ** ** All rights reserved. This program and the accompanying materials are made ** available under the terms of the GNU Lesser General Public License (LGPL) diff --git a/src/libs/vpropertyexplorer/checkablemessagebox.h b/src/libs/vpropertyexplorer/checkablemessagebox.h index 3e209a987..5056f7947 100644 --- a/src/libs/vpropertyexplorer/checkablemessagebox.h +++ b/src/libs/vpropertyexplorer/checkablemessagebox.h @@ -2,7 +2,6 @@ ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal -** Modified work Copyright (C) 2015 Felix Ulber ** ** All rights reserved. This program and the accompanying materials are made ** available under the terms of the GNU Lesser General Public License (LGPL) From 139d4d26f06c3250f2ec240a4feadaaea3022a7d Mon Sep 17 00:00:00 2001 From: Felix Ulber Date: Thu, 26 Feb 2015 23:27:33 +0100 Subject: [PATCH 182/186] merge fix --HG-- branch : develop --- src/app/tools/vabstracttool.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/tools/vabstracttool.cpp b/src/app/tools/vabstracttool.cpp index ee25a44c5..ed6f900dd 100644 --- a/src/app/tools/vabstracttool.cpp +++ b/src/app/tools/vabstracttool.cpp @@ -29,6 +29,7 @@ #include "vabstracttool.h" #include #include +#include #include #include #include "../../libs/vpropertyexplorer/checkablemessagebox.h" From bfbe2a5fc2249cdbb68bdd292864c25d71a50455 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 27 Feb 2015 12:21:09 +0200 Subject: [PATCH 183/186] Fixed copyright notice for library qmuparser. --HG-- branch : develop --- src/libs/qmuparser/qmuparser.cpp | 3 +- src/libs/qmuparser/qmuparser.h | 3 +- src/libs/qmuparser/qmuparser_global.h | 3 +- src/libs/qmuparser/qmuparserbase.cpp | 3 +- src/libs/qmuparser/qmuparserbase.h | 3 +- src/libs/qmuparser/qmuparserbytecode.cpp | 3 +- src/libs/qmuparser/qmuparserbytecode.h | 3 +- src/libs/qmuparser/qmuparsercallback.cpp | 3 +- src/libs/qmuparser/qmuparsercallback.h | 3 +- src/libs/qmuparser/qmuparserdef.h | 3 +- src/libs/qmuparser/qmuparsererror.cpp | 3 +- src/libs/qmuparser/qmuparsererror.h | 3 +- src/libs/qmuparser/qmuparserfixes.h | 3 +- src/libs/qmuparser/qmuparsertest.cpp | 3 +- src/libs/qmuparser/qmuparsertest.h | 3 +- src/libs/qmuparser/qmuparsertoken.h | 3 +- src/libs/qmuparser/qmuparsertokenreader.cpp | 3 +- src/libs/qmuparser/qmuparsertokenreader.h | 3 +- src/libs/qmuparser/qmutranslation.cpp | 2 +- src/libs/qmuparser/qmutranslation.h | 2 +- src/libs/qmuparser/stable.cpp | 37 ++++++++++----------- src/libs/qmuparser/stable.h | 35 +++++++++---------- 22 files changed, 53 insertions(+), 77 deletions(-) diff --git a/src/libs/qmuparser/qmuparser.cpp b/src/libs/qmuparser/qmuparser.cpp index bac0ecf00..03f2e7805 100644 --- a/src/libs/qmuparser/qmuparser.cpp +++ b/src/libs/qmuparser/qmuparser.cpp @@ -1,7 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2013 Ingo Berg - ** Modified work Copyright 2014 Roman Telezhynskyi + ** Copyright (C) 2013 Ingo Berg ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software diff --git a/src/libs/qmuparser/qmuparser.h b/src/libs/qmuparser/qmuparser.h index f35f545cc..fddbe451b 100644 --- a/src/libs/qmuparser/qmuparser.h +++ b/src/libs/qmuparser/qmuparser.h @@ -1,7 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2013 Ingo Berg - ** Modified work Copyright 2014 Roman Telezhynskyi + ** Copyright (C) 2013 Ingo Berg ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software diff --git a/src/libs/qmuparser/qmuparser_global.h b/src/libs/qmuparser/qmuparser_global.h index 95202fc48..d06c58adf 100644 --- a/src/libs/qmuparser/qmuparser_global.h +++ b/src/libs/qmuparser/qmuparser_global.h @@ -1,7 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2013 Ingo Berg - ** Modified work Copyright 2014 Roman Telezhynskyi + ** Copyright (C) 2014 Roman Telezhynskyi ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software diff --git a/src/libs/qmuparser/qmuparserbase.cpp b/src/libs/qmuparser/qmuparserbase.cpp index 7455d3046..2a0a8d68f 100644 --- a/src/libs/qmuparser/qmuparserbase.cpp +++ b/src/libs/qmuparser/qmuparserbase.cpp @@ -1,7 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2013 Ingo Berg - ** Modified work Copyright 2014 Roman Telezhynskyi + ** Copyright (C) 2013 Ingo Berg ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software diff --git a/src/libs/qmuparser/qmuparserbase.h b/src/libs/qmuparser/qmuparserbase.h index dc9a36385..aa96547a0 100644 --- a/src/libs/qmuparser/qmuparserbase.h +++ b/src/libs/qmuparser/qmuparserbase.h @@ -1,7 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2013 Ingo Berg - ** Modified work Copyright 2014 Roman Telezhynskyi + ** Copyright (C) 2013 Ingo Berg ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software diff --git a/src/libs/qmuparser/qmuparserbytecode.cpp b/src/libs/qmuparser/qmuparserbytecode.cpp index 680566436..83c8b97e9 100644 --- a/src/libs/qmuparser/qmuparserbytecode.cpp +++ b/src/libs/qmuparser/qmuparserbytecode.cpp @@ -1,7 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2013 Ingo Berg - ** Modified work Copyright 2014 Roman Telezhynskyi + ** Copyright (C) 2013 Ingo Berg ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software diff --git a/src/libs/qmuparser/qmuparserbytecode.h b/src/libs/qmuparser/qmuparserbytecode.h index 8ef932e03..a466fa068 100644 --- a/src/libs/qmuparser/qmuparserbytecode.h +++ b/src/libs/qmuparser/qmuparserbytecode.h @@ -1,7 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2013 Ingo Berg - ** Modified work Copyright 2014 Roman Telezhynskyi + ** Copyright (C) 2013 Ingo Berg ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software diff --git a/src/libs/qmuparser/qmuparsercallback.cpp b/src/libs/qmuparser/qmuparsercallback.cpp index 6f1cd95da..826ab03e9 100644 --- a/src/libs/qmuparser/qmuparsercallback.cpp +++ b/src/libs/qmuparser/qmuparsercallback.cpp @@ -1,7 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2013 Ingo Berg - ** Modified work Copyright 2014 Roman Telezhynskyi + ** Copyright (C) 2013 Ingo Berg ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software diff --git a/src/libs/qmuparser/qmuparsercallback.h b/src/libs/qmuparser/qmuparsercallback.h index f6573a5f9..c959050ba 100644 --- a/src/libs/qmuparser/qmuparsercallback.h +++ b/src/libs/qmuparser/qmuparsercallback.h @@ -1,7 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2013 Ingo Berg - ** Modified work Copyright 2014 Roman Telezhynskyi + ** Copyright (C) 2013 Ingo Berg ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software diff --git a/src/libs/qmuparser/qmuparserdef.h b/src/libs/qmuparser/qmuparserdef.h index f52723335..7b2a306a2 100644 --- a/src/libs/qmuparser/qmuparserdef.h +++ b/src/libs/qmuparser/qmuparserdef.h @@ -1,7 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2013 Ingo Berg - ** Modified work Copyright 2014 Roman Telezhynskyi + ** Copyright (C) 2013 Ingo Berg ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software diff --git a/src/libs/qmuparser/qmuparsererror.cpp b/src/libs/qmuparser/qmuparsererror.cpp index 89ffbea50..d5bc769a9 100644 --- a/src/libs/qmuparser/qmuparsererror.cpp +++ b/src/libs/qmuparser/qmuparsererror.cpp @@ -1,7 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2013 Ingo Berg - ** Modified work Copyright 2014 Roman Telezhynskyi + ** Copyright (C) 2013 Ingo Berg ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software diff --git a/src/libs/qmuparser/qmuparsererror.h b/src/libs/qmuparser/qmuparsererror.h index 4aea8f35f..4ec0d90bf 100644 --- a/src/libs/qmuparser/qmuparsererror.h +++ b/src/libs/qmuparser/qmuparsererror.h @@ -1,7 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2013 Ingo Berg - ** Modified work Copyright 2014 Roman Telezhynskyi + ** Copyright (C) 2013 Ingo Berg ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software diff --git a/src/libs/qmuparser/qmuparserfixes.h b/src/libs/qmuparser/qmuparserfixes.h index 85b4298cd..29c6d4f70 100644 --- a/src/libs/qmuparser/qmuparserfixes.h +++ b/src/libs/qmuparser/qmuparserfixes.h @@ -1,7 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2013 Ingo Berg - ** Modified work Copyright 2014 Roman Telezhynskyi + ** Copyright (C) 2013 Ingo Berg ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software diff --git a/src/libs/qmuparser/qmuparsertest.cpp b/src/libs/qmuparser/qmuparsertest.cpp index a5ffb9dac..d71ecf514 100644 --- a/src/libs/qmuparser/qmuparsertest.cpp +++ b/src/libs/qmuparser/qmuparsertest.cpp @@ -1,7 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2013 Ingo Berg - ** Modified work Copyright 2014 Roman Telezhynskyi + ** Copyright (C) 2013 Ingo Berg ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software diff --git a/src/libs/qmuparser/qmuparsertest.h b/src/libs/qmuparser/qmuparsertest.h index d1ffe91a8..8444175ca 100644 --- a/src/libs/qmuparser/qmuparsertest.h +++ b/src/libs/qmuparser/qmuparsertest.h @@ -1,7 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2013 Ingo Berg - ** Modified work Copyright 2014 Roman Telezhynskyi + ** Copyright (C) 2013 Ingo Berg ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software diff --git a/src/libs/qmuparser/qmuparsertoken.h b/src/libs/qmuparser/qmuparsertoken.h index 8db39d292..2c68be7cd 100644 --- a/src/libs/qmuparser/qmuparsertoken.h +++ b/src/libs/qmuparser/qmuparsertoken.h @@ -1,7 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2013 Ingo Berg - ** Modified work Copyright 2014 Roman Telezhynskyi + ** Copyright (C) 2013 Ingo Berg ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software diff --git a/src/libs/qmuparser/qmuparsertokenreader.cpp b/src/libs/qmuparser/qmuparsertokenreader.cpp index d5515eb94..b6da95f2e 100644 --- a/src/libs/qmuparser/qmuparsertokenreader.cpp +++ b/src/libs/qmuparser/qmuparsertokenreader.cpp @@ -1,7 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2013 Ingo Berg - ** Modified work Copyright 2014 Roman Telezhynskyi + ** Copyright (C) 2013 Ingo Berg ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software diff --git a/src/libs/qmuparser/qmuparsertokenreader.h b/src/libs/qmuparser/qmuparsertokenreader.h index 5a28e5136..af4dbc245 100644 --- a/src/libs/qmuparser/qmuparsertokenreader.h +++ b/src/libs/qmuparser/qmuparsertokenreader.h @@ -1,7 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2013 Ingo Berg - ** Modified work Copyright 2014 Roman Telezhynskyi + ** Copyright (C) 2013 Ingo Berg ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software diff --git a/src/libs/qmuparser/qmutranslation.cpp b/src/libs/qmuparser/qmutranslation.cpp index a01b5cdf5..b558f1345 100644 --- a/src/libs/qmuparser/qmutranslation.cpp +++ b/src/libs/qmuparser/qmutranslation.cpp @@ -1,6 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2014 Roman Telezhynskyi + ** Copyright (C) 2014 Roman Telezhynskyi ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software diff --git a/src/libs/qmuparser/qmutranslation.h b/src/libs/qmuparser/qmutranslation.h index 688e8ecb5..850168077 100644 --- a/src/libs/qmuparser/qmutranslation.h +++ b/src/libs/qmuparser/qmutranslation.h @@ -1,6 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2014 Roman Telezhynskyi + ** Copyright (C) 2014 Roman Telezhynskyi ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software diff --git a/src/libs/qmuparser/stable.cpp b/src/libs/qmuparser/stable.cpp index 243b23938..fd6b6e173 100644 --- a/src/libs/qmuparser/stable.cpp +++ b/src/libs/qmuparser/stable.cpp @@ -1,30 +1,27 @@ -/************************************************************************ +/*************************************************************************************************** ** - ** @file stable.cpp - ** @author Roman Telezhynskyi - ** @date November 15, 2013 + ** @file stable.h + ** @author Copyright (C) 2014 Roman Telezhynskyi + ** @date April 30, 2014 ** ** @brief ** @copyright - ** This source code is part of the Valentine project, a pattern making - ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project - ** All Rights Reserved. + ** Permission is hereby granted, free of charge, to any person obtaining a copy of this + ** software and associated documentation files (the "Software"), to deal in the Software + ** without restriction, including without limitation the rights to use, copy, modify, + ** merge, publish, distribute, sublicense, and/or sell copies of the Software, and to + ** permit persons to whom the Software is furnished to do so, subject to the following conditions: ** - ** Valentina is free software: you can redistribute it and/or modify - ** it under the terms of the GNU General Public License as published by - ** the Free Software Foundation, either version 3 of the License, or - ** (at your option) any later version. + ** The above copyright notice and this permission notice shall be included in all copies or + ** substantial portions of the Software. ** - ** Valentina is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. + ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT + ** NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + ** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + ** DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + ** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ** - ** You should have received a copy of the GNU General Public License - ** along with Valentina. If not, see . - ** - *************************************************************************/ + ******************************************************************************************************/ // Build the precompiled headers. #include "stable.h" diff --git a/src/libs/qmuparser/stable.h b/src/libs/qmuparser/stable.h index 2c8c41189..66fbc35dd 100644 --- a/src/libs/qmuparser/stable.h +++ b/src/libs/qmuparser/stable.h @@ -1,30 +1,27 @@ -/************************************************************************ +/*************************************************************************************************** ** ** @file stable.h - ** @author Roman Telezhynskyi - ** @date November 15, 2013 + ** @author Copyright (C) 2014 Roman Telezhynskyi + ** @date April 30, 2014 ** ** @brief ** @copyright - ** This source code is part of the Valentine project, a pattern making - ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project - ** All Rights Reserved. + ** Permission is hereby granted, free of charge, to any person obtaining a copy of this + ** software and associated documentation files (the "Software"), to deal in the Software + ** without restriction, including without limitation the rights to use, copy, modify, + ** merge, publish, distribute, sublicense, and/or sell copies of the Software, and to + ** permit persons to whom the Software is furnished to do so, subject to the following conditions: ** - ** Valentina is free software: you can redistribute it and/or modify - ** it under the terms of the GNU General Public License as published by - ** the Free Software Foundation, either version 3 of the License, or - ** (at your option) any later version. + ** The above copyright notice and this permission notice shall be included in all copies or + ** substantial portions of the Software. ** - ** Valentina is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. + ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT + ** NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + ** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + ** DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + ** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ** - ** You should have received a copy of the GNU General Public License - ** along with Valentina. If not, see . - ** - *************************************************************************/ + ******************************************************************************************************/ #ifndef STABLE_H #define STABLE_H From 629a2a7579d1a65e97b070b1fa365859293a6d3e Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 27 Feb 2015 12:27:48 +0200 Subject: [PATCH 184/186] Copyright dates. --HG-- branch : develop --- src/app/container/calculator.cpp | 2 +- src/app/container/calculator.h | 2 +- src/app/container/variables.h | 2 +- src/app/container/variables/varclength.cpp | 2 +- src/app/container/variables/varclength.h | 2 +- src/app/container/variables/vcurvelength.cpp | 2 +- src/app/container/variables/vcurvelength.h | 2 +- src/app/container/variables/vcurvelength_p.h | 2 +- src/app/container/variables/vincrement.cpp | 2 +- src/app/container/variables/vincrement.h | 2 +- src/app/container/variables/vincrement_p.h | 2 +- src/app/container/variables/vinternalvariable.cpp | 2 +- src/app/container/variables/vinternalvariable.h | 2 +- src/app/container/variables/vinternalvariable_p.h | 2 +- src/app/container/variables/vlineangle.cpp | 2 +- src/app/container/variables/vlineangle.h | 2 +- src/app/container/variables/vlineangle_p.h | 2 +- src/app/container/variables/vlinelength.cpp | 2 +- src/app/container/variables/vlinelength.h | 2 +- src/app/container/variables/vlinelength_p.h | 2 +- src/app/container/variables/vmeasurement.cpp | 2 +- src/app/container/variables/vmeasurement.h | 2 +- src/app/container/variables/vmeasurement_p.h | 2 +- src/app/container/variables/vsplinelength.cpp | 2 +- src/app/container/variables/vsplinelength.h | 2 +- src/app/container/variables/vvariable.cpp | 2 +- src/app/container/variables/vvariable.h | 2 +- src/app/container/variables/vvariable_p.h | 2 +- src/app/container/vcontainer.cpp | 2 +- src/app/container/vcontainer.h | 2 +- src/app/container/vformula.cpp | 2 +- src/app/container/vformula.h | 2 +- src/app/core/undoevent.cpp | 2 +- src/app/core/undoevent.h | 2 +- src/app/core/vapplication.cpp | 2 +- src/app/core/vapplication.h | 2 +- src/app/core/vsettings.cpp | 2 +- src/app/core/vsettings.h | 2 +- src/app/dialogs/app/configdialog.cpp | 2 +- src/app/dialogs/app/configdialog.h | 2 +- src/app/dialogs/app/configpages/communitypage.cpp | 2 +- src/app/dialogs/app/configpages/communitypage.h | 2 +- src/app/dialogs/app/configpages/configurationpage.cpp | 2 +- src/app/dialogs/app/configpages/configurationpage.h | 2 +- src/app/dialogs/app/configpages/pages.h | 2 +- src/app/dialogs/app/configpages/pathpage.cpp | 2 +- src/app/dialogs/app/configpages/pathpage.h | 2 +- src/app/dialogs/app/configpages/patternpage.cpp | 2 +- src/app/dialogs/app/configpages/patternpage.h | 2 +- src/app/dialogs/app/dialogaboutapp.cpp | 2 +- src/app/dialogs/app/dialogaboutapp.h | 2 +- src/app/dialogs/app/dialoghistory.cpp | 2 +- src/app/dialogs/app/dialoghistory.h | 2 +- src/app/dialogs/app/dialogincrements.cpp | 2 +- src/app/dialogs/app/dialogincrements.h | 2 +- src/app/dialogs/app/dialogindividualmeasurements.cpp | 2 +- src/app/dialogs/app/dialogindividualmeasurements.h | 2 +- src/app/dialogs/app/dialoglayoutprogress.cpp | 2 +- src/app/dialogs/app/dialoglayoutprogress.h | 2 +- src/app/dialogs/app/dialoglayoutsettings.cpp | 2 +- src/app/dialogs/app/dialoglayoutsettings.h | 2 +- src/app/dialogs/app/dialogmeasurements.cpp | 2 +- src/app/dialogs/app/dialogmeasurements.h | 2 +- src/app/dialogs/app/dialogpatternproperties.cpp | 2 +- src/app/dialogs/app/dialogpatternproperties.h | 2 +- src/app/dialogs/app/dialogpatternxmledit.cpp | 2 +- src/app/dialogs/app/dialogpatternxmledit.h | 2 +- src/app/dialogs/app/dialogsavelayout.cpp | 2 +- src/app/dialogs/app/dialogsavelayout.h | 2 +- src/app/dialogs/app/dialogstandardmeasurements.cpp | 2 +- src/app/dialogs/app/dialogstandardmeasurements.h | 2 +- src/app/dialogs/app/dialogundo.cpp | 2 +- src/app/dialogs/app/dialogundo.h | 2 +- src/app/dialogs/dialogs.h | 2 +- src/app/dialogs/tools/dialogalongline.cpp | 2 +- src/app/dialogs/tools/dialogalongline.h | 2 +- src/app/dialogs/tools/dialogarc.cpp | 2 +- src/app/dialogs/tools/dialogarc.h | 2 +- src/app/dialogs/tools/dialogbisector.cpp | 2 +- src/app/dialogs/tools/dialogbisector.h | 2 +- src/app/dialogs/tools/dialogcurveintersectaxis.cpp | 2 +- src/app/dialogs/tools/dialogcurveintersectaxis.h | 2 +- src/app/dialogs/tools/dialogcutarc.cpp | 2 +- src/app/dialogs/tools/dialogcutarc.h | 2 +- src/app/dialogs/tools/dialogcutspline.cpp | 2 +- src/app/dialogs/tools/dialogcutspline.h | 2 +- src/app/dialogs/tools/dialogcutsplinepath.cpp | 2 +- src/app/dialogs/tools/dialogcutsplinepath.h | 2 +- src/app/dialogs/tools/dialogdetail.cpp | 2 +- src/app/dialogs/tools/dialogdetail.h | 2 +- src/app/dialogs/tools/dialogeditwrongformula.cpp | 2 +- src/app/dialogs/tools/dialogeditwrongformula.h | 2 +- src/app/dialogs/tools/dialogendline.cpp | 2 +- src/app/dialogs/tools/dialogendline.h | 2 +- src/app/dialogs/tools/dialogheight.cpp | 2 +- src/app/dialogs/tools/dialogheight.h | 2 +- src/app/dialogs/tools/dialogline.cpp | 2 +- src/app/dialogs/tools/dialogline.h | 2 +- src/app/dialogs/tools/dialoglineintersect.cpp | 2 +- src/app/dialogs/tools/dialoglineintersect.h | 2 +- src/app/dialogs/tools/dialoglineintersectaxis.cpp | 2 +- src/app/dialogs/tools/dialoglineintersectaxis.h | 2 +- src/app/dialogs/tools/dialognormal.cpp | 2 +- src/app/dialogs/tools/dialognormal.h | 2 +- src/app/dialogs/tools/dialogpointofcontact.cpp | 2 +- src/app/dialogs/tools/dialogpointofcontact.h | 2 +- src/app/dialogs/tools/dialogpointofintersection.cpp | 2 +- src/app/dialogs/tools/dialogpointofintersection.h | 2 +- src/app/dialogs/tools/dialogshoulderpoint.cpp | 2 +- src/app/dialogs/tools/dialogshoulderpoint.h | 2 +- src/app/dialogs/tools/dialogsinglepoint.cpp | 2 +- src/app/dialogs/tools/dialogsinglepoint.h | 2 +- src/app/dialogs/tools/dialogspline.cpp | 2 +- src/app/dialogs/tools/dialogspline.h | 2 +- src/app/dialogs/tools/dialogsplinepath.cpp | 2 +- src/app/dialogs/tools/dialogsplinepath.h | 2 +- src/app/dialogs/tools/dialogtool.cpp | 2 +- src/app/dialogs/tools/dialogtool.h | 2 +- src/app/dialogs/tools/dialogtriangle.cpp | 2 +- src/app/dialogs/tools/dialogtriangle.h | 2 +- src/app/dialogs/tools/dialoguniondetails.cpp | 2 +- src/app/dialogs/tools/dialoguniondetails.h | 2 +- src/app/geometry/vabstractcurve.cpp | 2 +- src/app/geometry/vabstractcurve.h | 2 +- src/app/geometry/varc.cpp | 2 +- src/app/geometry/varc.h | 2 +- src/app/geometry/varc_p.h | 2 +- src/app/geometry/vdetail.cpp | 2 +- src/app/geometry/vdetail.h | 2 +- src/app/geometry/vdetail_p.h | 2 +- src/app/geometry/vgobject.cpp | 2 +- src/app/geometry/vgobject.h | 2 +- src/app/geometry/vgobject_p.h | 2 +- src/app/geometry/vnodedetail.cpp | 2 +- src/app/geometry/vnodedetail.h | 2 +- src/app/geometry/vnodedetail_p.h | 2 +- src/app/geometry/vpointf.cpp | 2 +- src/app/geometry/vpointf.h | 2 +- src/app/geometry/vpointf_p.h | 2 +- src/app/geometry/vspline.cpp | 2 +- src/app/geometry/vspline.h | 2 +- src/app/geometry/vspline_p.h | 2 +- src/app/geometry/vsplinepath.cpp | 2 +- src/app/geometry/vsplinepath.h | 2 +- src/app/geometry/vsplinepath_p.h | 2 +- src/app/geometry/vsplinepoint.cpp | 2 +- src/app/geometry/vsplinepoint.h | 2 +- src/app/geometry/vsplinepoint_p.h | 2 +- src/app/main.cpp | 2 +- src/app/mainwindow.cpp | 2 +- src/app/mainwindow.h | 2 +- src/app/options.cpp | 2 +- src/app/options.h | 2 +- src/app/stable.cpp | 2 +- src/app/stable.h | 2 +- src/app/tablewindow.cpp | 2 +- src/app/tablewindow.h | 2 +- src/app/tools/drawTools/drawtools.h | 2 +- src/app/tools/drawTools/vabstractspline.cpp | 2 +- src/app/tools/drawTools/vabstractspline.h | 2 +- src/app/tools/drawTools/vdrawtool.cpp | 2 +- src/app/tools/drawTools/vdrawtool.h | 2 +- src/app/tools/drawTools/vtoolalongline.cpp | 2 +- src/app/tools/drawTools/vtoolalongline.h | 2 +- src/app/tools/drawTools/vtoolarc.cpp | 2 +- src/app/tools/drawTools/vtoolarc.h | 2 +- src/app/tools/drawTools/vtoolbisector.cpp | 2 +- src/app/tools/drawTools/vtoolbisector.h | 2 +- src/app/tools/drawTools/vtoolcurveintersectaxis.cpp | 2 +- src/app/tools/drawTools/vtoolcurveintersectaxis.h | 2 +- src/app/tools/drawTools/vtoolcut.cpp | 2 +- src/app/tools/drawTools/vtoolcut.h | 2 +- src/app/tools/drawTools/vtoolcutarc.cpp | 2 +- src/app/tools/drawTools/vtoolcutarc.h | 2 +- src/app/tools/drawTools/vtoolcutspline.cpp | 2 +- src/app/tools/drawTools/vtoolcutspline.h | 2 +- src/app/tools/drawTools/vtoolcutsplinepath.cpp | 2 +- src/app/tools/drawTools/vtoolcutsplinepath.h | 2 +- src/app/tools/drawTools/vtoolendline.cpp | 2 +- src/app/tools/drawTools/vtoolendline.h | 2 +- src/app/tools/drawTools/vtoolheight.cpp | 2 +- src/app/tools/drawTools/vtoolheight.h | 2 +- src/app/tools/drawTools/vtoolline.cpp | 2 +- src/app/tools/drawTools/vtoolline.h | 2 +- src/app/tools/drawTools/vtoollineintersect.cpp | 2 +- src/app/tools/drawTools/vtoollineintersect.h | 2 +- src/app/tools/drawTools/vtoollineintersectaxis.cpp | 2 +- src/app/tools/drawTools/vtoollineintersectaxis.h | 2 +- src/app/tools/drawTools/vtoollinepoint.cpp | 2 +- src/app/tools/drawTools/vtoollinepoint.h | 2 +- src/app/tools/drawTools/vtoolnormal.cpp | 2 +- src/app/tools/drawTools/vtoolnormal.h | 2 +- src/app/tools/drawTools/vtoolpoint.cpp | 2 +- src/app/tools/drawTools/vtoolpoint.h | 2 +- src/app/tools/drawTools/vtoolpointofcontact.cpp | 2 +- src/app/tools/drawTools/vtoolpointofcontact.h | 2 +- src/app/tools/drawTools/vtoolpointofintersection.cpp | 2 +- src/app/tools/drawTools/vtoolpointofintersection.h | 2 +- src/app/tools/drawTools/vtoolshoulderpoint.cpp | 2 +- src/app/tools/drawTools/vtoolshoulderpoint.h | 2 +- src/app/tools/drawTools/vtoolsinglepoint.cpp | 2 +- src/app/tools/drawTools/vtoolsinglepoint.h | 2 +- src/app/tools/drawTools/vtoolspline.cpp | 2 +- src/app/tools/drawTools/vtoolspline.h | 2 +- src/app/tools/drawTools/vtoolsplinepath.cpp | 2 +- src/app/tools/drawTools/vtoolsplinepath.h | 2 +- src/app/tools/drawTools/vtooltriangle.cpp | 2 +- src/app/tools/drawTools/vtooltriangle.h | 2 +- src/app/tools/nodeDetails/nodedetails.h | 2 +- src/app/tools/nodeDetails/vabstractnode.cpp | 2 +- src/app/tools/nodeDetails/vabstractnode.h | 2 +- src/app/tools/nodeDetails/vnodearc.cpp | 2 +- src/app/tools/nodeDetails/vnodearc.h | 2 +- src/app/tools/nodeDetails/vnodepoint.cpp | 2 +- src/app/tools/nodeDetails/vnodepoint.h | 2 +- src/app/tools/nodeDetails/vnodespline.cpp | 2 +- src/app/tools/nodeDetails/vnodespline.h | 2 +- src/app/tools/nodeDetails/vnodesplinepath.cpp | 2 +- src/app/tools/nodeDetails/vnodesplinepath.h | 2 +- src/app/tools/tools.h | 2 +- src/app/tools/vabstracttool.cpp | 2 +- src/app/tools/vabstracttool.h | 2 +- src/app/tools/vdatatool.cpp | 2 +- src/app/tools/vdatatool.h | 2 +- src/app/tools/vtooldetail.cpp | 2 +- src/app/tools/vtooldetail.h | 2 +- src/app/tools/vtooluniondetails.cpp | 2 +- src/app/tools/vtooluniondetails.h | 2 +- src/app/undocommands/adddet.cpp | 2 +- src/app/undocommands/adddet.h | 2 +- src/app/undocommands/adddetnode.cpp | 2 +- src/app/undocommands/adddetnode.h | 2 +- src/app/undocommands/addpatternpiece.cpp | 2 +- src/app/undocommands/addpatternpiece.h | 2 +- src/app/undocommands/addtocalc.cpp | 2 +- src/app/undocommands/addtocalc.h | 2 +- src/app/undocommands/adduniondetails.cpp | 2 +- src/app/undocommands/adduniondetails.h | 2 +- src/app/undocommands/deletedetail.cpp | 2 +- src/app/undocommands/deletedetail.h | 2 +- src/app/undocommands/deletepatternpiece.cpp | 2 +- src/app/undocommands/deletepatternpiece.h | 2 +- src/app/undocommands/deltool.cpp | 2 +- src/app/undocommands/deltool.h | 2 +- src/app/undocommands/movedetail.cpp | 2 +- src/app/undocommands/movedetail.h | 2 +- src/app/undocommands/movelabel.cpp | 2 +- src/app/undocommands/movelabel.h | 2 +- src/app/undocommands/movespline.cpp | 2 +- src/app/undocommands/movespline.h | 2 +- src/app/undocommands/movesplinepath.cpp | 2 +- src/app/undocommands/movesplinepath.h | 2 +- src/app/undocommands/movespoint.cpp | 2 +- src/app/undocommands/movespoint.h | 2 +- src/app/undocommands/renamepp.cpp | 2 +- src/app/undocommands/renamepp.h | 2 +- src/app/undocommands/savedetailoptions.cpp | 2 +- src/app/undocommands/savedetailoptions.h | 2 +- src/app/undocommands/savetooloptions.cpp | 2 +- src/app/undocommands/savetooloptions.h | 2 +- src/app/undocommands/vundocommand.cpp | 2 +- src/app/undocommands/vundocommand.h | 2 +- src/app/version.cpp | 2 +- src/app/version.h | 2 +- src/app/visualization/vcontrolpointspline.cpp | 2 +- src/app/visualization/vcontrolpointspline.h | 2 +- src/app/visualization/vgraphicssimpletextitem.cpp | 2 +- src/app/visualization/vgraphicssimpletextitem.h | 2 +- src/app/visualization/visline.cpp | 2 +- src/app/visualization/visline.h | 2 +- src/app/visualization/vispath.cpp | 2 +- src/app/visualization/vispath.h | 2 +- src/app/visualization/vistoolalongline.cpp | 2 +- src/app/visualization/vistoolalongline.h | 2 +- src/app/visualization/vistoolarc.cpp | 2 +- src/app/visualization/vistoolarc.h | 2 +- src/app/visualization/vistoolbisector.cpp | 2 +- src/app/visualization/vistoolbisector.h | 2 +- src/app/visualization/vistoolcurveintersectaxis.cpp | 2 +- src/app/visualization/vistoolcurveintersectaxis.h | 2 +- src/app/visualization/vistoolcutarc.cpp | 2 +- src/app/visualization/vistoolcutarc.h | 2 +- src/app/visualization/vistoolcutspline.cpp | 2 +- src/app/visualization/vistoolcutspline.h | 2 +- src/app/visualization/vistoolcutsplinepath.cpp | 2 +- src/app/visualization/vistoolcutsplinepath.h | 2 +- src/app/visualization/vistoolendline.cpp | 2 +- src/app/visualization/vistoolendline.h | 2 +- src/app/visualization/vistoolheight.cpp | 2 +- src/app/visualization/vistoolheight.h | 2 +- src/app/visualization/vistoolline.cpp | 2 +- src/app/visualization/vistoolline.h | 2 +- src/app/visualization/vistoollineintersect.cpp | 2 +- src/app/visualization/vistoollineintersect.h | 2 +- src/app/visualization/vistoollineintersectaxis.cpp | 2 +- src/app/visualization/vistoollineintersectaxis.h | 2 +- src/app/visualization/vistoolnormal.cpp | 2 +- src/app/visualization/vistoolnormal.h | 2 +- src/app/visualization/vistoolpointofcontact.cpp | 2 +- src/app/visualization/vistoolpointofcontact.h | 2 +- src/app/visualization/vistoolpointofintersection.cpp | 2 +- src/app/visualization/vistoolpointofintersection.h | 2 +- src/app/visualization/vistoolshoulderpoint.cpp | 2 +- src/app/visualization/vistoolshoulderpoint.h | 2 +- src/app/visualization/vistoolspline.cpp | 2 +- src/app/visualization/vistoolspline.h | 2 +- src/app/visualization/vistoolsplinepath.cpp | 2 +- src/app/visualization/vistoolsplinepath.h | 2 +- src/app/visualization/vistooltriangle.cpp | 2 +- src/app/visualization/vistooltriangle.h | 2 +- src/app/visualization/visualization.cpp | 2 +- src/app/visualization/visualization.h | 2 +- src/app/visualization/vsimplecurve.cpp | 2 +- src/app/visualization/vsimplecurve.h | 2 +- src/app/widgets/doubledelegate.cpp | 2 +- src/app/widgets/doubledelegate.h | 2 +- src/app/widgets/textdelegate.cpp | 2 +- src/app/widgets/textdelegate.h | 2 +- src/app/widgets/vformulaproperty.cpp | 2 +- src/app/widgets/vformulaproperty.h | 2 +- src/app/widgets/vformulapropertyeditor.cpp | 2 +- src/app/widgets/vformulapropertyeditor.h | 2 +- src/app/widgets/vmaingraphicsscene.cpp | 2 +- src/app/widgets/vmaingraphicsscene.h | 2 +- src/app/widgets/vmaingraphicsview.cpp | 2 +- src/app/widgets/vmaingraphicsview.h | 2 +- src/app/widgets/vtablegraphicsview.cpp | 2 +- src/app/widgets/vtablegraphicsview.h | 2 +- src/app/widgets/vtooloptionspropertybrowser.cpp | 2 +- src/app/widgets/vtooloptionspropertybrowser.h | 2 +- src/app/widgets/vwidgetpopup.cpp | 2 +- src/app/widgets/vwidgetpopup.h | 2 +- src/app/xml/vabstractmeasurements.cpp | 2 +- src/app/xml/vabstractmeasurements.h | 2 +- src/app/xml/vindividualmeasurements.cpp | 2 +- src/app/xml/vindividualmeasurements.h | 2 +- src/app/xml/vpattern.cpp | 2 +- src/app/xml/vpattern.h | 2 +- src/app/xml/vstandardmeasurements.cpp | 2 +- src/app/xml/vstandardmeasurements.h | 2 +- src/app/xml/vtoolrecord.cpp | 2 +- src/app/xml/vtoolrecord.h | 2 +- src/libs/ifc/exception/vexception.cpp | 2 +- src/libs/ifc/exception/vexception.h | 2 +- src/libs/ifc/exception/vexceptionbadid.cpp | 2 +- src/libs/ifc/exception/vexceptionbadid.h | 2 +- src/libs/ifc/exception/vexceptionconversionerror.cpp | 2 +- src/libs/ifc/exception/vexceptionconversionerror.h | 2 +- src/libs/ifc/exception/vexceptionemptyparameter.cpp | 2 +- src/libs/ifc/exception/vexceptionemptyparameter.h | 2 +- src/libs/ifc/exception/vexceptionobjecterror.cpp | 2 +- src/libs/ifc/exception/vexceptionobjecterror.h | 2 +- src/libs/ifc/exception/vexceptionundo.cpp | 2 +- src/libs/ifc/exception/vexceptionundo.h | 2 +- src/libs/ifc/exception/vexceptionwrongid.cpp | 2 +- src/libs/ifc/exception/vexceptionwrongid.h | 2 +- src/libs/ifc/ifcdef.h | 2 +- src/libs/ifc/stable.cpp | 2 +- src/libs/ifc/stable.h | 2 +- src/libs/ifc/xml/vabstractconverter.cpp | 2 +- src/libs/ifc/xml/vabstractconverter.h | 2 +- src/libs/ifc/xml/vdomdocument.cpp | 2 +- src/libs/ifc/xml/vdomdocument.h | 2 +- src/libs/ifc/xml/vpatternconverter.cpp | 2 +- src/libs/ifc/xml/vpatternconverter.h | 2 +- src/libs/vlayout/stable.cpp | 2 +- src/libs/vlayout/stable.h | 2 +- src/libs/vlayout/vabstractdetail.cpp | 2 +- src/libs/vlayout/vabstractdetail.h | 2 +- src/libs/vlayout/vabstractdetail_p.h | 2 +- src/libs/vlayout/vbank.cpp | 2 +- src/libs/vlayout/vbank.h | 2 +- src/libs/vlayout/vbestsquare.cpp | 2 +- src/libs/vlayout/vbestsquare.h | 2 +- src/libs/vlayout/vcontour.cpp | 2 +- src/libs/vlayout/vcontour.h | 2 +- src/libs/vlayout/vcontour_p.h | 2 +- src/libs/vlayout/vlayoutdef.h | 2 +- src/libs/vlayout/vlayoutdetail.cpp | 2 +- src/libs/vlayout/vlayoutdetail.h | 2 +- src/libs/vlayout/vlayoutdetail_p.h | 2 +- src/libs/vlayout/vlayoutgenerator.cpp | 2 +- src/libs/vlayout/vlayoutgenerator.h | 2 +- src/libs/vlayout/vlayoutpaper.cpp | 2 +- src/libs/vlayout/vlayoutpaper.h | 2 +- src/libs/vlayout/vlayoutpaper_p.h | 2 +- src/libs/vlayout/vposition.cpp | 2 +- src/libs/vlayout/vposition.h | 2 +- src/libs/vobj/stable.cpp | 2 +- src/libs/vobj/stable.h | 2 +- src/libs/vobj/vobjengine.cpp | 2 +- src/libs/vobj/vobjengine.h | 2 +- src/libs/vobj/vobjpaintdevice.cpp | 2 +- src/libs/vobj/vobjpaintdevice.h | 2 +- src/libs/vpropertyexplorer/plugins/vlinecolorproperty.cpp | 2 +- src/libs/vpropertyexplorer/plugins/vlinecolorproperty.h | 2 +- src/libs/vpropertyexplorer/plugins/vlinetypeproperty.cpp | 2 +- src/libs/vpropertyexplorer/plugins/vlinetypeproperty.h | 2 +- src/test/ParserTest/main.cpp | 2 +- src/test/ParserTest/stable.cpp | 2 +- src/test/ParserTest/stable.h | 2 +- 401 files changed, 401 insertions(+), 401 deletions(-) diff --git a/src/app/container/calculator.cpp b/src/app/container/calculator.cpp index dc0796c7d..0f065a546 100644 --- a/src/app/container/calculator.cpp +++ b/src/app/container/calculator.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/calculator.h b/src/app/container/calculator.h index cb2089c9f..f2491ed43 100644 --- a/src/app/container/calculator.h +++ b/src/app/container/calculator.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables.h b/src/app/container/variables.h index b87530c5b..3c7daf4d3 100644 --- a/src/app/container/variables.h +++ b/src/app/container/variables.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/varclength.cpp b/src/app/container/variables/varclength.cpp index 2015f14c7..b094dc34f 100644 --- a/src/app/container/variables/varclength.cpp +++ b/src/app/container/variables/varclength.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/varclength.h b/src/app/container/variables/varclength.h index f56d7ddf3..a0e1e4ab2 100644 --- a/src/app/container/variables/varclength.h +++ b/src/app/container/variables/varclength.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vcurvelength.cpp b/src/app/container/variables/vcurvelength.cpp index 9205e7452..43f4ac20d 100644 --- a/src/app/container/variables/vcurvelength.cpp +++ b/src/app/container/variables/vcurvelength.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vcurvelength.h b/src/app/container/variables/vcurvelength.h index 15d45f672..47e566cc3 100644 --- a/src/app/container/variables/vcurvelength.h +++ b/src/app/container/variables/vcurvelength.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vcurvelength_p.h b/src/app/container/variables/vcurvelength_p.h index d4759e4a5..4e3b182e0 100644 --- a/src/app/container/variables/vcurvelength_p.h +++ b/src/app/container/variables/vcurvelength_p.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vincrement.cpp b/src/app/container/variables/vincrement.cpp index df9de9cfe..affaff44c 100644 --- a/src/app/container/variables/vincrement.cpp +++ b/src/app/container/variables/vincrement.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vincrement.h b/src/app/container/variables/vincrement.h index e82806892..8877c2e2e 100644 --- a/src/app/container/variables/vincrement.h +++ b/src/app/container/variables/vincrement.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vincrement_p.h b/src/app/container/variables/vincrement_p.h index 57eca4d99..270c779ba 100644 --- a/src/app/container/variables/vincrement_p.h +++ b/src/app/container/variables/vincrement_p.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vinternalvariable.cpp b/src/app/container/variables/vinternalvariable.cpp index 92c4a06a9..fe7c7a28f 100644 --- a/src/app/container/variables/vinternalvariable.cpp +++ b/src/app/container/variables/vinternalvariable.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vinternalvariable.h b/src/app/container/variables/vinternalvariable.h index 505d7b771..fc3653a7a 100644 --- a/src/app/container/variables/vinternalvariable.h +++ b/src/app/container/variables/vinternalvariable.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vinternalvariable_p.h b/src/app/container/variables/vinternalvariable_p.h index eeb97d956..05140d138 100644 --- a/src/app/container/variables/vinternalvariable_p.h +++ b/src/app/container/variables/vinternalvariable_p.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vlineangle.cpp b/src/app/container/variables/vlineangle.cpp index aceba1c51..9ed8195b1 100644 --- a/src/app/container/variables/vlineangle.cpp +++ b/src/app/container/variables/vlineangle.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vlineangle.h b/src/app/container/variables/vlineangle.h index df93a48f6..d2ebde429 100644 --- a/src/app/container/variables/vlineangle.h +++ b/src/app/container/variables/vlineangle.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vlineangle_p.h b/src/app/container/variables/vlineangle_p.h index d8c26ba96..fd3ca754c 100644 --- a/src/app/container/variables/vlineangle_p.h +++ b/src/app/container/variables/vlineangle_p.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vlinelength.cpp b/src/app/container/variables/vlinelength.cpp index 7146b3f23..4f569af41 100644 --- a/src/app/container/variables/vlinelength.cpp +++ b/src/app/container/variables/vlinelength.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vlinelength.h b/src/app/container/variables/vlinelength.h index 77311283c..bd52eae57 100644 --- a/src/app/container/variables/vlinelength.h +++ b/src/app/container/variables/vlinelength.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vlinelength_p.h b/src/app/container/variables/vlinelength_p.h index ac37bd5f4..ac0de76c5 100644 --- a/src/app/container/variables/vlinelength_p.h +++ b/src/app/container/variables/vlinelength_p.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vmeasurement.cpp b/src/app/container/variables/vmeasurement.cpp index f71921b4e..810d6e291 100644 --- a/src/app/container/variables/vmeasurement.cpp +++ b/src/app/container/variables/vmeasurement.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vmeasurement.h b/src/app/container/variables/vmeasurement.h index 98ac75f08..e0b645aad 100644 --- a/src/app/container/variables/vmeasurement.h +++ b/src/app/container/variables/vmeasurement.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vmeasurement_p.h b/src/app/container/variables/vmeasurement_p.h index dec94e809..bbe35215b 100644 --- a/src/app/container/variables/vmeasurement_p.h +++ b/src/app/container/variables/vmeasurement_p.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vsplinelength.cpp b/src/app/container/variables/vsplinelength.cpp index 2cb194c7e..327e21466 100644 --- a/src/app/container/variables/vsplinelength.cpp +++ b/src/app/container/variables/vsplinelength.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vsplinelength.h b/src/app/container/variables/vsplinelength.h index 10b6448d2..2f243915d 100644 --- a/src/app/container/variables/vsplinelength.h +++ b/src/app/container/variables/vsplinelength.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vvariable.cpp b/src/app/container/variables/vvariable.cpp index 83589a89c..a2fe21deb 100644 --- a/src/app/container/variables/vvariable.cpp +++ b/src/app/container/variables/vvariable.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vvariable.h b/src/app/container/variables/vvariable.h index 0d41d235c..e3472e99e 100644 --- a/src/app/container/variables/vvariable.h +++ b/src/app/container/variables/vvariable.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vvariable_p.h b/src/app/container/variables/vvariable_p.h index 57dbb3812..5b5b7f960 100644 --- a/src/app/container/variables/vvariable_p.h +++ b/src/app/container/variables/vvariable_p.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/vcontainer.cpp b/src/app/container/vcontainer.cpp index 4f3f755c9..51b4ac044 100644 --- a/src/app/container/vcontainer.cpp +++ b/src/app/container/vcontainer.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/vcontainer.h b/src/app/container/vcontainer.h index cb40925d9..37c043171 100644 --- a/src/app/container/vcontainer.h +++ b/src/app/container/vcontainer.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/vformula.cpp b/src/app/container/vformula.cpp index 5b846bbad..232a70ac6 100644 --- a/src/app/container/vformula.cpp +++ b/src/app/container/vformula.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/vformula.h b/src/app/container/vformula.h index 7599dcdac..fa0c42e79 100644 --- a/src/app/container/vformula.h +++ b/src/app/container/vformula.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/core/undoevent.cpp b/src/app/core/undoevent.cpp index bdbadd91c..7ea362f02 100644 --- a/src/app/core/undoevent.cpp +++ b/src/app/core/undoevent.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/core/undoevent.h b/src/app/core/undoevent.h index e3f1fc75c..e5c230b06 100644 --- a/src/app/core/undoevent.h +++ b/src/app/core/undoevent.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/core/vapplication.cpp b/src/app/core/vapplication.cpp index b3789393d..72e78bae7 100644 --- a/src/app/core/vapplication.cpp +++ b/src/app/core/vapplication.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/core/vapplication.h b/src/app/core/vapplication.h index 6ddbd683f..6d18aeb71 100644 --- a/src/app/core/vapplication.h +++ b/src/app/core/vapplication.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/core/vsettings.cpp b/src/app/core/vsettings.cpp index 199f1ce36..2f6fba5cb 100644 --- a/src/app/core/vsettings.cpp +++ b/src/app/core/vsettings.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/core/vsettings.h b/src/app/core/vsettings.h index 80e8dc500..23329014c 100644 --- a/src/app/core/vsettings.h +++ b/src/app/core/vsettings.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/configdialog.cpp b/src/app/dialogs/app/configdialog.cpp index 181b2006a..e6642114f 100644 --- a/src/app/dialogs/app/configdialog.cpp +++ b/src/app/dialogs/app/configdialog.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/configdialog.h b/src/app/dialogs/app/configdialog.h index 1c93a6ab6..3eac9336f 100644 --- a/src/app/dialogs/app/configdialog.h +++ b/src/app/dialogs/app/configdialog.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/configpages/communitypage.cpp b/src/app/dialogs/app/configpages/communitypage.cpp index e770424c0..ac27f05e5 100644 --- a/src/app/dialogs/app/configpages/communitypage.cpp +++ b/src/app/dialogs/app/configpages/communitypage.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/configpages/communitypage.h b/src/app/dialogs/app/configpages/communitypage.h index 6af2a1560..532b0e520 100644 --- a/src/app/dialogs/app/configpages/communitypage.h +++ b/src/app/dialogs/app/configpages/communitypage.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/configpages/configurationpage.cpp b/src/app/dialogs/app/configpages/configurationpage.cpp index 1f0e713d0..f566a4c7b 100644 --- a/src/app/dialogs/app/configpages/configurationpage.cpp +++ b/src/app/dialogs/app/configpages/configurationpage.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/configpages/configurationpage.h b/src/app/dialogs/app/configpages/configurationpage.h index 12f549464..d4ebdcf3b 100644 --- a/src/app/dialogs/app/configpages/configurationpage.h +++ b/src/app/dialogs/app/configpages/configurationpage.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/configpages/pages.h b/src/app/dialogs/app/configpages/pages.h index 271a48c3f..7df2cfb5b 100644 --- a/src/app/dialogs/app/configpages/pages.h +++ b/src/app/dialogs/app/configpages/pages.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/configpages/pathpage.cpp b/src/app/dialogs/app/configpages/pathpage.cpp index 72aab21d6..1421480f6 100644 --- a/src/app/dialogs/app/configpages/pathpage.cpp +++ b/src/app/dialogs/app/configpages/pathpage.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/configpages/pathpage.h b/src/app/dialogs/app/configpages/pathpage.h index f51b83da0..f81c14b36 100644 --- a/src/app/dialogs/app/configpages/pathpage.h +++ b/src/app/dialogs/app/configpages/pathpage.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/configpages/patternpage.cpp b/src/app/dialogs/app/configpages/patternpage.cpp index 5b0669e1d..e911bcd28 100644 --- a/src/app/dialogs/app/configpages/patternpage.cpp +++ b/src/app/dialogs/app/configpages/patternpage.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/configpages/patternpage.h b/src/app/dialogs/app/configpages/patternpage.h index 5040c7924..2a7743b09 100644 --- a/src/app/dialogs/app/configpages/patternpage.h +++ b/src/app/dialogs/app/configpages/patternpage.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/dialogaboutapp.cpp b/src/app/dialogs/app/dialogaboutapp.cpp index 11d8ec5dc..1598bf34d 100644 --- a/src/app/dialogs/app/dialogaboutapp.cpp +++ b/src/app/dialogs/app/dialogaboutapp.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/dialogaboutapp.h b/src/app/dialogs/app/dialogaboutapp.h index 97c07a104..684176d2d 100644 --- a/src/app/dialogs/app/dialogaboutapp.h +++ b/src/app/dialogs/app/dialogaboutapp.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/dialoghistory.cpp b/src/app/dialogs/app/dialoghistory.cpp index e906cd494..adb6238d7 100644 --- a/src/app/dialogs/app/dialoghistory.cpp +++ b/src/app/dialogs/app/dialoghistory.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/dialoghistory.h b/src/app/dialogs/app/dialoghistory.h index c6d085bf2..57f57f257 100644 --- a/src/app/dialogs/app/dialoghistory.h +++ b/src/app/dialogs/app/dialoghistory.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/dialogincrements.cpp b/src/app/dialogs/app/dialogincrements.cpp index 45b60080d..726147d78 100644 --- a/src/app/dialogs/app/dialogincrements.cpp +++ b/src/app/dialogs/app/dialogincrements.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/dialogincrements.h b/src/app/dialogs/app/dialogincrements.h index d563a966d..e91df636f 100644 --- a/src/app/dialogs/app/dialogincrements.h +++ b/src/app/dialogs/app/dialogincrements.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/dialogindividualmeasurements.cpp b/src/app/dialogs/app/dialogindividualmeasurements.cpp index 2b6257867..893772ae3 100644 --- a/src/app/dialogs/app/dialogindividualmeasurements.cpp +++ b/src/app/dialogs/app/dialogindividualmeasurements.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/dialogindividualmeasurements.h b/src/app/dialogs/app/dialogindividualmeasurements.h index c133c4799..793bd2908 100644 --- a/src/app/dialogs/app/dialogindividualmeasurements.h +++ b/src/app/dialogs/app/dialogindividualmeasurements.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/dialoglayoutprogress.cpp b/src/app/dialogs/app/dialoglayoutprogress.cpp index 7244cdbb5..dc21d86c2 100644 --- a/src/app/dialogs/app/dialoglayoutprogress.cpp +++ b/src/app/dialogs/app/dialoglayoutprogress.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2015 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/dialoglayoutprogress.h b/src/app/dialogs/app/dialoglayoutprogress.h index f2deb93fb..3d761c3d3 100644 --- a/src/app/dialogs/app/dialoglayoutprogress.h +++ b/src/app/dialogs/app/dialoglayoutprogress.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2015 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/dialoglayoutsettings.cpp b/src/app/dialogs/app/dialoglayoutsettings.cpp index 2d81b2d33..b2bdd401d 100644 --- a/src/app/dialogs/app/dialoglayoutsettings.cpp +++ b/src/app/dialogs/app/dialoglayoutsettings.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2015 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/dialoglayoutsettings.h b/src/app/dialogs/app/dialoglayoutsettings.h index 4936c9997..41d7dc940 100644 --- a/src/app/dialogs/app/dialoglayoutsettings.h +++ b/src/app/dialogs/app/dialoglayoutsettings.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2015 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/dialogmeasurements.cpp b/src/app/dialogs/app/dialogmeasurements.cpp index f58ed626f..cfa386f55 100644 --- a/src/app/dialogs/app/dialogmeasurements.cpp +++ b/src/app/dialogs/app/dialogmeasurements.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/dialogmeasurements.h b/src/app/dialogs/app/dialogmeasurements.h index 6b4bc3941..b5396b7d2 100644 --- a/src/app/dialogs/app/dialogmeasurements.h +++ b/src/app/dialogs/app/dialogmeasurements.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/dialogpatternproperties.cpp b/src/app/dialogs/app/dialogpatternproperties.cpp index 3229aceda..0cea50d57 100644 --- a/src/app/dialogs/app/dialogpatternproperties.cpp +++ b/src/app/dialogs/app/dialogpatternproperties.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/dialogpatternproperties.h b/src/app/dialogs/app/dialogpatternproperties.h index 8d09531a9..102b598cd 100644 --- a/src/app/dialogs/app/dialogpatternproperties.h +++ b/src/app/dialogs/app/dialogpatternproperties.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/dialogpatternxmledit.cpp b/src/app/dialogs/app/dialogpatternxmledit.cpp index 2e4701137..b1782f23f 100644 --- a/src/app/dialogs/app/dialogpatternxmledit.cpp +++ b/src/app/dialogs/app/dialogpatternxmledit.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/dialogpatternxmledit.h b/src/app/dialogs/app/dialogpatternxmledit.h index cbdf94a1a..5c6a8f4a4 100644 --- a/src/app/dialogs/app/dialogpatternxmledit.h +++ b/src/app/dialogs/app/dialogpatternxmledit.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/dialogsavelayout.cpp b/src/app/dialogs/app/dialogsavelayout.cpp index 8205d015e..7db82d8fb 100644 --- a/src/app/dialogs/app/dialogsavelayout.cpp +++ b/src/app/dialogs/app/dialogsavelayout.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2015 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/dialogsavelayout.h b/src/app/dialogs/app/dialogsavelayout.h index 1dbdb02f8..a2f694034 100644 --- a/src/app/dialogs/app/dialogsavelayout.h +++ b/src/app/dialogs/app/dialogsavelayout.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2015 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/dialogstandardmeasurements.cpp b/src/app/dialogs/app/dialogstandardmeasurements.cpp index 8cc53bcb6..4ad4c72f9 100644 --- a/src/app/dialogs/app/dialogstandardmeasurements.cpp +++ b/src/app/dialogs/app/dialogstandardmeasurements.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/dialogstandardmeasurements.h b/src/app/dialogs/app/dialogstandardmeasurements.h index 59d8c33e2..cc1785367 100644 --- a/src/app/dialogs/app/dialogstandardmeasurements.h +++ b/src/app/dialogs/app/dialogstandardmeasurements.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/dialogundo.cpp b/src/app/dialogs/app/dialogundo.cpp index a26fff415..4c396efa8 100644 --- a/src/app/dialogs/app/dialogundo.cpp +++ b/src/app/dialogs/app/dialogundo.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/dialogundo.h b/src/app/dialogs/app/dialogundo.h index d391e7696..93def2525 100644 --- a/src/app/dialogs/app/dialogundo.h +++ b/src/app/dialogs/app/dialogundo.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/dialogs.h b/src/app/dialogs/dialogs.h index e83eedc77..27195b696 100644 --- a/src/app/dialogs/dialogs.h +++ b/src/app/dialogs/dialogs.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogalongline.cpp b/src/app/dialogs/tools/dialogalongline.cpp index ff9f3d641..54a8dd1dc 100644 --- a/src/app/dialogs/tools/dialogalongline.cpp +++ b/src/app/dialogs/tools/dialogalongline.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogalongline.h b/src/app/dialogs/tools/dialogalongline.h index 057f7763b..b82f23350 100644 --- a/src/app/dialogs/tools/dialogalongline.h +++ b/src/app/dialogs/tools/dialogalongline.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogarc.cpp b/src/app/dialogs/tools/dialogarc.cpp index 728ead1ac..9c5873356 100644 --- a/src/app/dialogs/tools/dialogarc.cpp +++ b/src/app/dialogs/tools/dialogarc.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogarc.h b/src/app/dialogs/tools/dialogarc.h index 35c5e46db..25143bcfd 100644 --- a/src/app/dialogs/tools/dialogarc.h +++ b/src/app/dialogs/tools/dialogarc.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogbisector.cpp b/src/app/dialogs/tools/dialogbisector.cpp index d5fc72190..3320e63ba 100644 --- a/src/app/dialogs/tools/dialogbisector.cpp +++ b/src/app/dialogs/tools/dialogbisector.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogbisector.h b/src/app/dialogs/tools/dialogbisector.h index 4cadc9bb9..b1a2d2316 100644 --- a/src/app/dialogs/tools/dialogbisector.h +++ b/src/app/dialogs/tools/dialogbisector.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp b/src/app/dialogs/tools/dialogcurveintersectaxis.cpp index 43b79a5cb..350815bda 100644 --- a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp +++ b/src/app/dialogs/tools/dialogcurveintersectaxis.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogcurveintersectaxis.h b/src/app/dialogs/tools/dialogcurveintersectaxis.h index 33d5262eb..7b9164229 100644 --- a/src/app/dialogs/tools/dialogcurveintersectaxis.h +++ b/src/app/dialogs/tools/dialogcurveintersectaxis.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogcutarc.cpp b/src/app/dialogs/tools/dialogcutarc.cpp index c9ce1d94c..42ebb92f0 100644 --- a/src/app/dialogs/tools/dialogcutarc.cpp +++ b/src/app/dialogs/tools/dialogcutarc.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogcutarc.h b/src/app/dialogs/tools/dialogcutarc.h index f9ba4aa07..68df14c06 100644 --- a/src/app/dialogs/tools/dialogcutarc.h +++ b/src/app/dialogs/tools/dialogcutarc.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogcutspline.cpp b/src/app/dialogs/tools/dialogcutspline.cpp index 2130e25f7..e1bb786a1 100644 --- a/src/app/dialogs/tools/dialogcutspline.cpp +++ b/src/app/dialogs/tools/dialogcutspline.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogcutspline.h b/src/app/dialogs/tools/dialogcutspline.h index 12665a998..590788d14 100644 --- a/src/app/dialogs/tools/dialogcutspline.h +++ b/src/app/dialogs/tools/dialogcutspline.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogcutsplinepath.cpp b/src/app/dialogs/tools/dialogcutsplinepath.cpp index 9351c4102..0626b3252 100644 --- a/src/app/dialogs/tools/dialogcutsplinepath.cpp +++ b/src/app/dialogs/tools/dialogcutsplinepath.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogcutsplinepath.h b/src/app/dialogs/tools/dialogcutsplinepath.h index 340c91fbb..396dc73db 100644 --- a/src/app/dialogs/tools/dialogcutsplinepath.h +++ b/src/app/dialogs/tools/dialogcutsplinepath.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogdetail.cpp b/src/app/dialogs/tools/dialogdetail.cpp index d3d909b94..4a0dd4a27 100644 --- a/src/app/dialogs/tools/dialogdetail.cpp +++ b/src/app/dialogs/tools/dialogdetail.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogdetail.h b/src/app/dialogs/tools/dialogdetail.h index ab3535dc8..71eeafe6c 100644 --- a/src/app/dialogs/tools/dialogdetail.h +++ b/src/app/dialogs/tools/dialogdetail.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogeditwrongformula.cpp b/src/app/dialogs/tools/dialogeditwrongformula.cpp index 7800625c0..63bc747a0 100644 --- a/src/app/dialogs/tools/dialogeditwrongformula.cpp +++ b/src/app/dialogs/tools/dialogeditwrongformula.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogeditwrongformula.h b/src/app/dialogs/tools/dialogeditwrongformula.h index e163d7c21..faaa436ae 100644 --- a/src/app/dialogs/tools/dialogeditwrongformula.h +++ b/src/app/dialogs/tools/dialogeditwrongformula.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogendline.cpp b/src/app/dialogs/tools/dialogendline.cpp index 87ab2e9ca..0b04561b4 100644 --- a/src/app/dialogs/tools/dialogendline.cpp +++ b/src/app/dialogs/tools/dialogendline.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogendline.h b/src/app/dialogs/tools/dialogendline.h index d31101a12..d12a86e23 100644 --- a/src/app/dialogs/tools/dialogendline.h +++ b/src/app/dialogs/tools/dialogendline.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogheight.cpp b/src/app/dialogs/tools/dialogheight.cpp index 59ada77f2..fd704c880 100644 --- a/src/app/dialogs/tools/dialogheight.cpp +++ b/src/app/dialogs/tools/dialogheight.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogheight.h b/src/app/dialogs/tools/dialogheight.h index 18859f56a..da12d38b1 100644 --- a/src/app/dialogs/tools/dialogheight.h +++ b/src/app/dialogs/tools/dialogheight.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogline.cpp b/src/app/dialogs/tools/dialogline.cpp index b545f8c9d..8d5ba671f 100644 --- a/src/app/dialogs/tools/dialogline.cpp +++ b/src/app/dialogs/tools/dialogline.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogline.h b/src/app/dialogs/tools/dialogline.h index 8c7ff5d8f..7922fdec8 100644 --- a/src/app/dialogs/tools/dialogline.h +++ b/src/app/dialogs/tools/dialogline.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialoglineintersect.cpp b/src/app/dialogs/tools/dialoglineintersect.cpp index 83e38e663..403342115 100644 --- a/src/app/dialogs/tools/dialoglineintersect.cpp +++ b/src/app/dialogs/tools/dialoglineintersect.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialoglineintersect.h b/src/app/dialogs/tools/dialoglineintersect.h index 5f7a374f1..5777280cb 100644 --- a/src/app/dialogs/tools/dialoglineintersect.h +++ b/src/app/dialogs/tools/dialoglineintersect.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.cpp b/src/app/dialogs/tools/dialoglineintersectaxis.cpp index ee14ccc22..60f5d5f4e 100644 --- a/src/app/dialogs/tools/dialoglineintersectaxis.cpp +++ b/src/app/dialogs/tools/dialoglineintersectaxis.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.h b/src/app/dialogs/tools/dialoglineintersectaxis.h index 130510eb5..89975afa8 100644 --- a/src/app/dialogs/tools/dialoglineintersectaxis.h +++ b/src/app/dialogs/tools/dialoglineintersectaxis.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialognormal.cpp b/src/app/dialogs/tools/dialognormal.cpp index 0c456e781..f56b1e8c7 100644 --- a/src/app/dialogs/tools/dialognormal.cpp +++ b/src/app/dialogs/tools/dialognormal.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialognormal.h b/src/app/dialogs/tools/dialognormal.h index 8fce4a01a..4cf31b9df 100644 --- a/src/app/dialogs/tools/dialognormal.h +++ b/src/app/dialogs/tools/dialognormal.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogpointofcontact.cpp b/src/app/dialogs/tools/dialogpointofcontact.cpp index 31581734c..8476ea8ec 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.cpp +++ b/src/app/dialogs/tools/dialogpointofcontact.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogpointofcontact.h b/src/app/dialogs/tools/dialogpointofcontact.h index 549487a2e..54ec9fdcf 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.h +++ b/src/app/dialogs/tools/dialogpointofcontact.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogpointofintersection.cpp b/src/app/dialogs/tools/dialogpointofintersection.cpp index 882afa5dd..f45a41a2d 100644 --- a/src/app/dialogs/tools/dialogpointofintersection.cpp +++ b/src/app/dialogs/tools/dialogpointofintersection.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogpointofintersection.h b/src/app/dialogs/tools/dialogpointofintersection.h index 811375a8d..b9115c8cc 100644 --- a/src/app/dialogs/tools/dialogpointofintersection.h +++ b/src/app/dialogs/tools/dialogpointofintersection.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogshoulderpoint.cpp b/src/app/dialogs/tools/dialogshoulderpoint.cpp index 0fa24a2b5..428aba82a 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.cpp +++ b/src/app/dialogs/tools/dialogshoulderpoint.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogshoulderpoint.h b/src/app/dialogs/tools/dialogshoulderpoint.h index 4f5670654..c2b2de437 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.h +++ b/src/app/dialogs/tools/dialogshoulderpoint.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogsinglepoint.cpp b/src/app/dialogs/tools/dialogsinglepoint.cpp index f218776a4..f5fc1ca02 100644 --- a/src/app/dialogs/tools/dialogsinglepoint.cpp +++ b/src/app/dialogs/tools/dialogsinglepoint.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogsinglepoint.h b/src/app/dialogs/tools/dialogsinglepoint.h index 0b6ef3d0b..f4bfdb947 100644 --- a/src/app/dialogs/tools/dialogsinglepoint.h +++ b/src/app/dialogs/tools/dialogsinglepoint.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogspline.cpp b/src/app/dialogs/tools/dialogspline.cpp index 496c461dd..d5febb89e 100644 --- a/src/app/dialogs/tools/dialogspline.cpp +++ b/src/app/dialogs/tools/dialogspline.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogspline.h b/src/app/dialogs/tools/dialogspline.h index b2634c5f7..da7e8b790 100644 --- a/src/app/dialogs/tools/dialogspline.h +++ b/src/app/dialogs/tools/dialogspline.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogsplinepath.cpp b/src/app/dialogs/tools/dialogsplinepath.cpp index fe059a403..6cf0c431a 100644 --- a/src/app/dialogs/tools/dialogsplinepath.cpp +++ b/src/app/dialogs/tools/dialogsplinepath.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogsplinepath.h b/src/app/dialogs/tools/dialogsplinepath.h index d16cb0fd5..8d0b7eebf 100644 --- a/src/app/dialogs/tools/dialogsplinepath.h +++ b/src/app/dialogs/tools/dialogsplinepath.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogtool.cpp b/src/app/dialogs/tools/dialogtool.cpp index 41be6369c..99fc95b5a 100644 --- a/src/app/dialogs/tools/dialogtool.cpp +++ b/src/app/dialogs/tools/dialogtool.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogtool.h b/src/app/dialogs/tools/dialogtool.h index 191195b6d..0aec9afd9 100644 --- a/src/app/dialogs/tools/dialogtool.h +++ b/src/app/dialogs/tools/dialogtool.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogtriangle.cpp b/src/app/dialogs/tools/dialogtriangle.cpp index ce88a6b80..7caa7c885 100644 --- a/src/app/dialogs/tools/dialogtriangle.cpp +++ b/src/app/dialogs/tools/dialogtriangle.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialogtriangle.h b/src/app/dialogs/tools/dialogtriangle.h index e4d3d3236..fa541722d 100644 --- a/src/app/dialogs/tools/dialogtriangle.h +++ b/src/app/dialogs/tools/dialogtriangle.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialoguniondetails.cpp b/src/app/dialogs/tools/dialoguniondetails.cpp index 80b08877c..612be7d0a 100644 --- a/src/app/dialogs/tools/dialoguniondetails.cpp +++ b/src/app/dialogs/tools/dialoguniondetails.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialoguniondetails.h b/src/app/dialogs/tools/dialoguniondetails.h index 01aff8904..e7842a249 100644 --- a/src/app/dialogs/tools/dialoguniondetails.h +++ b/src/app/dialogs/tools/dialoguniondetails.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vabstractcurve.cpp b/src/app/geometry/vabstractcurve.cpp index 423aac8c2..1fe4e149a 100644 --- a/src/app/geometry/vabstractcurve.cpp +++ b/src/app/geometry/vabstractcurve.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vabstractcurve.h b/src/app/geometry/vabstractcurve.h index 057424687..c89bbfd8d 100644 --- a/src/app/geometry/vabstractcurve.h +++ b/src/app/geometry/vabstractcurve.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/varc.cpp b/src/app/geometry/varc.cpp index c407012a3..570eaa5d0 100644 --- a/src/app/geometry/varc.cpp +++ b/src/app/geometry/varc.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/varc.h b/src/app/geometry/varc.h index 53003724f..6f017e7da 100644 --- a/src/app/geometry/varc.h +++ b/src/app/geometry/varc.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/varc_p.h b/src/app/geometry/varc_p.h index dd56deb94..887bef20b 100644 --- a/src/app/geometry/varc_p.h +++ b/src/app/geometry/varc_p.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vdetail.cpp b/src/app/geometry/vdetail.cpp index 3112023ff..7f58c3c9d 100644 --- a/src/app/geometry/vdetail.cpp +++ b/src/app/geometry/vdetail.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vdetail.h b/src/app/geometry/vdetail.h index 8100248e4..d273e8da1 100644 --- a/src/app/geometry/vdetail.h +++ b/src/app/geometry/vdetail.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vdetail_p.h b/src/app/geometry/vdetail_p.h index 097d5b835..a6f1ae49a 100644 --- a/src/app/geometry/vdetail_p.h +++ b/src/app/geometry/vdetail_p.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vgobject.cpp b/src/app/geometry/vgobject.cpp index a191354c3..467d1be37 100644 --- a/src/app/geometry/vgobject.cpp +++ b/src/app/geometry/vgobject.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vgobject.h b/src/app/geometry/vgobject.h index e9a316a10..eff533f3d 100644 --- a/src/app/geometry/vgobject.h +++ b/src/app/geometry/vgobject.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vgobject_p.h b/src/app/geometry/vgobject_p.h index b3dcac78a..525cdbdd6 100644 --- a/src/app/geometry/vgobject_p.h +++ b/src/app/geometry/vgobject_p.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vnodedetail.cpp b/src/app/geometry/vnodedetail.cpp index 80b54c6fa..963b7a246 100644 --- a/src/app/geometry/vnodedetail.cpp +++ b/src/app/geometry/vnodedetail.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vnodedetail.h b/src/app/geometry/vnodedetail.h index ab557f8bc..4b89e17a0 100644 --- a/src/app/geometry/vnodedetail.h +++ b/src/app/geometry/vnodedetail.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vnodedetail_p.h b/src/app/geometry/vnodedetail_p.h index 3de2ea778..a99a289d0 100644 --- a/src/app/geometry/vnodedetail_p.h +++ b/src/app/geometry/vnodedetail_p.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vpointf.cpp b/src/app/geometry/vpointf.cpp index 0a0088b46..b37f4e95e 100644 --- a/src/app/geometry/vpointf.cpp +++ b/src/app/geometry/vpointf.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vpointf.h b/src/app/geometry/vpointf.h index 78b437310..ed3597b1d 100644 --- a/src/app/geometry/vpointf.h +++ b/src/app/geometry/vpointf.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vpointf_p.h b/src/app/geometry/vpointf_p.h index cefc69de9..82979c7a6 100644 --- a/src/app/geometry/vpointf_p.h +++ b/src/app/geometry/vpointf_p.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vspline.cpp b/src/app/geometry/vspline.cpp index 8985f9c56..0e65f14b4 100644 --- a/src/app/geometry/vspline.cpp +++ b/src/app/geometry/vspline.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vspline.h b/src/app/geometry/vspline.h index c01be8c88..4e55b1d65 100644 --- a/src/app/geometry/vspline.h +++ b/src/app/geometry/vspline.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vspline_p.h b/src/app/geometry/vspline_p.h index 8ca4d8efd..f63470486 100644 --- a/src/app/geometry/vspline_p.h +++ b/src/app/geometry/vspline_p.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vsplinepath.cpp b/src/app/geometry/vsplinepath.cpp index 2170ffbf0..63a5e68f2 100644 --- a/src/app/geometry/vsplinepath.cpp +++ b/src/app/geometry/vsplinepath.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vsplinepath.h b/src/app/geometry/vsplinepath.h index eec37a532..6804eb36c 100644 --- a/src/app/geometry/vsplinepath.h +++ b/src/app/geometry/vsplinepath.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vsplinepath_p.h b/src/app/geometry/vsplinepath_p.h index c671c1f3e..555139e64 100644 --- a/src/app/geometry/vsplinepath_p.h +++ b/src/app/geometry/vsplinepath_p.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vsplinepoint.cpp b/src/app/geometry/vsplinepoint.cpp index 2928bece2..0168b0312 100644 --- a/src/app/geometry/vsplinepoint.cpp +++ b/src/app/geometry/vsplinepoint.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vsplinepoint.h b/src/app/geometry/vsplinepoint.h index ae9d569d5..e6aae714f 100644 --- a/src/app/geometry/vsplinepoint.h +++ b/src/app/geometry/vsplinepoint.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vsplinepoint_p.h b/src/app/geometry/vsplinepoint_p.h index 4e7789358..99e1491a7 100644 --- a/src/app/geometry/vsplinepoint_p.h +++ b/src/app/geometry/vsplinepoint_p.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/main.cpp b/src/app/main.cpp index fc19562e5..16cb4f758 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index 0b636a272..649958727 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/mainwindow.h b/src/app/mainwindow.h index 1f5083f29..45aa2708d 100644 --- a/src/app/mainwindow.h +++ b/src/app/mainwindow.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/options.cpp b/src/app/options.cpp index 6d5b8fa53..d4703df93 100644 --- a/src/app/options.cpp +++ b/src/app/options.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/options.h b/src/app/options.h index 6024d2d09..57380992a 100644 --- a/src/app/options.h +++ b/src/app/options.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/stable.cpp b/src/app/stable.cpp index 243b23938..e291c2801 100644 --- a/src/app/stable.cpp +++ b/src/app/stable.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/stable.h b/src/app/stable.h index 695fe3df7..643dc33eb 100644 --- a/src/app/stable.h +++ b/src/app/stable.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tablewindow.cpp b/src/app/tablewindow.cpp index c2fa61c10..e16d98232 100644 --- a/src/app/tablewindow.cpp +++ b/src/app/tablewindow.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tablewindow.h b/src/app/tablewindow.h index f704c5e1d..171d3495f 100644 --- a/src/app/tablewindow.h +++ b/src/app/tablewindow.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/drawtools.h b/src/app/tools/drawTools/drawtools.h index 50930c440..804266cb5 100644 --- a/src/app/tools/drawTools/drawtools.h +++ b/src/app/tools/drawTools/drawtools.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vabstractspline.cpp b/src/app/tools/drawTools/vabstractspline.cpp index f0d04dcab..8d17770d8 100644 --- a/src/app/tools/drawTools/vabstractspline.cpp +++ b/src/app/tools/drawTools/vabstractspline.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vabstractspline.h b/src/app/tools/drawTools/vabstractspline.h index f9b314b73..c6c3e7688 100644 --- a/src/app/tools/drawTools/vabstractspline.h +++ b/src/app/tools/drawTools/vabstractspline.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vdrawtool.cpp b/src/app/tools/drawTools/vdrawtool.cpp index 997188b17..944d06d9b 100644 --- a/src/app/tools/drawTools/vdrawtool.cpp +++ b/src/app/tools/drawTools/vdrawtool.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vdrawtool.h b/src/app/tools/drawTools/vdrawtool.h index d76e5c99f..c4e3d4586 100644 --- a/src/app/tools/drawTools/vdrawtool.h +++ b/src/app/tools/drawTools/vdrawtool.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolalongline.cpp b/src/app/tools/drawTools/vtoolalongline.cpp index 61020f9ea..0f656aa57 100644 --- a/src/app/tools/drawTools/vtoolalongline.cpp +++ b/src/app/tools/drawTools/vtoolalongline.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolalongline.h b/src/app/tools/drawTools/vtoolalongline.h index f3b860cd1..52bf7a1f8 100644 --- a/src/app/tools/drawTools/vtoolalongline.h +++ b/src/app/tools/drawTools/vtoolalongline.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolarc.cpp b/src/app/tools/drawTools/vtoolarc.cpp index deef670a0..4ec731a5a 100644 --- a/src/app/tools/drawTools/vtoolarc.cpp +++ b/src/app/tools/drawTools/vtoolarc.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolarc.h b/src/app/tools/drawTools/vtoolarc.h index fa4e291b4..21df02572 100644 --- a/src/app/tools/drawTools/vtoolarc.h +++ b/src/app/tools/drawTools/vtoolarc.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolbisector.cpp b/src/app/tools/drawTools/vtoolbisector.cpp index e3bb1b9ee..def29cbc7 100644 --- a/src/app/tools/drawTools/vtoolbisector.cpp +++ b/src/app/tools/drawTools/vtoolbisector.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolbisector.h b/src/app/tools/drawTools/vtoolbisector.h index 5d8ea8316..428512cef 100644 --- a/src/app/tools/drawTools/vtoolbisector.h +++ b/src/app/tools/drawTools/vtoolbisector.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp b/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp index e5f23ae9d..d554676c2 100644 --- a/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp +++ b/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolcurveintersectaxis.h b/src/app/tools/drawTools/vtoolcurveintersectaxis.h index 5dbb7d475..cff89776f 100644 --- a/src/app/tools/drawTools/vtoolcurveintersectaxis.h +++ b/src/app/tools/drawTools/vtoolcurveintersectaxis.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolcut.cpp b/src/app/tools/drawTools/vtoolcut.cpp index dabc5deb3..6af5c8133 100644 --- a/src/app/tools/drawTools/vtoolcut.cpp +++ b/src/app/tools/drawTools/vtoolcut.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolcut.h b/src/app/tools/drawTools/vtoolcut.h index a815b3017..836650f98 100644 --- a/src/app/tools/drawTools/vtoolcut.h +++ b/src/app/tools/drawTools/vtoolcut.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolcutarc.cpp b/src/app/tools/drawTools/vtoolcutarc.cpp index a2b00da2f..dd159b6db 100644 --- a/src/app/tools/drawTools/vtoolcutarc.cpp +++ b/src/app/tools/drawTools/vtoolcutarc.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolcutarc.h b/src/app/tools/drawTools/vtoolcutarc.h index 5a731a43d..7505e729f 100644 --- a/src/app/tools/drawTools/vtoolcutarc.h +++ b/src/app/tools/drawTools/vtoolcutarc.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolcutspline.cpp b/src/app/tools/drawTools/vtoolcutspline.cpp index 24fe69975..4ea200552 100644 --- a/src/app/tools/drawTools/vtoolcutspline.cpp +++ b/src/app/tools/drawTools/vtoolcutspline.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolcutspline.h b/src/app/tools/drawTools/vtoolcutspline.h index 94799aa4c..eb151e0a9 100644 --- a/src/app/tools/drawTools/vtoolcutspline.h +++ b/src/app/tools/drawTools/vtoolcutspline.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolcutsplinepath.cpp b/src/app/tools/drawTools/vtoolcutsplinepath.cpp index f93ae346b..b27338f21 100644 --- a/src/app/tools/drawTools/vtoolcutsplinepath.cpp +++ b/src/app/tools/drawTools/vtoolcutsplinepath.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolcutsplinepath.h b/src/app/tools/drawTools/vtoolcutsplinepath.h index 1de640cfe..67fdf0ae0 100644 --- a/src/app/tools/drawTools/vtoolcutsplinepath.h +++ b/src/app/tools/drawTools/vtoolcutsplinepath.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolendline.cpp b/src/app/tools/drawTools/vtoolendline.cpp index 0956ef24f..7929ee0da 100644 --- a/src/app/tools/drawTools/vtoolendline.cpp +++ b/src/app/tools/drawTools/vtoolendline.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolendline.h b/src/app/tools/drawTools/vtoolendline.h index a2e7327d7..5233078bc 100644 --- a/src/app/tools/drawTools/vtoolendline.h +++ b/src/app/tools/drawTools/vtoolendline.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolheight.cpp b/src/app/tools/drawTools/vtoolheight.cpp index ae69149b5..f5665d411 100644 --- a/src/app/tools/drawTools/vtoolheight.cpp +++ b/src/app/tools/drawTools/vtoolheight.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolheight.h b/src/app/tools/drawTools/vtoolheight.h index 02e77cf0a..7f76f94c3 100644 --- a/src/app/tools/drawTools/vtoolheight.h +++ b/src/app/tools/drawTools/vtoolheight.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolline.cpp b/src/app/tools/drawTools/vtoolline.cpp index 8f9f8003e..1f67a5221 100644 --- a/src/app/tools/drawTools/vtoolline.cpp +++ b/src/app/tools/drawTools/vtoolline.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolline.h b/src/app/tools/drawTools/vtoolline.h index 17be7b9b4..8326d95cc 100644 --- a/src/app/tools/drawTools/vtoolline.h +++ b/src/app/tools/drawTools/vtoolline.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoollineintersect.cpp b/src/app/tools/drawTools/vtoollineintersect.cpp index beb7805da..850abaab7 100644 --- a/src/app/tools/drawTools/vtoollineintersect.cpp +++ b/src/app/tools/drawTools/vtoollineintersect.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoollineintersect.h b/src/app/tools/drawTools/vtoollineintersect.h index 414edcf15..722feba2f 100644 --- a/src/app/tools/drawTools/vtoollineintersect.h +++ b/src/app/tools/drawTools/vtoollineintersect.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoollineintersectaxis.cpp b/src/app/tools/drawTools/vtoollineintersectaxis.cpp index 0dcfb7605..bdef767aa 100644 --- a/src/app/tools/drawTools/vtoollineintersectaxis.cpp +++ b/src/app/tools/drawTools/vtoollineintersectaxis.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoollineintersectaxis.h b/src/app/tools/drawTools/vtoollineintersectaxis.h index 6a8d0da17..8db43bb49 100644 --- a/src/app/tools/drawTools/vtoollineintersectaxis.h +++ b/src/app/tools/drawTools/vtoollineintersectaxis.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoollinepoint.cpp b/src/app/tools/drawTools/vtoollinepoint.cpp index 0de9db82b..ba52aad1b 100644 --- a/src/app/tools/drawTools/vtoollinepoint.cpp +++ b/src/app/tools/drawTools/vtoollinepoint.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoollinepoint.h b/src/app/tools/drawTools/vtoollinepoint.h index eded33065..073d4b9c0 100644 --- a/src/app/tools/drawTools/vtoollinepoint.h +++ b/src/app/tools/drawTools/vtoollinepoint.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolnormal.cpp b/src/app/tools/drawTools/vtoolnormal.cpp index 2a083aaa4..61107598e 100644 --- a/src/app/tools/drawTools/vtoolnormal.cpp +++ b/src/app/tools/drawTools/vtoolnormal.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolnormal.h b/src/app/tools/drawTools/vtoolnormal.h index 6595e895e..2752101fd 100644 --- a/src/app/tools/drawTools/vtoolnormal.h +++ b/src/app/tools/drawTools/vtoolnormal.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolpoint.cpp b/src/app/tools/drawTools/vtoolpoint.cpp index 28753d1a2..18e6fc444 100644 --- a/src/app/tools/drawTools/vtoolpoint.cpp +++ b/src/app/tools/drawTools/vtoolpoint.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolpoint.h b/src/app/tools/drawTools/vtoolpoint.h index e0c0c52d5..02c8620d6 100644 --- a/src/app/tools/drawTools/vtoolpoint.h +++ b/src/app/tools/drawTools/vtoolpoint.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolpointofcontact.cpp b/src/app/tools/drawTools/vtoolpointofcontact.cpp index 37042dcf6..cd0663ed5 100644 --- a/src/app/tools/drawTools/vtoolpointofcontact.cpp +++ b/src/app/tools/drawTools/vtoolpointofcontact.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolpointofcontact.h b/src/app/tools/drawTools/vtoolpointofcontact.h index 5f4e13053..f47b044cf 100644 --- a/src/app/tools/drawTools/vtoolpointofcontact.h +++ b/src/app/tools/drawTools/vtoolpointofcontact.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolpointofintersection.cpp b/src/app/tools/drawTools/vtoolpointofintersection.cpp index e67ee2110..7f3eeb903 100644 --- a/src/app/tools/drawTools/vtoolpointofintersection.cpp +++ b/src/app/tools/drawTools/vtoolpointofintersection.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolpointofintersection.h b/src/app/tools/drawTools/vtoolpointofintersection.h index 876c475bf..751a88c75 100644 --- a/src/app/tools/drawTools/vtoolpointofintersection.h +++ b/src/app/tools/drawTools/vtoolpointofintersection.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolshoulderpoint.cpp b/src/app/tools/drawTools/vtoolshoulderpoint.cpp index 540f474ea..00744a5c9 100644 --- a/src/app/tools/drawTools/vtoolshoulderpoint.cpp +++ b/src/app/tools/drawTools/vtoolshoulderpoint.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolshoulderpoint.h b/src/app/tools/drawTools/vtoolshoulderpoint.h index 1af8391b4..78348ab84 100644 --- a/src/app/tools/drawTools/vtoolshoulderpoint.h +++ b/src/app/tools/drawTools/vtoolshoulderpoint.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolsinglepoint.cpp b/src/app/tools/drawTools/vtoolsinglepoint.cpp index a8abd0336..f964e8cfb 100644 --- a/src/app/tools/drawTools/vtoolsinglepoint.cpp +++ b/src/app/tools/drawTools/vtoolsinglepoint.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolsinglepoint.h b/src/app/tools/drawTools/vtoolsinglepoint.h index 9ecdf2c28..fa0af58a8 100644 --- a/src/app/tools/drawTools/vtoolsinglepoint.h +++ b/src/app/tools/drawTools/vtoolsinglepoint.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolspline.cpp b/src/app/tools/drawTools/vtoolspline.cpp index 847077453..f097b1129 100644 --- a/src/app/tools/drawTools/vtoolspline.cpp +++ b/src/app/tools/drawTools/vtoolspline.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolspline.h b/src/app/tools/drawTools/vtoolspline.h index fa1f95d51..7d6d5acfb 100644 --- a/src/app/tools/drawTools/vtoolspline.h +++ b/src/app/tools/drawTools/vtoolspline.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolsplinepath.cpp b/src/app/tools/drawTools/vtoolsplinepath.cpp index 612cd6e38..bf9d82f72 100644 --- a/src/app/tools/drawTools/vtoolsplinepath.cpp +++ b/src/app/tools/drawTools/vtoolsplinepath.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtoolsplinepath.h b/src/app/tools/drawTools/vtoolsplinepath.h index 1566149c0..0e057644c 100644 --- a/src/app/tools/drawTools/vtoolsplinepath.h +++ b/src/app/tools/drawTools/vtoolsplinepath.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtooltriangle.cpp b/src/app/tools/drawTools/vtooltriangle.cpp index 6c674121f..28b99f1fd 100644 --- a/src/app/tools/drawTools/vtooltriangle.cpp +++ b/src/app/tools/drawTools/vtooltriangle.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vtooltriangle.h b/src/app/tools/drawTools/vtooltriangle.h index 4e5696727..1e7f80b0f 100644 --- a/src/app/tools/drawTools/vtooltriangle.h +++ b/src/app/tools/drawTools/vtooltriangle.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/nodeDetails/nodedetails.h b/src/app/tools/nodeDetails/nodedetails.h index fbdf2b2ba..497136c6e 100644 --- a/src/app/tools/nodeDetails/nodedetails.h +++ b/src/app/tools/nodeDetails/nodedetails.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/nodeDetails/vabstractnode.cpp b/src/app/tools/nodeDetails/vabstractnode.cpp index 6998fef57..c3e9d23b0 100644 --- a/src/app/tools/nodeDetails/vabstractnode.cpp +++ b/src/app/tools/nodeDetails/vabstractnode.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/nodeDetails/vabstractnode.h b/src/app/tools/nodeDetails/vabstractnode.h index e8d41eaa4..7c3ca0926 100644 --- a/src/app/tools/nodeDetails/vabstractnode.h +++ b/src/app/tools/nodeDetails/vabstractnode.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/nodeDetails/vnodearc.cpp b/src/app/tools/nodeDetails/vnodearc.cpp index 865671106..a49ce5f4e 100644 --- a/src/app/tools/nodeDetails/vnodearc.cpp +++ b/src/app/tools/nodeDetails/vnodearc.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/nodeDetails/vnodearc.h b/src/app/tools/nodeDetails/vnodearc.h index 5341a3f99..5f818a356 100644 --- a/src/app/tools/nodeDetails/vnodearc.h +++ b/src/app/tools/nodeDetails/vnodearc.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/nodeDetails/vnodepoint.cpp b/src/app/tools/nodeDetails/vnodepoint.cpp index 638ef3277..ee5566ae4 100644 --- a/src/app/tools/nodeDetails/vnodepoint.cpp +++ b/src/app/tools/nodeDetails/vnodepoint.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/nodeDetails/vnodepoint.h b/src/app/tools/nodeDetails/vnodepoint.h index 23e666aa8..7414b7ef2 100644 --- a/src/app/tools/nodeDetails/vnodepoint.h +++ b/src/app/tools/nodeDetails/vnodepoint.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/nodeDetails/vnodespline.cpp b/src/app/tools/nodeDetails/vnodespline.cpp index 0982190d7..ade8c26fd 100644 --- a/src/app/tools/nodeDetails/vnodespline.cpp +++ b/src/app/tools/nodeDetails/vnodespline.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/nodeDetails/vnodespline.h b/src/app/tools/nodeDetails/vnodespline.h index 4ae2225f5..e4403ccdf 100644 --- a/src/app/tools/nodeDetails/vnodespline.h +++ b/src/app/tools/nodeDetails/vnodespline.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/nodeDetails/vnodesplinepath.cpp b/src/app/tools/nodeDetails/vnodesplinepath.cpp index 7b8c3f5da..c7adf9479 100644 --- a/src/app/tools/nodeDetails/vnodesplinepath.cpp +++ b/src/app/tools/nodeDetails/vnodesplinepath.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/nodeDetails/vnodesplinepath.h b/src/app/tools/nodeDetails/vnodesplinepath.h index d92bed5a3..0871e1e46 100644 --- a/src/app/tools/nodeDetails/vnodesplinepath.h +++ b/src/app/tools/nodeDetails/vnodesplinepath.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/tools.h b/src/app/tools/tools.h index 2802f71ce..0c63496a9 100644 --- a/src/app/tools/tools.h +++ b/src/app/tools/tools.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/vabstracttool.cpp b/src/app/tools/vabstracttool.cpp index ed6f900dd..51dc6f60d 100644 --- a/src/app/tools/vabstracttool.cpp +++ b/src/app/tools/vabstracttool.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/vabstracttool.h b/src/app/tools/vabstracttool.h index 0212b5692..962d87239 100644 --- a/src/app/tools/vabstracttool.h +++ b/src/app/tools/vabstracttool.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/vdatatool.cpp b/src/app/tools/vdatatool.cpp index aea1651f7..1ac7544f9 100644 --- a/src/app/tools/vdatatool.cpp +++ b/src/app/tools/vdatatool.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/vdatatool.h b/src/app/tools/vdatatool.h index e0798c7cb..3af039e2f 100644 --- a/src/app/tools/vdatatool.h +++ b/src/app/tools/vdatatool.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/vtooldetail.cpp b/src/app/tools/vtooldetail.cpp index 27d42fd6a..5cfb1cbd2 100644 --- a/src/app/tools/vtooldetail.cpp +++ b/src/app/tools/vtooldetail.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/vtooldetail.h b/src/app/tools/vtooldetail.h index f5aeefe06..62e4a1c38 100644 --- a/src/app/tools/vtooldetail.h +++ b/src/app/tools/vtooldetail.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/vtooluniondetails.cpp b/src/app/tools/vtooluniondetails.cpp index 087afa9f3..80da08f26 100644 --- a/src/app/tools/vtooluniondetails.cpp +++ b/src/app/tools/vtooluniondetails.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/vtooluniondetails.h b/src/app/tools/vtooluniondetails.h index 2685bf049..cde1e793b 100644 --- a/src/app/tools/vtooluniondetails.h +++ b/src/app/tools/vtooluniondetails.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/adddet.cpp b/src/app/undocommands/adddet.cpp index 8641c05c5..125cc5ae3 100644 --- a/src/app/undocommands/adddet.cpp +++ b/src/app/undocommands/adddet.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/adddet.h b/src/app/undocommands/adddet.h index 87166cc20..230c216e7 100644 --- a/src/app/undocommands/adddet.h +++ b/src/app/undocommands/adddet.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/adddetnode.cpp b/src/app/undocommands/adddetnode.cpp index 993c7a00a..6f6a78e5d 100644 --- a/src/app/undocommands/adddetnode.cpp +++ b/src/app/undocommands/adddetnode.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/adddetnode.h b/src/app/undocommands/adddetnode.h index f6456e8fc..d58b255dc 100644 --- a/src/app/undocommands/adddetnode.h +++ b/src/app/undocommands/adddetnode.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/addpatternpiece.cpp b/src/app/undocommands/addpatternpiece.cpp index cad8e21b1..760487ce7 100644 --- a/src/app/undocommands/addpatternpiece.cpp +++ b/src/app/undocommands/addpatternpiece.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/addpatternpiece.h b/src/app/undocommands/addpatternpiece.h index 035816de7..52416ac01 100644 --- a/src/app/undocommands/addpatternpiece.h +++ b/src/app/undocommands/addpatternpiece.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/addtocalc.cpp b/src/app/undocommands/addtocalc.cpp index 30cbb631a..dbe3799cf 100644 --- a/src/app/undocommands/addtocalc.cpp +++ b/src/app/undocommands/addtocalc.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/addtocalc.h b/src/app/undocommands/addtocalc.h index 81d589d82..261be91df 100644 --- a/src/app/undocommands/addtocalc.h +++ b/src/app/undocommands/addtocalc.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/adduniondetails.cpp b/src/app/undocommands/adduniondetails.cpp index e5ed9f1e3..bb58b6213 100644 --- a/src/app/undocommands/adduniondetails.cpp +++ b/src/app/undocommands/adduniondetails.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/adduniondetails.h b/src/app/undocommands/adduniondetails.h index bd1cb5fc0..29ab151d4 100644 --- a/src/app/undocommands/adduniondetails.h +++ b/src/app/undocommands/adduniondetails.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/deletedetail.cpp b/src/app/undocommands/deletedetail.cpp index fd7fecac7..f07c27479 100644 --- a/src/app/undocommands/deletedetail.cpp +++ b/src/app/undocommands/deletedetail.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/deletedetail.h b/src/app/undocommands/deletedetail.h index a5b5f62a0..8923d5244 100644 --- a/src/app/undocommands/deletedetail.h +++ b/src/app/undocommands/deletedetail.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/deletepatternpiece.cpp b/src/app/undocommands/deletepatternpiece.cpp index 4a3ba85bf..e3c3630f8 100644 --- a/src/app/undocommands/deletepatternpiece.cpp +++ b/src/app/undocommands/deletepatternpiece.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/deletepatternpiece.h b/src/app/undocommands/deletepatternpiece.h index 4c4c21564..1d29fab5d 100644 --- a/src/app/undocommands/deletepatternpiece.h +++ b/src/app/undocommands/deletepatternpiece.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/deltool.cpp b/src/app/undocommands/deltool.cpp index 161bb88a8..762624174 100644 --- a/src/app/undocommands/deltool.cpp +++ b/src/app/undocommands/deltool.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/deltool.h b/src/app/undocommands/deltool.h index df8c12377..f92f9463f 100644 --- a/src/app/undocommands/deltool.h +++ b/src/app/undocommands/deltool.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/movedetail.cpp b/src/app/undocommands/movedetail.cpp index 025457337..ba847af69 100644 --- a/src/app/undocommands/movedetail.cpp +++ b/src/app/undocommands/movedetail.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/movedetail.h b/src/app/undocommands/movedetail.h index 54b439b5d..2c42a396a 100644 --- a/src/app/undocommands/movedetail.h +++ b/src/app/undocommands/movedetail.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/movelabel.cpp b/src/app/undocommands/movelabel.cpp index 1d7d3858e..92502e0bb 100644 --- a/src/app/undocommands/movelabel.cpp +++ b/src/app/undocommands/movelabel.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/movelabel.h b/src/app/undocommands/movelabel.h index 6ead6cfb4..f3d277560 100644 --- a/src/app/undocommands/movelabel.h +++ b/src/app/undocommands/movelabel.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/movespline.cpp b/src/app/undocommands/movespline.cpp index 2b1eddfe4..00cc65698 100644 --- a/src/app/undocommands/movespline.cpp +++ b/src/app/undocommands/movespline.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/movespline.h b/src/app/undocommands/movespline.h index 96f252065..ff81965ec 100644 --- a/src/app/undocommands/movespline.h +++ b/src/app/undocommands/movespline.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/movesplinepath.cpp b/src/app/undocommands/movesplinepath.cpp index 44a4e53e9..43e7b63a0 100644 --- a/src/app/undocommands/movesplinepath.cpp +++ b/src/app/undocommands/movesplinepath.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/movesplinepath.h b/src/app/undocommands/movesplinepath.h index 509a07ddd..16f3e276a 100644 --- a/src/app/undocommands/movesplinepath.h +++ b/src/app/undocommands/movesplinepath.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/movespoint.cpp b/src/app/undocommands/movespoint.cpp index 5c7fa0ac8..36764e802 100644 --- a/src/app/undocommands/movespoint.cpp +++ b/src/app/undocommands/movespoint.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/movespoint.h b/src/app/undocommands/movespoint.h index e9825b19c..49e1d4ad2 100644 --- a/src/app/undocommands/movespoint.h +++ b/src/app/undocommands/movespoint.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/renamepp.cpp b/src/app/undocommands/renamepp.cpp index 05255daf7..8520652d9 100644 --- a/src/app/undocommands/renamepp.cpp +++ b/src/app/undocommands/renamepp.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/renamepp.h b/src/app/undocommands/renamepp.h index 36183986f..84e790ac3 100644 --- a/src/app/undocommands/renamepp.h +++ b/src/app/undocommands/renamepp.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/savedetailoptions.cpp b/src/app/undocommands/savedetailoptions.cpp index 5caa88a8a..dee20ce26 100644 --- a/src/app/undocommands/savedetailoptions.cpp +++ b/src/app/undocommands/savedetailoptions.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/savedetailoptions.h b/src/app/undocommands/savedetailoptions.h index cfb1ab0f8..9fb4394e8 100644 --- a/src/app/undocommands/savedetailoptions.h +++ b/src/app/undocommands/savedetailoptions.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/savetooloptions.cpp b/src/app/undocommands/savetooloptions.cpp index 2e9d98dda..ce176ecdf 100644 --- a/src/app/undocommands/savetooloptions.cpp +++ b/src/app/undocommands/savetooloptions.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/savetooloptions.h b/src/app/undocommands/savetooloptions.h index 4ac44c7e6..21cd29d9e 100644 --- a/src/app/undocommands/savetooloptions.h +++ b/src/app/undocommands/savetooloptions.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/vundocommand.cpp b/src/app/undocommands/vundocommand.cpp index f02f3c426..873f66081 100644 --- a/src/app/undocommands/vundocommand.cpp +++ b/src/app/undocommands/vundocommand.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/vundocommand.h b/src/app/undocommands/vundocommand.h index ef5971fb1..034962541 100644 --- a/src/app/undocommands/vundocommand.h +++ b/src/app/undocommands/vundocommand.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/version.cpp b/src/app/version.cpp index 70d0c93fe..f9ca57d77 100644 --- a/src/app/version.cpp +++ b/src/app/version.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/version.h b/src/app/version.h index 892e19d68..ef6586f7a 100644 --- a/src/app/version.h +++ b/src/app/version.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vcontrolpointspline.cpp b/src/app/visualization/vcontrolpointspline.cpp index 5fb35504a..f330d4525 100644 --- a/src/app/visualization/vcontrolpointspline.cpp +++ b/src/app/visualization/vcontrolpointspline.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vcontrolpointspline.h b/src/app/visualization/vcontrolpointspline.h index e72c78951..45d8b4268 100644 --- a/src/app/visualization/vcontrolpointspline.h +++ b/src/app/visualization/vcontrolpointspline.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vgraphicssimpletextitem.cpp b/src/app/visualization/vgraphicssimpletextitem.cpp index c937519fd..5f4be0c90 100644 --- a/src/app/visualization/vgraphicssimpletextitem.cpp +++ b/src/app/visualization/vgraphicssimpletextitem.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vgraphicssimpletextitem.h b/src/app/visualization/vgraphicssimpletextitem.h index 3868e33f6..0b6a891a9 100644 --- a/src/app/visualization/vgraphicssimpletextitem.h +++ b/src/app/visualization/vgraphicssimpletextitem.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/visline.cpp b/src/app/visualization/visline.cpp index 6a8371f22..6c8424784 100644 --- a/src/app/visualization/visline.cpp +++ b/src/app/visualization/visline.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/visline.h b/src/app/visualization/visline.h index d22389c3a..dfad23120 100644 --- a/src/app/visualization/visline.h +++ b/src/app/visualization/visline.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vispath.cpp b/src/app/visualization/vispath.cpp index 715d4000d..b93549394 100644 --- a/src/app/visualization/vispath.cpp +++ b/src/app/visualization/vispath.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vispath.h b/src/app/visualization/vispath.h index 4ac4e6fcb..a694d68fe 100644 --- a/src/app/visualization/vispath.h +++ b/src/app/visualization/vispath.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolalongline.cpp b/src/app/visualization/vistoolalongline.cpp index 4287bac2e..da845493f 100644 --- a/src/app/visualization/vistoolalongline.cpp +++ b/src/app/visualization/vistoolalongline.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolalongline.h b/src/app/visualization/vistoolalongline.h index 45d6d61e3..9225c1a69 100644 --- a/src/app/visualization/vistoolalongline.h +++ b/src/app/visualization/vistoolalongline.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolarc.cpp b/src/app/visualization/vistoolarc.cpp index dc0ee62b0..e4cad9c18 100644 --- a/src/app/visualization/vistoolarc.cpp +++ b/src/app/visualization/vistoolarc.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolarc.h b/src/app/visualization/vistoolarc.h index 5e44d0f1a..57fa4b66f 100644 --- a/src/app/visualization/vistoolarc.h +++ b/src/app/visualization/vistoolarc.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolbisector.cpp b/src/app/visualization/vistoolbisector.cpp index c98bb7fb5..d778bd151 100644 --- a/src/app/visualization/vistoolbisector.cpp +++ b/src/app/visualization/vistoolbisector.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolbisector.h b/src/app/visualization/vistoolbisector.h index be85db27b..5f8226a23 100644 --- a/src/app/visualization/vistoolbisector.h +++ b/src/app/visualization/vistoolbisector.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolcurveintersectaxis.cpp b/src/app/visualization/vistoolcurveintersectaxis.cpp index 9ceb59a18..62a222822 100644 --- a/src/app/visualization/vistoolcurveintersectaxis.cpp +++ b/src/app/visualization/vistoolcurveintersectaxis.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolcurveintersectaxis.h b/src/app/visualization/vistoolcurveintersectaxis.h index 1398a01ce..621e54342 100644 --- a/src/app/visualization/vistoolcurveintersectaxis.h +++ b/src/app/visualization/vistoolcurveintersectaxis.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolcutarc.cpp b/src/app/visualization/vistoolcutarc.cpp index ba770361e..68b66c872 100644 --- a/src/app/visualization/vistoolcutarc.cpp +++ b/src/app/visualization/vistoolcutarc.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolcutarc.h b/src/app/visualization/vistoolcutarc.h index 84aa695be..755da9330 100644 --- a/src/app/visualization/vistoolcutarc.h +++ b/src/app/visualization/vistoolcutarc.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolcutspline.cpp b/src/app/visualization/vistoolcutspline.cpp index 204d1f740..c120ed622 100644 --- a/src/app/visualization/vistoolcutspline.cpp +++ b/src/app/visualization/vistoolcutspline.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolcutspline.h b/src/app/visualization/vistoolcutspline.h index 5967f3ba5..02c26d443 100644 --- a/src/app/visualization/vistoolcutspline.h +++ b/src/app/visualization/vistoolcutspline.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolcutsplinepath.cpp b/src/app/visualization/vistoolcutsplinepath.cpp index f79105cc8..5ef52c37d 100644 --- a/src/app/visualization/vistoolcutsplinepath.cpp +++ b/src/app/visualization/vistoolcutsplinepath.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolcutsplinepath.h b/src/app/visualization/vistoolcutsplinepath.h index 6dd4bdfcb..6a0a7fab9 100644 --- a/src/app/visualization/vistoolcutsplinepath.h +++ b/src/app/visualization/vistoolcutsplinepath.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolendline.cpp b/src/app/visualization/vistoolendline.cpp index a3483c829..d9148150a 100644 --- a/src/app/visualization/vistoolendline.cpp +++ b/src/app/visualization/vistoolendline.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolendline.h b/src/app/visualization/vistoolendline.h index cc3dd3f14..0161bb6c9 100644 --- a/src/app/visualization/vistoolendline.h +++ b/src/app/visualization/vistoolendline.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolheight.cpp b/src/app/visualization/vistoolheight.cpp index 60f0456c0..87044c8b3 100644 --- a/src/app/visualization/vistoolheight.cpp +++ b/src/app/visualization/vistoolheight.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolheight.h b/src/app/visualization/vistoolheight.h index 0b17b78bb..9666e4387 100644 --- a/src/app/visualization/vistoolheight.h +++ b/src/app/visualization/vistoolheight.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolline.cpp b/src/app/visualization/vistoolline.cpp index edcd4e763..b90c9e84c 100644 --- a/src/app/visualization/vistoolline.cpp +++ b/src/app/visualization/vistoolline.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolline.h b/src/app/visualization/vistoolline.h index b46c1a49c..fd45c2ef6 100644 --- a/src/app/visualization/vistoolline.h +++ b/src/app/visualization/vistoolline.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoollineintersect.cpp b/src/app/visualization/vistoollineintersect.cpp index 8b732e55a..72d858f4e 100644 --- a/src/app/visualization/vistoollineintersect.cpp +++ b/src/app/visualization/vistoollineintersect.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoollineintersect.h b/src/app/visualization/vistoollineintersect.h index b69d03ff7..8b7b7544d 100644 --- a/src/app/visualization/vistoollineintersect.h +++ b/src/app/visualization/vistoollineintersect.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoollineintersectaxis.cpp b/src/app/visualization/vistoollineintersectaxis.cpp index bf757847f..8305d679f 100644 --- a/src/app/visualization/vistoollineintersectaxis.cpp +++ b/src/app/visualization/vistoollineintersectaxis.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoollineintersectaxis.h b/src/app/visualization/vistoollineintersectaxis.h index 419873f80..d9950c492 100644 --- a/src/app/visualization/vistoollineintersectaxis.h +++ b/src/app/visualization/vistoollineintersectaxis.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolnormal.cpp b/src/app/visualization/vistoolnormal.cpp index 858415366..344232972 100644 --- a/src/app/visualization/vistoolnormal.cpp +++ b/src/app/visualization/vistoolnormal.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolnormal.h b/src/app/visualization/vistoolnormal.h index c73a0cace..ae73725a9 100644 --- a/src/app/visualization/vistoolnormal.h +++ b/src/app/visualization/vistoolnormal.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolpointofcontact.cpp b/src/app/visualization/vistoolpointofcontact.cpp index e1db720eb..290623ec4 100644 --- a/src/app/visualization/vistoolpointofcontact.cpp +++ b/src/app/visualization/vistoolpointofcontact.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolpointofcontact.h b/src/app/visualization/vistoolpointofcontact.h index 4edc79ea0..c1a2b605e 100644 --- a/src/app/visualization/vistoolpointofcontact.h +++ b/src/app/visualization/vistoolpointofcontact.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolpointofintersection.cpp b/src/app/visualization/vistoolpointofintersection.cpp index 6427eb3f3..a33ed5175 100644 --- a/src/app/visualization/vistoolpointofintersection.cpp +++ b/src/app/visualization/vistoolpointofintersection.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolpointofintersection.h b/src/app/visualization/vistoolpointofintersection.h index a2c594f75..dc8bb4b75 100644 --- a/src/app/visualization/vistoolpointofintersection.h +++ b/src/app/visualization/vistoolpointofintersection.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolshoulderpoint.cpp b/src/app/visualization/vistoolshoulderpoint.cpp index c6863176a..e107c13d0 100644 --- a/src/app/visualization/vistoolshoulderpoint.cpp +++ b/src/app/visualization/vistoolshoulderpoint.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolshoulderpoint.h b/src/app/visualization/vistoolshoulderpoint.h index bfda38bc5..b5b27e54b 100644 --- a/src/app/visualization/vistoolshoulderpoint.h +++ b/src/app/visualization/vistoolshoulderpoint.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolspline.cpp b/src/app/visualization/vistoolspline.cpp index 5c014feeb..c56708c71 100644 --- a/src/app/visualization/vistoolspline.cpp +++ b/src/app/visualization/vistoolspline.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolspline.h b/src/app/visualization/vistoolspline.h index df24af01b..6c48dcdd5 100644 --- a/src/app/visualization/vistoolspline.h +++ b/src/app/visualization/vistoolspline.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolsplinepath.cpp b/src/app/visualization/vistoolsplinepath.cpp index 108f73c54..73261cf55 100644 --- a/src/app/visualization/vistoolsplinepath.cpp +++ b/src/app/visualization/vistoolsplinepath.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolsplinepath.h b/src/app/visualization/vistoolsplinepath.h index be9dc2b3c..8817805cf 100644 --- a/src/app/visualization/vistoolsplinepath.h +++ b/src/app/visualization/vistoolsplinepath.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistooltriangle.cpp b/src/app/visualization/vistooltriangle.cpp index d646a9056..373705bc7 100644 --- a/src/app/visualization/vistooltriangle.cpp +++ b/src/app/visualization/vistooltriangle.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistooltriangle.h b/src/app/visualization/vistooltriangle.h index a15defaf7..4cfb698e0 100644 --- a/src/app/visualization/vistooltriangle.h +++ b/src/app/visualization/vistooltriangle.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/visualization.cpp b/src/app/visualization/visualization.cpp index fe86684f4..6050fc7f0 100644 --- a/src/app/visualization/visualization.cpp +++ b/src/app/visualization/visualization.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/visualization.h b/src/app/visualization/visualization.h index c63527d24..1c398bfd5 100644 --- a/src/app/visualization/visualization.h +++ b/src/app/visualization/visualization.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vsimplecurve.cpp b/src/app/visualization/vsimplecurve.cpp index 095f6c2db..4a2661d2e 100644 --- a/src/app/visualization/vsimplecurve.cpp +++ b/src/app/visualization/vsimplecurve.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vsimplecurve.h b/src/app/visualization/vsimplecurve.h index 96cefdca2..1c33c6990 100644 --- a/src/app/visualization/vsimplecurve.h +++ b/src/app/visualization/vsimplecurve.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/widgets/doubledelegate.cpp b/src/app/widgets/doubledelegate.cpp index f375376a6..46feb8e09 100644 --- a/src/app/widgets/doubledelegate.cpp +++ b/src/app/widgets/doubledelegate.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/widgets/doubledelegate.h b/src/app/widgets/doubledelegate.h index 68557de9d..790be3ae5 100644 --- a/src/app/widgets/doubledelegate.h +++ b/src/app/widgets/doubledelegate.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/widgets/textdelegate.cpp b/src/app/widgets/textdelegate.cpp index a02fadece..860175bb6 100644 --- a/src/app/widgets/textdelegate.cpp +++ b/src/app/widgets/textdelegate.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/widgets/textdelegate.h b/src/app/widgets/textdelegate.h index 974579ed7..d19012d7e 100644 --- a/src/app/widgets/textdelegate.h +++ b/src/app/widgets/textdelegate.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/widgets/vformulaproperty.cpp b/src/app/widgets/vformulaproperty.cpp index a1f881b53..c9f468e46 100644 --- a/src/app/widgets/vformulaproperty.cpp +++ b/src/app/widgets/vformulaproperty.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/widgets/vformulaproperty.h b/src/app/widgets/vformulaproperty.h index bcbc2f407..ee63ee3cd 100644 --- a/src/app/widgets/vformulaproperty.h +++ b/src/app/widgets/vformulaproperty.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/widgets/vformulapropertyeditor.cpp b/src/app/widgets/vformulapropertyeditor.cpp index cc583ccfb..930da6272 100644 --- a/src/app/widgets/vformulapropertyeditor.cpp +++ b/src/app/widgets/vformulapropertyeditor.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/widgets/vformulapropertyeditor.h b/src/app/widgets/vformulapropertyeditor.h index 52de778aa..e3d25b0c9 100644 --- a/src/app/widgets/vformulapropertyeditor.h +++ b/src/app/widgets/vformulapropertyeditor.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/widgets/vmaingraphicsscene.cpp b/src/app/widgets/vmaingraphicsscene.cpp index 0d4b77150..c93a2392d 100644 --- a/src/app/widgets/vmaingraphicsscene.cpp +++ b/src/app/widgets/vmaingraphicsscene.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/widgets/vmaingraphicsscene.h b/src/app/widgets/vmaingraphicsscene.h index 06f2cd5b6..cde39f846 100644 --- a/src/app/widgets/vmaingraphicsscene.h +++ b/src/app/widgets/vmaingraphicsscene.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/widgets/vmaingraphicsview.cpp b/src/app/widgets/vmaingraphicsview.cpp index 198c95f53..e01a1d685 100644 --- a/src/app/widgets/vmaingraphicsview.cpp +++ b/src/app/widgets/vmaingraphicsview.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/widgets/vmaingraphicsview.h b/src/app/widgets/vmaingraphicsview.h index 706648197..cb0a488fa 100644 --- a/src/app/widgets/vmaingraphicsview.h +++ b/src/app/widgets/vmaingraphicsview.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/widgets/vtablegraphicsview.cpp b/src/app/widgets/vtablegraphicsview.cpp index e2028e54a..c4ac8b003 100644 --- a/src/app/widgets/vtablegraphicsview.cpp +++ b/src/app/widgets/vtablegraphicsview.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/widgets/vtablegraphicsview.h b/src/app/widgets/vtablegraphicsview.h index 6b523c71f..9bb837f42 100644 --- a/src/app/widgets/vtablegraphicsview.h +++ b/src/app/widgets/vtablegraphicsview.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/widgets/vtooloptionspropertybrowser.cpp b/src/app/widgets/vtooloptionspropertybrowser.cpp index 63dff0c6c..77e069795 100644 --- a/src/app/widgets/vtooloptionspropertybrowser.cpp +++ b/src/app/widgets/vtooloptionspropertybrowser.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/widgets/vtooloptionspropertybrowser.h b/src/app/widgets/vtooloptionspropertybrowser.h index 4e28e7a5f..e0830771a 100644 --- a/src/app/widgets/vtooloptionspropertybrowser.h +++ b/src/app/widgets/vtooloptionspropertybrowser.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/widgets/vwidgetpopup.cpp b/src/app/widgets/vwidgetpopup.cpp index ade47befd..5329dafca 100644 --- a/src/app/widgets/vwidgetpopup.cpp +++ b/src/app/widgets/vwidgetpopup.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2015 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/widgets/vwidgetpopup.h b/src/app/widgets/vwidgetpopup.h index 0f61cba98..eb6529435 100644 --- a/src/app/widgets/vwidgetpopup.h +++ b/src/app/widgets/vwidgetpopup.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2015 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/xml/vabstractmeasurements.cpp b/src/app/xml/vabstractmeasurements.cpp index 4a6189fc1..97be9fb28 100644 --- a/src/app/xml/vabstractmeasurements.cpp +++ b/src/app/xml/vabstractmeasurements.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/xml/vabstractmeasurements.h b/src/app/xml/vabstractmeasurements.h index ac64c9828..10917bc0b 100644 --- a/src/app/xml/vabstractmeasurements.h +++ b/src/app/xml/vabstractmeasurements.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/xml/vindividualmeasurements.cpp b/src/app/xml/vindividualmeasurements.cpp index c39dc72ac..580b57a85 100644 --- a/src/app/xml/vindividualmeasurements.cpp +++ b/src/app/xml/vindividualmeasurements.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/xml/vindividualmeasurements.h b/src/app/xml/vindividualmeasurements.h index 85e967216..50e339c2e 100644 --- a/src/app/xml/vindividualmeasurements.h +++ b/src/app/xml/vindividualmeasurements.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/xml/vpattern.cpp b/src/app/xml/vpattern.cpp index df52079ec..56d637832 100644 --- a/src/app/xml/vpattern.cpp +++ b/src/app/xml/vpattern.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/xml/vpattern.h b/src/app/xml/vpattern.h index ea4db3e0b..bac00fe71 100644 --- a/src/app/xml/vpattern.h +++ b/src/app/xml/vpattern.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/xml/vstandardmeasurements.cpp b/src/app/xml/vstandardmeasurements.cpp index e252cf7de..49424aca2 100644 --- a/src/app/xml/vstandardmeasurements.cpp +++ b/src/app/xml/vstandardmeasurements.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/xml/vstandardmeasurements.h b/src/app/xml/vstandardmeasurements.h index 8de409cf6..b5f822d68 100644 --- a/src/app/xml/vstandardmeasurements.h +++ b/src/app/xml/vstandardmeasurements.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/xml/vtoolrecord.cpp b/src/app/xml/vtoolrecord.cpp index 036d88583..12bbc3660 100644 --- a/src/app/xml/vtoolrecord.cpp +++ b/src/app/xml/vtoolrecord.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/xml/vtoolrecord.h b/src/app/xml/vtoolrecord.h index 5cf185f5a..836f0a779 100644 --- a/src/app/xml/vtoolrecord.h +++ b/src/app/xml/vtoolrecord.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/exception/vexception.cpp b/src/libs/ifc/exception/vexception.cpp index 051c6d60f..f7fce7b8d 100644 --- a/src/libs/ifc/exception/vexception.cpp +++ b/src/libs/ifc/exception/vexception.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/exception/vexception.h b/src/libs/ifc/exception/vexception.h index 302010102..d3987e412 100644 --- a/src/libs/ifc/exception/vexception.h +++ b/src/libs/ifc/exception/vexception.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/exception/vexceptionbadid.cpp b/src/libs/ifc/exception/vexceptionbadid.cpp index 7b2dad8f1..cec574d53 100644 --- a/src/libs/ifc/exception/vexceptionbadid.cpp +++ b/src/libs/ifc/exception/vexceptionbadid.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/exception/vexceptionbadid.h b/src/libs/ifc/exception/vexceptionbadid.h index 59fe25d15..72ce160c5 100644 --- a/src/libs/ifc/exception/vexceptionbadid.h +++ b/src/libs/ifc/exception/vexceptionbadid.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/exception/vexceptionconversionerror.cpp b/src/libs/ifc/exception/vexceptionconversionerror.cpp index f30cbc8a5..3ae802ec7 100644 --- a/src/libs/ifc/exception/vexceptionconversionerror.cpp +++ b/src/libs/ifc/exception/vexceptionconversionerror.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/exception/vexceptionconversionerror.h b/src/libs/ifc/exception/vexceptionconversionerror.h index bf82b2f08..9a6fa3224 100644 --- a/src/libs/ifc/exception/vexceptionconversionerror.h +++ b/src/libs/ifc/exception/vexceptionconversionerror.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/exception/vexceptionemptyparameter.cpp b/src/libs/ifc/exception/vexceptionemptyparameter.cpp index b85b721d0..1123d65b4 100644 --- a/src/libs/ifc/exception/vexceptionemptyparameter.cpp +++ b/src/libs/ifc/exception/vexceptionemptyparameter.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/exception/vexceptionemptyparameter.h b/src/libs/ifc/exception/vexceptionemptyparameter.h index fc188acb3..61571f34a 100644 --- a/src/libs/ifc/exception/vexceptionemptyparameter.h +++ b/src/libs/ifc/exception/vexceptionemptyparameter.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/exception/vexceptionobjecterror.cpp b/src/libs/ifc/exception/vexceptionobjecterror.cpp index b97257ddd..b3d1258d4 100644 --- a/src/libs/ifc/exception/vexceptionobjecterror.cpp +++ b/src/libs/ifc/exception/vexceptionobjecterror.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/exception/vexceptionobjecterror.h b/src/libs/ifc/exception/vexceptionobjecterror.h index 1a33432a4..f1e6a5aae 100644 --- a/src/libs/ifc/exception/vexceptionobjecterror.h +++ b/src/libs/ifc/exception/vexceptionobjecterror.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/exception/vexceptionundo.cpp b/src/libs/ifc/exception/vexceptionundo.cpp index c93cd5290..2fd6a622f 100644 --- a/src/libs/ifc/exception/vexceptionundo.cpp +++ b/src/libs/ifc/exception/vexceptionundo.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/exception/vexceptionundo.h b/src/libs/ifc/exception/vexceptionundo.h index 58521d899..be4110863 100644 --- a/src/libs/ifc/exception/vexceptionundo.h +++ b/src/libs/ifc/exception/vexceptionundo.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/exception/vexceptionwrongid.cpp b/src/libs/ifc/exception/vexceptionwrongid.cpp index edc4c989e..93fdd7fb5 100644 --- a/src/libs/ifc/exception/vexceptionwrongid.cpp +++ b/src/libs/ifc/exception/vexceptionwrongid.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/exception/vexceptionwrongid.h b/src/libs/ifc/exception/vexceptionwrongid.h index a0bf9bd1e..86b73488c 100644 --- a/src/libs/ifc/exception/vexceptionwrongid.h +++ b/src/libs/ifc/exception/vexceptionwrongid.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/ifcdef.h b/src/libs/ifc/ifcdef.h index 4facd7b4d..a3d98ad03 100644 --- a/src/libs/ifc/ifcdef.h +++ b/src/libs/ifc/ifcdef.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/stable.cpp b/src/libs/ifc/stable.cpp index 877ab2ddf..a42d3fd7c 100644 --- a/src/libs/ifc/stable.cpp +++ b/src/libs/ifc/stable.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/stable.h b/src/libs/ifc/stable.h index c2c2a7780..d94550e68 100644 --- a/src/libs/ifc/stable.h +++ b/src/libs/ifc/stable.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/xml/vabstractconverter.cpp b/src/libs/ifc/xml/vabstractconverter.cpp index f148d3fac..48fc13a10 100644 --- a/src/libs/ifc/xml/vabstractconverter.cpp +++ b/src/libs/ifc/xml/vabstractconverter.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/xml/vabstractconverter.h b/src/libs/ifc/xml/vabstractconverter.h index c3ce71d33..470e4e554 100644 --- a/src/libs/ifc/xml/vabstractconverter.h +++ b/src/libs/ifc/xml/vabstractconverter.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/xml/vdomdocument.cpp b/src/libs/ifc/xml/vdomdocument.cpp index b48d4abbe..ce52253f7 100644 --- a/src/libs/ifc/xml/vdomdocument.cpp +++ b/src/libs/ifc/xml/vdomdocument.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/xml/vdomdocument.h b/src/libs/ifc/xml/vdomdocument.h index 00fba6c8f..1bf1b1963 100644 --- a/src/libs/ifc/xml/vdomdocument.h +++ b/src/libs/ifc/xml/vdomdocument.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentina project, a pattern making ** program that allows creating and modelling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/xml/vpatternconverter.cpp b/src/libs/ifc/xml/vpatternconverter.cpp index df94c32cc..362fe7e28 100644 --- a/src/libs/ifc/xml/vpatternconverter.cpp +++ b/src/libs/ifc/xml/vpatternconverter.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/xml/vpatternconverter.h b/src/libs/ifc/xml/vpatternconverter.h index b8afb8c3c..c9075318d 100644 --- a/src/libs/ifc/xml/vpatternconverter.h +++ b/src/libs/ifc/xml/vpatternconverter.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vlayout/stable.cpp b/src/libs/vlayout/stable.cpp index 71d31cdba..16fc7b547 100644 --- a/src/libs/vlayout/stable.cpp +++ b/src/libs/vlayout/stable.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vlayout/stable.h b/src/libs/vlayout/stable.h index 8a4f7cdfc..829c1d86f 100644 --- a/src/libs/vlayout/stable.h +++ b/src/libs/vlayout/stable.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vlayout/vabstractdetail.cpp b/src/libs/vlayout/vabstractdetail.cpp index 9adbd8126..ef0a85aa7 100644 --- a/src/libs/vlayout/vabstractdetail.cpp +++ b/src/libs/vlayout/vabstractdetail.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2015 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vlayout/vabstractdetail.h b/src/libs/vlayout/vabstractdetail.h index e6958c121..04ef46214 100644 --- a/src/libs/vlayout/vabstractdetail.h +++ b/src/libs/vlayout/vabstractdetail.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2015 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vlayout/vabstractdetail_p.h b/src/libs/vlayout/vabstractdetail_p.h index 15bf4a31b..9f4fca2f5 100644 --- a/src/libs/vlayout/vabstractdetail_p.h +++ b/src/libs/vlayout/vabstractdetail_p.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2015 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vlayout/vbank.cpp b/src/libs/vlayout/vbank.cpp index ede1c3f3a..a3237e0a4 100644 --- a/src/libs/vlayout/vbank.cpp +++ b/src/libs/vlayout/vbank.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2015 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vlayout/vbank.h b/src/libs/vlayout/vbank.h index 2222fe323..944a0144b 100644 --- a/src/libs/vlayout/vbank.h +++ b/src/libs/vlayout/vbank.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2015 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vlayout/vbestsquare.cpp b/src/libs/vlayout/vbestsquare.cpp index e72fa7105..773bbfc96 100644 --- a/src/libs/vlayout/vbestsquare.cpp +++ b/src/libs/vlayout/vbestsquare.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2015 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vlayout/vbestsquare.h b/src/libs/vlayout/vbestsquare.h index 25f12bc82..fee9bad44 100644 --- a/src/libs/vlayout/vbestsquare.h +++ b/src/libs/vlayout/vbestsquare.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2015 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vlayout/vcontour.cpp b/src/libs/vlayout/vcontour.cpp index 0358347e7..831b81d50 100644 --- a/src/libs/vlayout/vcontour.cpp +++ b/src/libs/vlayout/vcontour.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2015 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vlayout/vcontour.h b/src/libs/vlayout/vcontour.h index 67b383573..bef34f6d0 100644 --- a/src/libs/vlayout/vcontour.h +++ b/src/libs/vlayout/vcontour.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2015 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vlayout/vcontour_p.h b/src/libs/vlayout/vcontour_p.h index 0c7fdc8f6..c0d4f1710 100644 --- a/src/libs/vlayout/vcontour_p.h +++ b/src/libs/vlayout/vcontour_p.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2015 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vlayout/vlayoutdef.h b/src/libs/vlayout/vlayoutdef.h index 5df8aa00d..7bb9ab662 100644 --- a/src/libs/vlayout/vlayoutdef.h +++ b/src/libs/vlayout/vlayoutdef.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2015 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vlayout/vlayoutdetail.cpp b/src/libs/vlayout/vlayoutdetail.cpp index d440ba452..2be3c848c 100644 --- a/src/libs/vlayout/vlayoutdetail.cpp +++ b/src/libs/vlayout/vlayoutdetail.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2015 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vlayout/vlayoutdetail.h b/src/libs/vlayout/vlayoutdetail.h index 2ca4ac76f..58dbfc85b 100644 --- a/src/libs/vlayout/vlayoutdetail.h +++ b/src/libs/vlayout/vlayoutdetail.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2015 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vlayout/vlayoutdetail_p.h b/src/libs/vlayout/vlayoutdetail_p.h index 04c687d05..1e469d6c4 100644 --- a/src/libs/vlayout/vlayoutdetail_p.h +++ b/src/libs/vlayout/vlayoutdetail_p.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2015 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vlayout/vlayoutgenerator.cpp b/src/libs/vlayout/vlayoutgenerator.cpp index 1a7697862..10d0ee387 100644 --- a/src/libs/vlayout/vlayoutgenerator.cpp +++ b/src/libs/vlayout/vlayoutgenerator.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2015 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vlayout/vlayoutgenerator.h b/src/libs/vlayout/vlayoutgenerator.h index 4405df468..7bc99c4ac 100644 --- a/src/libs/vlayout/vlayoutgenerator.h +++ b/src/libs/vlayout/vlayoutgenerator.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2015 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index 08542cfda..258a94604 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2015 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vlayout/vlayoutpaper.h b/src/libs/vlayout/vlayoutpaper.h index 4574adeec..5bbac84d1 100644 --- a/src/libs/vlayout/vlayoutpaper.h +++ b/src/libs/vlayout/vlayoutpaper.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2015 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vlayout/vlayoutpaper_p.h b/src/libs/vlayout/vlayoutpaper_p.h index 09acd09e1..fb31a0649 100644 --- a/src/libs/vlayout/vlayoutpaper_p.h +++ b/src/libs/vlayout/vlayoutpaper_p.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2015 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vlayout/vposition.cpp b/src/libs/vlayout/vposition.cpp index 8a5ab17db..4cd649620 100644 --- a/src/libs/vlayout/vposition.cpp +++ b/src/libs/vlayout/vposition.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2015 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vlayout/vposition.h b/src/libs/vlayout/vposition.h index 2ec01169c..ad7f16c0a 100644 --- a/src/libs/vlayout/vposition.h +++ b/src/libs/vlayout/vposition.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2015 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vobj/stable.cpp b/src/libs/vobj/stable.cpp index 877ab2ddf..a42d3fd7c 100644 --- a/src/libs/vobj/stable.cpp +++ b/src/libs/vobj/stable.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vobj/stable.h b/src/libs/vobj/stable.h index adb5eed9f..f24b2cdf9 100644 --- a/src/libs/vobj/stable.h +++ b/src/libs/vobj/stable.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vobj/vobjengine.cpp b/src/libs/vobj/vobjengine.cpp index ee1536355..189ea6ead 100644 --- a/src/libs/vobj/vobjengine.cpp +++ b/src/libs/vobj/vobjengine.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vobj/vobjengine.h b/src/libs/vobj/vobjengine.h index 52e71055a..3d8fb3513 100644 --- a/src/libs/vobj/vobjengine.h +++ b/src/libs/vobj/vobjengine.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vobj/vobjpaintdevice.cpp b/src/libs/vobj/vobjpaintdevice.cpp index 0b248b48d..3d5b7e021 100644 --- a/src/libs/vobj/vobjpaintdevice.cpp +++ b/src/libs/vobj/vobjpaintdevice.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vobj/vobjpaintdevice.h b/src/libs/vobj/vobjpaintdevice.h index 365a6da7a..36f037252 100644 --- a/src/libs/vobj/vobjpaintdevice.h +++ b/src/libs/vobj/vobjpaintdevice.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vpropertyexplorer/plugins/vlinecolorproperty.cpp b/src/libs/vpropertyexplorer/plugins/vlinecolorproperty.cpp index 58c03b877..c82e50c3c 100644 --- a/src/libs/vpropertyexplorer/plugins/vlinecolorproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vlinecolorproperty.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2015 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vpropertyexplorer/plugins/vlinecolorproperty.h b/src/libs/vpropertyexplorer/plugins/vlinecolorproperty.h index 416b2a1d3..f68c20f29 100644 --- a/src/libs/vpropertyexplorer/plugins/vlinecolorproperty.h +++ b/src/libs/vpropertyexplorer/plugins/vlinecolorproperty.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2015 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vpropertyexplorer/plugins/vlinetypeproperty.cpp b/src/libs/vpropertyexplorer/plugins/vlinetypeproperty.cpp index c449096fd..558e40ec1 100644 --- a/src/libs/vpropertyexplorer/plugins/vlinetypeproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vlinetypeproperty.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2015 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vpropertyexplorer/plugins/vlinetypeproperty.h b/src/libs/vpropertyexplorer/plugins/vlinetypeproperty.h index 335ac481d..3942cf140 100644 --- a/src/libs/vpropertyexplorer/plugins/vlinetypeproperty.h +++ b/src/libs/vpropertyexplorer/plugins/vlinetypeproperty.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2015 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/test/ParserTest/main.cpp b/src/test/ParserTest/main.cpp index 6239835c8..d53e71096 100644 --- a/src/test/ParserTest/main.cpp +++ b/src/test/ParserTest/main.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/test/ParserTest/stable.cpp b/src/test/ParserTest/stable.cpp index 243b23938..e291c2801 100644 --- a/src/test/ParserTest/stable.cpp +++ b/src/test/ParserTest/stable.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/test/ParserTest/stable.h b/src/test/ParserTest/stable.h index 4d9dd80f4..b4f802c0a 100644 --- a/src/test/ParserTest/stable.h +++ b/src/test/ParserTest/stable.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify From f4b720e26e96d9a6a90b03c35ce07649884f6bcd Mon Sep 17 00:00:00 2001 From: Roman Telezhinskyi Date: Fri, 27 Feb 2015 10:47:24 +0000 Subject: [PATCH 185/186] README.txt edited online with Bitbucket --HG-- branch : develop --- README.txt | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/README.txt b/README.txt index 33c10eee0..db0b3993e 100644 --- a/README.txt +++ b/README.txt @@ -1,5 +1,6 @@ Pattern making program -Copyright (C) 2013-2014 Roman Telezhynskyi +Author Roman Telezhynskyi +Copyright (C) 2013-2015 Valentina project Valentina Web page: http://www.valentina-project.org/ Valentina user manual https://bitbucket.org/dismine/valentina/wiki/manual/Content Valentina main repository: https://bitbucket.org/dismine/valentina/overview @@ -19,16 +20,19 @@ Supported Platforms =================== The standalone binary packages support the following platforms: -Windows XP SP2 or later -Ubuntu Linux 14.04 (32-bit) or later +Windows XP SP2 (32-bit) or later +Ubuntu Linux 14.04 (32-bit/64-bit) or later +OpenSUSE 13.02 (32-bit/64-bit) or later +Fedora 20 (32-bit/64-bit) or later +Mac OS X 10.7 (64-bit) or later -Building the sources requires Qt 5.2.1 or later. +Building the sources requires Qt 5.2.0 or later. Compiling Valentina ==================== Prerequisites: - * Qt 5.2.1 or later (On Unix development packages needed) - * mercurial + * Qt 5.2.0 or later (On Unix development packages needed) + * mercurial (only for working with repository) * On Unix: - ccache - g++ (at least GCC 4.6 is needed and GCC 4.8 is recommended) or @@ -65,9 +69,13 @@ Unix systems: Default prefix for command "make install" is /usr. For using another prefix build with qmake command: -qmake PREFIX=/usr/local Valentina.pro -r +qmake PREFIX=/usr/local PREFIX_LIB=/usr/lib/i386-linux-gnu Valentina.pro -r -where /usr/local is a new prefix for installation. +where /usr/local is a new prefix for installation binary files and /usr/lib/i386-linux-gnu is new prefix for install libraries. + +More about creation installers read in articles: +* How create Windows installer - https://bitbucket.org/dismine/valentina/wiki/developers/Creation_Windows_installer +* How create debian package - https://bitbucket.org/dismine/valentina/wiki/developers/Creation_deb_package LICENSING ========== @@ -81,4 +89,8 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -See LICENSE file for further information +See LICENSE_GPL.txt file for further information + +Other components released under: +* QMuParser - BSD license +* VPropertyExplorer - LGPLv2.1 license \ No newline at end of file From bb74ed2da6ed4e505e25dd891151d5120d175ce2 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 27 Feb 2015 15:07:43 +0200 Subject: [PATCH 186/186] Updated contributors list. --HG-- branch : develop --- AUTHORS.txt | 39 ++++++++++++++++++--------- src/app/dialogs/app/dialogaboutapp.ui | 13 +++++++-- 2 files changed, 38 insertions(+), 14 deletions(-) diff --git a/AUTHORS.txt b/AUTHORS.txt index f3123fad8..b245f676b 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -1,14 +1,29 @@ -Our Team: +This file contains a list of people who have made contributions +to the Valentina project. - (*) Roman Telezhynskyi - Maintainer and founder of the project. - - (*) Christine Neupert - Testing, translation. - - (*) Patrick Proy - Developing. - - (*) Lindsay Williams - Design logo. +Maintainer and founder of the project: + Roman Telezhynskyi + +Community manager, web site: + Susan Spencer + +Patch contributors: + Patrick Proy + * Developing. + Christine Neupert + * Testing. + * Translation. + Lindsay Williams + * Design logo. + Sabine Schmaltz + * Developing. + * Documantation. + Felix Ulber + * Developing. + * Translation. + Mischa Krempel + * Developing. + * Mac OS package. + Peter Gsellmann + * Testing diff --git a/src/app/dialogs/app/dialogaboutapp.ui b/src/app/dialogs/app/dialogaboutapp.ui index 01d4c4bd1..f901b50a8 100644 --- a/src/app/dialogs/app/dialogaboutapp.ui +++ b/src/app/dialogs/app/dialogaboutapp.ui @@ -201,7 +201,7 @@ - Qt::ScrollBarAlwaysOff + Qt::ScrollBarAsNeeded Qt::ScrollBarAlwaysOff @@ -217,7 +217,16 @@ Christine Neupert Sabine Schmaltz grumpi Steve Conklin -Patrick Proy +Lindsay Williams +Patrick Proy +Mischa Krempel +Matt Daw +Peter Gsellmann +Robert Martin +Michaela Orth +Rina Rivera +Fritz Rometsch +Felix Ulber