diff --git a/src/app/tape/tape.pri b/src/app/tape/tape.pri index 0150eea12..ae955616d 100644 --- a/src/app/tape/tape.pri +++ b/src/app/tape/tape.pri @@ -11,7 +11,8 @@ SOURCES += \ $$PWD/dialogs/dialogmdatabase.cpp \ $$PWD/dialogs/tapeconfigdialog.cpp \ $$PWD/dialogs/configpages/tapeconfigurationpage.cpp \ - $$PWD/dialogs/configpages/tapepathpage.cpp + $$PWD/dialogs/configpages/tapepathpage.cpp \ + $$PWD/vlitepattern.cpp HEADERS += \ $$PWD/tmainwindow.h \ @@ -23,7 +24,8 @@ HEADERS += \ $$PWD/version.h \ $$PWD/dialogs/tapeconfigdialog.h \ $$PWD/dialogs/configpages/tapeconfigurationpage.h \ - $$PWD/dialogs/configpages/tapepathpage.h + $$PWD/dialogs/configpages/tapepathpage.h \ + $$PWD/vlitepattern.h FORMS += \ $$PWD/tmainwindow.ui \ diff --git a/src/app/tape/tape.pro b/src/app/tape/tape.pro index 2131d6e67..de155d047 100644 --- a/src/app/tape/tape.pro +++ b/src/app/tape/tape.pro @@ -145,7 +145,7 @@ CONFIG(debug, debug|release){ win32:RC_FILE = share/resources/tape.rc # When the GNU linker sees a library, it discards all symbols that it doesn't need. -# Add dependent library the first. +# Dependent library go first. #VTools static library (depend on VWidgets, VMisc, VPatternDB) unix|win32: LIBS += -L$$OUT_PWD/../../libs/vtools/$${DESTDIR}/ -lvtools @@ -202,7 +202,7 @@ DEPENDPATH += $$PWD/../../libs/vgeometry win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vgeometry/$${DESTDIR}/vgeometry.lib else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vgeometry/$${DESTDIR}/libvgeometry.a -# IFC static library +# IFC static library (depend on QMuParser) unix|win32: LIBS += -L$$OUT_PWD/../../libs/ifc/$${DESTDIR}/ -lifc INCLUDEPATH += $$PWD/../../libs/ifc diff --git a/src/app/tape/vlitepattern.cpp b/src/app/tape/vlitepattern.cpp new file mode 100644 index 000000000..5f1dbe0c6 --- /dev/null +++ b/src/app/tape/vlitepattern.cpp @@ -0,0 +1,74 @@ +/************************************************************************ + ** + ** @file vlitepattern.cpp + ** @author Roman Telezhynskyi + ** @date 9 8, 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 "vlitepattern.h" + +//--------------------------------------------------------------------------------------------------------------------- +VLitePattern::VLitePattern(QObject *parent) + : VAbstractPattern(parent) +{ +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLitePattern::CreateEmptyFile(const QString &tablePath) +{ + Q_UNUSED(tablePath) +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLitePattern::IncrementReferens(quint32 id) const +{ + Q_UNUSED(id) +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLitePattern::DecrementReferens(quint32 id) const +{ + Q_UNUSED(id) +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VLitePattern::GenerateLabel(const LabelType &type, const QString &reservedName) const +{ + Q_UNUSED(type) + Q_UNUSED(reservedName) + return QString(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLitePattern::UpdateToolData(const quint32 &id, VContainer *data) +{ + Q_UNUSED(id) + Q_UNUSED(data) +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLitePattern::LiteParseTree(const Document &parse) +{ + Q_UNUSED(parse) +} diff --git a/src/libs/vgeometry/vgeometrydef.cpp b/src/app/tape/vlitepattern.h similarity index 55% rename from src/libs/vgeometry/vgeometrydef.cpp rename to src/app/tape/vlitepattern.h index 6a4c52593..25fde389e 100644 --- a/src/libs/vgeometry/vgeometrydef.cpp +++ b/src/app/tape/vlitepattern.h @@ -1,14 +1,14 @@ /************************************************************************ ** - ** @file vgeometrydef.cpp + ** @file vlitepattern.h ** @author Roman Telezhynskyi - ** @date 7 5, 2015 + ** @date 9 8, 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-2015 Valentina project + ** Copyright (C) 2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -26,19 +26,31 @@ ** *************************************************************************/ -#include "vgeometrydef.h" +#ifndef VLITEPATTERN_H +#define VLITEPATTERN_H -//variables -const QString spl_ = QStringLiteral("Spl_"); -const QString arc_ = QStringLiteral("Arc_"); -const QString splPath = QStringLiteral("SplPath"); -const QString radius_V = QStringLiteral("Radius"); -const QString radiusArc_ = radius_V + arc_; -const QString angle1_V = QStringLiteral("Angle1"); -const QString angle2_V = QStringLiteral("Angle2"); -const QString angle1Arc_ = angle1_V + arc_; -const QString angle2Arc_ = angle2_V + arc_; -const QString angle1Spl_ = angle1_V + spl_; -const QString angle2Spl_ = angle2_V + spl_; -const QString angle1SplPath = angle1_V + splPath; -const QString angle2SplPath = angle2_V + splPath; +#include "../ifc/xml/vabstractpattern.h" + +class VLitePattern : public VAbstractPattern +{ + Q_OBJECT +public: + VLitePattern(QObject *parent = nullptr); + + virtual void CreateEmptyFile(const QString &tablePath) Q_DECL_OVERRIDE; + + virtual void IncrementReferens(quint32 id) const Q_DECL_OVERRIDE; + virtual void DecrementReferens(quint32 id) const Q_DECL_OVERRIDE; + + virtual QString GenerateLabel(const LabelType &type, const QString &reservedName = QString())const Q_DECL_OVERRIDE; + + virtual void UpdateToolData(const quint32 &id, VContainer *data) Q_DECL_OVERRIDE; + +public slots: + virtual void LiteParseTree(const Document &parse) Q_DECL_OVERRIDE; + +private: + Q_DISABLE_COPY(VLitePattern) +}; + +#endif // VLITEPATTERN_H diff --git a/src/app/valentina/core/vtooloptionspropertybrowser.cpp b/src/app/valentina/core/vtooloptionspropertybrowser.cpp index 0883c1d8c..016058e2d 100644 --- a/src/app/valentina/core/vtooloptionspropertybrowser.cpp +++ b/src/app/valentina/core/vtooloptionspropertybrowser.cpp @@ -444,7 +444,7 @@ void VToolOptionsPropertyBrowser::AddPropertyPointName(Tool *i, const QString &p { VProperty* itemName = new VProperty(propertyName); itemName->setValue(i->name()); - AddProperty(itemName, VAbstractTool::AttrName); + AddProperty(itemName, AttrName); } @@ -454,7 +454,7 @@ void VToolOptionsPropertyBrowser::AddPropertyPointName1(Tool *i, const QString & { VProperty* itemName = new VProperty(propertyName); itemName->setValue(i->nameP1()); - AddProperty(itemName, VAbstractTool::AttrName1); + AddProperty(itemName, AttrName1); } //--------------------------------------------------------------------------------------------------------------------- @@ -463,7 +463,7 @@ void VToolOptionsPropertyBrowser::AddPropertyPointName2(Tool *i, const QString & { VProperty* itemName = new VProperty(propertyName); itemName->setValue(i->nameP2()); - AddProperty(itemName, VAbstractTool::AttrName2); + AddProperty(itemName, AttrName2); } //--------------------------------------------------------------------------------------------------------------------- @@ -473,7 +473,7 @@ void VToolOptionsPropertyBrowser::AddPropertyCrossPoint(Tool *i, const QString & VEnumProperty* itemProperty = new VEnumProperty(propertyName); itemProperty->setLiterals(QStringList()<< tr("First point") << tr("Second point")); itemProperty->setValue(static_cast(i->GetCrossCirclesPoint())-1); - AddProperty(itemProperty, VAbstractTool::AttrCrossPoint); + AddProperty(itemProperty, AttrCrossPoint); } //--------------------------------------------------------------------------------------------------------------------- @@ -489,7 +489,7 @@ void VToolOptionsPropertyBrowser::AddPropertyLineType(Tool *i, const QString &pr qWarning()<<"Can't find line style" << i->getLineType()<<"in list"; } lineTypeProperty->setValue(index); - AddProperty(lineTypeProperty, VAbstractTool::AttrTypeLine); + AddProperty(lineTypeProperty, AttrTypeLine); } //--------------------------------------------------------------------------------------------------------------------- @@ -522,7 +522,7 @@ void VToolOptionsPropertyBrowser::SetPointName(const QString &name) QRegularExpression rx(NameRegExp()); if (name.isEmpty() || VContainer::IsUnique(name) == false || rx.match(name).hasMatch() == false) { - idToProperty[VAbstractTool::AttrName]->setValue(i->name()); + idToProperty[AttrName]->setValue(i->name()); } else { @@ -549,7 +549,7 @@ void VToolOptionsPropertyBrowser::SetPointName1(const QString &name) QRegularExpression rx(NameRegExp()); if (name.isEmpty() || VContainer::IsUnique(name) == false || rx.match(name).hasMatch() == false) { - idToProperty[VAbstractTool::AttrName1]->setValue(i->nameP1()); + idToProperty[AttrName1]->setValue(i->nameP1()); } else { @@ -576,7 +576,7 @@ void VToolOptionsPropertyBrowser::SetPointName2(const QString &name) QRegularExpression rx(NameRegExp()); if (name.isEmpty() || VContainer::IsUnique(name) == false || rx.match(name).hasMatch() == false) { - idToProperty[VAbstractTool::AttrName2]->setValue(i->nameP2()); + idToProperty[AttrName2]->setValue(i->nameP2()); } else { @@ -640,7 +640,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolSinglePoint(VProperty *property) switch (PropertiesList().indexOf(id)) { - case 0: // VAbstractTool::AttrName + case 0: // AttrName SetPointName(value.toString()); break; case 1: // QLatin1String("position") @@ -664,19 +664,19 @@ void VToolOptionsPropertyBrowser::ChangeDataToolEndLine(VProperty *property) SCASSERT(i != nullptr); switch (PropertiesList().indexOf(id)) { - case 0: // VAbstractTool::AttrName + case 0: // AttrName SetPointName(value.toString()); break; - case 3: // VAbstractTool::AttrTypeLine + case 3: // AttrTypeLine i->SetTypeLine(value.toString()); break; - case 26: // VAbstractTool::AttrTypeLineColor + case 26: // AttrTypeLineColor i->SetLineColor(value.toString()); break; - case 4: // VAbstractTool::AttrLength + case 4: // AttrLength i->SetFormulaLength(value.value()); break; - case 5: // VAbstractTool::AttrAngle + case 5: // AttrAngle i->SetFormulaAngle(value.value()); break; default: @@ -697,16 +697,16 @@ void VToolOptionsPropertyBrowser::ChangeDataToolAlongLine(VProperty *property) SCASSERT(i != nullptr); switch (PropertiesList().indexOf(id)) { - case 0: // VAbstractTool::AttrName + case 0: // AttrName SetPointName(value.toString()); break; - case 3: // VAbstractTool::AttrTypeLine + case 3: // AttrTypeLine i->SetTypeLine(value.toString()); break; - case 26: // VAbstractTool::AttrTypeLineColor + case 26: // AttrTypeLineColor i->SetLineColor(value.toString()); break; - case 4: // VAbstractTool::AttrLength + case 4: // AttrLength i->SetFormulaLength(value.value()); break; default: @@ -727,16 +727,16 @@ void VToolOptionsPropertyBrowser::ChangeDataToolArc(VProperty *property) SCASSERT(i != nullptr); switch (PropertiesList().indexOf(id)) { - case 8: // VAbstractTool::AttrRadius + case 8: // AttrRadius i->SetFormulaRadius(value.value()); break; - case 9: // VAbstractTool::AttrAngle1 + case 9: // AttrAngle1 i->SetFormulaF1(value.value()); break; - case 10: // VAbstractTool::AttrAngle2 + case 10: // AttrAngle2 i->SetFormulaF2(value.value()); break; - case 27: // VAbstractTool::AttrTypeColor + case 27: // AttrTypeColor i->SetLineColor(value.toString()); break; default: @@ -757,16 +757,16 @@ void VToolOptionsPropertyBrowser::ChangeDataToolArcWithLength(VProperty *propert SCASSERT(i != nullptr); switch (PropertiesList().indexOf(id)) { - case 8: // VAbstractTool::AttrRadius + case 8: // AttrRadius i->SetFormulaRadius(value.value()); break; - case 9: // VAbstractTool::AttrAngle1 + case 9: // AttrAngle1 i->SetFormulaF1(value.value()); break; - case 4: // VAbstractTool::AttrLength + case 4: // AttrLength i->SetFormulaLength(value.value()); break; - case 27: // VAbstractTool::AttrTypeColor + case 27: // AttrTypeColor i->SetLineColor(value.toString()); break; default: @@ -787,16 +787,16 @@ void VToolOptionsPropertyBrowser::ChangeDataToolBisector(VProperty *property) SCASSERT(i != nullptr); switch (PropertiesList().indexOf(id)) { - case 0: // VAbstractTool::AttrName + case 0: // AttrName SetPointName(value.toString()); break; - case 4: // VAbstractTool::AttrLength + case 4: // AttrLength i->SetFormulaLength(value.value()); break; - case 3: // VAbstractTool::AttrTypeLine + case 3: // AttrTypeLine i->SetTypeLine(value.toString()); break; - case 26: // VAbstractTool::AttrTypeLineColor + case 26: // AttrTypeLineColor i->SetLineColor(value.toString()); break; default: @@ -815,10 +815,10 @@ void VToolOptionsPropertyBrowser::ChangeDataToolTrueDarts(VProperty *property) switch (PropertiesList().indexOf(id)) { - case 32: // VAbstractTool::AttrName1 + case 32: // AttrName1 SetPointName1(value.toString()); break; - case 33: // VAbstractTool::AttrName2 + case 33: // AttrName2 SetPointName2(value.toString()); break; default: @@ -839,13 +839,13 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCutArc(VProperty *property) SCASSERT(i != nullptr); switch (PropertiesList().indexOf(id)) { - case 0: // VAbstractTool::AttrName + case 0: // AttrName SetPointName(value.toString()); break; - case 4: // VAbstractTool::AttrLength + case 4: // AttrLength i->SetFormula(value.value()); break; - case 27: // VAbstractTool::AttrTypeColor + case 27: // AttrTypeColor i->SetLineColor(value.toString()); break; default: @@ -866,13 +866,13 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCutSpline(VProperty *property) SCASSERT(i != nullptr); switch (PropertiesList().indexOf(id)) { - case 0: // VAbstractTool::AttrName + case 0: // AttrName SetPointName(value.toString()); break; - case 4: // VAbstractTool::AttrLength + case 4: // AttrLength i->SetFormula(value.value()); break; - case 27: // VAbstractTool::AttrTypeColor + case 27: // AttrTypeColor i->SetLineColor(value.toString()); break; default: @@ -893,13 +893,13 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCutSplinePath(VProperty *propert SCASSERT(i != nullptr); switch (PropertiesList().indexOf(id)) { - case 0: // VAbstractTool::AttrName + case 0: // AttrName SetPointName(value.toString()); break; - case 4: // VAbstractTool::AttrLength + case 4: // AttrLength i->SetFormula(value.value()); break; - case 27: // VAbstractTool::AttrTypeColor + case 27: // AttrTypeColor i->SetLineColor(value.toString()); break; default: @@ -920,13 +920,13 @@ void VToolOptionsPropertyBrowser::ChangeDataToolHeight(VProperty *property) SCASSERT(i != nullptr); switch (PropertiesList().indexOf(id)) { - case 0: // VAbstractTool::AttrName + case 0: // AttrName SetPointName(value.toString()); break; - case 3: // VAbstractTool::AttrTypeLine + case 3: // AttrTypeLine i->SetTypeLine(value.toString()); break; - case 26: // VAbstractTool::AttrTypeLineColor + case 26: // AttrTypeLineColor i->SetLineColor(value.toString()); break; default: @@ -947,10 +947,10 @@ void VToolOptionsPropertyBrowser::ChangeDataToolLine(VProperty *property) SCASSERT(i != nullptr); switch (PropertiesList().indexOf(id)) { - case 3: // VAbstractTool::AttrTypeLine + case 3: // AttrTypeLine i->SetTypeLine(value.toString()); break; - case 26: // VAbstractTool::AttrTypeLineColor + case 26: // AttrTypeLineColor i->SetLineColor(value.toString()); break; default: @@ -969,7 +969,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolLineIntersect(VProperty *propert switch (PropertiesList().indexOf(id)) { - case 0: // VAbstractTool::AttrName + case 0: // AttrName SetPointName(value.toString()); break; default: @@ -990,19 +990,19 @@ void VToolOptionsPropertyBrowser::ChangeDataToolNormal(VProperty *property) SCASSERT(i != nullptr); switch (PropertiesList().indexOf(id)) { - case 4: // VAbstractTool::AttrLength + case 4: // AttrLength i->SetFormulaLength(value.value()); break; - case 0: // VAbstractTool::AttrName + case 0: // AttrName SetPointName(value.toString()); break; - case 5: // VAbstractTool::AttrAngle + case 5: // AttrAngle i->SetAngle(value.toDouble()); break; - case 3: // VAbstractTool::AttrTypeLine + case 3: // AttrTypeLine i->SetTypeLine(value.toString()); break; - case 26: // VAbstractTool::AttrTypeLineColor + case 26: // AttrTypeLineColor i->SetLineColor(value.toString()); break; default: @@ -1023,10 +1023,10 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfContact(VProperty *proper SCASSERT(i != nullptr); switch (PropertiesList().indexOf(id)) { - case 8: // VAbstractTool::AttrRadius + case 8: // AttrRadius i->setArcRadius(value.value()); break; - case 0: // VAbstractTool::AttrName + case 0: // AttrName SetPointName(value.toString()); break; default: @@ -1045,7 +1045,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersection(VProperty *p switch (PropertiesList().indexOf(id)) { - case 0: // VAbstractTool::AttrName + case 0: // AttrName SetPointName(value.toString()); break; default: @@ -1064,10 +1064,10 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionArcs(VPropert switch (PropertiesList().indexOf(id)) { - case 0: // VAbstractTool::AttrName + case 0: // AttrName SetPointName(value.toString()); break; - case 28: // VAbstractTool::AttrCrossPoint + case 28: // AttrCrossPoint { const QVariant value = property->data(VProperty::DPC_Data, Qt::EditRole); SetCrossCirclesPoint(value); @@ -1091,19 +1091,19 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionCircles(VProp SCASSERT(i != nullptr); switch (PropertiesList().indexOf(id)) { - case 0: // VAbstractTool::AttrName + case 0: // AttrName SetPointName(value.toString()); break; - case 28: // VAbstractTool::AttrCrossPoint + case 28: // AttrCrossPoint { const QVariant value = property->data(VProperty::DPC_Data, Qt::EditRole); SetCrossCirclesPoint(value); break; } - case 29: // VAbstractTool::AttrC1Radius + case 29: // AttrC1Radius i->SetFirstCircleRadius(value.value()); break; - case 30: // VAbstractTool::AttrC2Radius + case 30: // AttrC2Radius i->SetSecondCircleRadius(value.value()); break; default: @@ -1124,13 +1124,13 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointFromCircleAndTangent(VPrope SCASSERT(i != nullptr); switch (PropertiesList().indexOf(id)) { - case 0: // VAbstractTool::AttrName + case 0: // AttrName SetPointName(value.toString()); break; - case 31: // VAbstractTool::AttrCRadius + case 31: // AttrCRadius i->SetCircleRadius(value.value()); break; - case 28: // VAbstractTool::AttrCrossPoint + case 28: // AttrCrossPoint { const QVariant value = property->data(VProperty::DPC_Data, Qt::EditRole); SetCrossCirclesPoint(value); @@ -1152,10 +1152,10 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointFromArcAndTangent(VProperty switch (PropertiesList().indexOf(id)) { - case 0: // VAbstractTool::AttrName + case 0: // AttrName SetPointName(value.toString()); break; - case 28: // VAbstractTool::AttrCrossPoint + case 28: // AttrCrossPoint { const QVariant value = property->data(VProperty::DPC_Data, Qt::EditRole); SetCrossCirclesPoint(value); @@ -1179,16 +1179,16 @@ void VToolOptionsPropertyBrowser::ChangeDataToolShoulderPoint(VProperty *propert SCASSERT(i != nullptr); switch (PropertiesList().indexOf(id)) { - case 4: // VAbstractTool::AttrLength + case 4: // AttrLength i->SetFormulaLength(value.value()); break; - case 0: // VAbstractTool::AttrName + case 0: // AttrName SetPointName(value.toString()); break; - case 3: // VAbstractTool::AttrTypeLine + case 3: // AttrTypeLine i->SetTypeLine(value.toString()); break; - case 26: // VAbstractTool::AttrTypeLineColor + case 26: // AttrTypeLineColor i->SetLineColor(value.toString()); break; default: @@ -1209,14 +1209,14 @@ void VToolOptionsPropertyBrowser::ChangeDataToolSpline(VProperty *property) SCASSERT(i != nullptr); switch (PropertiesList().indexOf(id)) { - case 25: // VAbstractTool::AttrKCurve + case 25: // AttrKCurve { VSpline spl = i->getSpline(); spl.SetKcurve(value.toDouble()); i->setSpline(spl); break; } - case 27: // VAbstractTool::AttrTypeColor + case 27: // AttrTypeColor i->SetLineColor(value.toString()); break; default: @@ -1237,14 +1237,14 @@ void VToolOptionsPropertyBrowser::ChangeDataToolSplinePath(VProperty *property) SCASSERT(i != nullptr); switch (PropertiesList().indexOf(id)) { - case 25: // VAbstractTool::AttrKCurve + case 25: // AttrKCurve { VSplinePath splPath = i->getSplinePath(); splPath.SetKCurve(value.toDouble()); i->setSplinePath(splPath); break; } - case 27: // VAbstractTool::AttrTypeColor + case 27: // AttrTypeColor i->SetLineColor(value.toString()); break; default: @@ -1263,7 +1263,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolTriangle(VProperty *property) switch (PropertiesList().indexOf(id)) { - case 0: // VAbstractTool::AttrName + case 0: // AttrName SetPointName(value.toString()); break; default: @@ -1284,16 +1284,16 @@ void VToolOptionsPropertyBrowser::ChangeDataToolLineIntersectAxis(VProperty *pro SCASSERT(i != nullptr); switch (PropertiesList().indexOf(id)) { - case 0: // VAbstractTool::AttrName + case 0: // AttrName SetPointName(value.toString()); break; - case 3: // VAbstractTool::AttrTypeLine + case 3: // AttrTypeLine i->SetTypeLine(value.toString()); break; - case 26: // VAbstractTool::AttrTypeLineColor + case 26: // AttrTypeLineColor i->SetLineColor(value.toString()); break; - case 5: // VAbstractTool::AttrAngle + case 5: // AttrAngle i->SetFormulaAngle(value.value()); break; default: @@ -1314,16 +1314,16 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCurveIntersectAxis(VProperty *pr SCASSERT(i != nullptr); switch (PropertiesList().indexOf(id)) { - case 0: // VAbstractTool::AttrName + case 0: // AttrName SetPointName(value.toString()); break; - case 3: // VAbstractTool::AttrTypeLine + case 3: // AttrTypeLine i->SetTypeLine(value.toString()); break; - case 26: // VAbstractTool::AttrTypeLineColor + case 26: // AttrTypeLineColor i->SetLineColor(value.toString()); break; - case 5: // VAbstractTool::AttrAngle + case 5: // AttrAngle i->SetFormulaAngle(value.value()); break; default: @@ -1355,9 +1355,9 @@ 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); + AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), AttrLineColor); + AddPropertyFormula(tr("Length"), i->GetFormulaLength(), AttrLength); + AddPropertyFormula(tr("Angle"), i->GetFormulaAngle(), AttrAngle); } //--------------------------------------------------------------------------------------------------------------------- @@ -1369,8 +1369,8 @@ 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); + AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), AttrLineColor); + AddPropertyFormula(tr("Length"), i->GetFormulaLength(), AttrLength); } //--------------------------------------------------------------------------------------------------------------------- @@ -1380,10 +1380,10 @@ 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); - AddPropertyLineColor(i, tr("Color"), VAbstractTool::ColorsList(), VAbstractTool::AttrColor); + AddPropertyFormula(tr("Radius"), i->GetFormulaRadius(), AttrRadius); + AddPropertyFormula(tr("First angle"), i->GetFormulaF1(), AttrAngle1); + AddPropertyFormula(tr("Second angle"), i->GetFormulaF2(), AttrAngle2); + AddPropertyLineColor(i, tr("Color"), VAbstractTool::ColorsList(), AttrColor); } //--------------------------------------------------------------------------------------------------------------------- @@ -1393,10 +1393,10 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolArcWithLength(QGraphicsItem *it i->ShowVisualization(true); formView->setTitle(tr("Arc with given length")); - AddPropertyFormula(tr("Radius"), i->GetFormulaRadius(), VAbstractTool::AttrRadius); - AddPropertyFormula(tr("First angle"), i->GetFormulaF1(), VAbstractTool::AttrAngle1); - AddPropertyFormula(tr("Length"), i->GetFormulaLength(), VAbstractTool::AttrLength); - AddPropertyLineColor(i, tr("Color"), VAbstractTool::ColorsList(), VAbstractTool::AttrColor); + AddPropertyFormula(tr("Radius"), i->GetFormulaRadius(), AttrRadius); + AddPropertyFormula(tr("First angle"), i->GetFormulaF1(), AttrAngle1); + AddPropertyFormula(tr("Length"), i->GetFormulaLength(), AttrLength); + AddPropertyLineColor(i, tr("Color"), VAbstractTool::ColorsList(), AttrColor); } //--------------------------------------------------------------------------------------------------------------------- @@ -1408,8 +1408,8 @@ 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); + AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), AttrLineColor); + AddPropertyFormula(tr("Length"), i->GetFormulaLength(), AttrLength); } //--------------------------------------------------------------------------------------------------------------------- @@ -1431,8 +1431,8 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolCutArc(QGraphicsItem *item) formView->setTitle(tr("Cut arc tool")); AddPropertyPointName(i, tr("Point label")); - AddPropertyFormula(tr("Length"), i->GetFormula(), VAbstractTool::AttrLength); - AddPropertyLineColor(i, tr("Color"), VAbstractTool::ColorsList(), VAbstractTool::AttrColor); + AddPropertyFormula(tr("Length"), i->GetFormula(), AttrLength); + AddPropertyLineColor(i, tr("Color"), VAbstractTool::ColorsList(), AttrColor); } //--------------------------------------------------------------------------------------------------------------------- @@ -1443,8 +1443,8 @@ 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); - AddPropertyLineColor(i, tr("Color"), VAbstractTool::ColorsList(), VAbstractTool::AttrColor); + AddPropertyFormula(tr("Length"), i->GetFormula(), AttrLength); + AddPropertyLineColor(i, tr("Color"), VAbstractTool::ColorsList(), AttrColor); } //--------------------------------------------------------------------------------------------------------------------- @@ -1455,8 +1455,8 @@ 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); - AddPropertyLineColor(i, tr("Color"), VAbstractTool::ColorsList(), VAbstractTool::AttrColor); + AddPropertyFormula(tr("Length"), i->GetFormula(), AttrLength); + AddPropertyLineColor(i, tr("Color"), VAbstractTool::ColorsList(), AttrColor); } //--------------------------------------------------------------------------------------------------------------------- @@ -1468,7 +1468,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); + AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), AttrLineColor); } //--------------------------------------------------------------------------------------------------------------------- @@ -1479,9 +1479,9 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolLine(QGraphicsItem *item) formView->setTitle(tr("Line between points")); QMap styles = VAbstractTool::LineStylesPics(); - styles.remove(VAbstractTool::TypeLineNone); + styles.remove(TypeLineNone); AddPropertyLineType(i, tr("Line type"), styles); - AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), VAbstractTool::AttrLineColor); + AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), AttrLineColor); } //--------------------------------------------------------------------------------------------------------------------- @@ -1501,17 +1501,17 @@ 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(), AttrLength); AddPropertyPointName(i, tr("Point label")); AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); - AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), VAbstractTool::AttrLineColor); + AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), AttrLineColor); VDoubleProperty* itemAngle = new VDoubleProperty(tr("Additional angle degrees")); itemAngle->setValue(i->GetAngle()); itemAngle->setSetting("Min", -360); itemAngle->setSetting("Max", 360); itemAngle->setSetting("Precision", 3); - AddProperty(itemAngle, VAbstractTool::AttrAngle); + AddProperty(itemAngle, AttrAngle); } //--------------------------------------------------------------------------------------------------------------------- @@ -1522,7 +1522,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolPointOfContact(QGraphicsItem *i formView->setTitle(tr("Point at intersection of arc and line")); AddPropertyPointName(i, tr("Point label")); - AddPropertyFormula(tr("Radius"), i->getArcRadius(), VAbstractTool::AttrRadius); + AddPropertyFormula(tr("Radius"), i->getArcRadius(), AttrRadius); } //--------------------------------------------------------------------------------------------------------------------- @@ -1554,8 +1554,8 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolPointOfIntersectionCircles(QGra formView->setTitle(tr("Tool to make point from intersection two circles")); AddPropertyPointName(i, tr("Point label")); - AddPropertyFormula(tr("First circle radius"), i->GetFirstCircleRadius(), VAbstractTool::AttrC1Radius); - AddPropertyFormula(tr("Second circle radius"), i->GetSecondCircleRadius(), VAbstractTool::AttrC2Radius); + AddPropertyFormula(tr("First circle radius"), i->GetFirstCircleRadius(), AttrC1Radius); + AddPropertyFormula(tr("Second circle radius"), i->GetSecondCircleRadius(), AttrC2Radius); AddPropertyCrossPoint(i, tr("Take")); } @@ -1567,7 +1567,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolPointFromCircleAndTangent(QGrap formView->setTitle(tr("Tool to make point from circle and tangent")); AddPropertyPointName(i, tr("Point label")); - AddPropertyFormula(tr("Circle radius"), i->GetCircleRadius(), VAbstractTool::AttrCRadius); + AddPropertyFormula(tr("Circle radius"), i->GetCircleRadius(), AttrCRadius); AddPropertyCrossPoint(i, tr("Take")); } @@ -1591,8 +1591,8 @@ 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); + AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), AttrLineColor); + AddPropertyFormula(tr("Length"), i->GetFormulaLength(), AttrLength); } //--------------------------------------------------------------------------------------------------------------------- @@ -1609,8 +1609,8 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolSpline(QGraphicsItem *item) itemFactor->setSetting("Step", 0.01); itemFactor->setSetting("Precision", 3); itemFactor->setValue(spl.GetKcurve()); - AddProperty(itemFactor, VAbstractTool::AttrKCurve); - AddPropertyLineColor(i, tr("Color"), VAbstractTool::ColorsList(), VAbstractTool::AttrColor); + AddProperty(itemFactor, AttrKCurve); + AddPropertyLineColor(i, tr("Color"), VAbstractTool::ColorsList(), AttrColor); } //--------------------------------------------------------------------------------------------------------------------- @@ -1627,8 +1627,8 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolSplinePath(QGraphicsItem *item) itemFactor->setSetting("Step", 0.01); itemFactor->setSetting("Precision", 3); itemFactor->setValue(splPath.GetKCurve()); - AddProperty(itemFactor, VAbstractTool::AttrKCurve); - AddPropertyLineColor(i, tr("Color"), VAbstractTool::ColorsList(), VAbstractTool::AttrColor); + AddProperty(itemFactor, AttrKCurve); + AddPropertyLineColor(i, tr("Color"), VAbstractTool::ColorsList(), AttrColor); } //--------------------------------------------------------------------------------------------------------------------- @@ -1650,8 +1650,8 @@ 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); + AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), AttrLineColor); + AddPropertyFormula(tr("Angle"), i->GetFormulaAngle(), AttrAngle); } //--------------------------------------------------------------------------------------------------------------------- @@ -1663,15 +1663,15 @@ 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); + AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), AttrLineColor); + AddPropertyFormula(tr("Angle"), i->GetFormulaAngle(), AttrAngle); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolSinglePoint() { VToolBasePoint *i = qgraphicsitem_cast(currentItem); - idToProperty[VAbstractTool::AttrName]->setValue(i->name()); + idToProperty[AttrName]->setValue(i->name()); idToProperty[QLatin1String("position")]->setValue(i->pos()); } @@ -1679,46 +1679,46 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolSinglePoint() void VToolOptionsPropertyBrowser::UpdateOptionsToolEndLine() { VToolEndLine *i = qgraphicsitem_cast(currentItem); - idToProperty[VAbstractTool::AttrName]->setValue(i->name()); + idToProperty[AttrName]->setValue(i->name()); { const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); - idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); + idToProperty[AttrTypeLine]->setValue(index); } { const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); - idToProperty[VAbstractTool::AttrLineColor]->setValue(index); + idToProperty[AttrLineColor]->setValue(index); } QVariant valueFormula; valueFormula.setValue(i->GetFormulaLength()); - idToProperty[VAbstractTool::AttrLength]->setValue(valueFormula); + idToProperty[AttrLength]->setValue(valueFormula); QVariant valueAngle; valueAngle.setValue(i->GetFormulaAngle()); - idToProperty[VAbstractTool::AttrAngle]->setValue(valueAngle); + idToProperty[AttrAngle]->setValue(valueAngle); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolAlongLine() { VToolAlongLine *i = qgraphicsitem_cast(currentItem); - idToProperty[VAbstractTool::AttrName]->setValue(i->name()); + idToProperty[AttrName]->setValue(i->name()); { const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); - idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); + idToProperty[AttrTypeLine]->setValue(index); } { const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); - idToProperty[VAbstractTool::AttrLineColor]->setValue(index); + idToProperty[AttrLineColor]->setValue(index); } QVariant valueFormula; valueFormula.setValue(i->GetFormulaLength()); - idToProperty[VAbstractTool::AttrLength]->setValue(valueFormula); + idToProperty[AttrLength]->setValue(valueFormula); } //--------------------------------------------------------------------------------------------------------------------- @@ -1728,18 +1728,18 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolArc() QVariant valueRadius; valueRadius.setValue(i->GetFormulaRadius()); - idToProperty[VAbstractTool::AttrRadius]->setValue(valueRadius); + idToProperty[AttrRadius]->setValue(valueRadius); QVariant valueFirstAngle; valueFirstAngle.setValue(i->GetFormulaF1()); - idToProperty[VAbstractTool::AttrAngle1]->setValue(valueFirstAngle); + idToProperty[AttrAngle1]->setValue(valueFirstAngle); QVariant valueSecondAngle; valueSecondAngle.setValue(i->GetFormulaF2()); - idToProperty[VAbstractTool::AttrAngle2]->setValue(valueSecondAngle); + idToProperty[AttrAngle2]->setValue(valueSecondAngle); const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); - idToProperty[VAbstractTool::AttrColor]->setValue(index); + idToProperty[AttrColor]->setValue(index); } //--------------------------------------------------------------------------------------------------------------------- @@ -1749,18 +1749,18 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolArcWithLength() QVariant valueRadius; valueRadius.setValue(i->GetFormulaRadius()); - idToProperty[VAbstractTool::AttrRadius]->setValue(valueRadius); + idToProperty[AttrRadius]->setValue(valueRadius); QVariant valueFirstAngle; valueFirstAngle.setValue(i->GetFormulaF1()); - idToProperty[VAbstractTool::AttrAngle1]->setValue(valueFirstAngle); + idToProperty[AttrAngle1]->setValue(valueFirstAngle); QVariant valueLength; valueLength.setValue(i->GetFormulaLength()); - idToProperty[VAbstractTool::AttrLength]->setValue(valueLength); + idToProperty[AttrLength]->setValue(valueLength); const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); - idToProperty[VAbstractTool::AttrColor]->setValue(index); + idToProperty[AttrColor]->setValue(index); } //--------------------------------------------------------------------------------------------------------------------- @@ -1768,20 +1768,20 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolBisector() { VToolBisector *i = qgraphicsitem_cast(currentItem); - idToProperty[VAbstractTool::AttrName]->setValue(i->name()); + idToProperty[AttrName]->setValue(i->name()); QVariant valueFormula; valueFormula.setValue(i->GetFormulaLength()); - idToProperty[VAbstractTool::AttrLength]->setValue(valueFormula); + idToProperty[AttrLength]->setValue(valueFormula); { const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); - idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); + idToProperty[AttrTypeLine]->setValue(index); } { const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); - idToProperty[VAbstractTool::AttrLineColor]->setValue(index); + idToProperty[AttrLineColor]->setValue(index); } } @@ -1790,8 +1790,8 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolTrueDarts() { VToolTrueDarts *i = qgraphicsitem_cast(currentItem); - idToProperty[VAbstractTool::AttrName1]->setValue(i->nameP1()); - idToProperty[VAbstractTool::AttrName2]->setValue(i->nameP2()); + idToProperty[AttrName1]->setValue(i->nameP1()); + idToProperty[AttrName2]->setValue(i->nameP2()); } //--------------------------------------------------------------------------------------------------------------------- @@ -1799,14 +1799,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolCutArc() { VToolCutArc *i = qgraphicsitem_cast(currentItem); - idToProperty[VAbstractTool::AttrName]->setValue(i->name()); + idToProperty[AttrName]->setValue(i->name()); QVariant valueFormula; valueFormula.setValue(i->GetFormula()); - idToProperty[VAbstractTool::AttrLength]->setValue(valueFormula); + idToProperty[AttrLength]->setValue(valueFormula); const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); - idToProperty[VAbstractTool::AttrColor]->setValue(index); + idToProperty[AttrColor]->setValue(index); } //--------------------------------------------------------------------------------------------------------------------- @@ -1814,14 +1814,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolCutSpline() { VToolCutSpline *i = qgraphicsitem_cast(currentItem); - idToProperty[VAbstractTool::AttrName]->setValue(i->name()); + idToProperty[AttrName]->setValue(i->name()); QVariant valueFormula; valueFormula.setValue(i->GetFormula()); - idToProperty[VAbstractTool::AttrLength]->setValue(valueFormula); + idToProperty[AttrLength]->setValue(valueFormula); const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); - idToProperty[VAbstractTool::AttrColor]->setValue(index); + idToProperty[AttrColor]->setValue(index); } //--------------------------------------------------------------------------------------------------------------------- @@ -1829,14 +1829,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolCutSplinePath() { VToolCutSplinePath *i = qgraphicsitem_cast(currentItem); - idToProperty[VAbstractTool::AttrName]->setValue(i->name()); + idToProperty[AttrName]->setValue(i->name()); QVariant valueFormula; valueFormula.setValue(i->GetFormula()); - idToProperty[VAbstractTool::AttrLength]->setValue(valueFormula); + idToProperty[AttrLength]->setValue(valueFormula); const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); - idToProperty[VAbstractTool::AttrColor]->setValue(index); + idToProperty[AttrColor]->setValue(index); } //--------------------------------------------------------------------------------------------------------------------- @@ -1844,16 +1844,16 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolHeight() { VToolHeight *i = qgraphicsitem_cast(currentItem); - idToProperty[VAbstractTool::AttrName]->setValue(i->name()); + idToProperty[AttrName]->setValue(i->name()); { const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); - idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); + idToProperty[AttrTypeLine]->setValue(index); } { const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); - idToProperty[VAbstractTool::AttrLineColor]->setValue(index); + idToProperty[AttrLineColor]->setValue(index); } } @@ -1864,12 +1864,12 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolLine() { const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); - idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); + idToProperty[AttrTypeLine]->setValue(index); } { const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); - idToProperty[VAbstractTool::AttrLineColor]->setValue(index); + idToProperty[AttrLineColor]->setValue(index); } } @@ -1878,7 +1878,7 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolLineIntersect() { VToolLineIntersect *i = qgraphicsitem_cast(currentItem); - idToProperty[VAbstractTool::AttrName]->setValue(i->name()); + idToProperty[AttrName]->setValue(i->name()); } //--------------------------------------------------------------------------------------------------------------------- @@ -1888,20 +1888,20 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolNormal() QVariant valueFormula; valueFormula.setValue(i->GetFormulaLength()); - idToProperty[VAbstractTool::AttrLength]->setValue(valueFormula); + idToProperty[AttrLength]->setValue(valueFormula); - idToProperty[VAbstractTool::AttrName]->setValue(i->name()); + idToProperty[AttrName]->setValue(i->name()); - idToProperty[VAbstractTool::AttrAngle]->setValue( i->GetAngle()); + idToProperty[AttrAngle]->setValue( i->GetAngle()); { const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); - idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); + idToProperty[AttrTypeLine]->setValue(index); } { const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); - idToProperty[VAbstractTool::AttrLineColor]->setValue(index); + idToProperty[AttrLineColor]->setValue(index); } } @@ -1912,9 +1912,9 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolPointOfContact() QVariant valueFormula; valueFormula.setValue(i->getArcRadius()); - idToProperty[VAbstractTool::AttrRadius]->setValue(valueFormula); + idToProperty[AttrRadius]->setValue(valueFormula); - idToProperty[VAbstractTool::AttrName]->setValue(i->name()); + idToProperty[AttrName]->setValue(i->name()); } //--------------------------------------------------------------------------------------------------------------------- @@ -1922,7 +1922,7 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolPointOfIntersection() { VToolPointOfIntersection *i = qgraphicsitem_cast(currentItem); - idToProperty[VAbstractTool::AttrName]->setValue(i->name()); + idToProperty[AttrName]->setValue(i->name()); } //--------------------------------------------------------------------------------------------------------------------- @@ -1930,8 +1930,8 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolPointOfIntersectionArcs() { VToolPointOfIntersectionArcs *i = qgraphicsitem_cast(currentItem); - idToProperty[VAbstractTool::AttrName]->setValue(i->name()); - idToProperty[VAbstractTool::AttrCrossPoint]->setValue(static_cast(i->GetCrossCirclesPoint())-1); + idToProperty[AttrName]->setValue(i->name()); + idToProperty[AttrCrossPoint]->setValue(static_cast(i->GetCrossCirclesPoint())-1); } //--------------------------------------------------------------------------------------------------------------------- @@ -1939,16 +1939,16 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolPointOfIntersectionCircles() { VToolPointOfIntersectionCircles *i = qgraphicsitem_cast(currentItem); - idToProperty[VAbstractTool::AttrName]->setValue(i->name()); - idToProperty[VAbstractTool::AttrCrossPoint]->setValue(static_cast(i->GetCrossCirclesPoint())-1); + idToProperty[AttrName]->setValue(i->name()); + idToProperty[AttrCrossPoint]->setValue(static_cast(i->GetCrossCirclesPoint())-1); QVariant c1Radius; c1Radius.setValue(i->GetFirstCircleRadius()); - idToProperty[VAbstractTool::AttrC1Radius]->setValue(c1Radius); + idToProperty[AttrC1Radius]->setValue(c1Radius); QVariant c2Radius; c2Radius.setValue(i->GetSecondCircleRadius()); - idToProperty[VAbstractTool::AttrC2Radius]->setValue(c2Radius); + idToProperty[AttrC2Radius]->setValue(c2Radius); } //--------------------------------------------------------------------------------------------------------------------- @@ -1956,12 +1956,12 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolPointFromCircleAndTangent() { VToolPointFromCircleAndTangent *i = qgraphicsitem_cast(currentItem); - idToProperty[VAbstractTool::AttrName]->setValue(i->name()); - idToProperty[VAbstractTool::AttrCrossPoint]->setValue(static_cast(i->GetCrossCirclesPoint())-1); + idToProperty[AttrName]->setValue(i->name()); + idToProperty[AttrCrossPoint]->setValue(static_cast(i->GetCrossCirclesPoint())-1); QVariant cRadius; cRadius.setValue(i->GetCircleRadius()); - idToProperty[VAbstractTool::AttrCRadius]->setValue(cRadius); + idToProperty[AttrCRadius]->setValue(cRadius); } //--------------------------------------------------------------------------------------------------------------------- @@ -1969,8 +1969,8 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolPointFromArcAndTangent() { VToolPointFromArcAndTangent *i = qgraphicsitem_cast(currentItem); - idToProperty[VAbstractTool::AttrName]->setValue(i->name()); - idToProperty[VAbstractTool::AttrCrossPoint]->setValue(static_cast(i->GetCrossCirclesPoint())-1); + idToProperty[AttrName]->setValue(i->name()); + idToProperty[AttrCrossPoint]->setValue(static_cast(i->GetCrossCirclesPoint())-1); } //--------------------------------------------------------------------------------------------------------------------- @@ -1980,18 +1980,18 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolShoulderPoint() QVariant valueFormula; valueFormula.setValue(i->GetFormulaLength()); - idToProperty[VAbstractTool::AttrLength]->setValue(valueFormula); + idToProperty[AttrLength]->setValue(valueFormula); - idToProperty[VAbstractTool::AttrName]->setValue(i->name()); + idToProperty[AttrName]->setValue(i->name()); { const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); - idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); + idToProperty[AttrTypeLine]->setValue(index); } { const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); - idToProperty[VAbstractTool::AttrLineColor]->setValue(index); + idToProperty[AttrLineColor]->setValue(index); } } @@ -2001,10 +2001,10 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolSpline() VToolSpline *i = qgraphicsitem_cast(currentItem); VSpline spl = i->getSpline(); - idToProperty[VAbstractTool::AttrKCurve]->setValue(spl.GetKcurve()); + idToProperty[AttrKCurve]->setValue(spl.GetKcurve()); const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); - idToProperty[VAbstractTool::AttrColor]->setValue(index); + idToProperty[AttrColor]->setValue(index); } //--------------------------------------------------------------------------------------------------------------------- @@ -2013,10 +2013,10 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolSplinePath() VToolSplinePath *i = qgraphicsitem_cast(currentItem); VSplinePath splPath = i->getSplinePath(); - idToProperty[VAbstractTool::AttrKCurve]->setValue(splPath.GetKCurve()); + idToProperty[AttrKCurve]->setValue(splPath.GetKCurve()); const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); - idToProperty[VAbstractTool::AttrColor]->setValue(index); + idToProperty[AttrColor]->setValue(index); } //--------------------------------------------------------------------------------------------------------------------- @@ -2024,87 +2024,87 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolTriangle() { VToolTriangle *i = qgraphicsitem_cast(currentItem); - idToProperty[VAbstractTool::AttrName]->setValue(i->name()); + idToProperty[AttrName]->setValue(i->name()); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolLineIntersectAxis() { VToolLineIntersectAxis *i = qgraphicsitem_cast(currentItem); - idToProperty[VAbstractTool::AttrName]->setValue(i->name()); + idToProperty[AttrName]->setValue(i->name()); { const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); - idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); + idToProperty[AttrTypeLine]->setValue(index); } { const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); - idToProperty[VAbstractTool::AttrLineColor]->setValue(index); + idToProperty[AttrLineColor]->setValue(index); } QVariant valueAngle; valueAngle.setValue(i->GetFormulaAngle()); - idToProperty[VAbstractTool::AttrAngle]->setValue(valueAngle); + idToProperty[AttrAngle]->setValue(valueAngle); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolCurveIntersectAxis() { VToolCurveIntersectAxis *i = qgraphicsitem_cast(currentItem); - idToProperty[VAbstractTool::AttrName]->setValue(i->name()); + idToProperty[AttrName]->setValue(i->name()); { const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); - idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); + idToProperty[AttrTypeLine]->setValue(index); } { const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); - idToProperty[VAbstractTool::AttrLineColor]->setValue(index); + idToProperty[AttrLineColor]->setValue(index); } QVariant valueAngle; valueAngle.setValue(i->GetFormulaAngle()); - idToProperty[VAbstractTool::AttrAngle]->setValue(valueAngle); + idToProperty[AttrAngle]->setValue(valueAngle); } //--------------------------------------------------------------------------------------------------------------------- QStringList VToolOptionsPropertyBrowser::PropertiesList() const { - QStringList attr = QStringList() << VAbstractTool::AttrName /* 0 */ + QStringList attr = QStringList() << AttrName /* 0 */ << QLatin1String("position") /* 1 */ - << VAbstractTool::AttrBasePoint /* 2 */ - << VAbstractTool::AttrTypeLine /* 3 */ - << VAbstractTool::AttrLength /* 4 */ - << VAbstractTool::AttrAngle /* 5 */ - << VAbstractTool::AttrFirstPoint /* 6 */ - << VAbstractTool::AttrSecondPoint /* 7 */ - << VAbstractTool::AttrRadius /* 8 */ - << VAbstractTool::AttrAngle1 /* 9 */ - << VAbstractTool::AttrAngle2 /* 10 */ - << VAbstractTool::AttrCenter /* 11 */ - << VAbstractTool::AttrThirdPoint /* 12 */ - << VToolCutArc::AttrArc /* 13 */ + << AttrBasePoint /* 2 */ + << AttrTypeLine /* 3 */ + << AttrLength /* 4 */ + << AttrAngle /* 5 */ + << AttrFirstPoint /* 6 */ + << AttrSecondPoint /* 7 */ + << AttrRadius /* 8 */ + << AttrAngle1 /* 9 */ + << AttrAngle2 /* 10 */ + << AttrCenter /* 11 */ + << AttrThirdPoint /* 12 */ + << AttrArc /* 13 */ << VToolCutSpline::AttrSpline /* 14 */ << VToolCutSplinePath::AttrSplinePath /* 15 */ - << VAbstractTool::AttrP1Line /* 16 */ - << VAbstractTool::AttrP2Line /* 17 */ - << VAbstractTool::AttrP1Line1 /* 18 */ - << VAbstractTool::AttrP2Line1 /* 19 */ - << VAbstractTool::AttrP1Line2 /* 20 */ - << VAbstractTool::AttrP2Line2 /* 21 */ - << VAbstractTool::AttrPShoulder /* 22 */ - << VAbstractTool::AttrAxisP1 /* 23 */ - << VAbstractTool::AttrAxisP2 /* 24 */ - << VAbstractTool::AttrKCurve /* 25 */ - << VAbstractTool::AttrLineColor /* 26 */ - << VAbstractTool::AttrColor /* 27 */ - << VAbstractTool::AttrCrossPoint /* 28 */ - << VAbstractTool::AttrC1Radius /* 29 */ - << VAbstractTool::AttrC2Radius /* 30 */ - << VAbstractTool::AttrCRadius /* 31 */ - << VAbstractTool::AttrName1 /* 32 */ - << VAbstractTool::AttrName2; /* 33 */ + << AttrP1Line /* 16 */ + << AttrP2Line /* 17 */ + << AttrP1Line1 /* 18 */ + << AttrP2Line1 /* 19 */ + << AttrP1Line2 /* 20 */ + << AttrP2Line2 /* 21 */ + << AttrPShoulder /* 22 */ + << AttrAxisP1 /* 23 */ + << AttrAxisP2 /* 24 */ + << AttrKCurve /* 25 */ + << AttrLineColor /* 26 */ + << AttrColor /* 27 */ + << AttrCrossPoint /* 28 */ + << AttrC1Radius /* 29 */ + << AttrC2Radius /* 30 */ + << AttrCRadius /* 31 */ + << AttrName1 /* 32 */ + << AttrName2; /* 33 */ return attr; } diff --git a/src/app/valentina/dialogs/dialoghistory.cpp b/src/app/valentina/dialogs/dialoghistory.cpp index d57fbfb31..8359d4864 100644 --- a/src/app/valentina/dialogs/dialoghistory.cpp +++ b/src/app/valentina/dialogs/dialoghistory.cpp @@ -220,20 +220,20 @@ QString DialogHistory::Record(const VToolRecord &tool) case Tool::EndLine: { return QString(tr("%1_%2 - Line from point %1 to point %2")) - .arg(PointName(AttrUInt(domElem, VAbstractTool::AttrBasePoint))) + .arg(PointName(AttrUInt(domElem, AttrBasePoint))) .arg(PointName(tool.getId())); } case Tool::Line: { return QString(tr("%1_%2 - Line from point %1 to point %2")) - .arg(PointName(AttrUInt(domElem, VAbstractTool::AttrFirstPoint))) - .arg(PointName(AttrUInt(domElem, VAbstractTool::AttrSecondPoint))); + .arg(PointName(AttrUInt(domElem, AttrFirstPoint))) + .arg(PointName(AttrUInt(domElem, AttrSecondPoint))); } case Tool::AlongLine: { return QString(tr("%3 - Point along line %1_%2")) - .arg(PointName(AttrUInt(domElem, VAbstractTool::AttrFirstPoint))) - .arg(PointName(AttrUInt(domElem, VAbstractTool::AttrSecondPoint))) + .arg(PointName(AttrUInt(domElem, AttrFirstPoint))) + .arg(PointName(AttrUInt(domElem, AttrSecondPoint))) .arg(PointName(tool.getId())); } case Tool::ShoulderPoint: @@ -243,25 +243,25 @@ QString DialogHistory::Record(const VToolRecord &tool) case Tool::Normal: { return QString(tr("%3 - normal to line %1_%2")) - .arg(PointName(AttrUInt(domElem, VAbstractTool::AttrFirstPoint))) - .arg(PointName(AttrUInt(domElem, VAbstractTool::AttrSecondPoint))) + .arg(PointName(AttrUInt(domElem, AttrFirstPoint))) + .arg(PointName(AttrUInt(domElem, AttrSecondPoint))) .arg(PointName(tool.getId())); } case Tool::Bisector: { return QString(tr("%4 - bisector of angle %1_%2_%3")) - .arg(PointName(AttrUInt(domElem, VAbstractTool::AttrFirstPoint))) - .arg(PointName(AttrUInt(domElem, VAbstractTool::AttrSecondPoint))) - .arg(PointName(AttrUInt(domElem, VAbstractTool::AttrThirdPoint))) + .arg(PointName(AttrUInt(domElem, AttrFirstPoint))) + .arg(PointName(AttrUInt(domElem, AttrSecondPoint))) + .arg(PointName(AttrUInt(domElem, AttrThirdPoint))) .arg(PointName(tool.getId())); } case Tool::LineIntersect: { return QString(tr("%5 - intersection of lines %1_%2 and %3_%4")) - .arg(PointName(AttrUInt(domElem, VAbstractTool::AttrP1Line1))) - .arg(PointName(AttrUInt(domElem, VAbstractTool::AttrP2Line1))) - .arg(PointName(AttrUInt(domElem, VAbstractTool::AttrP1Line2))) - .arg(PointName(AttrUInt(domElem, VAbstractTool::AttrP2Line2))) + .arg(PointName(AttrUInt(domElem, AttrP1Line1))) + .arg(PointName(AttrUInt(domElem, AttrP2Line1))) + .arg(PointName(AttrUInt(domElem, AttrP1Line2))) + .arg(PointName(AttrUInt(domElem, AttrP2Line2))) .arg(PointName(tool.getId())); } case Tool::Spline: @@ -308,36 +308,36 @@ QString DialogHistory::Record(const VToolRecord &tool) case Tool::PointOfContact: { return QString(tr("%4 - point of contact of arc with the center in point %1 and line %2_%3")) - .arg(PointName(AttrUInt(domElem, VAbstractTool::AttrCenter))) - .arg(PointName(AttrUInt(domElem, VAbstractTool::AttrFirstPoint))) - .arg(PointName(AttrUInt(domElem, VAbstractTool::AttrSecondPoint))) + .arg(PointName(AttrUInt(domElem, AttrCenter))) + .arg(PointName(AttrUInt(domElem, AttrFirstPoint))) + .arg(PointName(AttrUInt(domElem, AttrSecondPoint))) .arg(PointName(tool.getId())); } case Tool::Height: { return QString(tr("Point of perpendicular from point %1 to line %2_%3")) - .arg(PointName(AttrUInt(domElem, VAbstractTool::AttrBasePoint))) - .arg(PointName(AttrUInt(domElem, VAbstractTool::AttrP1Line))) - .arg(PointName(AttrUInt(domElem, VAbstractTool::AttrP2Line))); + .arg(PointName(AttrUInt(domElem, AttrBasePoint))) + .arg(PointName(AttrUInt(domElem, AttrP1Line))) + .arg(PointName(AttrUInt(domElem, AttrP2Line))); } case Tool::Triangle: { return QString(tr("Triangle: axis %1_%2, points %3 and %4")) - .arg(PointName(AttrUInt(domElem, VAbstractTool::AttrAxisP1))) - .arg(PointName(AttrUInt(domElem, VAbstractTool::AttrAxisP2))) - .arg(PointName(AttrUInt(domElem, VAbstractTool::AttrFirstPoint))) - .arg(PointName(AttrUInt(domElem, VAbstractTool::AttrSecondPoint))); + .arg(PointName(AttrUInt(domElem, AttrAxisP1))) + .arg(PointName(AttrUInt(domElem, AttrAxisP2))) + .arg(PointName(AttrUInt(domElem, AttrFirstPoint))) + .arg(PointName(AttrUInt(domElem, AttrSecondPoint))); } case Tool::PointOfIntersection: { return QString(tr("%1 - point of intersection %2 and %3")) .arg(PointName(tool.getId())) - .arg(PointName(AttrUInt(domElem, VAbstractTool::AttrFirstPoint))) - .arg(PointName(AttrUInt(domElem, VAbstractTool::AttrSecondPoint))); + .arg(PointName(AttrUInt(domElem, AttrFirstPoint))) + .arg(PointName(AttrUInt(domElem, AttrSecondPoint))); } case Tool::CutArc: { - const QSharedPointer arc = data->GeometricObject(AttrUInt(domElem, VToolCutArc::AttrArc)); + const QSharedPointer arc = data->GeometricObject(AttrUInt(domElem, AttrArc)); SCASSERT(arc != nullptr); return QString(tr("%1 - cut arc with center %2")) .arg(PointName(tool.getId())) @@ -381,15 +381,15 @@ QString DialogHistory::Record(const VToolRecord &tool) { return QString(tr("%1 - point of intersection line %2_%3 and axis through point %4")) .arg(PointName(tool.getId())) - .arg(PointName(AttrUInt(domElem, VAbstractTool::AttrP1Line))) - .arg(PointName(AttrUInt(domElem, VAbstractTool::AttrP2Line))) - .arg(PointName(AttrUInt(domElem, VAbstractTool::AttrBasePoint))); + .arg(PointName(AttrUInt(domElem, AttrP1Line))) + .arg(PointName(AttrUInt(domElem, AttrP2Line))) + .arg(PointName(AttrUInt(domElem, AttrBasePoint))); } case Tool::CurveIntersectAxis: { return QString(tr("%1 - point of intersection curve and axis through point %2")) .arg(PointName(tool.getId())) - .arg(PointName(AttrUInt(domElem, VAbstractTool::AttrBasePoint))); + .arg(PointName(AttrUInt(domElem, AttrBasePoint))); } case Tool::PointOfIntersectionArcs: { @@ -410,9 +410,9 @@ QString DialogHistory::Record(const VToolRecord &tool) case Tool::TrueDarts: { return QString(tr("Correction the dart %1_%2_%3")) - .arg(PointName(AttrUInt(domElem, VAbstractTool::AttrDartP1))) - .arg(PointName(AttrUInt(domElem, VAbstractTool::AttrDartP2))) - .arg(PointName(AttrUInt(domElem, VAbstractTool::AttrDartP2))); + .arg(PointName(AttrUInt(domElem, AttrDartP1))) + .arg(PointName(AttrUInt(domElem, AttrDartP2))) + .arg(PointName(AttrUInt(domElem, AttrDartP2))); } //Because "history" not only show history of pattern, but help restore current data for each pattern's //piece, we need add record about details and nodes, but don't show them. diff --git a/src/app/valentina/valentina.pro b/src/app/valentina/valentina.pro index 224c1406c..d2e7df82e 100644 --- a/src/app/valentina/valentina.pro +++ b/src/app/valentina/valentina.pro @@ -1991,7 +1991,7 @@ for(DIR, INSTALL_STANDARD_MEASHUREMENTS) { copyToDestdir($$st_path, $$shell_path($${OUT_PWD}/$$DESTDIR/tables/standard)) # When the GNU linker sees a library, it discards all symbols that it doesn't need. -# Add dependent library the first. +# Dependent library go first. #VTools static library (depend on VWidgets, VMisc, VPatternDB) unix|win32: LIBS += -L$$OUT_PWD/../../libs/vtools/$${DESTDIR}/ -lvtools @@ -2021,15 +2021,6 @@ DEPENDPATH += $$PWD/../../libs/vpatterndb win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vpatterndb/$${DESTDIR}/vpatterndb.lib else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vpatterndb/$${DESTDIR}/libvpatterndb.a -#VMisc static library -unix|win32: LIBS += -L$$OUT_PWD/../../libs/vmisc/$${DESTDIR}/ -lvmisc - -INCLUDEPATH += $$PWD/../../libs/vmisc -DEPENDPATH += $$PWD/../../libs/vmisc - -win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vmisc/$${DESTDIR}/vmisc.lib -else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vmisc/$${DESTDIR}/libvmisc.a - # VGeometry static library (depend on ifc) unix|win32: LIBS += -L$$OUT_PWD/../../libs/vgeometry/$${DESTDIR}/ -lvgeometry @@ -2039,7 +2030,7 @@ DEPENDPATH += $$PWD/../../libs/vgeometry win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vgeometry/$${DESTDIR}/vgeometry.lib else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vgeometry/$${DESTDIR}/libvgeometry.a -# IFC static library +# IFC static library (depend on QMuParser, VMisc) unix|win32: LIBS += -L$$OUT_PWD/../../libs/ifc/$${DESTDIR}/ -lifc INCLUDEPATH += $$PWD/../../libs/ifc @@ -2048,6 +2039,15 @@ DEPENDPATH += $$PWD/../../libs/ifc win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/ifc/$${DESTDIR}/ifc.lib else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/ifc/$${DESTDIR}/libifc.a +#VMisc static library +unix|win32: LIBS += -L$$OUT_PWD/../../libs/vmisc/$${DESTDIR}/ -lvmisc + +INCLUDEPATH += $$PWD/../../libs/vmisc +DEPENDPATH += $$PWD/../../libs/vmisc + +win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vmisc/$${DESTDIR}/vmisc.lib +else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vmisc/$${DESTDIR}/libvmisc.a + # VObj static library unix|win32: LIBS += -L$$OUT_PWD/../../libs/vobj/$${DESTDIR}/ -lvobj diff --git a/src/app/valentina/xml/vpattern.cpp b/src/app/valentina/xml/vpattern.cpp index 48b015452..9dd96d265 100644 --- a/src/app/valentina/xml/vpattern.cpp +++ b/src/app/valentina/xml/vpattern.cpp @@ -532,9 +532,9 @@ void VPattern::ParseDetailElement(const QDomElement &domElement, const Document { VDetail detail; const quint32 id = GetParametrId(domElement); - detail.setName(GetParametrString(domElement, VAbstractTool::AttrName, "")); - detail.setMx(qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMx, "0.0"))); - detail.setMy(qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMy, "0.0"))); + detail.setName(GetParametrString(domElement, AttrName, "")); + detail.setMx(qApp->toPixel(GetParametrDouble(domElement, AttrMx, "0.0"))); + detail.setMy(qApp->toPixel(GetParametrDouble(domElement, AttrMy, "0.0"))); detail.setSeamAllowance(GetParametrUInt(domElement, VToolDetail::AttrSupplement, "1")); detail.setWidth(GetParametrDouble(domElement, VToolDetail::AttrWidth, "10.0")); detail.setClosed(GetParametrUInt(domElement, VToolDetail::AttrClosed, "1")); @@ -551,8 +551,8 @@ void VPattern::ParseDetailElement(const QDomElement &domElement, const Document if (element.tagName() == VToolDetail::TagNode) { const quint32 id = GetParametrUInt(element, VToolDetail::AttrIdObject, NULL_ID_STR); - const qreal mx = qApp->toPixel(GetParametrDouble(element, VAbstractTool::AttrMx, "0.0")); - const qreal my = qApp->toPixel(GetParametrDouble(element, VAbstractTool::AttrMy, "0.0")); + const qreal mx = qApp->toPixel(GetParametrDouble(element, AttrMx, "0.0")); + const qreal my = qApp->toPixel(GetParametrDouble(element, AttrMy, "0.0")); const bool reverse = GetParametrUInt(element, VToolDetail::AttrReverse, "0"); const NodeDetail nodeType = NodeDetail::Contour; @@ -624,23 +624,23 @@ void VPattern::PointsCommonAttributes(const QDomElement &domElement, quint32 &id QString &typeLine, QString &lineColor) { PointsCommonAttributes(domElement, id, name, mx, my); - typeLine = GetParametrString(domElement, VAbstractTool::AttrTypeLine, VAbstractTool::TypeLineLine); - lineColor = GetParametrString(domElement, VAbstractTool::AttrLineColor, VAbstractTool::ColorBlack); + typeLine = GetParametrString(domElement, AttrTypeLine, TypeLineLine); + lineColor = GetParametrString(domElement, AttrLineColor, ColorBlack); } //--------------------------------------------------------------------------------------------------------------------- void VPattern::PointsCommonAttributes(const QDomElement &domElement, quint32 &id, QString &name, qreal &mx, qreal &my) { PointsCommonAttributes(domElement, id, mx, my); - name = GetParametrString(domElement, VAbstractTool::AttrName, "A"); + name = GetParametrString(domElement, AttrName, "A"); } //--------------------------------------------------------------------------------------------------------------------- void VPattern::PointsCommonAttributes(const QDomElement &domElement, quint32 &id, qreal &mx, qreal &my) { ToolsCommonAttributes(domElement, id); - mx = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMx, "10.0")); - my = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMy, "15.0")); + mx = qApp->toPixel(GetParametrDouble(domElement, AttrMx, "10.0")); + my = qApp->toPixel(GetParametrDouble(domElement, AttrMy, "15.0")); } //--------------------------------------------------------------------------------------------------------------------- @@ -770,12 +770,12 @@ void VPattern::ParseLineElement(VMainGraphicsScene *scene, const QDomElement &do { quint32 id = 0; ToolsCommonAttributes(domElement, id); - const quint32 firstPoint = GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, NULL_ID_STR); - 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); + const quint32 firstPoint = GetParametrUInt(domElement, AttrFirstPoint, NULL_ID_STR); + const quint32 secondPoint = GetParametrUInt(domElement, AttrSecondPoint, NULL_ID_STR); + const QString typeLine = GetParametrString(domElement, AttrTypeLine, + TypeLineLine); + const QString lineColor = GetParametrString(domElement, AttrLineColor, + ColorBlack); VToolLine::Create(id, firstPoint, secondPoint, typeLine, lineColor, scene, this, data, parse, Source::FromFile); } @@ -896,8 +896,8 @@ void VPattern::ParseToolBasePoint(VMainGraphicsScene *scene, const QDomElement & try { PointsCommonAttributes(domElement, id, name, mx, my); - const qreal x = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrX, "10.0")); - const qreal y = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrY, "10.0")); + const qreal x = qApp->toPixel(GetParametrDouble(domElement, AttrX, "10.0")); + const qreal y = qApp->toPixel(GetParametrDouble(domElement, AttrY, "10.0")); data->UpdateGObject(id, new VPointF(x, y, name, mx, my)); VDrawTool::AddRecord(id, Tool::BasePoint, this); @@ -943,12 +943,12 @@ void VPattern::ParseToolEndLine(VMainGraphicsScene *scene, QDomElement &domEleme { PointsCommonAttributes(domElement, id, name, mx, my, typeLine, lineColor); - const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "100.0"); + const QString formula = GetParametrString(domElement, AttrLength, "100.0"); QString f = formula;//need for saving fixed formula; - const quint32 basePointId = GetParametrUInt(domElement, VAbstractTool::AttrBasePoint, NULL_ID_STR); + const quint32 basePointId = GetParametrUInt(domElement, AttrBasePoint, NULL_ID_STR); - const QString angle = GetParametrString(domElement, VAbstractTool::AttrAngle, "0.0"); + const QString angle = GetParametrString(domElement, AttrAngle, "0.0"); QString angleFix = angle; VToolEndLine::Create(id, name, typeLine, lineColor, f, angleFix, basePointId, mx, my, scene, this, data, @@ -956,8 +956,8 @@ void VPattern::ParseToolEndLine(VMainGraphicsScene *scene, QDomElement &domEleme //Rewrite attribute formula. Need for situation when we have wrong formula. if (f != formula || angleFix != angle) { - SetAttribute(domElement, VAbstractTool::AttrLength, f); - SetAttribute(domElement, VAbstractTool::AttrAngle, angleFix); + SetAttribute(domElement, AttrLength, f); + SetAttribute(domElement, AttrAngle, angleFix); haveLiteChange(); } } @@ -991,17 +991,17 @@ void VPattern::ParseToolAlongLine(VMainGraphicsScene *scene, QDomElement &domEle try { PointsCommonAttributes(domElement, id, name, mx, my, typeLine, lineColor); - const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "100.0"); + const QString formula = GetParametrString(domElement, 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 quint32 firstPointId = GetParametrUInt(domElement, AttrFirstPoint, NULL_ID_STR); + const quint32 secondPointId = GetParametrUInt(domElement, AttrSecondPoint, NULL_ID_STR); 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) { - SetAttribute(domElement, VAbstractTool::AttrLength, f); + SetAttribute(domElement, AttrLength, f); haveLiteChange(); } } @@ -1035,18 +1035,18 @@ void VPattern::ParseToolShoulderPoint(VMainGraphicsScene *scene, QDomElement &do try { PointsCommonAttributes(domElement, id, name, mx, my, typeLine, lineColor); - const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "100.0"); + const QString formula = GetParametrString(domElement, 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); + const quint32 p1Line = GetParametrUInt(domElement, AttrP1Line, NULL_ID_STR); + const quint32 p2Line = GetParametrUInt(domElement, AttrP2Line, NULL_ID_STR); + const quint32 pShoulder = GetParametrUInt(domElement, AttrPShoulder, NULL_ID_STR); 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) { - SetAttribute(domElement, VAbstractTool::AttrLength, f); + SetAttribute(domElement, AttrLength, f); haveLiteChange(); } } @@ -1080,18 +1080,18 @@ void VPattern::ParseToolNormal(VMainGraphicsScene *scene, QDomElement &domElemen try { PointsCommonAttributes(domElement, id, name, mx, my, typeLine, lineColor); - const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "100.0"); + const QString formula = GetParametrString(domElement, 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"); + const quint32 firstPointId = GetParametrUInt(domElement, AttrFirstPoint, NULL_ID_STR); + const quint32 secondPointId = GetParametrUInt(domElement, AttrSecondPoint, NULL_ID_STR); + const qreal angle = GetParametrDouble(domElement, AttrAngle, "0.0"); 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) { - SetAttribute(domElement, VAbstractTool::AttrLength, f); + SetAttribute(domElement, AttrLength, f); haveLiteChange(); } } @@ -1125,18 +1125,18 @@ void VPattern::ParseToolBisector(VMainGraphicsScene *scene, QDomElement &domElem try { PointsCommonAttributes(domElement, id, name, mx, my, typeLine, lineColor); - const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "100.0"); + const QString formula = GetParametrString(domElement, 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 quint32 thirdPointId = GetParametrUInt(domElement, VAbstractTool::AttrThirdPoint, NULL_ID_STR); + const quint32 firstPointId = GetParametrUInt(domElement, AttrFirstPoint, NULL_ID_STR); + const quint32 secondPointId = GetParametrUInt(domElement, AttrSecondPoint, NULL_ID_STR); + const quint32 thirdPointId = GetParametrUInt(domElement, AttrThirdPoint, NULL_ID_STR); VToolBisector::Create(id, f, firstPointId, secondPointId, thirdPointId, 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) { - SetAttribute(domElement, VAbstractTool::AttrLength, f); + SetAttribute(domElement, AttrLength, f); haveLiteChange(); } } @@ -1168,10 +1168,10 @@ void VPattern::ParseToolLineIntersect(VMainGraphicsScene *scene, const QDomEleme try { PointsCommonAttributes(domElement, id, name, mx, my); - const quint32 p1Line1Id = GetParametrUInt(domElement, VAbstractTool::AttrP1Line1, NULL_ID_STR); - const quint32 p2Line1Id = GetParametrUInt(domElement, VAbstractTool::AttrP2Line1, NULL_ID_STR); - const quint32 p1Line2Id = GetParametrUInt(domElement, VAbstractTool::AttrP1Line2, NULL_ID_STR); - const quint32 p2Line2Id = GetParametrUInt(domElement, VAbstractTool::AttrP2Line2, NULL_ID_STR); + const quint32 p1Line1Id = GetParametrUInt(domElement, AttrP1Line1, NULL_ID_STR); + const quint32 p2Line1Id = GetParametrUInt(domElement, AttrP2Line1, NULL_ID_STR); + const quint32 p1Line2Id = GetParametrUInt(domElement, AttrP1Line2, NULL_ID_STR); + const quint32 p2Line2Id = GetParametrUInt(domElement, AttrP2Line2, NULL_ID_STR); VToolLineIntersect::Create(id, p1Line1Id, p2Line1Id, p1Line2Id, p2Line2Id, name, mx, my, scene, this, data, parse, Source::FromFile); @@ -1198,18 +1198,18 @@ void VPattern::ParseToolPointOfContact(VMainGraphicsScene *scene, QDomElement &d try { PointsCommonAttributes(domElement, id, name, mx, my); - const QString radius = GetParametrString(domElement, VAbstractTool::AttrRadius, "0"); + const QString radius = GetParametrString(domElement, AttrRadius, "0"); QString f = radius;//need for saving fixed formula; - const quint32 center = GetParametrUInt(domElement, VAbstractTool::AttrCenter, NULL_ID_STR); - const quint32 firstPointId = GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, NULL_ID_STR); - const quint32 secondPointId = GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, NULL_ID_STR); + const quint32 center = GetParametrUInt(domElement, AttrCenter, NULL_ID_STR); + const quint32 firstPointId = GetParametrUInt(domElement, AttrFirstPoint, NULL_ID_STR); + const quint32 secondPointId = GetParametrUInt(domElement, AttrSecondPoint, NULL_ID_STR); VToolPointOfContact::Create(id, f, center, firstPointId, secondPointId, name, mx, my, scene, this, data, parse, Source::FromFile); //Rewrite attribute formula. Need for situation when we have wrong formula. if (f != radius) { - SetAttribute(domElement, VAbstractTool::AttrRadius, f); + SetAttribute(domElement, AttrRadius, f); haveLiteChange(); } } @@ -1270,9 +1270,9 @@ void VPattern::ParseToolHeight(VMainGraphicsScene *scene, const QDomElement &dom try { 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); + const quint32 basePointId = GetParametrUInt(domElement, AttrBasePoint, NULL_ID_STR); + const quint32 p1LineId = GetParametrUInt(domElement, AttrP1Line, NULL_ID_STR); + const quint32 p2LineId = GetParametrUInt(domElement, AttrP2Line, NULL_ID_STR); VToolHeight::Create(id, name, typeLine, lineColor, basePointId, p1LineId, p2LineId, mx, my, scene, this, data, parse, Source::FromFile); @@ -1299,10 +1299,10 @@ void VPattern::ParseToolTriangle(VMainGraphicsScene *scene, const QDomElement &d try { PointsCommonAttributes(domElement, id, name, mx, my); - const quint32 axisP1Id = GetParametrUInt(domElement, VAbstractTool::AttrAxisP1, NULL_ID_STR); - const quint32 axisP2Id = GetParametrUInt(domElement, VAbstractTool::AttrAxisP2, NULL_ID_STR); - const quint32 firstPointId = GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, NULL_ID_STR); - const quint32 secondPointId = GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, NULL_ID_STR); + const quint32 axisP1Id = GetParametrUInt(domElement, AttrAxisP1, NULL_ID_STR); + const quint32 axisP2Id = GetParametrUInt(domElement, AttrAxisP2, NULL_ID_STR); + const quint32 firstPointId = GetParametrUInt(domElement, AttrFirstPoint, NULL_ID_STR); + const quint32 secondPointId = GetParametrUInt(domElement, AttrSecondPoint, NULL_ID_STR); VToolTriangle::Create(id, name, axisP1Id, axisP2Id, firstPointId, secondPointId, mx, my, scene, this, data, parse, Source::FromFile); @@ -1330,8 +1330,8 @@ void VPattern::ParseToolPointOfIntersection(VMainGraphicsScene *scene, const QDo try { PointsCommonAttributes(domElement, id, name, mx, my); - const quint32 firstPointId = GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, NULL_ID_STR); - const quint32 secondPointId = GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, NULL_ID_STR); + const quint32 firstPointId = GetParametrUInt(domElement, AttrFirstPoint, NULL_ID_STR); + const quint32 secondPointId = GetParametrUInt(domElement, AttrSecondPoint, NULL_ID_STR); VToolPointOfIntersection::Create(id, name, firstPointId, secondPointId, mx, my, scene, this, data, parse, Source::FromFile); @@ -1358,18 +1358,18 @@ void VPattern::ParseToolCutSpline(VMainGraphicsScene *scene, QDomElement &domEle try { PointsCommonAttributes(domElement, id, name, mx, my); - const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "0"); + const QString formula = GetParametrString(domElement, 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); + const QString color = GetParametrString(domElement, AttrColor, + ColorBlack); 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) { - SetAttribute(domElement, VAbstractTool::AttrLength, f); + SetAttribute(domElement, AttrLength, f); haveLiteChange(); } } @@ -1401,19 +1401,19 @@ void VPattern::ParseToolCutSplinePath(VMainGraphicsScene *scene, QDomElement &do try { PointsCommonAttributes(domElement, id, name, mx, my); - const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "0"); + const QString formula = GetParametrString(domElement, AttrLength, "0"); 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); + const QString color = GetParametrString(domElement, AttrColor, + ColorBlack); 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) { - SetAttribute(domElement, VAbstractTool::AttrLength, f); + SetAttribute(domElement, AttrLength, f); haveLiteChange(); } } @@ -1445,17 +1445,16 @@ void VPattern::ParseToolCutArc(VMainGraphicsScene *scene, QDomElement &domElemen try { PointsCommonAttributes(domElement, id, name, mx, my); - const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "0"); + const QString formula = GetParametrString(domElement, 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); + const quint32 arcId = GetParametrUInt(domElement, AttrArc, NULL_ID_STR); + const QString color = GetParametrString(domElement, AttrColor, ColorBlack); 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) { - SetAttribute(domElement, VAbstractTool::AttrLength, f); + SetAttribute(domElement, AttrLength, f); haveLiteChange(); } } @@ -1491,11 +1490,11 @@ void VPattern::ParseToolLineIntersectAxis(VMainGraphicsScene *scene, QDomElement { 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); - const quint32 secondPointId = GetParametrUInt(domElement, VAbstractTool::AttrP2Line, NULL_ID_STR); + const quint32 basePointId = GetParametrUInt(domElement, AttrBasePoint, NULL_ID_STR); + const quint32 firstPointId = GetParametrUInt(domElement, AttrP1Line, NULL_ID_STR); + const quint32 secondPointId = GetParametrUInt(domElement, AttrP2Line, NULL_ID_STR); - const QString angle = GetParametrString(domElement, VAbstractTool::AttrAngle, "0.0"); + const QString angle = GetParametrString(domElement, AttrAngle, "0.0"); QString angleFix = angle; VToolLineIntersectAxis::Create(id, name, typeLine, lineColor, angleFix, basePointId, firstPointId, @@ -1503,7 +1502,7 @@ void VPattern::ParseToolLineIntersectAxis(VMainGraphicsScene *scene, QDomElement //Rewrite attribute formula. Need for situation when we have wrong formula. if (angleFix != angle) { - SetAttribute(domElement, VAbstractTool::AttrAngle, angleFix); + SetAttribute(domElement, AttrAngle, angleFix); haveLiteChange(); } } @@ -1541,9 +1540,9 @@ void VPattern::ParseToolCurveIntersectAxis(VMainGraphicsScene *scene, QDomElemen { 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"); + const quint32 basePointId = GetParametrUInt(domElement, AttrBasePoint, NULL_ID_STR); + const quint32 curveId = GetParametrUInt(domElement, AttrCurve, NULL_ID_STR); + const QString angle = GetParametrString(domElement, AttrAngle, "0.0"); QString angleFix = angle; VToolCurveIntersectAxis::Create(id, name, typeLine, lineColor, angleFix, basePointId, curveId, mx, my, @@ -1551,7 +1550,7 @@ void VPattern::ParseToolCurveIntersectAxis(VMainGraphicsScene *scene, QDomElemen //Rewrite attribute formula. Need for situation when we have wrong formula. if (angleFix != angle) { - SetAttribute(domElement, VAbstractTool::AttrAngle, angleFix); + SetAttribute(domElement, AttrAngle, angleFix); haveLiteChange(); } } @@ -1586,10 +1585,10 @@ void VPattern::ParseToolPointOfIntersectionArcs(VMainGraphicsScene *scene, const try { PointsCommonAttributes(domElement, id, name, mx, my); - const quint32 firstArcId = GetParametrUInt(domElement, VAbstractTool::AttrFirstArc, NULL_ID_STR); - const quint32 secondArcId = GetParametrUInt(domElement, VAbstractTool::AttrSecondArc, NULL_ID_STR); + const quint32 firstArcId = GetParametrUInt(domElement, AttrFirstArc, NULL_ID_STR); + const quint32 secondArcId = GetParametrUInt(domElement, AttrSecondArc, NULL_ID_STR); const CrossCirclesPoint crossPoint = static_cast(GetParametrUInt(domElement, - VAbstractTool::AttrCrossPoint, + AttrCrossPoint, "1")); VToolPointOfIntersectionArcs::Create(id, name, firstArcId, secondArcId, crossPoint, mx, my, scene, this, @@ -1618,23 +1617,22 @@ void VPattern::ParseToolPointOfIntersectionCircles(VMainGraphicsScene *scene, QD try { PointsCommonAttributes(domElement, id, name, mx, my); - const quint32 c1CenterId = GetParametrUInt(domElement, VAbstractTool::AttrC1Center, NULL_ID_STR); - const quint32 c2CenterId = GetParametrUInt(domElement, VAbstractTool::AttrC2Center, NULL_ID_STR); - const QString c1Radius = GetParametrString(domElement, VAbstractTool::AttrC1Radius); + const quint32 c1CenterId = GetParametrUInt(domElement, AttrC1Center, NULL_ID_STR); + const quint32 c2CenterId = GetParametrUInt(domElement, AttrC2Center, NULL_ID_STR); + const QString c1Radius = GetParametrString(domElement, AttrC1Radius); QString c1R = c1Radius; - const QString c2Radius = GetParametrString(domElement, VAbstractTool::AttrC2Radius); + const QString c2Radius = GetParametrString(domElement, AttrC2Radius); QString c2R = c2Radius; const CrossCirclesPoint crossPoint = static_cast(GetParametrUInt(domElement, - VAbstractTool::AttrCrossPoint, - "1")); + AttrCrossPoint, "1")); VToolPointOfIntersectionCircles::Create(id, name, c1CenterId, c2CenterId, c1R, c2R, crossPoint, mx, my, scene, this, data, parse, Source::FromFile); //Rewrite attribute formula. Need for situation when we have wrong formula. if (c1R != c1Radius || c2R != c2Radius) { - SetAttribute(domElement, VAbstractTool::AttrC1Center, c1R); - SetAttribute(domElement, VAbstractTool::AttrC2Center, c2R); + SetAttribute(domElement, AttrC1Center, c1R); + SetAttribute(domElement, AttrC2Center, c2R); haveLiteChange(); } } @@ -1661,12 +1659,12 @@ void VPattern::ParseToolPointFromCircleAndTangent(VMainGraphicsScene *scene, QDo try { PointsCommonAttributes(domElement, id, name, mx, my); - const quint32 cCenterId = GetParametrUInt(domElement, VAbstractTool::AttrCCenter, NULL_ID_STR); - const quint32 tangentId = GetParametrUInt(domElement, VAbstractTool::AttrTangent, NULL_ID_STR); - const QString cRadius = GetParametrString(domElement, VAbstractTool::AttrCRadius); + const quint32 cCenterId = GetParametrUInt(domElement, AttrCCenter, NULL_ID_STR); + const quint32 tangentId = GetParametrUInt(domElement, AttrTangent, NULL_ID_STR); + const QString cRadius = GetParametrString(domElement, AttrCRadius); QString cR = cRadius; const CrossCirclesPoint crossPoint = static_cast(GetParametrUInt(domElement, - VAbstractTool::AttrCrossPoint, + AttrCrossPoint, "1")); VToolPointFromCircleAndTangent::Create(id, name, cCenterId, cR, tangentId, crossPoint, mx, my, @@ -1674,7 +1672,7 @@ void VPattern::ParseToolPointFromCircleAndTangent(VMainGraphicsScene *scene, QDo //Rewrite attribute formula. Need for situation when we have wrong formula. if (cR != cRadius) { - SetAttribute(domElement, VAbstractTool::AttrCCenter, cR); + SetAttribute(domElement, AttrCCenter, cR); haveLiteChange(); } } @@ -1701,10 +1699,10 @@ void VPattern::ParseToolPointFromArcAndTangent(VMainGraphicsScene *scene, const try { PointsCommonAttributes(domElement, id, name, mx, my); - const quint32 arcId = GetParametrUInt(domElement, VAbstractTool::AttrArc, NULL_ID_STR); - const quint32 tangentId = GetParametrUInt(domElement, VAbstractTool::AttrTangent, NULL_ID_STR); + const quint32 arcId = GetParametrUInt(domElement, AttrArc, NULL_ID_STR); + const quint32 tangentId = GetParametrUInt(domElement, AttrTangent, NULL_ID_STR); const CrossCirclesPoint crossPoint = static_cast(GetParametrUInt(domElement, - VAbstractTool::AttrCrossPoint, + AttrCrossPoint, "1")); VToolPointFromArcAndTangent::Create(id, name, arcId, tangentId, crossPoint, mx, my, @@ -1730,22 +1728,22 @@ void VPattern::ParseToolTrueDarts(VMainGraphicsScene *scene, const QDomElement & { ToolsCommonAttributes(domElement, id); - const quint32 p1Id = GetParametrUInt(domElement, VAbstractTool::AttrPoint1, NULL_ID_STR); - const quint32 p2Id = GetParametrUInt(domElement, VAbstractTool::AttrPoint2, NULL_ID_STR); + const quint32 p1Id = GetParametrUInt(domElement, AttrPoint1, NULL_ID_STR); + const quint32 p2Id = GetParametrUInt(domElement, AttrPoint2, NULL_ID_STR); - const quint32 baseLineP1Id = GetParametrUInt(domElement, VAbstractTool::AttrBaseLineP1, NULL_ID_STR); - const quint32 baseLineP2Id = GetParametrUInt(domElement, VAbstractTool::AttrBaseLineP2, NULL_ID_STR); - const quint32 dartP1Id = GetParametrUInt(domElement, VAbstractTool::AttrDartP1, NULL_ID_STR); - const quint32 dartP2Id = GetParametrUInt(domElement, VAbstractTool::AttrDartP2, NULL_ID_STR); - const quint32 dartP3Id = GetParametrUInt(domElement, VAbstractTool::AttrDartP3, NULL_ID_STR); + const quint32 baseLineP1Id = GetParametrUInt(domElement, AttrBaseLineP1, NULL_ID_STR); + const quint32 baseLineP2Id = GetParametrUInt(domElement, AttrBaseLineP2, NULL_ID_STR); + const quint32 dartP1Id = GetParametrUInt(domElement, AttrDartP1, NULL_ID_STR); + const quint32 dartP2Id = GetParametrUInt(domElement, AttrDartP2, NULL_ID_STR); + const quint32 dartP3Id = GetParametrUInt(domElement, AttrDartP3, NULL_ID_STR); - const QString name1 = GetParametrString(domElement, VAbstractTool::AttrName1, "A"); - const qreal mx1 = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMx1, "10.0")); - const qreal my1 = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMy1, "15.0")); + const QString name1 = GetParametrString(domElement, AttrName1, "A"); + const qreal mx1 = qApp->toPixel(GetParametrDouble(domElement, AttrMx1, "10.0")); + const qreal my1 = qApp->toPixel(GetParametrDouble(domElement, AttrMy1, "15.0")); - const QString name2 = GetParametrString(domElement, VAbstractTool::AttrName2, "A"); - const qreal mx2 = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMx2, "10.0")); - const qreal my2 = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMy2, "15.0")); + const QString name2 = GetParametrString(domElement, AttrName2, "A"); + const qreal mx2 = qApp->toPixel(GetParametrDouble(domElement, AttrMx2, "10.0")); + const qreal my2 = qApp->toPixel(GetParametrDouble(domElement, AttrMy2, "15.0")); VToolTrueDarts::Create(id, p1Id, p2Id, baseLineP1Id, baseLineP2Id, dartP1Id, dartP2Id, dartP3Id, @@ -1771,15 +1769,14 @@ void VPattern::ParseToolSpline(VMainGraphicsScene *scene, const QDomElement &dom try { ToolsCommonAttributes(domElement, id); - const quint32 point1 = GetParametrUInt(domElement, VAbstractTool::AttrPoint1, NULL_ID_STR); - const quint32 point4 = GetParametrUInt(domElement, VAbstractTool::AttrPoint4, NULL_ID_STR); - const qreal angle1 = GetParametrDouble(domElement, VAbstractTool::AttrAngle1, "270.0"); - const qreal angle2 = GetParametrDouble(domElement, VAbstractTool::AttrAngle2, "90.0"); - 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); + const quint32 point1 = GetParametrUInt(domElement, AttrPoint1, NULL_ID_STR); + const quint32 point4 = GetParametrUInt(domElement, AttrPoint4, NULL_ID_STR); + const qreal angle1 = GetParametrDouble(domElement, AttrAngle1, "270.0"); + const qreal angle2 = GetParametrDouble(domElement, AttrAngle2, "90.0"); + const qreal kAsm1 = GetParametrDouble(domElement, AttrKAsm1, "1.0"); + const qreal kAsm2 = GetParametrDouble(domElement, AttrKAsm2, "1.0"); + const qreal kCurve = GetParametrDouble(domElement, AttrKCurve, "1.0"); + const QString color = GetParametrString(domElement, AttrColor, ColorBlack); VToolSpline::Create(id, point1, point4, kAsm1, kAsm2, angle1, angle2, kCurve, color, scene, this, data, parse, Source::FromFile); @@ -1803,9 +1800,8 @@ void VPattern::ParseToolSplinePath(VMainGraphicsScene *scene, const QDomElement try { ToolsCommonAttributes(domElement, id); - const qreal kCurve = GetParametrDouble(domElement, VAbstractTool::AttrKCurve, "1.0"); - const QString color = GetParametrString(domElement, VAbstractTool::AttrColor, - VAbstractTool::ColorBlack); + const qreal kCurve = GetParametrDouble(domElement, AttrKCurve, "1.0"); + const QString color = GetParametrString(domElement, AttrColor, ColorBlack); VSplinePath *path = new VSplinePath(kCurve); const QDomNodeList nodeList = domElement.childNodes(); @@ -1815,12 +1811,12 @@ void VPattern::ParseToolSplinePath(VMainGraphicsScene *scene, const QDomElement const QDomElement element = nodeList.at(i).toElement(); if (element.isNull() == false) { - if (element.tagName() == VAbstractTool::AttrPathPoint) + if (element.tagName() == AttrPathPoint) { - const qreal kAsm1 = GetParametrDouble(element, VAbstractTool::AttrKAsm1, "1.0"); - const qreal angle = GetParametrDouble(element, VAbstractTool::AttrAngle, "0"); - const qreal kAsm2 = GetParametrDouble(element, VAbstractTool::AttrKAsm2, "1.0"); - const quint32 pSpline = GetParametrUInt(element, VAbstractTool::AttrPSpline, NULL_ID_STR); + const qreal kAsm1 = GetParametrDouble(element, AttrKAsm1, "1.0"); + const qreal angle = GetParametrDouble(element, AttrAngle, "0"); + const qreal kAsm2 = GetParametrDouble(element, AttrKAsm2, "1.0"); + const quint32 pSpline = GetParametrUInt(element, AttrPSpline, NULL_ID_STR); const VPointF p = *data->GeometricObject(pSpline); QLineF line(0, 0, 100, 0); @@ -1909,23 +1905,22 @@ void VPattern::ParseToolArc(VMainGraphicsScene *scene, QDomElement &domElement, try { ToolsCommonAttributes(domElement, id); - const quint32 center = GetParametrUInt(domElement, VAbstractTool::AttrCenter, NULL_ID_STR); - const QString radius = GetParametrString(domElement, VAbstractTool::AttrRadius, "10"); + const quint32 center = GetParametrUInt(domElement, AttrCenter, NULL_ID_STR); + const QString radius = GetParametrString(domElement, AttrRadius, "10"); QString r = radius;//need for saving fixed formula; - const QString f1 = GetParametrString(domElement, VAbstractTool::AttrAngle1, "180"); + const QString f1 = GetParametrString(domElement, AttrAngle1, "180"); QString f1Fix = f1;//need for saving fixed formula; - const QString f2 = GetParametrString(domElement, VAbstractTool::AttrAngle2, "270"); + const QString f2 = GetParametrString(domElement, AttrAngle2, "270"); QString f2Fix = f2;//need for saving fixed formula; - const QString color = GetParametrString(domElement, VAbstractTool::AttrColor, - VAbstractTool::ColorBlack); + const QString color = GetParametrString(domElement, AttrColor, ColorBlack); 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) { - SetAttribute(domElement, VAbstractTool::AttrRadius, r); - SetAttribute(domElement, VAbstractTool::AttrAngle1, f1Fix); - SetAttribute(domElement, VAbstractTool::AttrAngle2, f2Fix); + SetAttribute(domElement, AttrRadius, r); + SetAttribute(domElement, AttrAngle1, f1Fix); + SetAttribute(domElement, AttrAngle2, f2Fix); haveLiteChange(); } } @@ -1980,24 +1975,23 @@ void VPattern::ParseToolArcWithLength(VMainGraphicsScene *scene, QDomElement &do try { ToolsCommonAttributes(domElement, id); - const quint32 center = GetParametrUInt(domElement, VAbstractTool::AttrCenter, NULL_ID_STR); - const QString radius = GetParametrString(domElement, VAbstractTool::AttrRadius, "10"); + const quint32 center = GetParametrUInt(domElement, AttrCenter, NULL_ID_STR); + const QString radius = GetParametrString(domElement, AttrRadius, "10"); QString r = radius;//need for saving fixed formula; - const QString f1 = GetParametrString(domElement, VAbstractTool::AttrAngle1, "180"); + const QString f1 = GetParametrString(domElement, AttrAngle1, "180"); QString f1Fix = f1;//need for saving fixed formula; - const QString length = GetParametrString(domElement, VAbstractTool::AttrLength, "10"); + const QString length = GetParametrString(domElement, AttrLength, "10"); QString lengthFix = length;//need for saving fixed length; - const QString color = GetParametrString(domElement, VAbstractTool::AttrColor, - VAbstractTool::ColorBlack); + const QString color = GetParametrString(domElement, AttrColor, ColorBlack); VToolArcWithLength::Create(id, center, r, f1Fix, lengthFix, color, scene, this, data, parse, Source::FromFile); //Rewrite attribute formula. Need for situation when we have wrong formula. if (r != radius || f1Fix != f1 || lengthFix != length) { - SetAttribute(domElement, VAbstractTool::AttrRadius, r); - SetAttribute(domElement, VAbstractTool::AttrAngle1, f1Fix); - SetAttribute(domElement, VAbstractTool::AttrLength, lengthFix); + SetAttribute(domElement, AttrRadius, r); + SetAttribute(domElement, AttrAngle1, f1Fix); + SetAttribute(domElement, AttrLength, lengthFix); haveLiteChange(); } } diff --git a/src/libs/ifc/ifcdef.cpp b/src/libs/ifc/ifcdef.cpp index 8866567bf..e762de188 100644 --- a/src/libs/ifc/ifcdef.cpp +++ b/src/libs/ifc/ifcdef.cpp @@ -59,3 +59,111 @@ qreal WidthHairLine(Unit patternUnit) { return WidthMainLine(patternUnit)/3.0; } + +const QString AttrType = QStringLiteral("type"); +const QString AttrMx = QStringLiteral("mx"); +const QString AttrMy = QStringLiteral("my"); +const QString AttrName = QStringLiteral("name"); +const QString AttrMx1 = QStringLiteral("mx1"); +const QString AttrMy1 = QStringLiteral("my1"); +const QString AttrName1 = QStringLiteral("name1"); +const QString AttrMx2 = QStringLiteral("mx2"); +const QString AttrMy2 = QStringLiteral("my2"); +const QString AttrName2 = QStringLiteral("name2"); +const QString AttrBaseLineP1 = QStringLiteral("baseLineP1"); +const QString AttrBaseLineP2 = QStringLiteral("baseLineP2"); +const QString AttrDartP1 = QStringLiteral("dartP1"); +const QString AttrDartP2 = QStringLiteral("dartP2"); +const QString AttrDartP3 = QStringLiteral("dartP3"); +const QString AttrX = QStringLiteral("x"); +const QString AttrY = QStringLiteral("y"); +const QString AttrTypeLine = QStringLiteral("typeLine"); +const QString AttrLength = QStringLiteral("length"); +const QString AttrBasePoint = QStringLiteral("basePoint"); +const QString AttrFirstPoint = QStringLiteral("firstPoint"); +const QString AttrSecondPoint = QStringLiteral("secondPoint"); +const QString AttrThirdPoint = QStringLiteral("thirdPoint"); +const QString AttrCenter = QStringLiteral("center"); +const QString AttrRadius = QStringLiteral("radius"); +const QString AttrAngle = QStringLiteral("angle"); +const QString AttrAngle1 = QStringLiteral("angle1"); +const QString AttrAngle2 = QStringLiteral("angle2"); +const QString AttrP1Line = QStringLiteral("p1Line"); +const QString AttrP2Line = QStringLiteral("p2Line"); +const QString AttrP1Line1 = QStringLiteral("p1Line1"); +const QString AttrP2Line1 = QStringLiteral("p2Line1"); +const QString AttrP1Line2 = QStringLiteral("p1Line2"); +const QString AttrP2Line2 = QStringLiteral("p2Line2"); +const QString AttrPShoulder = QStringLiteral("pShoulder"); +const QString AttrPoint1 = QStringLiteral("point1"); +const QString AttrPoint2 = QStringLiteral("point2"); +const QString AttrPoint4 = QStringLiteral("point4"); +const QString AttrKAsm1 = QStringLiteral("kAsm1"); +const QString AttrKAsm2 = QStringLiteral("kAsm2"); +const QString AttrKCurve = QStringLiteral("kCurve"); +const QString AttrPathPoint = QStringLiteral("pathPoint"); +const QString AttrPSpline = QStringLiteral("pSpline"); +const QString AttrAxisP1 = QStringLiteral("axisP1"); +const QString AttrAxisP2 = QStringLiteral("axisP2"); +const QString AttrCurve = QStringLiteral("curve"); +const QString AttrLineColor = QStringLiteral("lineColor"); +const QString AttrColor = QStringLiteral("color"); +const QString AttrFirstArc = QStringLiteral("firstArc"); +const QString AttrSecondArc = QStringLiteral("secondArc"); +const QString AttrCrossPoint = QStringLiteral("crossPoint"); +const QString AttrC1Center = QStringLiteral("c1Center"); +const QString AttrC2Center = QStringLiteral("c2Center"); +const QString AttrC1Radius = QStringLiteral("c1Radius"); +const QString AttrC2Radius = QStringLiteral("c2Radius"); +const QString AttrCCenter = QStringLiteral("cCenter"); +const QString AttrTangent = QStringLiteral("tangent"); +const QString AttrCRadius = QStringLiteral("cRadius"); +const QString AttrArc = QStringLiteral("arc"); + +const QString TypeLineNone = QStringLiteral("none"); +const QString TypeLineLine = QStringLiteral("hair"); +const QString TypeLineDashLine = QStringLiteral("dashLine"); +const QString TypeLineDotLine = QStringLiteral("dotLine"); +const QString TypeLineDashDotLine = QStringLiteral("dashDotLine"); +const QString TypeLineDashDotDotLine = QStringLiteral("dashDotDotLine"); + +const QString ColorBlack = QStringLiteral("black"); +const QString ColorGreen = QStringLiteral("green"); +const QString ColorBlue = QStringLiteral("blue"); +const QString ColorDarkRed = QStringLiteral("darkRed"); +const QString ColorDarkGreen = QStringLiteral("darkGreen"); +const QString ColorDarkBlue = QStringLiteral("darkBlue"); +const QString ColorYellow = QStringLiteral("yellow"); + +//variables +const QString line_ = QStringLiteral("Line_"); +const QString angleLine_ = QStringLiteral("AngleLine_"); +const QString spl_ = QStringLiteral(SPL_); +const QString arc_ = QStringLiteral(ARC_); +const QString splPath = QStringLiteral("SplPath"); +const QString radius_V = QStringLiteral("Radius"); +const QString radiusArc_ = radius_V + arc_; +const QString angle1_V = QStringLiteral("Angle1"); +const QString angle2_V = QStringLiteral("Angle2"); +const QString angle1Arc_ = angle1_V + arc_; +const QString angle2Arc_ = angle2_V + arc_; +const QString angle1Spl_ = angle1_V + spl_; +const QString angle2Spl_ = angle2_V + spl_; +const QString angle1SplPath = angle1_V + splPath; +const QString angle2SplPath = angle2_V + splPath; + +const QStringList builInVariables = QStringList() << line_ + << angleLine_ + << arc_ + << spl_ + << splPath + << radius_V + << radiusArc_ + << angle1_V + << angle2_V + << angle1Arc_ + << angle2Arc_ + << angle1Spl_ + << angle2Spl_ + << angle1SplPath + << angle2SplPath; diff --git a/src/libs/ifc/ifcdef.h b/src/libs/ifc/ifcdef.h index 700b72474..d0612962a 100644 --- a/src/libs/ifc/ifcdef.h +++ b/src/libs/ifc/ifcdef.h @@ -62,4 +62,102 @@ static const quint32 null_id = 0; qreal WidthMainLine(Unit patternUnit); qreal WidthHairLine(Unit patternUnit); +extern const QString AttrType; +extern const QString AttrMx; +extern const QString AttrMy; +extern const QString AttrName; +extern const QString AttrMx1; +extern const QString AttrMy1; +extern const QString AttrName1; +extern const QString AttrMx2; +extern const QString AttrMy2; +extern const QString AttrName2; +extern const QString AttrBaseLineP1; +extern const QString AttrBaseLineP2; +extern const QString AttrDartP1; +extern const QString AttrDartP2; +extern const QString AttrDartP3; +extern const QString AttrX; +extern const QString AttrY; +extern const QString AttrTypeLine; +extern const QString AttrLength; +extern const QString AttrBasePoint; +extern const QString AttrFirstPoint; +extern const QString AttrSecondPoint; +extern const QString AttrThirdPoint; +extern const QString AttrCenter; +extern const QString AttrRadius; +extern const QString AttrAngle; +extern const QString AttrAngle1; +extern const QString AttrAngle2; +extern const QString AttrP1Line; +extern const QString AttrP2Line; +extern const QString AttrP1Line1; +extern const QString AttrP2Line1; +extern const QString AttrP1Line2; +extern const QString AttrP2Line2; +extern const QString AttrPShoulder; +extern const QString AttrPoint1; +extern const QString AttrPoint2; +extern const QString AttrPoint4; +extern const QString AttrKAsm1; +extern const QString AttrKAsm2; +extern const QString AttrKCurve; +extern const QString AttrPathPoint; +extern const QString AttrPSpline; +extern const QString AttrAxisP1; +extern const QString AttrAxisP2; +extern const QString AttrCurve; +extern const QString AttrLineColor; +extern const QString AttrColor; +extern const QString AttrFirstArc; +extern const QString AttrSecondArc; +extern const QString AttrCrossPoint; +extern const QString AttrC1Center; +extern const QString AttrC2Center; +extern const QString AttrC1Radius; +extern const QString AttrC2Radius; +extern const QString AttrCCenter; +extern const QString AttrTangent; +extern const QString AttrCRadius; +extern const QString AttrArc; + +extern const QString TypeLineNone; +extern const QString TypeLineLine; +extern const QString TypeLineDashLine; +extern const QString TypeLineDotLine; +extern const QString TypeLineDashDotLine; +extern const QString TypeLineDashDotDotLine; + +extern const QString ColorBlack; +extern const QString ColorGreen; +extern const QString ColorBlue; +extern const QString ColorDarkRed; +extern const QString ColorDarkGreen; +extern const QString ColorDarkBlue; +extern const QString ColorYellow; + +// variables name +// Hacks for avoiding the linker error "undefined reference to" +#define SPL_ "Spl_" +#define ARC_ "Arc_" + +extern const QString line_; +extern const QString angleLine_; +extern const QString arc_; +extern const QString spl_; +extern const QString splPath; +extern const QString radius_V; +extern const QString radiusArc_; +extern const QString angle1_V; +extern const QString angle2_V; +extern const QString angle1Arc_; +extern const QString angle2Arc_; +extern const QString angle1Spl_; +extern const QString angle2Spl_; +extern const QString angle1SplPath; +extern const QString angle2SplPath; + +extern const QStringList builInVariables; + #endif // IFCDEF_H diff --git a/src/libs/ifc/xml/vabstractpattern.cpp b/src/libs/ifc/xml/vabstractpattern.cpp index 08a3a645e..4181d616d 100644 --- a/src/libs/ifc/xml/vabstractpattern.cpp +++ b/src/libs/ifc/xml/vabstractpattern.cpp @@ -27,9 +27,10 @@ *************************************************************************/ #include "vabstractpattern.h" -#include "../vmisc/def.h" #include "exception/vexceptionbadid.h" +#include "exception/vexceptionemptyparameter.h" #include "vpatternconverter.h" +#include "../qmuparser/qmutokenparser.h" const QString VAbstractPattern::TagPattern = QStringLiteral("pattern"); const QString VAbstractPattern::TagCalculation = QStringLiteral("calculation"); @@ -111,6 +112,53 @@ VAbstractPattern::VAbstractPattern(QObject *parent) VAbstractPattern::~VAbstractPattern() {} +//--------------------------------------------------------------------------------------------------------------------- +QStringList VAbstractPattern::ListMeasurements() const +{ + QSet measurements; + QSet others; + + const QStringList increments = ListIncrements(); + for (int i=0; i < increments.size(); ++i) + { + others.insert(increments.at(i)); + } + + const QStringList expressions = ListExpressions(); + for (int i=0; i < expressions.size(); ++i) + { + qmu::QmuTokenParser *cal = new qmu::QmuTokenParser(expressions.at(i), false, false);// Eval formula + const QMap tokens = cal->GetTokens();// Tokens (variables, measurements) + delete cal; + + const QList tValues = tokens.values(); + for (int j = 0; j < tValues.size(); ++j) + { + if (measurements.contains(tValues.at(j))) + { + continue; + } + + if (others.contains(tValues.at(j))) + { + continue; + } + + if (IsVariable(tValues.at(j)) || IsPostfixOperator(tValues.at(j)) || IsFunction(tValues.at(j))) + { + others.insert(tValues.at(j)); + continue; + } + else + { + measurements.insert(tValues.at(j)); + } + } + } + + return QStringList(measurements.toList()); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief ChangeActivPP set new active pattern piece name. @@ -989,3 +1037,233 @@ void VAbstractPattern::CheckTagExists(const QString &tag) } } } + +//--------------------------------------------------------------------------------------------------------------------- +QStringList VAbstractPattern::ListIncrements() const +{ + QStringList increments; + const QDomNodeList list = elementsByTagName(TagIncrement); + for (int i=0; i < list.size(); ++i) + { + const QDomElement dom = list.at(i).toElement(); + + try + { + increments.append(GetParametrString(dom, IncrementName)); + } + catch (VExceptionEmptyParameter &e) + { + Q_UNUSED(e) + } + } + + return increments; +} + +//--------------------------------------------------------------------------------------------------------------------- +QStringList VAbstractPattern::ListExpressions() const +{ + QStringList list; + + list << ListPointExpressions(); + list << ListArcExpressions(); + list << ListSplineExpressions(); + + return list; +} + +//--------------------------------------------------------------------------------------------------------------------- +QStringList VAbstractPattern::ListPointExpressions() const +{ + QStringList expressions; + const QDomNodeList list = elementsByTagName(TagPoint); + for (int i=0; i < list.size(); ++i) + { + const QDomElement dom = list.at(i).toElement(); + + try + { + expressions.append(GetParametrString(dom, AttrLength)); + } + catch (VExceptionEmptyParameter &e) + { + Q_UNUSED(e) + } + + try + { + expressions.append(GetParametrString(dom, AttrAngle)); + } + catch (VExceptionEmptyParameter &e) + { + Q_UNUSED(e) + } + try + { + expressions.append(GetParametrString(dom, AttrC1Radius)); + } + catch (VExceptionEmptyParameter &e) + { + Q_UNUSED(e) + } + + try + { + expressions.append(GetParametrString(dom, AttrC2Radius)); + } + catch (VExceptionEmptyParameter &e) + { + Q_UNUSED(e) + } + + try + { + expressions.append(GetParametrString(dom, AttrCRadius)); + } + catch (VExceptionEmptyParameter &e) + { + Q_UNUSED(e) + } + } + + return expressions; +} + +//--------------------------------------------------------------------------------------------------------------------- +QStringList VAbstractPattern::ListArcExpressions() const +{ + QStringList expressions; + const QDomNodeList list = elementsByTagName(TagPoint); + for (int i=0; i < list.size(); ++i) + { + const QDomElement dom = list.at(i).toElement(); + + try + { + expressions.append(GetParametrString(dom, AttrAngle1)); + } + catch (VExceptionEmptyParameter &e) + { + Q_UNUSED(e) + } + + try + { + expressions.append(GetParametrString(dom, AttrAngle2)); + } + catch (VExceptionEmptyParameter &e) + { + Q_UNUSED(e) + } + + try + { + expressions.append(GetParametrString(dom, AttrRadius)); + } + catch (VExceptionEmptyParameter &e) + { + Q_UNUSED(e) + } + + try + { + expressions.append(GetParametrString(dom, AttrLength)); + } + catch (VExceptionEmptyParameter &e) + { + Q_UNUSED(e) + } + } + + return expressions; +} + +//--------------------------------------------------------------------------------------------------------------------- +QStringList VAbstractPattern::ListSplineExpressions() const +{ + QStringList expressions; + expressions << ListPathPointExpressions(); + return expressions; +} + +//--------------------------------------------------------------------------------------------------------------------- +QStringList VAbstractPattern::ListPathPointExpressions() const +{ + QStringList expressions; + const QDomNodeList list = elementsByTagName(TagPoint); + for (int i=0; i < list.size(); ++i) + { + const QDomElement dom = list.at(i).toElement(); + + try + { + expressions.append(GetParametrString(dom, AttrKAsm1)); + } + catch (VExceptionEmptyParameter &e) + { + Q_UNUSED(e) + } + + try + { + expressions.append(GetParametrString(dom, AttrKAsm2)); + } + catch (VExceptionEmptyParameter &e) + { + Q_UNUSED(e) + } + + try + { + expressions.append(GetParametrString(dom, AttrAngle)); + } + catch (VExceptionEmptyParameter &e) + { + Q_UNUSED(e) + } + } + + return expressions; +} + +//--------------------------------------------------------------------------------------------------------------------- +bool VAbstractPattern::IsVariable(const QString &token) const +{ + for (int i = 0; i < builInVariables.size(); ++i) + { + if (token.indexOf( builInVariables.at(i) ) == 0) + { + return true; + } + } + + return false; +} + +//--------------------------------------------------------------------------------------------------------------------- +bool VAbstractPattern::IsPostfixOperator(const QString &token) const +{ + for (int i = 0; i < builInPostfixOperators.size(); ++i) + { + if (token.indexOf( builInPostfixOperators.at(i) ) == 0) + { + return true; + } + } + + return false; +} + +//--------------------------------------------------------------------------------------------------------------------- +bool VAbstractPattern::IsFunction(const QString &token) const +{ + for (int i = 0; i < builInFunctions.size(); ++i) + { + if (token.indexOf( builInFunctions.at(i) ) == 0) + { + return true; + } + } + + return false; +} diff --git a/src/libs/ifc/xml/vabstractpattern.h b/src/libs/ifc/xml/vabstractpattern.h index 23091bfee..aea75529a 100644 --- a/src/libs/ifc/xml/vabstractpattern.h +++ b/src/libs/ifc/xml/vabstractpattern.h @@ -48,6 +48,8 @@ public: VAbstractPattern(QObject *parent = nullptr); virtual ~VAbstractPattern() Q_DECL_OVERRIDE; + QStringList ListMeasurements() const; + virtual void CreateEmptyFile(const QString &tablePath)=0; void ChangeActivPP(const QString& name, const Document &parse = Document::FullParse); @@ -242,6 +244,17 @@ protected: private: Q_DISABLE_COPY(VAbstractPattern) + + QStringList ListIncrements() const; + QStringList ListExpressions() const; + QStringList ListPointExpressions() const; + QStringList ListArcExpressions() const; + QStringList ListSplineExpressions() const; + QStringList ListPathPointExpressions() const; + + bool IsVariable(const QString& token) const; + bool IsPostfixOperator(const QString& token) const; + bool IsFunction(const QString& token) const; }; //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vgeometry/varc.cpp b/src/libs/vgeometry/varc.cpp index 5080f92c5..becc0ecf1 100644 --- a/src/libs/vgeometry/varc.cpp +++ b/src/libs/vgeometry/varc.cpp @@ -28,6 +28,8 @@ #include "varc.h" #include "varc_p.h" +#include "../ifc/ifcdef.h" + #include #include #include @@ -273,13 +275,13 @@ QPointF VArc::CutArc(const qreal &length) const void VArc::setId(const quint32 &id) { VAbstractCurve::setId(id); - setName(QString (arc_+"%1_%2").arg(d->center.name()).arg(id)); + setName(ARC_ + QString("%1_%2").arg(d->center.name()).arg(id)); } //--------------------------------------------------------------------------------------------------------------------- void VArc::ArcName() { - setName(QString (arc_+"%1").arg(this->GetCenter().name())); + setName(ARC_ + QString("%1").arg(this->GetCenter().name())); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vgeometry/vgeometry.pri b/src/libs/vgeometry/vgeometry.pri index 267cad448..95739777c 100644 --- a/src/libs/vgeometry/vgeometry.pri +++ b/src/libs/vgeometry/vgeometry.pri @@ -9,8 +9,7 @@ SOURCES += \ $$PWD/vpointf.cpp \ $$PWD/vspline.cpp \ $$PWD/vsplinepath.cpp \ - $$PWD/vsplinepoint.cpp \ - $$PWD/vgeometrydef.cpp + $$PWD/vsplinepoint.cpp HEADERS += \ $$PWD/stable.h \ diff --git a/src/libs/vgeometry/vgeometrydef.h b/src/libs/vgeometry/vgeometrydef.h index 709987748..b69e68c7d 100644 --- a/src/libs/vgeometry/vgeometrydef.h +++ b/src/libs/vgeometry/vgeometrydef.h @@ -35,20 +35,4 @@ enum class Draw : char { Calculation, Modeling, Layout }; enum class GOType : char { Point, Arc, Spline, SplinePath, Unknown }; enum class SplinePointPosition : char { FirstPoint, LastPoint }; -// variables name -extern const QString arc_; -extern const QString spl_; -extern const QString splPath; -extern const QString radius_V; -extern const QString radiusArc_; -extern const QString angle1_V; -extern const QString angle2_V; -extern const QString angle1Arc_; -extern const QString angle2Arc_; -extern const QString angle1Spl_; -extern const QString angle2Spl_; -extern const QString angle1SplPath; -extern const QString angle2SplPath; - - #endif // VGEOMETRYDEF_H diff --git a/src/libs/vgeometry/vspline.cpp b/src/libs/vgeometry/vspline.cpp index 18f2a2dca..139839473 100644 --- a/src/libs/vgeometry/vspline.cpp +++ b/src/libs/vgeometry/vspline.cpp @@ -601,7 +601,7 @@ qreal VSpline::CalcSqDistance (qreal x1, qreal y1, qreal x2, qreal y2) */ void VSpline::CreateName() { - setName(QString(spl_+"%1_%2").arg(this->GetP1().name(), this->GetP4().name())); + setName(SPL_ + QString("%1_%2").arg(this->GetP1().name(), this->GetP4().name())); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vmisc/def.cpp b/src/libs/vmisc/def.cpp index 503a67654..ab584250d 100644 --- a/src/libs/vmisc/def.cpp +++ b/src/libs/vmisc/def.cpp @@ -343,10 +343,6 @@ const QString p52_S = QStringLiteral("p52"); const QString p53_S = QStringLiteral("p53"); const QString p54_S = QStringLiteral("p54"); -//variables -const QString line_ = QStringLiteral("Line_"); -const QString angleLine_ = QStringLiteral("AngleLine_"); - //functions const QString sin_F = QStringLiteral("sin"); const QString cos_F = QStringLiteral("cos"); @@ -386,6 +382,10 @@ const QString cm_Oprt = QStringLiteral("cm"); const QString mm_Oprt = QStringLiteral("mm"); const QString in_Oprt = QStringLiteral("in"); +const QStringList builInPostfixOperators = QStringList() << cm_Oprt + << mm_Oprt + << in_Oprt; + const QString cursorArrowOpenHand = QStringLiteral("://cursor/cursor-arrow-openhand.png"); const QString cursorArrowCloseHand = QStringLiteral("://cursor/cursor-arrow-closehand.png"); diff --git a/src/libs/vmisc/def.h b/src/libs/vmisc/def.h index d241e1dd4..f4a96e314 100644 --- a/src/libs/vmisc/def.h +++ b/src/libs/vmisc/def.h @@ -529,13 +529,6 @@ extern const QString p52_S; extern const QString p53_S; extern const QString p54_S; -extern const QString line_; -extern const QString angleLine_; - -// variables name -extern const QString line_; -extern const QString angleLine_; - // functions extern const QString sin_F; extern const QString cos_F; @@ -571,6 +564,8 @@ extern const QString cm_Oprt; extern const QString mm_Oprt; extern const QString in_Oprt; +extern const QStringList builInPostfixOperators; + extern const QString cursorArrowOpenHand; extern const QString cursorArrowCloseHand; diff --git a/src/libs/vpatterndb/vtranslatevars.cpp b/src/libs/vpatterndb/vtranslatevars.cpp index 7007dcc17..e180dc2d2 100644 --- a/src/libs/vpatterndb/vtranslatevars.cpp +++ b/src/libs/vpatterndb/vtranslatevars.cpp @@ -31,6 +31,7 @@ #include "../vmisc/def.h" #include "../vgeometry/vgeometrydef.h" #include "../qmuparser/qmutokenparser.h" +#include "../ifc/ifcdef.h" using namespace qmu; diff --git a/src/libs/vtools/dialogs/tools/dialogalongline.cpp b/src/libs/vtools/dialogs/tools/dialogalongline.cpp index 28ecfa9d2..817274dce 100644 --- a/src/libs/vtools/dialogs/tools/dialogalongline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogalongline.cpp @@ -75,7 +75,7 @@ DialogAlongLine::DialogAlongLine(const VContainer *data, const quint32 &toolId, vis = new VisToolAlongLine(data); // Call after initialization vis!!!! - SetTypeLine(VAbstractTool::TypeLineNone);//By default don't show line + SetTypeLine(TypeLineNone);//By default don't show line FixateSize(); } diff --git a/src/libs/vtools/dialogs/tools/dialogline.cpp b/src/libs/vtools/dialogs/tools/dialogline.cpp index 819da62dd..1873c57db 100644 --- a/src/libs/vtools/dialogs/tools/dialogline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogline.cpp @@ -52,7 +52,7 @@ DialogLine::DialogLine(const VContainer *data, const quint32 &toolId, QWidget *p FillComboBoxLineColors(ui->comboBoxLineColor); QMap stylesPics = VAbstractTool::LineStylesPics(); - stylesPics.remove(VAbstractTool::TypeLineNone);// Prevent hiding line + stylesPics.remove(TypeLineNone);// Prevent hiding line FillComboBoxTypeLine(ui->comboBoxLineType, stylesPics); number = 0; diff --git a/src/libs/vtools/dialogs/tools/dialogtool.cpp b/src/libs/vtools/dialogs/tools/dialogtool.cpp index 2d3169279..80b39ebe4 100644 --- a/src/libs/vtools/dialogs/tools/dialogtool.cpp +++ b/src/libs/vtools/dialogs/tools/dialogtool.cpp @@ -227,7 +227,7 @@ QString DialogTool::GetComboBoxCurrentData(const QComboBox *box) const #endif if (value.isEmpty()) { - value = VAbstractTool::TypeLineLine; + value = TypeLineLine; } return value; } diff --git a/src/libs/vtools/tools/vabstracttool.cpp b/src/libs/vtools/tools/vabstracttool.cpp index 61370ab03..8bf9bfcc8 100644 --- a/src/libs/vtools/tools/vabstracttool.cpp +++ b/src/libs/vtools/tools/vabstracttool.cpp @@ -40,81 +40,6 @@ #include #include -const QString VAbstractTool::AttrType = QStringLiteral("type"); -const QString VAbstractTool::AttrMx = QStringLiteral("mx"); -const QString VAbstractTool::AttrMy = QStringLiteral("my"); -const QString VAbstractTool::AttrName = QStringLiteral("name"); -const QString VAbstractTool::AttrMx1 = QStringLiteral("mx1"); -const QString VAbstractTool::AttrMy1 = QStringLiteral("my1"); -const QString VAbstractTool::AttrName1 = QStringLiteral("name1"); -const QString VAbstractTool::AttrMx2 = QStringLiteral("mx2"); -const QString VAbstractTool::AttrMy2 = QStringLiteral("my2"); -const QString VAbstractTool::AttrName2 = QStringLiteral("name2"); -const QString VAbstractTool::AttrBaseLineP1 = QStringLiteral("baseLineP1"); -const QString VAbstractTool::AttrBaseLineP2 = QStringLiteral("baseLineP2"); -const QString VAbstractTool::AttrDartP1 = QStringLiteral("dartP1"); -const QString VAbstractTool::AttrDartP2 = QStringLiteral("dartP2"); -const QString VAbstractTool::AttrDartP3 = QStringLiteral("dartP3"); -const QString VAbstractTool::AttrX = QStringLiteral("x"); -const QString VAbstractTool::AttrY = QStringLiteral("y"); -const QString VAbstractTool::AttrTypeLine = QStringLiteral("typeLine"); -const QString VAbstractTool::AttrLength = QStringLiteral("length"); -const QString VAbstractTool::AttrBasePoint = QStringLiteral("basePoint"); -const QString VAbstractTool::AttrFirstPoint = QStringLiteral("firstPoint"); -const QString VAbstractTool::AttrSecondPoint = QStringLiteral("secondPoint"); -const QString VAbstractTool::AttrThirdPoint = QStringLiteral("thirdPoint"); -const QString VAbstractTool::AttrCenter = QStringLiteral("center"); -const QString VAbstractTool::AttrRadius = QStringLiteral("radius"); -const QString VAbstractTool::AttrAngle = QStringLiteral("angle"); -const QString VAbstractTool::AttrAngle1 = QStringLiteral("angle1"); -const QString VAbstractTool::AttrAngle2 = QStringLiteral("angle2"); -const QString VAbstractTool::AttrP1Line = QStringLiteral("p1Line"); -const QString VAbstractTool::AttrP2Line = QStringLiteral("p2Line"); -const QString VAbstractTool::AttrP1Line1 = QStringLiteral("p1Line1"); -const QString VAbstractTool::AttrP2Line1 = QStringLiteral("p2Line1"); -const QString VAbstractTool::AttrP1Line2 = QStringLiteral("p1Line2"); -const QString VAbstractTool::AttrP2Line2 = QStringLiteral("p2Line2"); -const QString VAbstractTool::AttrPShoulder = QStringLiteral("pShoulder"); -const QString VAbstractTool::AttrPoint1 = QStringLiteral("point1"); -const QString VAbstractTool::AttrPoint2 = QStringLiteral("point2"); -const QString VAbstractTool::AttrPoint4 = QStringLiteral("point4"); -const QString VAbstractTool::AttrKAsm1 = QStringLiteral("kAsm1"); -const QString VAbstractTool::AttrKAsm2 = QStringLiteral("kAsm2"); -const QString VAbstractTool::AttrKCurve = QStringLiteral("kCurve"); -const QString VAbstractTool::AttrPathPoint = QStringLiteral("pathPoint"); -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::AttrFirstArc = QStringLiteral("firstArc"); -const QString VAbstractTool::AttrSecondArc = QStringLiteral("secondArc"); -const QString VAbstractTool::AttrCrossPoint = QStringLiteral("crossPoint"); -const QString VAbstractTool::AttrC1Center = QStringLiteral("c1Center"); -const QString VAbstractTool::AttrC2Center = QStringLiteral("c2Center"); -const QString VAbstractTool::AttrC1Radius = QStringLiteral("c1Radius"); -const QString VAbstractTool::AttrC2Radius = QStringLiteral("c2Radius"); -const QString VAbstractTool::AttrCCenter = QStringLiteral("cCenter"); -const QString VAbstractTool::AttrTangent = QStringLiteral("tangent"); -const QString VAbstractTool::AttrCRadius = QStringLiteral("cRadius"); -const QString VAbstractTool::AttrArc = QStringLiteral("arc"); - -const QString VAbstractTool::TypeLineNone = QStringLiteral("none"); -const QString VAbstractTool::TypeLineLine = QStringLiteral("hair"); -const QString VAbstractTool::TypeLineDashLine = QStringLiteral("dashLine"); -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. @@ -244,7 +169,8 @@ QMap VAbstractTool::LineStylesPics() //--------------------------------------------------------------------------------------------------------------------- const QStringList VAbstractTool::Colors() { - const QStringList colors = QStringList() << ColorBlack << ColorGreen << ColorBlue << ColorDarkRed << ColorDarkGreen + const QStringList colors = QStringList() << ColorBlack << ColorGreen << ColorBlue + << ColorDarkRed << ColorDarkGreen << ColorDarkBlue << ColorYellow; return colors; } @@ -333,8 +259,9 @@ void VAbstractTool::ToolCreation(const Source &typeCreation) */ const QStringList VAbstractTool::StylesList() { - const QStringList styles = QStringList() << TypeLineNone << TypeLineLine << TypeLineDashLine << TypeLineDotLine - << TypeLineDashDotLine << TypeLineDashDotDotLine; + const QStringList styles = QStringList() << TypeLineNone << TypeLineLine << TypeLineDashLine + << TypeLineDotLine << TypeLineDashDotLine + << TypeLineDashDotDotLine; return styles; } diff --git a/src/libs/vtools/tools/vabstracttool.h b/src/libs/vtools/tools/vabstracttool.h index 3b40e76da..08affb508 100644 --- a/src/libs/vtools/tools/vabstracttool.h +++ b/src/libs/vtools/tools/vabstracttool.h @@ -54,80 +54,6 @@ public: VAbstractTool(VAbstractPattern *doc, VContainer *data, quint32 id, QObject *parent = nullptr); virtual ~VAbstractTool() Q_DECL_OVERRIDE; quint32 getId() const; - static const QString AttrType; - static const QString AttrMx; - static const QString AttrMy; - static const QString AttrName; - static const QString AttrMx1; - static const QString AttrMy1; - static const QString AttrName1; - static const QString AttrMx2; - static const QString AttrMy2; - static const QString AttrName2; - static const QString AttrBaseLineP1; - static const QString AttrBaseLineP2; - static const QString AttrDartP1; - static const QString AttrDartP2; - static const QString AttrDartP3; - static const QString AttrX; - static const QString AttrY; - static const QString AttrTypeLine; - static const QString AttrLength; - static const QString AttrBasePoint; - static const QString AttrFirstPoint; - static const QString AttrSecondPoint; - static const QString AttrThirdPoint; - static const QString AttrCenter; - static const QString AttrRadius; - static const QString AttrAngle; - static const QString AttrAngle1; - static const QString AttrAngle2; - static const QString AttrP1Line; - static const QString AttrP2Line; - static const QString AttrP1Line1; - static const QString AttrP2Line1; - static const QString AttrP1Line2; - static const QString AttrP2Line2; - static const QString AttrPShoulder; - static const QString AttrPoint1; - static const QString AttrPoint2; - static const QString AttrPoint4; - static const QString AttrKAsm1; - static const QString AttrKAsm2; - static const QString AttrKCurve; - static const QString AttrPathPoint; - static const QString AttrPSpline; - static const QString AttrAxisP1; - static const QString AttrAxisP2; - static const QString AttrCurve; - static const QString AttrLineColor; - static const QString AttrColor; - static const QString AttrFirstArc; - static const QString AttrSecondArc; - static const QString AttrCrossPoint; - static const QString AttrC1Center; - static const QString AttrC2Center; - static const QString AttrC1Radius; - static const QString AttrC2Radius; - static const QString AttrCCenter; - static const QString AttrTangent; - static const QString AttrCRadius; - static const QString AttrArc; - - static const QString TypeLineNone; - static const QString TypeLineLine; - static const QString TypeLineDashLine; - static const QString TypeLineDotLine; - 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); diff --git a/src/libs/vtools/tools/vtooluniondetails.cpp b/src/libs/vtools/tools/vtooluniondetails.cpp index fbfdc0641..66a4d3919 100644 --- a/src/libs/vtools/tools/vtooluniondetails.cpp +++ b/src/libs/vtools/tools/vtooluniondetails.cpp @@ -671,8 +671,8 @@ QVector VToolUnionDetails::GetDetailFromFile(VAbstractPattern *doc, con if (element.tagName() == VToolUnionDetails::TagNode) { quint32 id = doc->GetParametrUInt(element, VToolDetail::AttrIdObject, NULL_ID_STR); - qreal mx = qApp->toPixel(doc->GetParametrDouble(element, VAbstractTool::AttrMx, "0.0")); - qreal my = qApp->toPixel(doc->GetParametrDouble(element, VAbstractTool::AttrMy, "0.0")); + qreal mx = qApp->toPixel(doc->GetParametrDouble(element, AttrMx, "0.0")); + qreal my = qApp->toPixel(doc->GetParametrDouble(element, AttrMy, "0.0")); const bool reversed = doc->GetParametrUInt(element, VToolDetail::AttrReverse, "0"); Tool tool = Tool::NodePoint; NodeDetail nodeType = NodeDetail::Contour; diff --git a/src/libs/vtools/undocommands/movedetail.cpp b/src/libs/vtools/undocommands/movedetail.cpp index c42e3c7c4..814a1b16b 100644 --- a/src/libs/vtools/undocommands/movedetail.cpp +++ b/src/libs/vtools/undocommands/movedetail.cpp @@ -45,8 +45,8 @@ MoveDetail::MoveDetail(VAbstractPattern *doc, const double &x, const double &y, QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { - oldX = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrMx, "0.0")); - oldY = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrMy, "0.0")); + oldX = qApp->toPixel(doc->GetParametrDouble(domElement, AttrMx, "0.0")); + oldY = qApp->toPixel(doc->GetParametrDouble(domElement, AttrMy, "0.0")); } else { @@ -134,6 +134,6 @@ int MoveDetail::id() const //--------------------------------------------------------------------------------------------------------------------- void MoveDetail::SaveCoordinates(QDomElement &domElement, double x, double y) { - doc->SetAttribute(domElement, VAbstractTool::AttrMx, QString().setNum(qApp->fromPixel(x))); - doc->SetAttribute(domElement, VAbstractTool::AttrMy, QString().setNum(qApp->fromPixel(y))); + doc->SetAttribute(domElement, AttrMx, QString().setNum(qApp->fromPixel(x))); + doc->SetAttribute(domElement, AttrMy, QString().setNum(qApp->fromPixel(y))); } diff --git a/src/libs/vtools/undocommands/movedoublelabel.cpp b/src/libs/vtools/undocommands/movedoublelabel.cpp index 6d32c0e75..67f8c5f2e 100644 --- a/src/libs/vtools/undocommands/movedoublelabel.cpp +++ b/src/libs/vtools/undocommands/movedoublelabel.cpp @@ -69,13 +69,13 @@ MoveDoubleLabel::MoveDoubleLabel(VAbstractPattern *doc, const double &x, const d { if (type == DoublePoint::FirstPoint) { - oldMx = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrMx1, "0.0")); - oldMy = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrMy1, "0.0")); + oldMx = qApp->toPixel(doc->GetParametrDouble(domElement, AttrMx1, "0.0")); + oldMy = qApp->toPixel(doc->GetParametrDouble(domElement, AttrMy1, "0.0")); } else { - oldMx = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrMx2, "0.0")); - oldMy = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrMy2, "0.0")); + oldMx = qApp->toPixel(doc->GetParametrDouble(domElement, AttrMx2, "0.0")); + oldMy = qApp->toPixel(doc->GetParametrDouble(domElement, AttrMy2, "0.0")); } if (type == DoublePoint::FirstPoint) @@ -168,13 +168,13 @@ void MoveDoubleLabel::Do(double mx, double my) { if (type == DoublePoint::FirstPoint) { - doc->SetAttribute(domElement, VAbstractTool::AttrMx1, QString().setNum(qApp->fromPixel(mx))); - doc->SetAttribute(domElement, VAbstractTool::AttrMy1, QString().setNum(qApp->fromPixel(my))); + doc->SetAttribute(domElement, AttrMx1, QString().setNum(qApp->fromPixel(mx))); + doc->SetAttribute(domElement, AttrMy1, QString().setNum(qApp->fromPixel(my))); } else { - doc->SetAttribute(domElement, VAbstractTool::AttrMx2, QString().setNum(qApp->fromPixel(mx))); - doc->SetAttribute(domElement, VAbstractTool::AttrMy2, QString().setNum(qApp->fromPixel(my))); + doc->SetAttribute(domElement, AttrMx2, QString().setNum(qApp->fromPixel(mx))); + doc->SetAttribute(domElement, AttrMy2, QString().setNum(qApp->fromPixel(my))); } emit NeedLiteParsing(Document::LitePPParse); diff --git a/src/libs/vtools/undocommands/movelabel.cpp b/src/libs/vtools/undocommands/movelabel.cpp index 00ebde0d3..a26090288 100644 --- a/src/libs/vtools/undocommands/movelabel.cpp +++ b/src/libs/vtools/undocommands/movelabel.cpp @@ -49,8 +49,8 @@ MoveLabel::MoveLabel(VAbstractPattern *doc, const double &x, const double &y, co QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { - oldMx = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrMx, "0.0")); - oldMy = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrMy, "0.0")); + oldMx = qApp->toPixel(doc->GetParametrDouble(domElement, AttrMx, "0.0")); + oldMy = qApp->toPixel(doc->GetParametrDouble(domElement, AttrMy, "0.0")); qCDebug(vUndo, "Label old Mx %f", oldMx); qCDebug(vUndo, "Label old My %f", oldMy); @@ -117,8 +117,8 @@ void MoveLabel::Do(double mx, double my) QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) { - doc->SetAttribute(domElement, VAbstractTool::AttrMx, QString().setNum(qApp->fromPixel(mx))); - doc->SetAttribute(domElement, VAbstractTool::AttrMy, QString().setNum(qApp->fromPixel(my))); + doc->SetAttribute(domElement, AttrMx, QString().setNum(qApp->fromPixel(mx))); + doc->SetAttribute(domElement, AttrMy, QString().setNum(qApp->fromPixel(my))); emit NeedLiteParsing(Document::LitePPParse); diff --git a/src/libs/vtools/undocommands/movespline.cpp b/src/libs/vtools/undocommands/movespline.cpp index 73408bef5..85b69438b 100644 --- a/src/libs/vtools/undocommands/movespline.cpp +++ b/src/libs/vtools/undocommands/movespline.cpp @@ -92,11 +92,11 @@ void MoveSpline::Do(const VSpline &spl) QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) { - doc->SetAttribute(domElement, VAbstractTool::AttrAngle1, QString().setNum(spl.GetStartAngle())); - doc->SetAttribute(domElement, VAbstractTool::AttrAngle2, QString().setNum(spl.GetEndAngle())); - doc->SetAttribute(domElement, VAbstractTool::AttrKAsm1, QString().setNum(spl.GetKasm1())); - doc->SetAttribute(domElement, VAbstractTool::AttrKAsm2, QString().setNum(spl.GetKasm2())); - doc->SetAttribute(domElement, VAbstractTool::AttrKCurve, QString().setNum(spl.GetKcurve())); + doc->SetAttribute(domElement, AttrAngle1, QString().setNum(spl.GetStartAngle())); + doc->SetAttribute(domElement, AttrAngle2, QString().setNum(spl.GetEndAngle())); + doc->SetAttribute(domElement, AttrKAsm1, QString().setNum(spl.GetKasm1())); + doc->SetAttribute(domElement, AttrKAsm2, QString().setNum(spl.GetKasm2())); + doc->SetAttribute(domElement, AttrKCurve, QString().setNum(spl.GetKcurve())); emit NeedLiteParsing(Document::LiteParse); diff --git a/src/libs/vtools/undocommands/movesplinepath.cpp b/src/libs/vtools/undocommands/movesplinepath.cpp index 35c6be1cc..142e871e3 100644 --- a/src/libs/vtools/undocommands/movesplinepath.cpp +++ b/src/libs/vtools/undocommands/movesplinepath.cpp @@ -89,7 +89,7 @@ void MoveSplinePath::Do(const VSplinePath &splPath) QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) { - doc->SetAttribute(domElement, VToolSplinePath::AttrKCurve, QString().setNum(splPath.GetKCurve())); + doc->SetAttribute(domElement, AttrKCurve, QString().setNum(splPath.GetKCurve())); VToolSplinePath::UpdatePathPoint(doc, domElement, splPath); emit NeedLiteParsing(Document::LiteParse); diff --git a/src/libs/vtools/undocommands/movespoint.cpp b/src/libs/vtools/undocommands/movespoint.cpp index f9cc2cc5f..fb34714b6 100644 --- a/src/libs/vtools/undocommands/movespoint.cpp +++ b/src/libs/vtools/undocommands/movespoint.cpp @@ -49,8 +49,8 @@ MoveSPoint::MoveSPoint(VAbstractPattern *doc, const double &x, const double &y, QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { - oldX = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrX, "0.0")); - oldY = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrY, "0.0")); + oldX = qApp->toPixel(doc->GetParametrDouble(domElement, AttrX, "0.0")); + oldY = qApp->toPixel(doc->GetParametrDouble(domElement, AttrY, "0.0")); qCDebug(vUndo, "SPoint oldX %f", oldX); qCDebug(vUndo, "SPoint oldY %f", oldY); @@ -119,8 +119,8 @@ void MoveSPoint::Do(double x, double y) QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) { - doc->SetAttribute(domElement, VAbstractTool::AttrX, QString().setNum(qApp->fromPixel(x))); - doc->SetAttribute(domElement, VAbstractTool::AttrY, QString().setNum(qApp->fromPixel(y))); + doc->SetAttribute(domElement, AttrX, QString().setNum(qApp->fromPixel(x))); + doc->SetAttribute(domElement, AttrY, QString().setNum(qApp->fromPixel(y))); emit NeedLiteParsing(Document::LitePPParse); diff --git a/src/libs/vtools/undocommands/savedetailoptions.cpp b/src/libs/vtools/undocommands/savedetailoptions.cpp index 7d29db2cc..9c6c7da53 100644 --- a/src/libs/vtools/undocommands/savedetailoptions.cpp +++ b/src/libs/vtools/undocommands/savedetailoptions.cpp @@ -144,7 +144,7 @@ int SaveDetailOptions::id() const //--------------------------------------------------------------------------------------------------------------------- void SaveDetailOptions::SaveDet(QDomElement &domElement, const VDetail &det) { - doc->SetAttribute(domElement, VAbstractTool::AttrName, det.getName()); + doc->SetAttribute(domElement, AttrName, det.getName()); doc->SetAttribute(domElement, VToolDetail::AttrSupplement, QString().setNum(det.getSeamAllowance())); doc->SetAttribute(domElement, VToolDetail::AttrClosed, QString().setNum(det.getClosed())); doc->SetAttribute(domElement, VToolDetail::AttrWidth, QString().setNum(det.getWidth()));