From f8c6a65962ba96fdbe67f72b2ded65775a548d70 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 12 Jun 2015 11:55:44 +0300 Subject: [PATCH] Moving class VContainer in a static library complited. --HG-- branch : feature --- share/translations.pro | 4 +- src/app/app.pri | 1 - src/app/app.pro | 9 + src/app/container/container.pri | 46 +-- src/app/container/vformula.cpp | 10 +- src/app/core/vapplication.h | 2 +- src/app/core/vsettings.cpp | 8 +- src/app/dialogs/app/dialogincrements.cpp | 2 +- .../app/dialogindividualmeasurements.cpp | 2 +- src/app/dialogs/app/dialoglayoutsettings.cpp | 89 +++--- .../app/dialogstandardmeasurements.cpp | 2 +- src/app/dialogs/tools/dialogalongline.cpp | 2 +- src/app/dialogs/tools/dialogarc.cpp | 8 +- src/app/dialogs/tools/dialogarcwithlength.cpp | 8 +- src/app/dialogs/tools/dialogbisector.cpp | 4 +- .../tools/dialogcurveintersectaxis.cpp | 4 +- src/app/dialogs/tools/dialogcutarc.cpp | 4 +- src/app/dialogs/tools/dialogcutspline.cpp | 4 +- src/app/dialogs/tools/dialogcutsplinepath.cpp | 4 +- src/app/dialogs/tools/dialogdetail.cpp | 4 +- src/app/dialogs/tools/dialogdetail.h | 2 +- .../dialogs/tools/dialogeditwrongformula.cpp | 4 +- src/app/dialogs/tools/dialogendline.cpp | 6 +- src/app/dialogs/tools/dialogheight.cpp | 2 +- src/app/dialogs/tools/dialogline.cpp | 2 +- src/app/dialogs/tools/dialoglineintersect.cpp | 2 +- .../dialogs/tools/dialoglineintersectaxis.cpp | 4 +- src/app/dialogs/tools/dialognormal.cpp | 2 +- .../tools/dialogpointfromarcandtangent.cpp | 2 +- .../tools/dialogpointfromcircleandtangent.cpp | 5 +- .../dialogs/tools/dialogpointofcontact.cpp | 4 +- .../tools/dialogpointofintersection.cpp | 2 +- .../tools/dialogpointofintersectionarcs.cpp | 2 +- .../dialogpointofintersectioncircles.cpp | 8 +- src/app/dialogs/tools/dialogshoulderpoint.cpp | 4 +- src/app/dialogs/tools/dialogspline.cpp | 2 +- src/app/dialogs/tools/dialogsplinepath.cpp | 2 +- src/app/dialogs/tools/dialogtool.cpp | 9 +- src/app/dialogs/tools/dialogtriangle.cpp | 2 +- src/app/dialogs/tools/dialoguniondetails.cpp | 4 +- src/app/geometry/geometry.pri | 12 - src/app/mainwindow.cpp | 8 +- src/app/mainwindowsnogui.cpp | 8 +- src/app/mainwindowsnogui.h | 2 +- src/app/options.cpp | 190 ------------ src/app/options.h | 265 ----------------- src/app/tools/drawTools/vdrawtool.cpp | 6 +- src/app/tools/drawTools/vtoolalongline.cpp | 2 +- src/app/tools/drawTools/vtoolarc.cpp | 2 +- .../tools/drawTools/vtoolarcwithlength.cpp | 2 +- src/app/tools/drawTools/vtoolbisector.cpp | 2 +- .../drawTools/vtoolcurveintersectaxis.cpp | 2 +- src/app/tools/drawTools/vtoolcutarc.cpp | 2 +- src/app/tools/drawTools/vtoolcutspline.cpp | 2 +- .../tools/drawTools/vtoolcutsplinepath.cpp | 2 +- src/app/tools/drawTools/vtoolendline.cpp | 2 +- .../drawTools/vtoollineintersectaxis.cpp | 2 +- src/app/tools/drawTools/vtoolnormal.cpp | 2 +- .../tools/drawTools/vtoolpointofcontact.cpp | 2 +- .../tools/drawTools/vtoolshoulderpoint.cpp | 2 +- src/app/tools/vdatatool.h | 2 +- src/app/visualization/vistoolalongline.cpp | 2 +- src/app/visualization/vistoolarc.cpp | 2 +- .../visualization/vistoolarcwithlength.cpp | 2 +- src/app/visualization/vistoolbisector.cpp | 2 +- .../vistoolcurveintersectaxis.cpp | 2 +- src/app/visualization/vistoolcutarc.cpp | 2 +- src/app/visualization/vistoolcutspline.cpp | 2 +- .../visualization/vistoolcutsplinepath.cpp | 2 +- src/app/visualization/vistoolendline.cpp | 2 +- src/app/visualization/vistoolline.cpp | 2 +- .../visualization/vistoollineintersect.cpp | 2 +- .../vistoollineintersectaxis.cpp | 2 +- .../vistoolpointfromarcandtangent.cpp | 2 +- .../vistoolpointfromcircleandtangent.cpp | 2 +- .../vistoolpointofintersection.cpp | 2 +- .../vistoolpointofintersectionarcs.cpp | 2 +- .../vistoolpointofintersectioncircles.cpp | 2 +- src/app/visualization/vistoolspline.cpp | 2 +- src/app/visualization/vistooltriangle.cpp | 2 +- src/app/visualization/visualization.cpp | 6 +- src/app/widgets/textdelegate.cpp | 2 +- src/app/xml/vabstractmeasurements.cpp | 71 ----- src/app/xml/vabstractmeasurements.h | 3 +- src/app/xml/vpattern.h | 2 +- src/libs/ifc/exception/vexception.h | 2 +- src/libs/ifc/ifcdef.h | 71 +++++ src/libs/libs.pro | 6 +- .../vpatterndb}/calculator.cpp | 30 +- .../vpatterndb}/calculator.h | 10 +- src/libs/vpatterndb/stable.cpp | 30 ++ src/libs/vpatterndb/stable.h | 52 ++++ .../container => libs/vpatterndb}/variables.h | 0 .../vpatterndb}/variables/varcangle.cpp | 2 +- .../vpatterndb}/variables/varcangle.h | 0 .../vpatterndb}/variables/varclength.cpp | 7 +- .../vpatterndb}/variables/varclength.h | 2 +- .../vpatterndb}/variables/varcradius.cpp | 7 +- .../vpatterndb}/variables/varcradius.h | 3 +- .../vpatterndb}/variables/varcradius_p.h | 0 .../vpatterndb}/variables/vcurveangle.cpp | 2 +- .../vpatterndb}/variables/vcurveangle.h | 0 .../vpatterndb}/variables/vcurvelength.cpp | 7 +- .../vpatterndb}/variables/vcurvelength.h | 3 +- .../vpatterndb}/variables/vcurvevariable.cpp | 3 +- .../vpatterndb}/variables/vcurvevariable.h | 0 .../vpatterndb}/variables/vcurvevariable_p.h | 2 + .../vpatterndb}/variables/vincrement.cpp | 1 - .../vpatterndb}/variables/vincrement.h | 0 .../vpatterndb}/variables/vincrement_p.h | 2 + .../variables/vinternalvariable.cpp | 0 .../vpatterndb}/variables/vinternalvariable.h | 2 +- .../variables/vinternalvariable_p.h | 1 - .../vpatterndb}/variables/vlineangle.cpp | 3 +- .../vpatterndb}/variables/vlineangle.h | 0 .../vpatterndb}/variables/vlineangle_p.h | 2 + .../vpatterndb}/variables/vlinelength.cpp | 10 +- .../vpatterndb}/variables/vlinelength.h | 3 +- .../vpatterndb}/variables/vlinelength_p.h | 11 +- .../vpatterndb}/variables/vmeasurement.cpp | 22 +- .../vpatterndb}/variables/vmeasurement.h | 8 +- .../vpatterndb}/variables/vmeasurement_p.h | 0 .../vpatterndb}/variables/vsplineangle.cpp | 2 +- .../vpatterndb}/variables/vsplineangle.h | 0 .../vpatterndb}/variables/vsplinelength.cpp | 7 +- .../vpatterndb}/variables/vsplinelength.h | 2 +- .../vpatterndb}/variables/vvariable.cpp | 14 +- .../vpatterndb}/variables/vvariable.h | 3 +- .../vpatterndb}/variables/vvariable_p.h | 0 .../vpatterndb}/vcontainer.cpp | 12 +- .../vpatterndb}/vcontainer.h | 10 +- .../geometry => libs/vpatterndb}/vdetail.cpp | 4 +- .../geometry => libs/vpatterndb}/vdetail.h | 2 +- .../geometry => libs/vpatterndb}/vdetail_p.h | 2 +- .../vpatterndb}/vnodedetail.cpp | 0 .../vpatterndb}/vnodedetail.h | 3 +- .../vpatterndb}/vnodedetail_p.h | 2 +- src/libs/vpatterndb/vpatterndb.pri | 57 ++++ src/libs/vpatterndb/vpatterndb.pro | 97 +++++++ .../vpatterndb}/vtranslatevars.cpp | 17 +- .../vpatterndb}/vtranslatevars.h | 9 +- src/utils/def.cpp | 218 ++++++++++++++ src/utils/def.h | 270 ++++++++++++++++++ src/utils/utils.pri | 3 + 144 files changed, 1097 insertions(+), 869 deletions(-) delete mode 100644 src/app/geometry/geometry.pri rename src/{app/container => libs/vpatterndb}/calculator.cpp (92%) rename src/{app/container => libs/vpatterndb}/calculator.h (89%) create mode 100644 src/libs/vpatterndb/stable.cpp create mode 100644 src/libs/vpatterndb/stable.h rename src/{app/container => libs/vpatterndb}/variables.h (100%) rename src/{app/container => libs/vpatterndb}/variables/varcangle.cpp (98%) rename src/{app/container => libs/vpatterndb}/variables/varcangle.h (100%) rename src/{app/container => libs/vpatterndb}/variables/varclength.cpp (93%) rename src/{app/container => libs/vpatterndb}/variables/varclength.h (97%) rename src/{app/container => libs/vpatterndb}/variables/varcradius.cpp (94%) rename src/{app/container => libs/vpatterndb}/variables/varcradius.h (96%) rename src/{app/container => libs/vpatterndb}/variables/varcradius_p.h (100%) rename src/{app/container => libs/vpatterndb}/variables/vcurveangle.cpp (98%) rename src/{app/container => libs/vpatterndb}/variables/vcurveangle.h (100%) rename src/{app/container => libs/vpatterndb}/variables/vcurvelength.cpp (93%) rename src/{app/container => libs/vpatterndb}/variables/vcurvelength.h (95%) rename src/{app/container => libs/vpatterndb}/variables/vcurvevariable.cpp (97%) rename src/{app/container => libs/vpatterndb}/variables/vcurvevariable.h (100%) rename src/{app/container => libs/vpatterndb}/variables/vcurvevariable_p.h (98%) rename src/{app/container => libs/vpatterndb}/variables/vincrement.cpp (99%) rename src/{app/container => libs/vpatterndb}/variables/vincrement.h (100%) rename src/{app/container => libs/vpatterndb}/variables/vincrement_p.h (98%) rename src/{app/container => libs/vpatterndb}/variables/vinternalvariable.cpp (100%) rename src/{app/container => libs/vpatterndb}/variables/vinternalvariable.h (98%) rename src/{app/container => libs/vpatterndb}/variables/vinternalvariable_p.h (98%) rename src/{app/container => libs/vpatterndb}/variables/vlineangle.cpp (98%) rename src/{app/container => libs/vpatterndb}/variables/vlineangle.h (100%) rename src/{app/container => libs/vpatterndb}/variables/vlineangle_p.h (98%) rename src/{app/container => libs/vpatterndb}/variables/vlinelength.cpp (91%) rename src/{app/container => libs/vpatterndb}/variables/vlinelength.h (95%) rename src/{app/container => libs/vpatterndb}/variables/vlinelength_p.h (83%) rename src/{app/container => libs/vpatterndb}/variables/vmeasurement.cpp (91%) rename src/{app/container => libs/vpatterndb}/variables/vmeasurement.h (89%) rename src/{app/container => libs/vpatterndb}/variables/vmeasurement_p.h (100%) rename src/{app/container => libs/vpatterndb}/variables/vsplineangle.cpp (98%) rename src/{app/container => libs/vpatterndb}/variables/vsplineangle.h (100%) rename src/{app/container => libs/vpatterndb}/variables/vsplinelength.cpp (94%) rename src/{app/container => libs/vpatterndb}/variables/vsplinelength.h (97%) rename src/{app/container => libs/vpatterndb}/variables/vvariable.cpp (90%) rename src/{app/container => libs/vpatterndb}/variables/vvariable.h (95%) rename src/{app/container => libs/vpatterndb}/variables/vvariable_p.h (100%) rename src/{app/container => libs/vpatterndb}/vcontainer.cpp (98%) rename src/{app/container => libs/vpatterndb}/vcontainer.h (98%) rename src/{app/geometry => libs/vpatterndb}/vdetail.cpp (99%) rename src/{app/geometry => libs/vpatterndb}/vdetail.h (98%) rename src/{app/geometry => libs/vpatterndb}/vdetail_p.h (98%) rename src/{app/geometry => libs/vpatterndb}/vnodedetail.cpp (100%) rename src/{app/geometry => libs/vpatterndb}/vnodedetail.h (99%) rename src/{app/geometry => libs/vpatterndb}/vnodedetail_p.h (98%) create mode 100644 src/libs/vpatterndb/vpatterndb.pri create mode 100644 src/libs/vpatterndb/vpatterndb.pro rename src/{app/container => libs/vpatterndb}/vtranslatevars.cpp (99%) rename src/{app/container => libs/vpatterndb}/vtranslatevars.h (93%) create mode 100644 src/utils/def.cpp diff --git a/share/translations.pro b/share/translations.pro index 066e627fa..45cdae4fe 100644 --- a/share/translations.pro +++ b/share/translations.pro @@ -14,7 +14,8 @@ DEPENDPATH += \ ../src/libs/ifc \ ../src/libs/vobj \ ../src/libs/vlayout \ - ../src/libs/vgeometry + ../src/libs/vgeometry \ + ../src/libs/vpatterndb include(../src/app/app.pri) include(../src/libs/qmuparser/qmuparser.pri) @@ -23,6 +24,7 @@ include(../src/libs/ifc/ifc.pri) include(../src/libs/vobj/vobj.pri) include(../src/libs/vlayout/vlayout.pri) include(../src/libs/vgeometry/vgeometry.pri) +include(../src/libs/vpatterndb/vpatterndb.pri) # Add here path to new translation file with name "valentina_*_*.ts" if you want to add new language. # Same paths in variable INSTALL_TRANSLATIONS (app.pro). diff --git a/src/app/app.pri b/src/app/app.pri index 4d185e939..ba5f59840 100644 --- a/src/app/app.pri +++ b/src/app/app.pri @@ -1,7 +1,6 @@ # Suport subdirectories. Just better project code tree. include(container/container.pri) include(dialogs/dialogs.pri) -include(geometry/geometry.pri) include(tools/tools.pri) include(widgets/widgets.pri) include(xml/xml.pri) diff --git a/src/app/app.pro b/src/app/app.pro index d7c2b4ba9..193aa596f 100644 --- a/src/app/app.pro +++ b/src/app/app.pro @@ -600,6 +600,15 @@ 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 +#VPatternDB staic library +unix|win32: LIBS += -L$$OUT_PWD/../libs/vpatterndb/$${DESTDIR}/ -lvpatterndb + +INCLUDEPATH += $$PWD/../libs/vpatterndb +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 + noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols # do nothing } else { diff --git a/src/app/container/container.pri b/src/app/container/container.pri index e1c016619..44e5c9e4e 100644 --- a/src/app/container/container.pri +++ b/src/app/container/container.pri @@ -2,49 +2,7 @@ # This need for corect working file translations.pro SOURCES += \ - $$PWD/vcontainer.cpp \ - $$PWD/calculator.cpp \ - $$PWD/variables/vmeasurement.cpp \ - $$PWD/variables/vincrement.cpp \ - $$PWD/variables/vvariable.cpp \ - $$PWD/variables/vinternalvariable.cpp \ - $$PWD/variables/vlineangle.cpp \ - $$PWD/variables/varclength.cpp \ - $$PWD/variables/vcurvelength.cpp \ - $$PWD/variables/vlinelength.cpp \ - $$PWD/variables/vsplinelength.cpp \ - $$PWD/vformula.cpp \ - $$PWD/variables/varcradius.cpp \ - $$PWD/variables/vcurvevariable.cpp \ - container/variables/vcurveangle.cpp \ - container/variables/varcangle.cpp \ - container/variables/vsplineangle.cpp \ - container/vtranslatevars.cpp + $$PWD/vformula.cpp HEADERS += \ - $$PWD/vcontainer.h \ - $$PWD/calculator.h \ - $$PWD/variables/vmeasurement.h \ - $$PWD/variables/vincrement.h \ - $$PWD/variables/vvariable.h \ - $$PWD/variables/vinternalvariable.h \ - $$PWD/variables/vlineangle.h \ - $$PWD/variables.h \ - $$PWD/variables/vcurvelength.h \ - $$PWD/variables/varclength.h \ - $$PWD/variables/vlinelength.h \ - $$PWD/variables/vsplinelength.h \ - $$PWD/variables/vinternalvariable_p.h \ - $$PWD/variables/vvariable_p.h \ - $$PWD/variables/vincrement_p.h \ - $$PWD/variables/vlineangle_p.h \ - $$PWD/variables/vlinelength_p.h \ - $$PWD/variables/vmeasurement_p.h \ - $$PWD/vformula.h \ - $$PWD/variables/varcradius.h \ - $$PWD/variables/vcurvevariable.h \ - $$PWD/variables/vcurvevariable_p.h \ - container/variables/vcurveangle.h \ - container/variables/varcangle.h \ - container/variables/vsplineangle.h \ - container/vtranslatevars.h + $$PWD/vformula.h diff --git a/src/app/container/vformula.cpp b/src/app/container/vformula.cpp index b897cf4bf..5f1185cbd 100644 --- a/src/app/container/vformula.cpp +++ b/src/app/container/vformula.cpp @@ -27,8 +27,8 @@ *************************************************************************/ #include "vformula.h" -#include "../container/calculator.h" -#include "../container/vcontainer.h" +#include "../libs/vpatterndb/calculator.h" +#include "../libs/vpatterndb/vcontainer.h" #include "../core/vapplication.h" #include "../core/vsettings.h" #include @@ -102,7 +102,7 @@ QString VFormula::GetFormula(FormulaType type) const } else { - return qApp->TrVars()->FormulaFromUser(formula); + return qApp->TrVars()->FormulaFromUser(formula, qApp->getSettings()->GetOsSeparator()); } } @@ -225,8 +225,8 @@ void VFormula::Eval() { try { - Calculator *cal = new Calculator(data); - QString expression = qApp->TrVars()->FormulaFromUser(formula); + Calculator *cal = new Calculator(data, qApp->patternType()); + QString expression = qApp->TrVars()->FormulaFromUser(formula, qApp->getSettings()->GetOsSeparator()); const qreal result = cal->EvalFormula(expression); delete cal; diff --git a/src/app/core/vapplication.h b/src/app/core/vapplication.h index e8a89c5f9..98ff39415 100644 --- a/src/app/core/vapplication.h +++ b/src/app/core/vapplication.h @@ -32,7 +32,7 @@ #include #include "../options.h" #include "../widgets/vmaingraphicsview.h" -#include "../container/vtranslatevars.h" +#include "../libs/vpatterndb/vtranslatevars.h" #include "vsettings.h" class VApplication;// used in define diff --git a/src/app/core/vsettings.cpp b/src/app/core/vsettings.cpp index a3b954983..02033aef4 100644 --- a/src/app/core/vsettings.cpp +++ b/src/app/core/vsettings.cpp @@ -492,7 +492,7 @@ void VSettings::SetUserPassword(const QString &value) //--------------------------------------------------------------------------------------------------------------------- int VSettings::GetLayoutPaperHeight() const { - const int def = qFloor(VAbstractMeasurements::UnitConvertor(1189/*A0*/, Unit::Mm, Unit::Px)); + const int def = qFloor(UnitConvertor(1189/*A0*/, Unit::Mm, Unit::Px)); bool ok = false; const int height = value(SettingLayoutPaperHeight, def).toInt(&ok); if (ok) @@ -514,7 +514,7 @@ void VSettings::SetLayoutPaperHeight(int value) //--------------------------------------------------------------------------------------------------------------------- int VSettings::GetLayoutPaperWidth() const { - const int def = qFloor(VAbstractMeasurements::UnitConvertor(841/*A0*/, Unit::Mm, Unit::Px)); + const int def = qFloor(UnitConvertor(841/*A0*/, Unit::Mm, Unit::Px)); bool ok = false; const int width = value(SettingLayoutPaperWidth, def).toInt(&ok); if (ok) @@ -552,7 +552,7 @@ unsigned int VSettings::GetLayoutShift() const //--------------------------------------------------------------------------------------------------------------------- unsigned int VSettings::GetDefLayoutShift() { - return static_cast(VAbstractMeasurements::UnitConvertor(50, Unit::Mm, Unit::Px)); + return static_cast(UnitConvertor(50, Unit::Mm, Unit::Px)); } //--------------------------------------------------------------------------------------------------------------------- @@ -580,7 +580,7 @@ unsigned int VSettings::GetLayoutWidth() const //--------------------------------------------------------------------------------------------------------------------- unsigned int VSettings::GetDefLayoutWidth() { - return static_cast(VAbstractMeasurements::UnitConvertor(2.5, Unit::Mm, Unit::Px)); + return static_cast(UnitConvertor(2.5, Unit::Mm, Unit::Px)); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/app/dialogincrements.cpp b/src/app/dialogs/app/dialogincrements.cpp index e1c0ae2ac..3aa3d0bac 100644 --- a/src/app/dialogs/app/dialogincrements.cpp +++ b/src/app/dialogs/app/dialogincrements.cpp @@ -942,7 +942,7 @@ void DialogIncrements::MeasurementChanged(qint32 row, qint32 column) qCDebug(vDialog, "Changed value to %f", base); // Convert value to measurements table unit - base = VAbstractMeasurements::UnitConvertor(base, qApp->patternUnit(), m->MUnit()); + base = UnitConvertor(base, qApp->patternUnit(), m->MUnit()); m->SetAttribute(domElement, VIndividualMeasurements::AttrValue, QString("%1").arg(base)); QString error; diff --git a/src/app/dialogs/app/dialogindividualmeasurements.cpp b/src/app/dialogs/app/dialogindividualmeasurements.cpp index c7f0e94f9..3fcc132f7 100644 --- a/src/app/dialogs/app/dialogindividualmeasurements.cpp +++ b/src/app/dialogs/app/dialogindividualmeasurements.cpp @@ -31,7 +31,7 @@ #include "../../xml/vindividualmeasurements.h" #include "../../core/vapplication.h" #include "../../core/vsettings.h" -#include "../../container/vcontainer.h" +#include "../../libs/vpatterndb/vcontainer.h" #include #include diff --git a/src/app/dialogs/app/dialoglayoutsettings.cpp b/src/app/dialogs/app/dialoglayoutsettings.cpp index f840af433..ab6ae314b 100644 --- a/src/app/dialogs/app/dialoglayoutsettings.cpp +++ b/src/app/dialogs/app/dialoglayoutsettings.cpp @@ -31,7 +31,6 @@ #include "../../core/vapplication.h" #include "../../libs/ifc/xml/vdomdocument.h" #include "../../core/vsettings.h" -#include "../../xml/vabstractmeasurements.h" #include "../../libs/vlayout/vlayoutgenerator.h" #if QT_VERSION < QT_VERSION_CHECK(5, 1, 0) @@ -86,51 +85,51 @@ DialogLayoutSettings::~DialogLayoutSettings() //--------------------------------------------------------------------------------------------------------------------- int DialogLayoutSettings::GetPaperHeight() const { - return qFloor(VAbstractMeasurements::UnitConvertor(ui->doubleSpinBoxPaperHeight->value(), oldPaperUnit, Unit::Px)); + return qFloor(UnitConvertor(ui->doubleSpinBoxPaperHeight->value(), oldPaperUnit, Unit::Px)); } //--------------------------------------------------------------------------------------------------------------------- void DialogLayoutSettings::SetPaperHeight(int value) { - ui->doubleSpinBoxPaperHeight->setValue(VAbstractMeasurements::UnitConvertor(value, Unit::Px, PaperUnit())); + ui->doubleSpinBoxPaperHeight->setValue(UnitConvertor(value, Unit::Px, PaperUnit())); } //--------------------------------------------------------------------------------------------------------------------- int DialogLayoutSettings::GetPaperWidth() const { - return qFloor(VAbstractMeasurements::UnitConvertor(ui->doubleSpinBoxPaperWidth->value(), oldPaperUnit, Unit::Px)); + return qFloor(UnitConvertor(ui->doubleSpinBoxPaperWidth->value(), oldPaperUnit, Unit::Px)); } //--------------------------------------------------------------------------------------------------------------------- void DialogLayoutSettings::SetPaperWidth(int value) { - ui->doubleSpinBoxPaperWidth->setValue(VAbstractMeasurements::UnitConvertor(value, Unit::Px, PaperUnit())); + ui->doubleSpinBoxPaperWidth->setValue(UnitConvertor(value, Unit::Px, PaperUnit())); } //--------------------------------------------------------------------------------------------------------------------- unsigned int DialogLayoutSettings::GetShift() const { - return static_cast(qFloor(VAbstractMeasurements::UnitConvertor(ui->doubleSpinBoxShift->value(), + return static_cast(qFloor(UnitConvertor(ui->doubleSpinBoxShift->value(), oldLayoutUnit, Unit::Px))); } //--------------------------------------------------------------------------------------------------------------------- void DialogLayoutSettings::SetShift(unsigned int value) { - ui->doubleSpinBoxShift->setValue(VAbstractMeasurements::UnitConvertor(value, Unit::Px, LayoutUnit())); + ui->doubleSpinBoxShift->setValue(UnitConvertor(value, Unit::Px, LayoutUnit())); } //--------------------------------------------------------------------------------------------------------------------- unsigned int DialogLayoutSettings::GetLayoutWidth() const { - return static_cast(qFloor(VAbstractMeasurements::UnitConvertor(ui->doubleSpinBoxLayoutWidth->value(), + return static_cast(qFloor(UnitConvertor(ui->doubleSpinBoxLayoutWidth->value(), oldLayoutUnit, Unit::Px))); } //--------------------------------------------------------------------------------------------------------------------- void DialogLayoutSettings::SetLayoutWidth(unsigned int value) { - ui->doubleSpinBoxLayoutWidth->setValue(VAbstractMeasurements::UnitConvertor(value, Unit::Px, LayoutUnit())); + ui->doubleSpinBoxLayoutWidth->setValue(UnitConvertor(value, Unit::Px, LayoutUnit())); } //--------------------------------------------------------------------------------------------------------------------- @@ -257,8 +256,8 @@ void DialogLayoutSettings::ConvertPaperSize() ui->doubleSpinBoxPaperWidth->setMaximum(FromPixel(QIMAGE_MAX, paperUnit)); ui->doubleSpinBoxPaperHeight->setMaximum(FromPixel(QIMAGE_MAX, paperUnit)); - ui->doubleSpinBoxPaperWidth->setValue(VAbstractMeasurements::UnitConvertor(width, oldPaperUnit, paperUnit)); - ui->doubleSpinBoxPaperHeight->setValue(VAbstractMeasurements::UnitConvertor(height, oldPaperUnit, paperUnit)); + ui->doubleSpinBoxPaperWidth->setValue(UnitConvertor(width, oldPaperUnit, paperUnit)); + ui->doubleSpinBoxPaperHeight->setValue(UnitConvertor(height, oldPaperUnit, paperUnit)); oldPaperUnit = paperUnit; CorrectPaperDecimals(); MinimumPaperSize(); @@ -274,8 +273,8 @@ void DialogLayoutSettings::ConvertLayoutSize() ui->doubleSpinBoxLayoutWidth->setMaximum(FromPixel(QIMAGE_MAX, unit)); ui->doubleSpinBoxShift->setMaximum(FromPixel(QIMAGE_MAX, unit)); - ui->doubleSpinBoxLayoutWidth->setValue(VAbstractMeasurements::UnitConvertor(layoutWidth, oldLayoutUnit, unit)); - ui->doubleSpinBoxShift->setValue(VAbstractMeasurements::UnitConvertor(shift, oldLayoutUnit, unit)); + ui->doubleSpinBoxLayoutWidth->setValue(UnitConvertor(layoutWidth, oldLayoutUnit, unit)); + ui->doubleSpinBoxShift->setValue(UnitConvertor(shift, oldLayoutUnit, unit)); oldLayoutUnit = unit; CorrectLayoutDecimals(); MinimumLayoutSize(); @@ -432,74 +431,74 @@ QSizeF DialogLayoutSettings::Template() case PaperSizeTemplate::A0: SetAdditionalOptions(false); - width = VAbstractMeasurements::UnitConvertor(841, Unit::Mm, paperUnit); - height = VAbstractMeasurements::UnitConvertor(1189, Unit::Mm, paperUnit); + width = UnitConvertor(841, Unit::Mm, paperUnit); + height = UnitConvertor(1189, Unit::Mm, paperUnit); return QSizeF(width, height); case PaperSizeTemplate::A1: SetAdditionalOptions(false); - width = VAbstractMeasurements::UnitConvertor(594, Unit::Mm, paperUnit); - height = VAbstractMeasurements::UnitConvertor(841, Unit::Mm, paperUnit); + width = UnitConvertor(594, Unit::Mm, paperUnit); + height = UnitConvertor(841, Unit::Mm, paperUnit); return QSizeF(width, height); case PaperSizeTemplate::A2: SetAdditionalOptions(false); - width = VAbstractMeasurements::UnitConvertor(420, Unit::Mm, paperUnit); - height = VAbstractMeasurements::UnitConvertor(594, Unit::Mm, paperUnit); + width = UnitConvertor(420, Unit::Mm, paperUnit); + height = UnitConvertor(594, Unit::Mm, paperUnit); return QSizeF(width, height); case PaperSizeTemplate::A3: SetAdditionalOptions(false); - width = VAbstractMeasurements::UnitConvertor(297, Unit::Mm, paperUnit); - height = VAbstractMeasurements::UnitConvertor(420, Unit::Mm, paperUnit); + width = UnitConvertor(297, Unit::Mm, paperUnit); + height = UnitConvertor(420, Unit::Mm, paperUnit); return QSizeF(width, height); case PaperSizeTemplate::A4: SetAdditionalOptions(false); - width = VAbstractMeasurements::UnitConvertor(210, Unit::Mm, paperUnit); - height = VAbstractMeasurements::UnitConvertor(297, Unit::Mm, paperUnit); + width = UnitConvertor(210, Unit::Mm, paperUnit); + height = UnitConvertor(297, Unit::Mm, paperUnit); return QSizeF(width, height); case PaperSizeTemplate::Letter: SetAdditionalOptions(false); - width = VAbstractMeasurements::UnitConvertor(8.5, Unit::Inch, paperUnit); - height = VAbstractMeasurements::UnitConvertor(11, Unit::Inch, paperUnit); + width = UnitConvertor(8.5, Unit::Inch, paperUnit); + height = UnitConvertor(11, Unit::Inch, paperUnit); return QSizeF(width, height); case PaperSizeTemplate::Legal: SetAdditionalOptions(true); - width = VAbstractMeasurements::UnitConvertor(11, Unit::Inch, paperUnit); - height = VAbstractMeasurements::UnitConvertor(17, Unit::Inch, paperUnit); + width = UnitConvertor(11, Unit::Inch, paperUnit); + height = UnitConvertor(17, Unit::Inch, paperUnit); return QSizeF(width, height); case PaperSizeTemplate::Roll24in: SetAdditionalOptions(true); - width = VAbstractMeasurements::UnitConvertor(24, Unit::Inch, paperUnit); - height = VAbstractMeasurements::UnitConvertor(QIMAGE_MAX, Unit::Px, paperUnit); + width = UnitConvertor(24, Unit::Inch, paperUnit); + height = UnitConvertor(QIMAGE_MAX, Unit::Px, paperUnit); return QSizeF(width, height); case PaperSizeTemplate::Roll30in: SetAdditionalOptions(true); - width = VAbstractMeasurements::UnitConvertor(30, Unit::Inch, paperUnit); - height = VAbstractMeasurements::UnitConvertor(QIMAGE_MAX, Unit::Px, paperUnit); + width = UnitConvertor(30, Unit::Inch, paperUnit); + height = UnitConvertor(QIMAGE_MAX, Unit::Px, paperUnit); return QSizeF(width, height); case PaperSizeTemplate::Roll36in: SetAdditionalOptions(true); - width = VAbstractMeasurements::UnitConvertor(36, Unit::Inch, paperUnit); - height = VAbstractMeasurements::UnitConvertor(QIMAGE_MAX, Unit::Px, paperUnit); + width = UnitConvertor(36, Unit::Inch, paperUnit); + height = UnitConvertor(QIMAGE_MAX, Unit::Px, paperUnit); return QSizeF(width, height); case PaperSizeTemplate::Roll42in: SetAdditionalOptions(true); - width = VAbstractMeasurements::UnitConvertor(42, Unit::Inch, paperUnit); - height = VAbstractMeasurements::UnitConvertor(QIMAGE_MAX, Unit::Px, paperUnit); + width = UnitConvertor(42, Unit::Inch, paperUnit); + height = UnitConvertor(QIMAGE_MAX, Unit::Px, paperUnit); return QSizeF(width, height); case PaperSizeTemplate::Roll44in: SetAdditionalOptions(true); - width = VAbstractMeasurements::UnitConvertor(44, Unit::Inch, paperUnit); - height = VAbstractMeasurements::UnitConvertor(QIMAGE_MAX, Unit::Px, paperUnit); + width = UnitConvertor(44, Unit::Inch, paperUnit); + height = UnitConvertor(QIMAGE_MAX, Unit::Px, paperUnit); return QSizeF(width, height); default: break; @@ -578,10 +577,8 @@ void DialogLayoutSettings::CorrectLayoutDecimals() //--------------------------------------------------------------------------------------------------------------------- void DialogLayoutSettings::Label() { - const int width = qFloor(VAbstractMeasurements::UnitConvertor(ui->doubleSpinBoxPaperWidth->value(), PaperUnit(), - Unit::Px)); - const int height = qFloor(VAbstractMeasurements::UnitConvertor(ui->doubleSpinBoxPaperHeight->value(), - PaperUnit(), Unit::Px)); + const int width = qFloor(UnitConvertor(ui->doubleSpinBoxPaperWidth->value(), PaperUnit(), Unit::Px)); + const int height = qFloor(UnitConvertor(ui->doubleSpinBoxPaperHeight->value(), PaperUnit(), Unit::Px)); QString text = QString("%1 x %2 px, \n%3 ppi").arg(width).arg(height).arg(PrintDPI); ui->labelSizeDescription->setText(text); } @@ -589,7 +586,7 @@ void DialogLayoutSettings::Label() //--------------------------------------------------------------------------------------------------------------------- void DialogLayoutSettings::MinimumPaperSize() { - const qreal value = VAbstractMeasurements::UnitConvertor(1, Unit::Px, oldPaperUnit); + const qreal value = UnitConvertor(1, Unit::Px, oldPaperUnit); ui->doubleSpinBoxPaperWidth->setMinimum(value); ui->doubleSpinBoxPaperHeight->setMinimum(value); } @@ -597,7 +594,7 @@ void DialogLayoutSettings::MinimumPaperSize() //--------------------------------------------------------------------------------------------------------------------- void DialogLayoutSettings::MinimumLayoutSize() { - const qreal value = VAbstractMeasurements::UnitConvertor(1, Unit::Px, oldLayoutUnit); + const qreal value = UnitConvertor(1, Unit::Px, oldLayoutUnit); ui->doubleSpinBoxLayoutWidth->setMinimum(value); } @@ -613,10 +610,8 @@ void DialogLayoutSettings::ReadSettings() SetLayoutWidth(qApp->getSettings()->GetLayoutWidth()); SetShift(qApp->getSettings()->GetLayoutShift()); - const qreal width = VAbstractMeasurements::UnitConvertor(qApp->getSettings()->GetLayoutPaperWidth(), Unit::Px, - LayoutUnit()); - const qreal height = VAbstractMeasurements::UnitConvertor(qApp->getSettings()->GetLayoutPaperHeight(), Unit::Px, - LayoutUnit()); + const qreal width = UnitConvertor(qApp->getSettings()->GetLayoutPaperWidth(), Unit::Px, LayoutUnit()); + const qreal height = UnitConvertor(qApp->getSettings()->GetLayoutPaperHeight(), Unit::Px, LayoutUnit()); SheetSize(QSizeF(width, height)); SetGroup(qApp->getSettings()->GetLayoutGroup()); SetRotate(qApp->getSettings()->GetLayoutRotate()); diff --git a/src/app/dialogs/app/dialogstandardmeasurements.cpp b/src/app/dialogs/app/dialogstandardmeasurements.cpp index 52e0f7486..2cd149854 100644 --- a/src/app/dialogs/app/dialogstandardmeasurements.cpp +++ b/src/app/dialogs/app/dialogstandardmeasurements.cpp @@ -31,7 +31,7 @@ #include "../../xml/vstandardmeasurements.h" #include "../../core/vapplication.h" #include "../../core/vsettings.h" -#include "../../container/vcontainer.h" +#include "../../libs/vpatterndb/vcontainer.h" #include "../../utils/logging.h" #include diff --git a/src/app/dialogs/tools/dialogalongline.cpp b/src/app/dialogs/tools/dialogalongline.cpp index df922edd5..bbcd01fd8 100644 --- a/src/app/dialogs/tools/dialogalongline.cpp +++ b/src/app/dialogs/tools/dialogalongline.cpp @@ -306,7 +306,7 @@ QString DialogAlongLine::GetTypeLine() const */ QString DialogAlongLine::GetFormula() const { - return qApp->TrVars()->FormulaFromUser(formula); + return qApp->TrVars()->FormulaFromUser(formula, qApp->getSettings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogarc.cpp b/src/app/dialogs/tools/dialogarc.cpp index 7ee1167c2..a5ffd15d7 100644 --- a/src/app/dialogs/tools/dialogarc.cpp +++ b/src/app/dialogs/tools/dialogarc.cpp @@ -33,7 +33,7 @@ #include #include "../../libs/vgeometry/vpointf.h" -#include "../../container/vcontainer.h" +#include "../../libs/vpatterndb/vcontainer.h" #include "../../libs/ifc/xml/vdomdocument.h" #include "../../visualization/vistoolarc.h" #include "dialogeditwrongformula.h" @@ -424,7 +424,7 @@ quint32 DialogArc::GetCenter() const */ QString DialogArc::GetRadius() const { - return qApp->TrVars()->FormulaFromUser(radius); + return qApp->TrVars()->FormulaFromUser(radius, qApp->getSettings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- @@ -434,7 +434,7 @@ QString DialogArc::GetRadius() const */ QString DialogArc::GetF1() const { - return qApp->TrVars()->FormulaFromUser(f1); + return qApp->TrVars()->FormulaFromUser(f1, qApp->getSettings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- @@ -444,5 +444,5 @@ QString DialogArc::GetF1() const */ QString DialogArc::GetF2() const { - return qApp->TrVars()->FormulaFromUser(f2); + return qApp->TrVars()->FormulaFromUser(f2, qApp->getSettings()->GetOsSeparator()); } diff --git a/src/app/dialogs/tools/dialogarcwithlength.cpp b/src/app/dialogs/tools/dialogarcwithlength.cpp index 37570b10a..f809e80ae 100644 --- a/src/app/dialogs/tools/dialogarcwithlength.cpp +++ b/src/app/dialogs/tools/dialogarcwithlength.cpp @@ -33,7 +33,7 @@ #include #include "../../libs/vgeometry/vpointf.h" -#include "../../container/vcontainer.h" +#include "../../libs/vpatterndb/vcontainer.h" #include "../../libs/ifc/xml/vdomdocument.h" #include "../../visualization/vistoolarcwithlength.h" #include "dialogeditwrongformula.h" @@ -109,7 +109,7 @@ void DialogArcWithLength::SetCenter(const quint32 &value) //--------------------------------------------------------------------------------------------------------------------- QString DialogArcWithLength::GetRadius() const { - return qApp->TrVars()->FormulaFromUser(radius); + return qApp->TrVars()->FormulaFromUser(radius, qApp->getSettings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- @@ -133,7 +133,7 @@ void DialogArcWithLength::SetRadius(const QString &value) //--------------------------------------------------------------------------------------------------------------------- QString DialogArcWithLength::GetF1() const { - return qApp->TrVars()->FormulaFromUser(f1); + return qApp->TrVars()->FormulaFromUser(f1, qApp->getSettings()->GetOsSeparator()); } void DialogArcWithLength::SetF1(const QString &value) @@ -156,7 +156,7 @@ void DialogArcWithLength::SetF1(const QString &value) //--------------------------------------------------------------------------------------------------------------------- QString DialogArcWithLength::GetLength() const { - return qApp->TrVars()->FormulaFromUser(length); + return qApp->TrVars()->FormulaFromUser(length, qApp->getSettings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogbisector.cpp b/src/app/dialogs/tools/dialogbisector.cpp index 858e52274..de3cb782f 100644 --- a/src/app/dialogs/tools/dialogbisector.cpp +++ b/src/app/dialogs/tools/dialogbisector.cpp @@ -30,7 +30,7 @@ #include "ui_dialogbisector.h" #include "../../libs/vgeometry/vpointf.h" -#include "../../container/vcontainer.h" +#include "../../libs/vpatterndb/vcontainer.h" #include "../../visualization/vistoolbisector.h" #include "../../widgets/vmaingraphicsscene.h" #include "../../tools/vabstracttool.h" @@ -342,7 +342,7 @@ QString DialogBisector::GetTypeLine() const */ QString DialogBisector::GetFormula() const { - return qApp->TrVars()->FormulaFromUser(formula); + return qApp->TrVars()->FormulaFromUser(formula, qApp->getSettings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp b/src/app/dialogs/tools/dialogcurveintersectaxis.cpp index 62aa33b15..93ca299b7 100644 --- a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp +++ b/src/app/dialogs/tools/dialogcurveintersectaxis.cpp @@ -30,7 +30,7 @@ #include "ui_dialogcurveintersectaxis.h" #include "../../libs/vgeometry/vpointf.h" -#include "../../container/vcontainer.h" +#include "../../libs/vpatterndb/vcontainer.h" #include "../../visualization/vistoolcurveintersectaxis.h" #include "../../widgets/vmaingraphicsscene.h" #include "../../tools/vabstracttool.h" @@ -99,7 +99,7 @@ void DialogCurveIntersectAxis::SetTypeLine(const QString &value) //--------------------------------------------------------------------------------------------------------------------- QString DialogCurveIntersectAxis::GetAngle() const { - return qApp->TrVars()->FormulaFromUser(formulaAngle); + return qApp->TrVars()->FormulaFromUser(formulaAngle, qApp->getSettings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogcutarc.cpp b/src/app/dialogs/tools/dialogcutarc.cpp index a66ffe870..2e0c08544 100644 --- a/src/app/dialogs/tools/dialogcutarc.cpp +++ b/src/app/dialogs/tools/dialogcutarc.cpp @@ -30,7 +30,7 @@ #include "ui_dialogcutarc.h" #include "../../libs/vgeometry/varc.h" -#include "../../container/vcontainer.h" +#include "../../libs/vpatterndb/vcontainer.h" #include "../../visualization/vistoolcutarc.h" #include "../../widgets/vmaingraphicsscene.h" #include "../../xml/vpattern.h" @@ -216,7 +216,7 @@ void DialogCutArc::SetPointName(const QString &value) */ QString DialogCutArc::GetFormula() const { - return qApp->TrVars()->FormulaFromUser(formula); + return qApp->TrVars()->FormulaFromUser(formula, qApp->getSettings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogcutspline.cpp b/src/app/dialogs/tools/dialogcutspline.cpp index a9ccc1915..ed9769543 100644 --- a/src/app/dialogs/tools/dialogcutspline.cpp +++ b/src/app/dialogs/tools/dialogcutspline.cpp @@ -30,7 +30,7 @@ #include "ui_dialogcutspline.h" #include "../../libs/vgeometry/vspline.h" -#include "../../container/vcontainer.h" +#include "../../libs/vpatterndb/vcontainer.h" #include "../../xml/vpattern.h" #include "../../visualization/vistoolcutspline.h" #include "dialogeditwrongformula.h" @@ -210,7 +210,7 @@ void DialogCutSpline::ShowVisualization() */ QString DialogCutSpline::GetFormula() const { - return qApp->TrVars()->FormulaFromUser(formula); + return qApp->TrVars()->FormulaFromUser(formula, qApp->getSettings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogcutsplinepath.cpp b/src/app/dialogs/tools/dialogcutsplinepath.cpp index 714c46962..41e66f00d 100644 --- a/src/app/dialogs/tools/dialogcutsplinepath.cpp +++ b/src/app/dialogs/tools/dialogcutsplinepath.cpp @@ -30,7 +30,7 @@ #include "ui_dialogcutsplinepath.h" #include "../../libs/vgeometry/vsplinepath.h" -#include "../../container/vcontainer.h" +#include "../../libs/vpatterndb/vcontainer.h" #include "../../xml/vpattern.h" #include "../../visualization/vistoolcutsplinepath.h" #include "dialogeditwrongformula.h" @@ -210,7 +210,7 @@ void DialogCutSplinePath::ShowVisualization() */ QString DialogCutSplinePath::GetFormula() const { - return qApp->TrVars()->FormulaFromUser(formula); + return qApp->TrVars()->FormulaFromUser(formula, qApp->getSettings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogdetail.cpp b/src/app/dialogs/tools/dialogdetail.cpp index 7e37218f4..30c53d53c 100644 --- a/src/app/dialogs/tools/dialogdetail.cpp +++ b/src/app/dialogs/tools/dialogdetail.cpp @@ -33,7 +33,7 @@ #include "../../libs/vgeometry/varc.h" #include "../../libs/vgeometry/vpointf.h" #include "../../libs/vgeometry/vsplinepath.h" -#include "../../container/vcontainer.h" +#include "../../libs/vpatterndb/vcontainer.h" #include "../../libs/ifc/xml/vdomdocument.h" #include "../../xml/vabstractmeasurements.h" @@ -53,7 +53,7 @@ DialogDetail::DialogDetail(const VContainer *data, const quint32 &toolId, QWidge ui.labelUnitY->setText(VDomDocument::UnitsToStr(qApp->patternUnit(), true)); // Default value for seam allowence is 1 cm. But pattern have different units, so just set 1 in dialog not enough. - ui.doubleSpinBoxSeams->setValue(VAbstractMeasurements::UnitConvertor(1, Unit::Cm, qApp->patternUnit())); + ui.doubleSpinBoxSeams->setValue(UnitConvertor(1, Unit::Cm, qApp->patternUnit())); bOk = ui.buttonBox->button(QDialogButtonBox::Ok); SCASSERT(bOk != nullptr); diff --git a/src/app/dialogs/tools/dialogdetail.h b/src/app/dialogs/tools/dialogdetail.h index be864d9d2..518410cf7 100644 --- a/src/app/dialogs/tools/dialogdetail.h +++ b/src/app/dialogs/tools/dialogdetail.h @@ -31,7 +31,7 @@ #include "ui_dialogdetail.h" #include "dialogtool.h" -#include "../../geometry/vdetail.h" +#include "../../libs/vpatterndb/vdetail.h" /** * @brief The DialogDetail class dialog for ToolDetai. Help create detail and edit option. diff --git a/src/app/dialogs/tools/dialogeditwrongformula.cpp b/src/app/dialogs/tools/dialogeditwrongformula.cpp index c009b5819..7c8b78079 100644 --- a/src/app/dialogs/tools/dialogeditwrongformula.cpp +++ b/src/app/dialogs/tools/dialogeditwrongformula.cpp @@ -28,7 +28,7 @@ #include "dialogeditwrongformula.h" #include "ui_dialogeditwrongformula.h" -#include "../../container/vcontainer.h" +#include "../../libs/vpatterndb/vcontainer.h" //--------------------------------------------------------------------------------------------------------------------- DialogEditWrongFormula::DialogEditWrongFormula(const VContainer *data, const quint32 &toolId, QWidget *parent) @@ -385,7 +385,7 @@ void DialogEditWrongFormula::setPostfix(const QString &value) //--------------------------------------------------------------------------------------------------------------------- QString DialogEditWrongFormula::GetFormula() const { - return qApp->TrVars()->FormulaFromUser(formula); + return qApp->TrVars()->FormulaFromUser(formula, qApp->getSettings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogendline.cpp b/src/app/dialogs/tools/dialogendline.cpp index 91ec9114a..71f80a40b 100644 --- a/src/app/dialogs/tools/dialogendline.cpp +++ b/src/app/dialogs/tools/dialogendline.cpp @@ -30,7 +30,7 @@ #include "ui_dialogendline.h" #include "../../libs/vgeometry/vpointf.h" -#include "../../container/vcontainer.h" +#include "../../libs/vpatterndb/vcontainer.h" #include "../../visualization/vistoolendline.h" #include "../../widgets/vmaingraphicsscene.h" #include "../../tools/vabstracttool.h" @@ -355,7 +355,7 @@ QString DialogEndLine::GetTypeLine() const */ QString DialogEndLine::GetFormula() const { - return qApp->TrVars()->FormulaFromUser(formulaLength); + return qApp->TrVars()->FormulaFromUser(formulaLength, qApp->getSettings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- @@ -365,7 +365,7 @@ QString DialogEndLine::GetFormula() const */ QString DialogEndLine::GetAngle() const { - return qApp->TrVars()->FormulaFromUser(formulaAngle); + return qApp->TrVars()->FormulaFromUser(formulaAngle, qApp->getSettings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogheight.cpp b/src/app/dialogs/tools/dialogheight.cpp index d4b55f498..fb0f69cdd 100644 --- a/src/app/dialogs/tools/dialogheight.cpp +++ b/src/app/dialogs/tools/dialogheight.cpp @@ -30,7 +30,7 @@ #include "ui_dialogheight.h" #include "../../libs/vgeometry/vpointf.h" -#include "../../container/vcontainer.h" +#include "../../libs/vpatterndb/vcontainer.h" #include "../../tools/vabstracttool.h" #include "../visualization/vistoolheight.h" #include "../widgets/vmaingraphicsscene.h" diff --git a/src/app/dialogs/tools/dialogline.cpp b/src/app/dialogs/tools/dialogline.cpp index d474f2362..18f69fcaa 100644 --- a/src/app/dialogs/tools/dialogline.cpp +++ b/src/app/dialogs/tools/dialogline.cpp @@ -30,7 +30,7 @@ #include "ui_dialogline.h" #include "../../libs/vgeometry/vpointf.h" -#include "../../container/vcontainer.h" +#include "../../libs/vpatterndb/vcontainer.h" #include "../../visualization/vistoolline.h" #include "../../core/vapplication.h" #include "../../widgets/vmaingraphicsscene.h" diff --git a/src/app/dialogs/tools/dialoglineintersect.cpp b/src/app/dialogs/tools/dialoglineintersect.cpp index 8f523c833..1ec708225 100644 --- a/src/app/dialogs/tools/dialoglineintersect.cpp +++ b/src/app/dialogs/tools/dialoglineintersect.cpp @@ -30,7 +30,7 @@ #include "ui_dialoglineintersect.h" #include "../../libs/vgeometry/vpointf.h" -#include "../../container/vcontainer.h" +#include "../../libs/vpatterndb/vcontainer.h" #include "../../visualization/vistoollineintersect.h" #include "../../widgets/vmaingraphicsscene.h" #include "../../xml/vpattern.h" diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.cpp b/src/app/dialogs/tools/dialoglineintersectaxis.cpp index 60c399fde..20f0500ef 100644 --- a/src/app/dialogs/tools/dialoglineintersectaxis.cpp +++ b/src/app/dialogs/tools/dialoglineintersectaxis.cpp @@ -30,7 +30,7 @@ #include "ui_dialoglineintersectaxis.h" #include "../../libs/vgeometry/vpointf.h" -#include "../../container/vcontainer.h" +#include "../../libs/vpatterndb/vcontainer.h" #include "../../visualization/vistoollineintersectaxis.h" #include "../../widgets/vmaingraphicsscene.h" #include "../../tools/vabstracttool.h" @@ -107,7 +107,7 @@ void DialogLineIntersectAxis::SetTypeLine(const QString &value) //--------------------------------------------------------------------------------------------------------------------- QString DialogLineIntersectAxis::GetAngle() const { - return qApp->TrVars()->FormulaFromUser(formulaAngle); + return qApp->TrVars()->FormulaFromUser(formulaAngle, qApp->getSettings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialognormal.cpp b/src/app/dialogs/tools/dialognormal.cpp index 8d8b79e40..00061f9da 100644 --- a/src/app/dialogs/tools/dialognormal.cpp +++ b/src/app/dialogs/tools/dialognormal.cpp @@ -315,7 +315,7 @@ QString DialogNormal::GetTypeLine() const */ QString DialogNormal::GetFormula() const { - return qApp->TrVars()->FormulaFromUser(formula); + return qApp->TrVars()->FormulaFromUser(formula, qApp->getSettings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogpointfromarcandtangent.cpp b/src/app/dialogs/tools/dialogpointfromarcandtangent.cpp index 87c1810cc..b4d0285b1 100644 --- a/src/app/dialogs/tools/dialogpointfromarcandtangent.cpp +++ b/src/app/dialogs/tools/dialogpointfromarcandtangent.cpp @@ -30,7 +30,7 @@ #include "ui_dialogpointfromarcandtangent.h" #include "../../libs/vgeometry/vpointf.h" -#include "../../container/vcontainer.h" +#include "../../libs/vpatterndb/vcontainer.h" #include "../../visualization/vistoolpointfromarcandtangent.h" #include "../../widgets/vmaingraphicsscene.h" diff --git a/src/app/dialogs/tools/dialogpointfromcircleandtangent.cpp b/src/app/dialogs/tools/dialogpointfromcircleandtangent.cpp index 03cecf995..167f163f0 100644 --- a/src/app/dialogs/tools/dialogpointfromcircleandtangent.cpp +++ b/src/app/dialogs/tools/dialogpointfromcircleandtangent.cpp @@ -30,7 +30,7 @@ #include "ui_dialogpointfromcircleandtangent.h" #include "../../libs/vgeometry/vpointf.h" -#include "../../container/vcontainer.h" +#include "../../libs/vpatterndb/vcontainer.h" #include "../../visualization/vistoolpointfromcircleandtangent.h" #include "../../widgets/vmaingraphicsscene.h" #include "dialogeditwrongformula.h" @@ -111,7 +111,8 @@ void DialogPointFromCircleAndTangent::SetCircleCenterId(const quint32 &value) //--------------------------------------------------------------------------------------------------------------------- QString DialogPointFromCircleAndTangent::GetCircleRadius() const { - return qApp->TrVars()->FormulaFromUser(ui->plainTextEditRadius->toPlainText()); + return qApp->TrVars()->FormulaFromUser(ui->plainTextEditRadius->toPlainText(), + qApp->getSettings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogpointofcontact.cpp b/src/app/dialogs/tools/dialogpointofcontact.cpp index 0e796f900..dc65404ff 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.cpp +++ b/src/app/dialogs/tools/dialogpointofcontact.cpp @@ -29,7 +29,7 @@ #include "dialogpointofcontact.h" #include "../../libs/vgeometry/vpointf.h" -#include "../../container/vcontainer.h" +#include "../../libs/vpatterndb/vcontainer.h" #include "../../visualization/vistoolpointofcontact.h" #include "../../widgets/vmaingraphicsscene.h" #include "../../xml/vpattern.h" @@ -304,7 +304,7 @@ void DialogPointOfContact::SetPointName(const QString &value) */ QString DialogPointOfContact::getRadius() const { - return qApp->TrVars()->FormulaFromUser(radius); + return qApp->TrVars()->FormulaFromUser(radius, qApp->getSettings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogpointofintersection.cpp b/src/app/dialogs/tools/dialogpointofintersection.cpp index 1870f8204..186df7882 100644 --- a/src/app/dialogs/tools/dialogpointofintersection.cpp +++ b/src/app/dialogs/tools/dialogpointofintersection.cpp @@ -30,7 +30,7 @@ #include "ui_dialogpointofintersection.h" #include "../../libs/vgeometry/vpointf.h" -#include "../../container/vcontainer.h" +#include "../../libs/vpatterndb/vcontainer.h" #include "../../visualization/vistoolpointofintersection.h" #include "../../widgets/vmaingraphicsscene.h" #include "../../xml/vpattern.h" diff --git a/src/app/dialogs/tools/dialogpointofintersectionarcs.cpp b/src/app/dialogs/tools/dialogpointofintersectionarcs.cpp index 1c77755f2..bdeee9cd0 100644 --- a/src/app/dialogs/tools/dialogpointofintersectionarcs.cpp +++ b/src/app/dialogs/tools/dialogpointofintersectionarcs.cpp @@ -30,7 +30,7 @@ #include "ui_dialogpointofintersectionarcs.h" #include "../../libs/vgeometry/vpointf.h" -#include "../../container/vcontainer.h" +#include "../../libs/vpatterndb/vcontainer.h" #include "../../visualization/vistoolpointofintersectionarcs.h" #include "../../widgets/vmaingraphicsscene.h" diff --git a/src/app/dialogs/tools/dialogpointofintersectioncircles.cpp b/src/app/dialogs/tools/dialogpointofintersectioncircles.cpp index d97546eef..ad957656b 100644 --- a/src/app/dialogs/tools/dialogpointofintersectioncircles.cpp +++ b/src/app/dialogs/tools/dialogpointofintersectioncircles.cpp @@ -30,7 +30,7 @@ #include "ui_dialogpointofintersectioncircles.h" #include "../../libs/vgeometry/vpointf.h" -#include "../../container/vcontainer.h" +#include "../../libs/vpatterndb/vcontainer.h" #include "../../visualization/vistoolpointofintersectioncircles.h" #include "../../widgets/vmaingraphicsscene.h" #include "dialogeditwrongformula.h" @@ -143,7 +143,8 @@ void DialogPointOfIntersectionCircles::SetSecondCircleCenterId(const quint32 &va //--------------------------------------------------------------------------------------------------------------------- QString DialogPointOfIntersectionCircles::GetFirstCircleRadius() const { - return qApp->TrVars()->FormulaFromUser(ui->plainTextEditCircle1Radius->toPlainText()); + return qApp->TrVars()->FormulaFromUser(ui->plainTextEditCircle1Radius->toPlainText(), + qApp->getSettings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- @@ -167,7 +168,8 @@ void DialogPointOfIntersectionCircles::SetFirstCircleRadius(const QString &value //--------------------------------------------------------------------------------------------------------------------- QString DialogPointOfIntersectionCircles::GetSecondCircleRadius() const { - return qApp->TrVars()->FormulaFromUser(ui->plainTextEditCircle2Radius->toPlainText()); + return qApp->TrVars()->FormulaFromUser(ui->plainTextEditCircle2Radius->toPlainText(), + qApp->getSettings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogshoulderpoint.cpp b/src/app/dialogs/tools/dialogshoulderpoint.cpp index f1db9e5ad..12fcfa1cc 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.cpp +++ b/src/app/dialogs/tools/dialogshoulderpoint.cpp @@ -30,7 +30,7 @@ #include "ui_dialogshoulderpoint.h" #include "../../libs/vgeometry/vpointf.h" -#include "../../container/vcontainer.h" +#include "../../libs/vpatterndb/vcontainer.h" #include "../../visualization/vistoolshoulderpoint.h" #include "../../widgets/vmaingraphicsscene.h" #include "../../tools/vabstracttool.h" @@ -341,7 +341,7 @@ QString DialogShoulderPoint::GetTypeLine() const */ QString DialogShoulderPoint::GetFormula() const { - return qApp->TrVars()->FormulaFromUser(formula); + return qApp->TrVars()->FormulaFromUser(formula, qApp->getSettings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogspline.cpp b/src/app/dialogs/tools/dialogspline.cpp index 924a5e759..9736f5d10 100644 --- a/src/app/dialogs/tools/dialogspline.cpp +++ b/src/app/dialogs/tools/dialogspline.cpp @@ -30,7 +30,7 @@ #include "ui_dialogspline.h" #include "../../libs/vgeometry/vpointf.h" -#include "../../container/vcontainer.h" +#include "../../libs/vpatterndb/vcontainer.h" #include "../../visualization/vistoolspline.h" #include diff --git a/src/app/dialogs/tools/dialogsplinepath.cpp b/src/app/dialogs/tools/dialogsplinepath.cpp index 2d0f01fe6..2b3a1243e 100644 --- a/src/app/dialogs/tools/dialogsplinepath.cpp +++ b/src/app/dialogs/tools/dialogsplinepath.cpp @@ -29,7 +29,7 @@ #include "dialogsplinepath.h" #include "ui_dialogsplinepath.h" #include "../../libs/vgeometry/vsplinepoint.h" -#include "../../container/vcontainer.h" +#include "../../libs/vpatterndb/vcontainer.h" #include "../../visualization/vistoolsplinepath.h" //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogtool.cpp b/src/app/dialogs/tools/dialogtool.cpp index e8e64a717..6019f634b 100644 --- a/src/app/dialogs/tools/dialogtool.cpp +++ b/src/app/dialogs/tools/dialogtool.cpp @@ -27,8 +27,8 @@ *************************************************************************/ #include "dialogtool.h" -#include "../../container/calculator.h" -#include "../../container/vcontainer.h" +#include "../../libs/vpatterndb/calculator.h" +#include "../../libs/vpatterndb/vcontainer.h" #include "../../libs/vgeometry/varc.h" #include "../../libs/vgeometry/vpointf.h" #include "../../libs/vgeometry/vsplinepath.h" @@ -460,8 +460,9 @@ qreal DialogTool::Eval(const QString &text, bool &flag, QLabel *label, const QSt // Replace line return character with spaces for calc if exist QString formula = text; formula.replace("\n", " "); - formula = qApp->TrVars()->FormulaFromUser(formula);// Translate to internal look. - Calculator *cal = new Calculator(data); + // Translate to internal look. + formula = qApp->TrVars()->FormulaFromUser(formula, qApp->getSettings()->GetOsSeparator()); + Calculator *cal = new Calculator(data, qApp->patternType()); result = cal->EvalFormula(formula); delete cal; diff --git a/src/app/dialogs/tools/dialogtriangle.cpp b/src/app/dialogs/tools/dialogtriangle.cpp index 063910511..fdee8a144 100644 --- a/src/app/dialogs/tools/dialogtriangle.cpp +++ b/src/app/dialogs/tools/dialogtriangle.cpp @@ -29,7 +29,7 @@ #include "dialogtriangle.h" #include "ui_dialogtriangle.h" #include "../../libs/vgeometry/vpointf.h" -#include "../../container/vcontainer.h" +#include "../../libs/vpatterndb/vcontainer.h" #include "../../visualization/vistooltriangle.h" #include "../../widgets/vmaingraphicsscene.h" #include "../../xml/vpattern.h" diff --git a/src/app/dialogs/tools/dialoguniondetails.cpp b/src/app/dialogs/tools/dialoguniondetails.cpp index 12a26c7e1..35a33cbad 100644 --- a/src/app/dialogs/tools/dialoguniondetails.cpp +++ b/src/app/dialogs/tools/dialoguniondetails.cpp @@ -28,8 +28,8 @@ #include "dialoguniondetails.h" #include "ui_dialoguniondetails.h" -#include "../../geometry/vdetail.h" -#include "../../container/vcontainer.h" +#include "../../libs/vpatterndb/vdetail.h" +#include "../../libs/vpatterndb/vcontainer.h" //--------------------------------------------------------------------------------------------------------------------- /** diff --git a/src/app/geometry/geometry.pri b/src/app/geometry/geometry.pri deleted file mode 100644 index 8a2022c78..000000000 --- a/src/app/geometry/geometry.pri +++ /dev/null @@ -1,12 +0,0 @@ -# ADD TO EACH PATH $$PWD VARIABLE!!!!!! -# This need for corect working file translations.pro - -HEADERS += \ - $$PWD/vnodedetail.h \ - $$PWD/vdetail.h \ - $$PWD/vnodedetail_p.h \ - $$PWD/vdetail_p.h - -SOURCES += \ - $$PWD/vnodedetail.cpp \ - $$PWD/vdetail.cpp diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index a48869939..39ac9fe8b 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -895,8 +895,8 @@ void MainWindow::ToolBarOption() { if (qApp->patternType() == MeasurementsType::Standard) { - const QStringList listHeights = VMeasurement::ListHeights(doc->GetGradationHeights()); - const QStringList listSizes = VMeasurement::ListSizes(doc->GetGradationSizes()); + const QStringList listHeights = VMeasurement::ListHeights(doc->GetGradationHeights(), qApp->patternUnit()); + const QStringList listSizes = VMeasurement::ListSizes(doc->GetGradationSizes(), qApp->patternUnit()); gradationHeights = SetGradationList(tr("Height: "), listHeights); SetDefaultHeight(static_cast(pattern->height())); @@ -1904,8 +1904,8 @@ void MainWindow::Layout() //--------------------------------------------------------------------------------------------------------------------- void MainWindow::UpdateGradation() { - UpdateHeightsList(VMeasurement::ListHeights(doc->GetGradationHeights())); - UpdateSizesList(VMeasurement::ListSizes(doc->GetGradationSizes())); + UpdateHeightsList(VMeasurement::ListHeights(doc->GetGradationHeights(), qApp->patternUnit())); + UpdateSizesList(VMeasurement::ListSizes(doc->GetGradationSizes(), qApp->patternUnit())); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/mainwindowsnogui.cpp b/src/app/mainwindowsnogui.cpp index f12399b06..cc97757b1 100644 --- a/src/app/mainwindowsnogui.cpp +++ b/src/app/mainwindowsnogui.cpp @@ -28,13 +28,13 @@ #include "mainwindowsnogui.h" #include "../core/vapplication.h" -#include "../container/vcontainer.h" -#include "../../libs/vobj/vobjpaintdevice.h" +#include "../libs/vpatterndb/vcontainer.h" +#include "../libs/vobj/vobjpaintdevice.h" #include "../dialogs/app/dialoglayoutsettings.h" -#include "../../libs/vlayout/vlayoutgenerator.h" +#include "../libs/vlayout/vlayoutgenerator.h" #include "../dialogs/app/dialoglayoutprogress.h" #include "../dialogs/app/dialogsavelayout.h" -#include "../../libs/vlayout/vposter.h" +#include "../libs/vlayout/vposter.h" #include #include diff --git a/src/app/mainwindowsnogui.h b/src/app/mainwindowsnogui.h index 9c5625642..2e3b39a4d 100644 --- a/src/app/mainwindowsnogui.h +++ b/src/app/mainwindowsnogui.h @@ -31,7 +31,7 @@ #include -#include "../geometry/vdetail.h" +#include "../libs/vpatterndb/vdetail.h" #include "../libs/vlayout/vlayoutdetail.h" #include "xml/vpattern.h" diff --git a/src/app/options.cpp b/src/app/options.cpp index fe9746ed9..22f45df26 100644 --- a/src/app/options.cpp +++ b/src/app/options.cpp @@ -28,7 +28,6 @@ #include "options.h" #include -#include // From documantation: If you use QStringLiteral you should avoid declaring the same literal in multiple places: This // furthermore blows up the binary sizes. @@ -36,192 +35,3 @@ const QString degreeSymbol = QStringLiteral("°"); const QString cursorArrowOpenHand = QStringLiteral("://cursor/cursor-arrow-openhand.png"); const QString cursorArrowCloseHand = QStringLiteral("://cursor/cursor-arrow-closehand.png"); - -// Keep synchronize all names with initialization in VApllication class!!!!! -//measurements -//head and neck -const QString headGirth_M = QStringLiteral("head_girth"); -const QString midNeckGirth_M = QStringLiteral("mid_neck_girth"); -const QString neckBaseGirth_M = QStringLiteral("neck_base_girth"); -const QString headAndNeckLength_M = QStringLiteral("head_and_neck_length"); -//torso -const QString centerFrontWaistLength_M = QStringLiteral("center_front_waist_length"); -const QString centerBackWaistLength_M = QStringLiteral("center_back_waist_length"); -const QString shoulderLength_M = QStringLiteral("shoulder_length"); -const QString sideWaistLength_M = QStringLiteral("side_waist_length"); -const QString trunkLength_M = QStringLiteral("trunk_length"); -const QString shoulderGirth_M = QStringLiteral("shoulder_girth"); -const QString upperChestGirth_M = QStringLiteral("upper_chest_girth"); -const QString bustGirth_M = QStringLiteral("bust_girth"); -const QString underBustGirth_M = QStringLiteral("under_bust_girth"); -const QString waistGirth_M = QStringLiteral("waist_girth"); -const QString highHipGirth_M = QStringLiteral("high_hip_girth"); -const QString hipGirth_M = QStringLiteral("hip_girth"); -const QString upperFrontChestWidth_M = QStringLiteral("upper_front_chest_width"); -const QString frontChestWidth_M = QStringLiteral("front_chest_width"); -const QString acrossFrontShoulderWidth_M = QStringLiteral("across_front_shoulder_width"); -const QString acrossBackShoulderWidth_M = QStringLiteral("across_back_shoulder_width"); -const QString upperBackWidth_M = QStringLiteral("upper_back_width"); -const QString backWidth_M = QStringLiteral("back_width"); -const QString bustpointToBustpoint_M = QStringLiteral("bustpoint_to_bustpoint"); -const QString halterBustpointToBustpoint_M = QStringLiteral("halter_bustpoint_to_bustpoint"); -const QString neckToBustpoint_M = QStringLiteral("neck_to_bustpoint"); -const QString crotchLength_M = QStringLiteral("crotch_length"); -const QString riseHeight_M = QStringLiteral("rise_height"); -const QString shoulderDrop_M = QStringLiteral("shoulder_drop"); -const QString shoulderSlopeDegrees_M = QStringLiteral("shoulder_slope_degrees"); -const QString frontShoulderSlopeLength_M = QStringLiteral("front_shoulder_slope_length"); -const QString backShoulderSlopeLength_M = QStringLiteral("back_shoulder_slope_length"); -const QString frontShoulderToWaistLength_M = QStringLiteral("front_shoulder_to_waist_length"); -const QString backShoulderToWaistLength_M = QStringLiteral("back_shoulder_to_waist_length"); -const QString frontNeckArc_M = QStringLiteral("front_neck_arc"); -const QString backNeckArc_M = QStringLiteral("back_neck_arc"); -const QString frontUpperChestArc_M = QStringLiteral("front_upper_chest_arc"); -const QString backUpperChestArc_M = QStringLiteral("back_upper_chest_arc"); -const QString frontWaistArc_M = QStringLiteral("front_waist_arc"); -const QString backWaistArc_M = QStringLiteral("back_waist_arc"); -const QString frontUpperHipArc_M = QStringLiteral("front_upper_hip_arc"); -const QString backUpperHipArc_M = QStringLiteral("back_upper_hip_arc"); -const QString frontHipArc_M = QStringLiteral("front_hip_arc"); -const QString backHipArc_M = QStringLiteral("back_hip_arc"); -const QString chestSlope_M = QStringLiteral("chest_slope"); -const QString backSlope_M = QStringLiteral("back_slope"); -const QString frontWaistSlope_M = QStringLiteral("front_waist_slope"); -const QString backWaistSlope_M = QStringLiteral("back_waist_slope"); -const QString frontNeckToUpperChestHeight_M = QStringLiteral("front_neck_to_upper_chest_height"); -const QString frontNeckToBustHeight_M = QStringLiteral("front_neck_to_bust_height"); -const QString frontWaistToUpperChest_M = QStringLiteral("front_waist_to_upper_chest"); -const QString frontWaistToLowerBreast_M = QStringLiteral("front_waist_to_lower_breast"); -const QString backWaistToUpperChest_M = QStringLiteral("back_waist_to_upper_chest"); -const QString strapLength_M = QStringLiteral("strap_length"); -//arm -const QString armscyeGirth_M = QStringLiteral("armscye_girth"); -const QString elbowGirth_M = QStringLiteral("elbow_girth"); -const QString upperArmGirth_M = QStringLiteral("upper_arm_girth"); -const QString wristGirth_M = QStringLiteral("wrist_girth"); -const QString scyeDepth_M = QStringLiteral("scye_depth"); -const QString shoulderAndArmLength_M = QStringLiteral("shoulder_and_arm_length"); -const QString underarmLength_M = QStringLiteral("underarm_length"); -const QString cervicaleToWristLength_M = QStringLiteral("cervicale_to_wrist_length"); -const QString shoulderToElbowLength_M = QStringLiteral("shoulder_to_elbow_length"); -const QString armLength_M = QStringLiteral("arm_length"); -//hand -const QString handWidth_M = QStringLiteral("hand_width"); -const QString handLength_M = QStringLiteral("hand_length"); -const QString handGirth_M = QStringLiteral("hand_girth"); -//leg -const QString thighGirth_M = QStringLiteral("thigh_girth"); -const QString midThighGirth_M = QStringLiteral("mid_thigh_girth"); -const QString kneeGirth_M = QStringLiteral("knee_girth"); -const QString calfGirth_M = QStringLiteral("calf_girth"); -const QString ankleGirth_M = QStringLiteral("ankle_girth"); -const QString kneeHeight_M = QStringLiteral("knee_height"); -const QString ankleHeight_M = QStringLiteral("ankle_height"); -//foot -const QString footWidth_M = QStringLiteral("foot_width"); -const QString footLength_M = QStringLiteral("foot_length"); -//heights -const QString height_M = QStringLiteral("height"); -const QString cervicaleHeight_M = QStringLiteral("cervicale_height"); -const QString cervicaleToKneeHeight_M = QStringLiteral("cervicale_to_knee_height"); -const QString waistHeight_M = QStringLiteral("waist_height"); -const QString highHipHeight_M = QStringLiteral("high_hip_height"); -const QString hipHeight_M = QStringLiteral("hip_height"); -const QString waistToHipHeight_M = QStringLiteral("waist_to_hip_height"); -const QString waistToKneeHeight_M = QStringLiteral("waist_to_knee_height"); -const QString crotchHeight_M = QStringLiteral("crotch_height"); -//extended measurements -const QString size_M = QStringLiteral("size"); -const QString heightFrontNeckBasePoint_M = QStringLiteral("height_front_neck_base_point"); -const QString heightBaseNeckSidePoint_M = QStringLiteral("height_base_neck_side_point"); -const QString heightShoulderPoint_M = QStringLiteral("height_shoulder_point"); -const QString heightNipplePoint_M = QStringLiteral("height_nipple_point"); -const QString heightBackAngleAxilla_M = QStringLiteral("height_back_angle_axilla"); -const QString heightScapularPoint_M = QStringLiteral("height_scapular_point"); -const QString heightUnderButtockFolds_M = QStringLiteral("height_under_buttock_folds"); -const QString hipsExcludingProtrudingAbdomen_M = QStringLiteral("hips_excluding_protruding_abdomen"); -const QString girthFootInstep_M = QStringLiteral("girth_foot_instep"); -const QString sideWaistToFloor_M = QStringLiteral("side_waist_to_floor"); -const QString frontWaistToFloor_M = QStringLiteral("front_waist_to_floor"); -const QString arcThroughGroinArea_M = QStringLiteral("arc_through_groin_area"); -const QString waistToPlaneSeat_M = QStringLiteral("waist_to_plane_seat"); -const QString neckToRadialPoint_M = QStringLiteral("neck_to_radial_point"); -const QString neckToThirdFinger_M = QStringLiteral("neck_to_third_finger"); -const QString neckToFirstLineChestCircumference_M = QStringLiteral("neck_to_first_line_chest_circumference"); -const QString frontWaistLength_M = QStringLiteral("front_waist_length"); -const QString arcThroughShoulderJoint_M = QStringLiteral("arc_through_shoulder_joint"); -const QString neckToBackLineChestCircumference_M = QStringLiteral("neck_to_back_line_chest_circumference"); -const QString waistToNeckSide_M = QStringLiteral("waist_to_neck_side"); -const QString arcLengthUpperBody_M = QStringLiteral("arc_length_upper_body"); -const QString chestWidth_M = QStringLiteral("chest_width"); -const QString anteroposteriorDiameterHands_M = QStringLiteral("anteroposterior_diameter_hands"); -const QString heightClavicularPoint_M = QStringLiteral("height_clavicular_point"); -const QString heightArmholeSlash_M = QStringLiteral("height_armhole_slash"); -const QString slashShoulderHeight_M = QStringLiteral("slash_shoulder_height"); -const QString halfGirthNeck_M = QStringLiteral("half_girth_neck"); -const QString halfGirthNeckForShirts_M = QStringLiteral("half_girth_neck_for_shirts"); -const QString halfGirthChestFirst_M = QStringLiteral("half_girth_chest_first"); -const QString halfGirthChestSecond_M = QStringLiteral("half_girth_chest_second"); -const QString halfGirthChestThird_M = QStringLiteral("half_girth_chest_third"); -const QString halfGirthWaist_M = QStringLiteral("half_girth_waist"); -const QString halfGirthHipsConsideringProtrudingAbdomen_M -= QStringLiteral("half_girth_hips_considering_protruding_abdomen"); -const QString halfGirthHipsExcludingProtrudingAbdomen_M -= QStringLiteral("half_girth_hips_excluding_protruding_abdomen"); -const QString girthKneeFlexedFeet_M = QStringLiteral("girth_knee_flexed_feet"); -const QString neckTransverseDiameter_M = QStringLiteral("neck_transverse_diameter"); -const QString frontSlashShoulderHeight_M = QStringLiteral("front_slash_shoulder_height"); -const QString neckToFrontWaistLine_M = QStringLiteral("neck_to_front_waist_line"); -const QString handVerticalDiameter_M = QStringLiteral("hand_vertical_diameter"); -const QString neckToKneePoint_M = QStringLiteral("neck_to_knee_point"); -const QString waistToKnee_M = QStringLiteral("waist_to_knee"); -const QString shoulderHeight_M = QStringLiteral("shoulder_height"); -const QString headHeight_M = QStringLiteral("head_height"); -const QString bodyPosition_M = QStringLiteral("body_position"); -const QString arcBehindShoulderGirdle_M = QStringLiteral("arc_behind_shoulder_girdle"); -const QString neckToNeckBase_M = QStringLiteral("neck_to_neck_base"); -const QString depthWaistFirst_M = QStringLiteral("depth_waist_first"); -const QString depthWaistSecond_M = QStringLiteral("depth_waist_second"); - -//variables -const QString line_ = QStringLiteral("Line_"); -const QString angleLine_ = QStringLiteral("AngleLine_"); - -//functions -const QString sin_F = QStringLiteral("sin"); -const QString cos_F = QStringLiteral("cos"); -const QString tan_F = QStringLiteral("tan"); -const QString asin_F = QStringLiteral("asin"); -const QString acos_F = QStringLiteral("acos"); -const QString atan_F = QStringLiteral("atan"); -const QString sinh_F = QStringLiteral("sinh"); -const QString cosh_F = QStringLiteral("cosh"); -const QString tanh_F = QStringLiteral("tanh"); -const QString asinh_F = QStringLiteral("asinh"); -const QString acosh_F = QStringLiteral("acosh"); -const QString atanh_F = QStringLiteral("atanh"); -const QString log2_F = QStringLiteral("log2"); -const QString log10_F = QStringLiteral("log10"); -const QString log_F = QStringLiteral("log"); -const QString ln_F = QStringLiteral("ln"); -const QString exp_F = QStringLiteral("exp"); -const QString sqrt_F = QStringLiteral("sqrt"); -const QString sign_F = QStringLiteral("sign"); -const QString rint_F = QStringLiteral("rint"); -const QString abs_F = QStringLiteral("abs"); -const QString min_F = QStringLiteral("min"); -const QString max_F = QStringLiteral("max"); -const QString sum_F = QStringLiteral("sum"); -const QString avg_F = QStringLiteral("avg"); -const QString fmod_F = QStringLiteral("fmod"); - -const QStringList builInFunctions = QStringList() << sin_F << cos_F << tan_F << asin_F << acos_F << atan_F - << sinh_F << cosh_F << tanh_F << asinh_F << acosh_F << atanh_F - << log2_F << log10_F << log_F << ln_F << exp_F << sqrt_F - << sign_F << rint_F << abs_F << min_F << max_F << sum_F - << avg_F << fmod_F; - -// Postfix operators -const QString cm_Oprt = QStringLiteral("cm"); -const QString mm_Oprt = QStringLiteral("mm"); -const QString in_Oprt = QStringLiteral("in"); diff --git a/src/app/options.h b/src/app/options.h index 6bd5239da..a008c89d9 100644 --- a/src/app/options.h +++ b/src/app/options.h @@ -56,274 +56,9 @@ extern const QString cursorArrowOpenHand; extern const QString cursorArrowCloseHand; enum class SceneObject : char { Point, Line, Spline, Arc, SplinePath, Detail, Unknown }; -enum class Tool : unsigned char -{ - Arrow, - Point, - LinePoint, - AbstractSpline, - Cut, - SinglePoint, - EndLine, - Line, - AlongLine, - ShoulderPoint, - Normal, - Bisector, - LineIntersect, - Spline, - CutSpline, - CutArc, - Arc, - ArcWithLength, - SplinePath, - CutSplinePath, - PointOfContact, - Detail, - NodePoint, - NodeArc, - NodeSpline, - NodeSplinePath, - Height, - Triangle, - LineIntersectAxis, - PointOfIntersectionArcs, - PointOfIntersectionCircles, - CurveIntersectAxis, - PointOfIntersection, - PointFromCircleAndTangent, - PointFromArcAndTangent, - UnionDetails // 35 -}; -enum class Vis : unsigned char -{ - ControlPointSpline = 36, // increase this value if need more positions in Tool enum - GraphicsSimpleTextItem, - SimpleSplinePath, - Line, - Path, - ToolAlongLine, - ToolArc, - ToolArcWithLength, - ToolBisector, - ToolCutArc, - ToolEndLine, - ToolHeight, - ToolLine, - ToolLineIntersect, - ToolNormal, - ToolPointOfContact, - ToolPointOfIntersection, - ToolPointOfIntersectionArcs, - ToolPointOfIntersectionCircles, - ToolPointFromCircleAndTangent, - ToolPointFromArcAndTangent, - ToolShoulderPoint, - ToolSpline, - ToolTriangle, - ToolCutSpline, - ToolSplinePath, - ToolCutSplinePath, - ToolLineIntersectAxis, - ToolCurveIntersectAxis -}; enum class Source : char { FromGui, FromFile, FromTool }; -enum class NodeDetail : char { Contour, Modeling }; enum class Contour : char { OpenContour, CloseContour }; -enum class VarType : char { Measurement, Increment, LineLength, SplineLength, ArcLength, ArcRadius, LineAngle, ArcAngle, - SplineAngle, Unknown }; - -enum class GHeights : unsigned char { ALL, - H92=92, H98=98, H104=104, H110=110, H116=116, H122=122, H128=128, H134=134, - H140=140, H146=146, H152=152, H158=158, H164=164, H170=170, H176=176, H182=182, - H188=188, H194=194}; - -enum class GSizes : unsigned char { ALL, - S22=22, S24=24, S26=26, S28=28, S30=30, S32=32, S34=34, S36=36, S38=38, S40=40, - S42=42, S44=44, S46=46, S48=48, S50=50, S52=52, S54=54, S56=56 }; - -// measurements -//head and neck -extern const QString headGirth_M; -extern const QString midNeckGirth_M; -extern const QString neckBaseGirth_M; -extern const QString headAndNeckLength_M; -//torso -extern const QString centerFrontWaistLength_M; -extern const QString centerBackWaistLength_M; -extern const QString shoulderLength_M; -extern const QString sideWaistLength_M; -extern const QString trunkLength_M; -extern const QString shoulderGirth_M; -extern const QString upperChestGirth_M; -extern const QString bustGirth_M; -extern const QString underBustGirth_M; -extern const QString waistGirth_M; -extern const QString highHipGirth_M; -extern const QString hipGirth_M; -extern const QString upperFrontChestWidth_M; -extern const QString frontChestWidth_M; -extern const QString acrossFrontShoulderWidth_M; -extern const QString acrossBackShoulderWidth_M; -extern const QString upperBackWidth_M; -extern const QString backWidth_M; -extern const QString bustpointToBustpoint_M; -extern const QString halterBustpointToBustpoint_M; -extern const QString neckToBustpoint_M; -extern const QString crotchLength_M; -extern const QString riseHeight_M; -extern const QString shoulderDrop_M; -extern const QString shoulderSlopeDegrees_M; -extern const QString frontShoulderSlopeLength_M; -extern const QString backShoulderSlopeLength_M; -extern const QString frontShoulderToWaistLength_M; -extern const QString backShoulderToWaistLength_M; -extern const QString frontNeckArc_M; -extern const QString backNeckArc_M; -extern const QString frontUpperChestArc_M; -extern const QString backUpperChestArc_M; -extern const QString frontWaistArc_M; -extern const QString backWaistArc_M; -extern const QString frontUpperHipArc_M; -extern const QString backUpperHipArc_M; -extern const QString frontHipArc_M; -extern const QString backHipArc_M; -extern const QString chestSlope_M; -extern const QString backSlope_M; -extern const QString frontWaistSlope_M; -extern const QString backWaistSlope_M; -extern const QString frontNeckToUpperChestHeight_M; -extern const QString frontNeckToBustHeight_M; -extern const QString frontWaistToUpperChest_M; -extern const QString frontWaistToLowerBreast_M; -extern const QString backWaistToUpperChest_M; -extern const QString strapLength_M; -//arm -extern const QString armscyeGirth_M; -extern const QString elbowGirth_M; -extern const QString upperArmGirth_M; -extern const QString wristGirth_M; -extern const QString scyeDepth_M; -extern const QString shoulderAndArmLength_M; -extern const QString underarmLength_M; -extern const QString cervicaleToWristLength_M; -extern const QString shoulderToElbowLength_M; -extern const QString armLength_M; -//hand -extern const QString handWidth_M; -extern const QString handLength_M; -extern const QString handGirth_M; -//leg -extern const QString thighGirth_M; -extern const QString midThighGirth_M; -extern const QString kneeGirth_M; -extern const QString calfGirth_M; -extern const QString ankleGirth_M; -extern const QString kneeHeight_M; -extern const QString ankleHeight_M; -//foot -extern const QString footWidth_M; -extern const QString footLength_M; -//heights -extern const QString height_M; -extern const QString cervicaleHeight_M; -extern const QString cervicaleToKneeHeight_M; -extern const QString waistHeight_M; -extern const QString highHipHeight_M; -extern const QString hipHeight_M; -extern const QString waistToHipHeight_M; -extern const QString waistToKneeHeight_M; -extern const QString crotchHeight_M; -//extended measurements -extern const QString size_M; -extern const QString heightFrontNeckBasePoint_M; -extern const QString heightBaseNeckSidePoint_M; -extern const QString heightShoulderPoint_M; -extern const QString heightNipplePoint_M; -extern const QString heightBackAngleAxilla_M; -extern const QString heightScapularPoint_M; -extern const QString heightUnderButtockFolds_M; -extern const QString hipsExcludingProtrudingAbdomen_M; -extern const QString girthFootInstep_M; -extern const QString sideWaistToFloor_M; -extern const QString frontWaistToFloor_M; -extern const QString arcThroughGroinArea_M; -extern const QString waistToPlaneSeat_M; -extern const QString neckToRadialPoint_M; -extern const QString neckToThirdFinger_M; -extern const QString neckToFirstLineChestCircumference_M; -extern const QString frontWaistLength_M; -extern const QString arcThroughShoulderJoint_M; -extern const QString neckToBackLineChestCircumference_M; -extern const QString waistToNeckSide_M; -extern const QString arcLengthUpperBody_M; -extern const QString chestWidth_M; -extern const QString anteroposteriorDiameterHands_M; -extern const QString heightClavicularPoint_M; -extern const QString heightArmholeSlash_M; -extern const QString slashShoulderHeight_M; -extern const QString halfGirthNeck_M; -extern const QString halfGirthNeckForShirts_M; -extern const QString halfGirthChestFirst_M; -extern const QString halfGirthChestSecond_M; -extern const QString halfGirthChestThird_M; -extern const QString halfGirthWaist_M; -extern const QString halfGirthHipsConsideringProtrudingAbdomen_M; -extern const QString halfGirthHipsExcludingProtrudingAbdomen_M; -extern const QString girthKneeFlexedFeet_M; -extern const QString neckTransverseDiameter_M; -extern const QString frontSlashShoulderHeight_M; -extern const QString neckToFrontWaistLine_M; -extern const QString handVerticalDiameter_M; -extern const QString neckToKneePoint_M; -extern const QString waistToKnee_M; -extern const QString shoulderHeight_M; -extern const QString headHeight_M; -extern const QString bodyPosition_M; -extern const QString arcBehindShoulderGirdle_M; -extern const QString neckToNeckBase_M; -extern const QString depthWaistFirst_M; -extern const QString depthWaistSecond_M; - -// variables name -extern const QString line_; -extern const QString angleLine_; - -// functions -extern const QString sin_F; -extern const QString cos_F; -extern const QString tan_F; -extern const QString asin_F; -extern const QString acos_F; -extern const QString atan_F; -extern const QString sinh_F; -extern const QString cosh_F; -extern const QString tanh_F; -extern const QString asinh_F; -extern const QString acosh_F; -extern const QString atanh_F; -extern const QString log2_F; -extern const QString log10_F; -extern const QString log_F; -extern const QString ln_F; -extern const QString exp_F; -extern const QString sqrt_F; -extern const QString sign_F; -extern const QString rint_F; -extern const QString abs_F; -extern const QString min_F; -extern const QString max_F; -extern const QString sum_F; -extern const QString avg_F; -extern const QString fmod_F; - -extern const QStringList builInFunctions; - -// Postfix operators -extern const QString cm_Oprt; -extern const QString mm_Oprt; -extern const QString in_Oprt; #endif // OPTIONS_H diff --git a/src/app/tools/drawTools/vdrawtool.cpp b/src/app/tools/drawTools/vdrawtool.cpp index 2a54b762c..8f6980310 100644 --- a/src/app/tools/drawTools/vdrawtool.cpp +++ b/src/app/tools/drawTools/vdrawtool.cpp @@ -31,7 +31,7 @@ #include #include "../dialogs/tools/dialogeditwrongformula.h" #include "../dialogs/app/dialogundo.h" -#include "../container/calculator.h" +#include "../libs/vpatterndb/calculator.h" #include "../../undocommands/addtocalc.h" #include "../../undocommands/savetooloptions.h" #include "../../libs/ifc/exception/vexceptionundo.h" @@ -285,7 +285,7 @@ qreal VDrawTool::CheckFormula(const quint32 &toolId, QString &formula, VContaine Calculator *cal = nullptr; try { - cal = new Calculator(data); + cal = new Calculator(data, qApp->patternType()); result = cal->EvalFormula(formula); delete cal; } @@ -316,7 +316,7 @@ qreal VDrawTool::CheckFormula(const quint32 &toolId, QString &formula, VContaine /* Need delete dialog here because parser in dialog don't allow use correct separator for * parsing here. */ delete dialog; - Calculator *cal1 = new Calculator(data); + Calculator *cal1 = new Calculator(data, qApp->patternType()); result = cal1->EvalFormula(formula); delete cal1; /* Here can be memory leak, but dialog already check this formula and probability * very low. */ diff --git a/src/app/tools/drawTools/vtoolalongline.cpp b/src/app/tools/drawTools/vtoolalongline.cpp index e2c927473..9b50106ea 100644 --- a/src/app/tools/drawTools/vtoolalongline.cpp +++ b/src/app/tools/drawTools/vtoolalongline.cpp @@ -27,7 +27,7 @@ *************************************************************************/ #include "vtoolalongline.h" -#include "../../container/calculator.h" +#include "../../libs/vpatterndb/calculator.h" #include "../../dialogs/tools/dialogalongline.h" #include "../../libs/vgeometry/vpointf.h" #include "../../libs/ifc/exception/vexceptionobjecterror.h" diff --git a/src/app/tools/drawTools/vtoolarc.cpp b/src/app/tools/drawTools/vtoolarc.cpp index b80d642e7..af0dfd106 100644 --- a/src/app/tools/drawTools/vtoolarc.cpp +++ b/src/app/tools/drawTools/vtoolarc.cpp @@ -27,7 +27,7 @@ *************************************************************************/ #include "vtoolarc.h" -#include "../../container/calculator.h" +#include "../../libs/vpatterndb/calculator.h" #include "../../dialogs/tools/dialogarc.h" #include "../../libs/vgeometry/varc.h" #include "../container/vformula.h" diff --git a/src/app/tools/drawTools/vtoolarcwithlength.cpp b/src/app/tools/drawTools/vtoolarcwithlength.cpp index 8386360ac..34f53b611 100644 --- a/src/app/tools/drawTools/vtoolarcwithlength.cpp +++ b/src/app/tools/drawTools/vtoolarcwithlength.cpp @@ -27,7 +27,7 @@ *************************************************************************/ #include "vtoolarcwithlength.h" -#include "../../container/calculator.h" +#include "../../libs/vpatterndb/calculator.h" #include "../../dialogs/tools/dialogarcwithlength.h" #include "../../libs/vgeometry/varc.h" #include "../container/vformula.h" diff --git a/src/app/tools/drawTools/vtoolbisector.cpp b/src/app/tools/drawTools/vtoolbisector.cpp index c439ed48f..def7fd069 100644 --- a/src/app/tools/drawTools/vtoolbisector.cpp +++ b/src/app/tools/drawTools/vtoolbisector.cpp @@ -27,7 +27,7 @@ *************************************************************************/ #include "vtoolbisector.h" -#include "../../container/calculator.h" +#include "../../libs/vpatterndb/calculator.h" #include "../../dialogs/tools/dialogbisector.h" #include "../../libs/vgeometry/vpointf.h" #include "../../visualization/vistoolbisector.h" diff --git a/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp b/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp index 1132a9452..26c90c11b 100644 --- a/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp +++ b/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp @@ -28,7 +28,7 @@ #include "vtoolcurveintersectaxis.h" #include "../../widgets/vmaingraphicsscene.h" -#include "../../container/calculator.h" +#include "../../libs/vpatterndb/calculator.h" #include "../../dialogs/tools/dialogcurveintersectaxis.h" #include "../../dialogs/tools/dialogeditwrongformula.h" #include "../../libs/vgeometry/vpointf.h" diff --git a/src/app/tools/drawTools/vtoolcutarc.cpp b/src/app/tools/drawTools/vtoolcutarc.cpp index ddd61441d..075d96b63 100644 --- a/src/app/tools/drawTools/vtoolcutarc.cpp +++ b/src/app/tools/drawTools/vtoolcutarc.cpp @@ -27,7 +27,7 @@ *************************************************************************/ #include "vtoolcutarc.h" -#include "../../container/calculator.h" +#include "../../libs/vpatterndb/calculator.h" #include "../../dialogs/tools/dialogcutarc.h" #include "../../libs/vgeometry/vpointf.h" #include "../../libs/vgeometry/varc.h" diff --git a/src/app/tools/drawTools/vtoolcutspline.cpp b/src/app/tools/drawTools/vtoolcutspline.cpp index 5ecdf1772..2ad1bae44 100644 --- a/src/app/tools/drawTools/vtoolcutspline.cpp +++ b/src/app/tools/drawTools/vtoolcutspline.cpp @@ -27,7 +27,7 @@ *************************************************************************/ #include "vtoolcutspline.h" -#include "../../container/calculator.h" +#include "../../libs/vpatterndb/calculator.h" #include "../../dialogs/tools/dialogcutspline.h" #include "../../libs/vgeometry/vpointf.h" #include "../../visualization/vistoolcutspline.h" diff --git a/src/app/tools/drawTools/vtoolcutsplinepath.cpp b/src/app/tools/drawTools/vtoolcutsplinepath.cpp index 5ef0291f4..2e8ef38ee 100644 --- a/src/app/tools/drawTools/vtoolcutsplinepath.cpp +++ b/src/app/tools/drawTools/vtoolcutsplinepath.cpp @@ -27,7 +27,7 @@ *************************************************************************/ #include "vtoolcutsplinepath.h" -#include "../../container/calculator.h" +#include "../../libs/vpatterndb/calculator.h" #include "../../dialogs/tools/dialogcutsplinepath.h" #include "../../libs/vgeometry/vpointf.h" #include "../../visualization/vistoolcutsplinepath.h" diff --git a/src/app/tools/drawTools/vtoolendline.cpp b/src/app/tools/drawTools/vtoolendline.cpp index 3bb4ab45c..25b8ad8f9 100644 --- a/src/app/tools/drawTools/vtoolendline.cpp +++ b/src/app/tools/drawTools/vtoolendline.cpp @@ -28,7 +28,7 @@ #include "vtoolendline.h" #include "../../widgets/vmaingraphicsscene.h" -#include "../../container/calculator.h" +#include "../../libs/vpatterndb/calculator.h" #include "../../dialogs/tools/dialogendline.h" #include "../../dialogs/tools/dialogeditwrongformula.h" #include "../../libs/vgeometry/vpointf.h" diff --git a/src/app/tools/drawTools/vtoollineintersectaxis.cpp b/src/app/tools/drawTools/vtoollineintersectaxis.cpp index be4dc5ab5..e6adc40b9 100644 --- a/src/app/tools/drawTools/vtoollineintersectaxis.cpp +++ b/src/app/tools/drawTools/vtoollineintersectaxis.cpp @@ -28,7 +28,7 @@ #include "vtoollineintersectaxis.h" #include "../../widgets/vmaingraphicsscene.h" -#include "../../container/calculator.h" +#include "../../libs/vpatterndb/calculator.h" #include "../../dialogs/tools/dialoglineintersectaxis.h" #include "../../dialogs/tools/dialogeditwrongformula.h" #include "../../libs/vgeometry/vpointf.h" diff --git a/src/app/tools/drawTools/vtoolnormal.cpp b/src/app/tools/drawTools/vtoolnormal.cpp index 598645ba6..4c320433a 100644 --- a/src/app/tools/drawTools/vtoolnormal.cpp +++ b/src/app/tools/drawTools/vtoolnormal.cpp @@ -27,7 +27,7 @@ *************************************************************************/ #include "vtoolnormal.h" -#include "../../container/calculator.h" +#include "../../libs/vpatterndb/calculator.h" #include "../../dialogs/tools/dialognormal.h" #include "../../libs/vgeometry/vpointf.h" #include "../../visualization/vistoolnormal.h" diff --git a/src/app/tools/drawTools/vtoolpointofcontact.cpp b/src/app/tools/drawTools/vtoolpointofcontact.cpp index 043920482..91e4d8781 100644 --- a/src/app/tools/drawTools/vtoolpointofcontact.cpp +++ b/src/app/tools/drawTools/vtoolpointofcontact.cpp @@ -27,7 +27,7 @@ *************************************************************************/ #include "vtoolpointofcontact.h" -#include "../../container/calculator.h" +#include "../../libs/vpatterndb/calculator.h" #include "../../dialogs/tools/dialogpointofcontact.h" #include "../../libs/vgeometry/vpointf.h" #include "../../container/vformula.h" diff --git a/src/app/tools/drawTools/vtoolshoulderpoint.cpp b/src/app/tools/drawTools/vtoolshoulderpoint.cpp index 1af652200..baabaa3ef 100644 --- a/src/app/tools/drawTools/vtoolshoulderpoint.cpp +++ b/src/app/tools/drawTools/vtoolshoulderpoint.cpp @@ -27,7 +27,7 @@ *************************************************************************/ #include "vtoolshoulderpoint.h" -#include "../../container/calculator.h" +#include "../../libs/vpatterndb/calculator.h" #include "../../dialogs/tools/dialogshoulderpoint.h" #include "../../libs/vgeometry/vpointf.h" #include "../../visualization/vistoolshoulderpoint.h" diff --git a/src/app/tools/vdatatool.h b/src/app/tools/vdatatool.h index 75046fe52..645f9be4f 100644 --- a/src/app/tools/vdatatool.h +++ b/src/app/tools/vdatatool.h @@ -29,7 +29,7 @@ #ifndef VDATATOOL_H #define VDATATOOL_H -#include "../container/vcontainer.h" +#include "../libs/vpatterndb/vcontainer.h" #include "../../utils/logging.h" Q_DECLARE_LOGGING_CATEGORY(vTool) diff --git a/src/app/visualization/vistoolalongline.cpp b/src/app/visualization/vistoolalongline.cpp index 6565818d6..4c7cddbd9 100644 --- a/src/app/visualization/vistoolalongline.cpp +++ b/src/app/visualization/vistoolalongline.cpp @@ -27,7 +27,7 @@ *************************************************************************/ #include "vistoolalongline.h" -#include "../container/vcontainer.h" +#include "../libs/vpatterndb/vcontainer.h" #include "../libs/vgeometry/vpointf.h" //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/visualization/vistoolarc.cpp b/src/app/visualization/vistoolarc.cpp index ce540f435..cd3c2978b 100644 --- a/src/app/visualization/vistoolarc.cpp +++ b/src/app/visualization/vistoolarc.cpp @@ -29,7 +29,7 @@ #include "vistoolarc.h" #include "../libs/vgeometry/vpointf.h" #include "../libs/vgeometry/varc.h" -#include "../container/vcontainer.h" +#include "../libs/vpatterndb/vcontainer.h" //--------------------------------------------------------------------------------------------------------------------- VisToolArc::VisToolArc(const VContainer *data, QGraphicsItem *parent) diff --git a/src/app/visualization/vistoolarcwithlength.cpp b/src/app/visualization/vistoolarcwithlength.cpp index 423468c92..861e9266c 100644 --- a/src/app/visualization/vistoolarcwithlength.cpp +++ b/src/app/visualization/vistoolarcwithlength.cpp @@ -29,7 +29,7 @@ #include "vistoolarcwithlength.h" #include "../libs/vgeometry/vpointf.h" #include "../libs/vgeometry/varc.h" -#include "../container/vcontainer.h" +#include "../libs/vpatterndb/vcontainer.h" //--------------------------------------------------------------------------------------------------------------------- VisToolArcWithLength::VisToolArcWithLength(const VContainer *data, QGraphicsItem *parent) diff --git a/src/app/visualization/vistoolbisector.cpp b/src/app/visualization/vistoolbisector.cpp index d70e7ba1b..3d69556da 100644 --- a/src/app/visualization/vistoolbisector.cpp +++ b/src/app/visualization/vistoolbisector.cpp @@ -28,7 +28,7 @@ #include "vistoolbisector.h" #include "../libs/vgeometry/vpointf.h" -#include "../container/vcontainer.h" +#include "../libs/vpatterndb/vcontainer.h" #include "../tools/drawTools/vtoolbisector.h" //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/visualization/vistoolcurveintersectaxis.cpp b/src/app/visualization/vistoolcurveintersectaxis.cpp index ac862d011..e2e1d441d 100644 --- a/src/app/visualization/vistoolcurveintersectaxis.cpp +++ b/src/app/visualization/vistoolcurveintersectaxis.cpp @@ -27,7 +27,7 @@ *************************************************************************/ #include "vistoolcurveintersectaxis.h" -#include "../container/vcontainer.h" +#include "../libs/vpatterndb/vcontainer.h" #include "../libs/vgeometry/vpointf.h" #include "../tools/drawTools/vtoolcurveintersectaxis.h" diff --git a/src/app/visualization/vistoolcutarc.cpp b/src/app/visualization/vistoolcutarc.cpp index 617153ddf..0ff22f56d 100644 --- a/src/app/visualization/vistoolcutarc.cpp +++ b/src/app/visualization/vistoolcutarc.cpp @@ -28,7 +28,7 @@ #include "vistoolcutarc.h" #include "../libs/vgeometry/varc.h" -#include "../container/vcontainer.h" +#include "../libs/vpatterndb/vcontainer.h" //--------------------------------------------------------------------------------------------------------------------- VisToolCutArc::VisToolCutArc(const VContainer *data, QGraphicsItem *parent) diff --git a/src/app/visualization/vistoolcutspline.cpp b/src/app/visualization/vistoolcutspline.cpp index d1ae453a5..85b03db86 100644 --- a/src/app/visualization/vistoolcutspline.cpp +++ b/src/app/visualization/vistoolcutspline.cpp @@ -28,7 +28,7 @@ #include "vistoolcutspline.h" #include "../libs/vgeometry/vspline.h" -#include "../container/vcontainer.h" +#include "../libs/vpatterndb/vcontainer.h" //--------------------------------------------------------------------------------------------------------------------- VisToolCutSpline::VisToolCutSpline(const VContainer *data, QGraphicsItem *parent) diff --git a/src/app/visualization/vistoolcutsplinepath.cpp b/src/app/visualization/vistoolcutsplinepath.cpp index 80bfebd4e..85f8834ca 100644 --- a/src/app/visualization/vistoolcutsplinepath.cpp +++ b/src/app/visualization/vistoolcutsplinepath.cpp @@ -27,7 +27,7 @@ *************************************************************************/ #include "vistoolcutsplinepath.h" -#include "../container/vcontainer.h" +#include "../libs/vpatterndb/vcontainer.h" #include "../libs/vgeometry/vsplinepath.h" //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/visualization/vistoolendline.cpp b/src/app/visualization/vistoolendline.cpp index ff517ffac..0e57cdd56 100644 --- a/src/app/visualization/vistoolendline.cpp +++ b/src/app/visualization/vistoolendline.cpp @@ -28,7 +28,7 @@ #include "vistoolendline.h" #include "../libs/vgeometry/vpointf.h" -#include "../container/vcontainer.h" +#include "../libs/vpatterndb/vcontainer.h" #include "../tools/vabstracttool.h" #include diff --git a/src/app/visualization/vistoolline.cpp b/src/app/visualization/vistoolline.cpp index e3759efd2..3f41397aa 100644 --- a/src/app/visualization/vistoolline.cpp +++ b/src/app/visualization/vistoolline.cpp @@ -27,7 +27,7 @@ *************************************************************************/ #include "vistoolline.h" -#include "../container/vcontainer.h" +#include "../libs/vpatterndb/vcontainer.h" #include "../libs/vgeometry/vpointf.h" #include "../tools/drawTools/vdrawtool.h" diff --git a/src/app/visualization/vistoollineintersect.cpp b/src/app/visualization/vistoollineintersect.cpp index 2c2dfdeb9..79ed075dd 100644 --- a/src/app/visualization/vistoollineintersect.cpp +++ b/src/app/visualization/vistoollineintersect.cpp @@ -28,7 +28,7 @@ #include "vistoollineintersect.h" #include "../libs/vgeometry/vpointf.h" -#include "../container/vcontainer.h" +#include "../libs/vpatterndb/vcontainer.h" //--------------------------------------------------------------------------------------------------------------------- VisToolLineIntersect::VisToolLineIntersect(const VContainer *data, QGraphicsItem *parent) diff --git a/src/app/visualization/vistoollineintersectaxis.cpp b/src/app/visualization/vistoollineintersectaxis.cpp index 6e4ac5140..17c6f1db8 100644 --- a/src/app/visualization/vistoollineintersectaxis.cpp +++ b/src/app/visualization/vistoollineintersectaxis.cpp @@ -27,7 +27,7 @@ *************************************************************************/ #include "vistoollineintersectaxis.h" -#include "../container/vcontainer.h" +#include "../libs/vpatterndb/vcontainer.h" #include "../libs/vgeometry/vpointf.h" #include "../tools/drawTools/vtoollineintersectaxis.h" diff --git a/src/app/visualization/vistoolpointfromarcandtangent.cpp b/src/app/visualization/vistoolpointfromarcandtangent.cpp index e7ee06e70..8e72f7ad6 100644 --- a/src/app/visualization/vistoolpointfromarcandtangent.cpp +++ b/src/app/visualization/vistoolpointfromarcandtangent.cpp @@ -27,7 +27,7 @@ *************************************************************************/ #include "vistoolpointfromarcandtangent.h" -#include "../container/vcontainer.h" +#include "../libs/vpatterndb/vcontainer.h" #include "../tools/drawTools/vtoolpointfromarcandtangent.h" #include "../libs/vgeometry/vpointf.h" #include "../libs/vgeometry/varc.h" diff --git a/src/app/visualization/vistoolpointfromcircleandtangent.cpp b/src/app/visualization/vistoolpointfromcircleandtangent.cpp index 3164f9874..cc06d0a57 100644 --- a/src/app/visualization/vistoolpointfromcircleandtangent.cpp +++ b/src/app/visualization/vistoolpointfromcircleandtangent.cpp @@ -27,7 +27,7 @@ *************************************************************************/ #include "vistoolpointfromcircleandtangent.h" -#include "../container/vcontainer.h" +#include "../libs/vpatterndb/vcontainer.h" #include "../tools/drawTools/vtoolpointfromcircleandtangent.h" #include "../libs/vgeometry/vpointf.h" diff --git a/src/app/visualization/vistoolpointofintersection.cpp b/src/app/visualization/vistoolpointofintersection.cpp index a6a51e58a..a8f174a72 100644 --- a/src/app/visualization/vistoolpointofintersection.cpp +++ b/src/app/visualization/vistoolpointofintersection.cpp @@ -28,7 +28,7 @@ #include "vistoolpointofintersection.h" #include "../libs/vgeometry/vpointf.h" -#include "../container/vcontainer.h" +#include "../libs/vpatterndb/vcontainer.h" //--------------------------------------------------------------------------------------------------------------------- VisToolPointOfIntersection::VisToolPointOfIntersection(const VContainer *data, QGraphicsItem *parent) diff --git a/src/app/visualization/vistoolpointofintersectionarcs.cpp b/src/app/visualization/vistoolpointofintersectionarcs.cpp index 82cffc774..7a11d46e4 100644 --- a/src/app/visualization/vistoolpointofintersectionarcs.cpp +++ b/src/app/visualization/vistoolpointofintersectionarcs.cpp @@ -28,7 +28,7 @@ #include "vistoolpointofintersectionarcs.h" #include "../libs/vgeometry/varc.h" -#include "../container/vcontainer.h" +#include "../libs/vpatterndb/vcontainer.h" #include "../tools/drawTools/vtoolpointofintersectionarcs.h" //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/visualization/vistoolpointofintersectioncircles.cpp b/src/app/visualization/vistoolpointofintersectioncircles.cpp index 95451b793..55dc336a1 100644 --- a/src/app/visualization/vistoolpointofintersectioncircles.cpp +++ b/src/app/visualization/vistoolpointofintersectioncircles.cpp @@ -27,7 +27,7 @@ *************************************************************************/ #include "vistoolpointofintersectioncircles.h" -#include "../container/vcontainer.h" +#include "../libs/vpatterndb/vcontainer.h" #include "../tools/drawTools/vtoolpointofintersectioncircles.h" #include "../libs/vgeometry/vpointf.h" diff --git a/src/app/visualization/vistoolspline.cpp b/src/app/visualization/vistoolspline.cpp index 0bd65ad58..b9130d58b 100644 --- a/src/app/visualization/vistoolspline.cpp +++ b/src/app/visualization/vistoolspline.cpp @@ -29,7 +29,7 @@ #include "vistoolspline.h" #include "../libs/vgeometry/vpointf.h" #include "../libs/vgeometry/vspline.h" -#include "../container/vcontainer.h" +#include "../libs/vpatterndb/vcontainer.h" const int EMPTY_ANGLE = -1; diff --git a/src/app/visualization/vistooltriangle.cpp b/src/app/visualization/vistooltriangle.cpp index 106920620..db490e095 100644 --- a/src/app/visualization/vistooltriangle.cpp +++ b/src/app/visualization/vistooltriangle.cpp @@ -28,7 +28,7 @@ #include "vistooltriangle.h" #include "../libs/vgeometry/vpointf.h" -#include "../container/vcontainer.h" +#include "../libs/vpatterndb/vcontainer.h" #include "../tools/drawTools/vtooltriangle.h" #include diff --git a/src/app/visualization/visualization.cpp b/src/app/visualization/visualization.cpp index ade0be1ae..90cc7797f 100644 --- a/src/app/visualization/visualization.cpp +++ b/src/app/visualization/visualization.cpp @@ -28,7 +28,7 @@ #include "visualization.h" #include "../tools/drawTools/vdrawtool.h" -#include "../container/calculator.h" +#include "../libs/vpatterndb/calculator.h" #include @@ -145,8 +145,8 @@ qreal Visualization::FindVal(const QString &expression) // Replace line return with spaces for calc if exist QString formula = expression; formula.replace("\n", " "); - formula = qApp->TrVars()->FormulaFromUser(formula); - Calculator *cal = new Calculator(Visualization::data); + formula = qApp->TrVars()->FormulaFromUser(formula, qApp->getSettings()->GetOsSeparator()); + Calculator *cal = new Calculator(Visualization::data, qApp->patternType()); val = cal->EvalFormula(formula); delete cal; } diff --git a/src/app/widgets/textdelegate.cpp b/src/app/widgets/textdelegate.cpp index e9589e0d9..6be5f6b69 100644 --- a/src/app/widgets/textdelegate.cpp +++ b/src/app/widgets/textdelegate.cpp @@ -29,7 +29,7 @@ #include "textdelegate.h" #include #include "../options.h" -#include "../container/vcontainer.h" +#include "../libs/vpatterndb/vcontainer.h" //--------------------------------------------------------------------------------------------------------------------- /** diff --git a/src/app/xml/vabstractmeasurements.cpp b/src/app/xml/vabstractmeasurements.cpp index 4c87b9fc2..5f5d1984a 100644 --- a/src/app/xml/vabstractmeasurements.cpp +++ b/src/app/xml/vabstractmeasurements.cpp @@ -201,77 +201,6 @@ Unit VAbstractMeasurements::MUnit() const return VDomDocument::StrToUnits(unit); } -//--------------------------------------------------------------------------------------------------------------------- -qreal VAbstractMeasurements::UnitConvertor(qreal value, const Unit &from, const Unit &to) -{ - switch (from) - { - case Unit::Mm: - switch (to) - { - case Unit::Mm: - return value; - case Unit::Cm: - return value / 10.0; - case Unit::Inch: - return value / 25.4; - case Unit::Px: - return (value / 25.4) * PrintDPI; - default: - break; - } - break; - case Unit::Cm: - switch (to) - { - case Unit::Mm: - return value * 10.0; - case Unit::Cm: - return value; - case Unit::Inch: - return value / 2.54; - case Unit::Px: - return ((value * 10.0) / 25.4) * PrintDPI; - default: - break; - } - break; - case Unit::Inch: - switch (to) - { - case Unit::Mm: - return value * 25.4; - case Unit::Cm: - return value * 2.54; - case Unit::Inch: - return value; - case Unit::Px: - return value * PrintDPI; - default: - break; - } - break; - case Unit::Px: - switch (to) - { - case Unit::Mm: - return (value / PrintDPI) * 25.4; - case Unit::Cm: - return ((value / PrintDPI) * 25.4) / 10.0; - case Unit::Inch: - return value / PrintDPI; - case Unit::Px: - return value; - default: - break; - } - break; - default: - break; - } - return 0; -} - //--------------------------------------------------------------------------------------------------------------------- void VAbstractMeasurements::Measurement(const QString &tag) { diff --git a/src/app/xml/vabstractmeasurements.h b/src/app/xml/vabstractmeasurements.h index 10917bc0b..3d0501cfe 100644 --- a/src/app/xml/vabstractmeasurements.h +++ b/src/app/xml/vabstractmeasurements.h @@ -30,7 +30,7 @@ #define VABSTRACTMEASUREMENTS_H #include "../libs/ifc/xml/vdomdocument.h" -#include "../container/vcontainer.h" +#include "../libs/vpatterndb/vcontainer.h" class VAbstractMeasurements : public VDomDocument { @@ -41,7 +41,6 @@ public: Unit MUnit() const; static const QString TagUnit; static const QString AttrValue; - static qreal UnitConvertor(qreal value, const Unit &from, const Unit &to); protected: /** @brief data container with data. */ VContainer *data; diff --git a/src/app/xml/vpattern.h b/src/app/xml/vpattern.h index 35c4acaf7..d0afc0219 100644 --- a/src/app/xml/vpattern.h +++ b/src/app/xml/vpattern.h @@ -31,7 +31,7 @@ #include "../libs/ifc/xml/vdomdocument.h" #include "vtoolrecord.h" -#include "../container/vcontainer.h" +#include "../libs/vpatterndb/vcontainer.h" class VDataTool; class VMainGraphicsScene; diff --git a/src/libs/ifc/exception/vexception.h b/src/libs/ifc/exception/vexception.h index d3987e412..66f6eb1f3 100644 --- a/src/libs/ifc/exception/vexception.h +++ b/src/libs/ifc/exception/vexception.h @@ -32,7 +32,7 @@ #include #include #include -#include "ifcdef.h" +#include "../ifcdef.h" class QWidget; diff --git a/src/libs/ifc/ifcdef.h b/src/libs/ifc/ifcdef.h index 9b0e7a03a..7777bd572 100644 --- a/src/libs/ifc/ifcdef.h +++ b/src/libs/ifc/ifcdef.h @@ -99,4 +99,75 @@ inline double FromPixel(double pix, const Unit &unit) return 0; } +//--------------------------------------------------------------------------------------------------------------------- +inline qreal UnitConvertor(qreal value, const Unit &from, const Unit &to) +{ + switch (from) + { + case Unit::Mm: + switch (to) + { + case Unit::Mm: + return value; + case Unit::Cm: + return value / 10.0; + case Unit::Inch: + return value / 25.4; + case Unit::Px: + return (value / 25.4) * PrintDPI; + default: + break; + } + break; + case Unit::Cm: + switch (to) + { + case Unit::Mm: + return value * 10.0; + case Unit::Cm: + return value; + case Unit::Inch: + return value / 2.54; + case Unit::Px: + return ((value * 10.0) / 25.4) * PrintDPI; + default: + break; + } + break; + case Unit::Inch: + switch (to) + { + case Unit::Mm: + return value * 25.4; + case Unit::Cm: + return value * 2.54; + case Unit::Inch: + return value; + case Unit::Px: + return value * PrintDPI; + default: + break; + } + break; + case Unit::Px: + switch (to) + { + case Unit::Mm: + return (value / PrintDPI) * 25.4; + case Unit::Cm: + return ((value / PrintDPI) * 25.4) / 10.0; + case Unit::Inch: + return value / PrintDPI; + case Unit::Px: + return value; + default: + break; + } + break; + default: + break; + } + return 0; +} + #endif // IFCDEF_H diff --git a/src/libs/libs.pro b/src/libs/libs.pro index 52a4fb199..81690d91a 100644 --- a/src/libs/libs.pro +++ b/src/libs/libs.pro @@ -1,8 +1,10 @@ TEMPLATE = subdirs CONFIG += ordered -SUBDIRS = qmuparser \ +SUBDIRS = \ + qmuparser \ vpropertyexplorer \ ifc \ vobj \ vlayout \ - vgeometry + vgeometry \ + vpatterndb diff --git a/src/app/container/calculator.cpp b/src/libs/vpatterndb/calculator.cpp similarity index 92% rename from src/app/container/calculator.cpp rename to src/libs/vpatterndb/calculator.cpp index 084fc266a..c33540198 100644 --- a/src/app/container/calculator.cpp +++ b/src/libs/vpatterndb/calculator.cpp @@ -29,9 +29,7 @@ #include "calculator.h" #include #include -#include "../core/vapplication.h" #include "vcontainer.h" -#include "../core/vsettings.h" using namespace qmu; @@ -44,14 +42,14 @@ using namespace qmu; * Example: * * const QString formula = qApp->FormulaFromUser(edit->text()); - * Calculator *cal = new Calculator(data); + * Calculator *cal = new Calculator(data, patternType); * const qreal result = cal->EvalFormula(formula); * delete cal; * * @param data pointer to a variable container. */ -Calculator::Calculator(const VContainer *data) - :QmuParser(), vVarVal(nullptr), data(data) +Calculator::Calculator(const VContainer *data, MeasurementsType patternType) + :QmuParser(), vVarVal(nullptr), data(data), patternType(patternType) { SCASSERT(data != nullptr) InitCharacterSets(); @@ -68,7 +66,7 @@ Calculator::Calculator(const VContainer *data) * Use this constuctor to get tokens from formula. All formulas must be converted to external look. * Example: * - * Calculator *cal = new Calculator(formula, false); + * Calculator *cal = new Calculator(formula, osSeparator, false); * tokens = cal->GetTokens(); * numbers = cal->GetNumbers(); * delete cal; @@ -76,14 +74,14 @@ Calculator::Calculator(const VContainer *data) * @param formula string with formula. * @param fromUser true if we parse formula from user */ -Calculator::Calculator(const QString &formula, bool fromUser) - :QmuParser(), vVarVal(nullptr), data(nullptr) +Calculator::Calculator(const QString &formula, bool osSeparator, bool fromUser) + :QmuParser(), vVarVal(nullptr), data(nullptr), patternType(MeasurementsType::Standard) { InitCharacterSets(); setAllowSubexpressions(false);//Only one expression per time SetVarFactory(AddVariable, this); - SetSepForTr(fromUser); + SetSepForTr(osSeparator, fromUser); SetExpr(formula); //Need run for making tokens. Don't catch exception here, because we want know if formula has error. @@ -154,7 +152,7 @@ qreal Calculator::EvalFormula(const QString &formula) */ void Calculator::InitVariables(const VContainer *data, const QMap &tokens, const QString &formula) { - if (qApp->patternType() == MeasurementsType::Standard) + if (patternType == MeasurementsType::Standard) { vVarVal = new qreal[2]; //stabdard measurements table have two additional variables } @@ -169,17 +167,17 @@ void Calculator::InitVariables(const VContainer *data, const QMap if (vars->contains(i.value())) { QSharedPointer var = vars->value(i.value()); - if ((qApp->patternType() == MeasurementsType::Standard) && + if ((patternType == MeasurementsType::Standard) && (var->GetType() == VarType::Measurement || var->GetType() == VarType::Increment)) { QSharedPointer m = data->GetVariable(i.value()); - m->SetValue(data->size(), data->height()); + m->SetValue(data->size(), data->height(), *data->GetPatternUnit()); } DefineVar(i.value(), var->GetValue()); found = true; } - if (qApp->patternType() == MeasurementsType::Standard) + if (patternType == MeasurementsType::Standard) { if (i.value() == data->SizeName()) { @@ -259,13 +257,11 @@ void Calculator::SetSepForEval() * @brief Calculator::SetSepForTr set separators for translation expression. * @param fromUser true if expression come from user (from dialog). */ -void Calculator::SetSepForTr(bool fromUser) +void Calculator::SetSepForTr(bool osSeparator, bool fromUser) { if (fromUser) { - const bool osSeparatorValue = qApp->getSettings()->GetOsSeparator(); - - if (osSeparatorValue) + if (osSeparator) { const QLocale loc = QLocale::system(); SetDecSep(loc.decimalPoint().toLatin1()); diff --git a/src/app/container/calculator.h b/src/libs/vpatterndb/calculator.h similarity index 89% rename from src/app/container/calculator.h rename to src/libs/vpatterndb/calculator.h index f2491ed43..db9dba192 100644 --- a/src/app/container/calculator.h +++ b/src/libs/vpatterndb/calculator.h @@ -29,7 +29,8 @@ #ifndef CALCULATOR_H #define CALCULATOR_H -#include "../../libs/qmuparser/qmuparser.h" +#include "../qmuparser/qmuparser.h" +#include "../ifc/ifcdef.h" class VContainer; @@ -55,19 +56,20 @@ class VContainer; class Calculator:public qmu::QmuParser { public: - Calculator(const VContainer *data); - Calculator(const QString &formula, bool fromUser = true); + Calculator(const VContainer *data, MeasurementsType patternType); + Calculator(const QString &formula, bool osSeparator, bool fromUser = true); ~Calculator(); qreal EvalFormula(const QString &formula); private: Q_DISABLE_COPY(Calculator) qreal *vVarVal; const VContainer *data; + MeasurementsType patternType; void InitVariables(const VContainer *data, const QMap &tokens, const QString &formula); void InitCharacterSets(); static qreal* AddVariable(const QString &a_szName, void *a_pUserData); void SetSepForEval(); - void SetSepForTr(bool fromUser); + void SetSepForTr(bool osSeparator, bool fromUser); static void RemoveAll(QMap &map, const QString &val); }; diff --git a/src/libs/vpatterndb/stable.cpp b/src/libs/vpatterndb/stable.cpp new file mode 100644 index 000000000..a42d3fd7c --- /dev/null +++ b/src/libs/vpatterndb/stable.cpp @@ -0,0 +1,30 @@ +/************************************************************************ + ** + ** @file stable.cpp + ** @author Roman Telezhynskyi + ** @date 10 12, 2014 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2013-2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +// Build the precompiled headers. +#include "stable.h" diff --git a/src/libs/vpatterndb/stable.h b/src/libs/vpatterndb/stable.h new file mode 100644 index 000000000..e19a85cee --- /dev/null +++ b/src/libs/vpatterndb/stable.h @@ -0,0 +1,52 @@ +/************************************************************************ + ** + ** @file stable.h + ** @author Roman Telezhynskyi + ** @date 10 12, 2014 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2013-2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef STABLE_H +#define STABLE_H + +/* I like to include this pragma too, so the build log indicates if pre-compiled headers were in use. */ +#ifndef __clang__ +#pragma message("Compiling precompiled headers for VPatternDB library.\n") +#endif + +/* Add C includes here */ + +#if defined __cplusplus +/* Add C++ includes here */ + +#ifdef QT_CORE_LIB +#include +#endif + +#ifdef QT_GUI_LIB +# include +#endif + +#endif/*__cplusplus*/ + +#endif // STABLE_H diff --git a/src/app/container/variables.h b/src/libs/vpatterndb/variables.h similarity index 100% rename from src/app/container/variables.h rename to src/libs/vpatterndb/variables.h diff --git a/src/app/container/variables/varcangle.cpp b/src/libs/vpatterndb/variables/varcangle.cpp similarity index 98% rename from src/app/container/variables/varcangle.cpp rename to src/libs/vpatterndb/variables/varcangle.cpp index 0e3d5603e..84d7d7fce 100644 --- a/src/app/container/variables/varcangle.cpp +++ b/src/libs/vpatterndb/variables/varcangle.cpp @@ -27,7 +27,7 @@ *************************************************************************/ #include "varcangle.h" -#include "../libs/vgeometry/vabstractcurve.h" +#include "../vgeometry/vabstractcurve.h" //--------------------------------------------------------------------------------------------------------------------- VArcAngle::VArcAngle() diff --git a/src/app/container/variables/varcangle.h b/src/libs/vpatterndb/variables/varcangle.h similarity index 100% rename from src/app/container/variables/varcangle.h rename to src/libs/vpatterndb/variables/varcangle.h diff --git a/src/app/container/variables/varclength.cpp b/src/libs/vpatterndb/variables/varclength.cpp similarity index 93% rename from src/app/container/variables/varclength.cpp rename to src/libs/vpatterndb/variables/varclength.cpp index c0af0170f..c94e39a34 100644 --- a/src/app/container/variables/varclength.cpp +++ b/src/libs/vpatterndb/variables/varclength.cpp @@ -27,8 +27,7 @@ *************************************************************************/ #include "varclength.h" -#include "../libs/vgeometry/vabstractcurve.h" -#include "../core/vapplication.h" +#include "../vgeometry/vabstractcurve.h" //--------------------------------------------------------------------------------------------------------------------- VArcLength::VArcLength() @@ -38,8 +37,8 @@ VArcLength::VArcLength() } //--------------------------------------------------------------------------------------------------------------------- -VArcLength::VArcLength(const quint32 &id, const quint32 &parentId, const VAbstractCurve *arc) - :VCurveLength(id, parentId, arc) +VArcLength::VArcLength(const quint32 &id, const quint32 &parentId, const VAbstractCurve *arc, Unit patternUnit) + :VCurveLength(id, parentId, arc, patternUnit) { SetType(VarType::ArcLength); } diff --git a/src/app/container/variables/varclength.h b/src/libs/vpatterndb/variables/varclength.h similarity index 97% rename from src/app/container/variables/varclength.h rename to src/libs/vpatterndb/variables/varclength.h index a0e1e4ab2..570f5ed0b 100644 --- a/src/app/container/variables/varclength.h +++ b/src/libs/vpatterndb/variables/varclength.h @@ -37,7 +37,7 @@ class VArcLength :public VCurveLength { public: VArcLength(); - VArcLength(const quint32 &id, const quint32 &parentId, const VAbstractCurve *arc); + VArcLength(const quint32 &id, const quint32 &parentId, const VAbstractCurve *arc, Unit patternUnit); VArcLength(const VArcLength &var); VArcLength &operator=(const VArcLength &var); virtual ~VArcLength(); diff --git a/src/app/container/variables/varcradius.cpp b/src/libs/vpatterndb/variables/varcradius.cpp similarity index 94% rename from src/app/container/variables/varcradius.cpp rename to src/libs/vpatterndb/variables/varcradius.cpp index 83b99e7b6..dec68ecd9 100644 --- a/src/app/container/variables/varcradius.cpp +++ b/src/libs/vpatterndb/variables/varcradius.cpp @@ -27,8 +27,7 @@ *************************************************************************/ #include "varcradius.h" -#include "../libs/vgeometry/varc.h" -#include "../core/vapplication.h" +#include "../vgeometry/varc.h" //--------------------------------------------------------------------------------------------------------------------- VArcRadius::VArcRadius() @@ -38,14 +37,14 @@ VArcRadius::VArcRadius() } //--------------------------------------------------------------------------------------------------------------------- -VArcRadius::VArcRadius(const quint32 &id, const quint32 &parentId, const VArc *arc) +VArcRadius::VArcRadius(const quint32 &id, const quint32 &parentId, const VArc *arc, Unit patternUnit) :VCurveVariable(id, parentId) { SCASSERT(arc != nullptr); SetType(VarType::ArcRadius); SetName(QString(radius_V+"%1").arg(arc->name())); - SetValue(qApp->fromPixel(arc->GetRadius())); + SetValue(FromPixel(arc->GetRadius(), patternUnit)); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/container/variables/varcradius.h b/src/libs/vpatterndb/variables/varcradius.h similarity index 96% rename from src/app/container/variables/varcradius.h rename to src/libs/vpatterndb/variables/varcradius.h index 0b32afb21..a9d9b0d99 100644 --- a/src/app/container/variables/varcradius.h +++ b/src/libs/vpatterndb/variables/varcradius.h @@ -30,6 +30,7 @@ #define VARCRADIUS_H #include "vcurvevariable.h" +#include "../ifc/ifcdef.h" class VArc; @@ -37,7 +38,7 @@ class VArcRadius :public VCurveVariable { public: VArcRadius(); - VArcRadius(const quint32 &id, const quint32 &parentId, const VArc *arc); + VArcRadius(const quint32 &id, const quint32 &parentId, const VArc *arc, Unit patternUnit); VArcRadius(const VArcRadius &var); VArcRadius &operator=(const VArcRadius &var); virtual ~VArcRadius(); diff --git a/src/app/container/variables/varcradius_p.h b/src/libs/vpatterndb/variables/varcradius_p.h similarity index 100% rename from src/app/container/variables/varcradius_p.h rename to src/libs/vpatterndb/variables/varcradius_p.h diff --git a/src/app/container/variables/vcurveangle.cpp b/src/libs/vpatterndb/variables/vcurveangle.cpp similarity index 98% rename from src/app/container/variables/vcurveangle.cpp rename to src/libs/vpatterndb/variables/vcurveangle.cpp index aa34b9efb..99c572acb 100644 --- a/src/app/container/variables/vcurveangle.cpp +++ b/src/libs/vpatterndb/variables/vcurveangle.cpp @@ -27,7 +27,7 @@ *************************************************************************/ #include "vcurveangle.h" -#include "../libs/vgeometry/vabstractcurve.h" +#include "../vgeometry/vabstractcurve.h" //--------------------------------------------------------------------------------------------------------------------- VCurveAngle::VCurveAngle() diff --git a/src/app/container/variables/vcurveangle.h b/src/libs/vpatterndb/variables/vcurveangle.h similarity index 100% rename from src/app/container/variables/vcurveangle.h rename to src/libs/vpatterndb/variables/vcurveangle.h diff --git a/src/app/container/variables/vcurvelength.cpp b/src/libs/vpatterndb/variables/vcurvelength.cpp similarity index 93% rename from src/app/container/variables/vcurvelength.cpp rename to src/libs/vpatterndb/variables/vcurvelength.cpp index 3382806c9..15201a482 100644 --- a/src/app/container/variables/vcurvelength.cpp +++ b/src/libs/vpatterndb/variables/vcurvelength.cpp @@ -27,8 +27,7 @@ *************************************************************************/ #include "vcurvelength.h" -#include "../core/vapplication.h" -#include "../libs/vgeometry/vabstractcurve.h" +#include "../vgeometry/vabstractcurve.h" //--------------------------------------------------------------------------------------------------------------------- VCurveLength::VCurveLength() @@ -38,13 +37,13 @@ VCurveLength::VCurveLength() } //--------------------------------------------------------------------------------------------------------------------- -VCurveLength::VCurveLength(const quint32 &id, const quint32 &parentId, const VAbstractCurve *curve) +VCurveLength::VCurveLength(const quint32 &id, const quint32 &parentId, const VAbstractCurve *curve, Unit patternUnit) :VCurveVariable(id, parentId) { SetType(VarType::Unknown); SCASSERT(curve != nullptr); SetName(curve->name()); - SetValue(qApp->fromPixel(curve->GetLength())); + SetValue(FromPixel(curve->GetLength(), patternUnit)); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/container/variables/vcurvelength.h b/src/libs/vpatterndb/variables/vcurvelength.h similarity index 95% rename from src/app/container/variables/vcurvelength.h rename to src/libs/vpatterndb/variables/vcurvelength.h index 212331a7c..22f86df36 100644 --- a/src/app/container/variables/vcurvelength.h +++ b/src/libs/vpatterndb/variables/vcurvelength.h @@ -30,6 +30,7 @@ #define VCURVELENGTH_H #include "vcurvevariable.h" +#include "../ifc/ifcdef.h" class VAbstractCurve; @@ -37,7 +38,7 @@ class VCurveLength : public VCurveVariable { public: VCurveLength(); - VCurveLength(const quint32 &id, const quint32 &parentId, const VAbstractCurve *curve); + VCurveLength(const quint32 &id, const quint32 &parentId, const VAbstractCurve *curve, Unit patternUnit); VCurveLength(const VCurveLength &var); VCurveLength &operator=(const VCurveLength &var); virtual ~VCurveLength(); diff --git a/src/app/container/variables/vcurvevariable.cpp b/src/libs/vpatterndb/variables/vcurvevariable.cpp similarity index 97% rename from src/app/container/variables/vcurvevariable.cpp rename to src/libs/vpatterndb/variables/vcurvevariable.cpp index 0ea24ec04..9a093a18a 100644 --- a/src/app/container/variables/vcurvevariable.cpp +++ b/src/libs/vpatterndb/variables/vcurvevariable.cpp @@ -28,8 +28,7 @@ #include "vcurvevariable.h" #include "vcurvevariable_p.h" -#include "../core/vapplication.h" -#include "../libs/vgeometry/vabstractcurve.h" +#include "../vgeometry/vabstractcurve.h" //--------------------------------------------------------------------------------------------------------------------- VCurveVariable::VCurveVariable() diff --git a/src/app/container/variables/vcurvevariable.h b/src/libs/vpatterndb/variables/vcurvevariable.h similarity index 100% rename from src/app/container/variables/vcurvevariable.h rename to src/libs/vpatterndb/variables/vcurvevariable.h diff --git a/src/app/container/variables/vcurvevariable_p.h b/src/libs/vpatterndb/variables/vcurvevariable_p.h similarity index 98% rename from src/app/container/variables/vcurvevariable_p.h rename to src/libs/vpatterndb/variables/vcurvevariable_p.h index 1da206ec8..ad7224ccf 100644 --- a/src/app/container/variables/vcurvevariable_p.h +++ b/src/libs/vpatterndb/variables/vcurvevariable_p.h @@ -31,6 +31,8 @@ #include +#include "../ifc/ifcdef.h" + #ifdef Q_CC_GNU #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Weffc++" diff --git a/src/app/container/variables/vincrement.cpp b/src/libs/vpatterndb/variables/vincrement.cpp similarity index 99% rename from src/app/container/variables/vincrement.cpp rename to src/libs/vpatterndb/variables/vincrement.cpp index affaff44c..2ec9465c7 100644 --- a/src/app/container/variables/vincrement.cpp +++ b/src/libs/vpatterndb/variables/vincrement.cpp @@ -28,7 +28,6 @@ #include "vincrement.h" #include "vincrement_p.h" -#include "../options.h" //--------------------------------------------------------------------------------------------------------------------- /** diff --git a/src/app/container/variables/vincrement.h b/src/libs/vpatterndb/variables/vincrement.h similarity index 100% rename from src/app/container/variables/vincrement.h rename to src/libs/vpatterndb/variables/vincrement.h diff --git a/src/app/container/variables/vincrement_p.h b/src/libs/vpatterndb/variables/vincrement_p.h similarity index 98% rename from src/app/container/variables/vincrement_p.h rename to src/libs/vpatterndb/variables/vincrement_p.h index 270c779ba..52e4f2b75 100644 --- a/src/app/container/variables/vincrement_p.h +++ b/src/libs/vpatterndb/variables/vincrement_p.h @@ -31,6 +31,8 @@ #include +#include "../ifc/ifcdef.h" + #ifdef Q_CC_GNU #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Weffc++" diff --git a/src/app/container/variables/vinternalvariable.cpp b/src/libs/vpatterndb/variables/vinternalvariable.cpp similarity index 100% rename from src/app/container/variables/vinternalvariable.cpp rename to src/libs/vpatterndb/variables/vinternalvariable.cpp diff --git a/src/app/container/variables/vinternalvariable.h b/src/libs/vpatterndb/variables/vinternalvariable.h similarity index 98% rename from src/app/container/variables/vinternalvariable.h rename to src/libs/vpatterndb/variables/vinternalvariable.h index fc3653a7a..9c8e61c50 100644 --- a/src/app/container/variables/vinternalvariable.h +++ b/src/libs/vpatterndb/variables/vinternalvariable.h @@ -31,7 +31,7 @@ #include #include -#include "../options.h" +#include "../../utils/def.h" class VInternalVariableData; diff --git a/src/app/container/variables/vinternalvariable_p.h b/src/libs/vpatterndb/variables/vinternalvariable_p.h similarity index 98% rename from src/app/container/variables/vinternalvariable_p.h rename to src/libs/vpatterndb/variables/vinternalvariable_p.h index 05140d138..53ec54c3d 100644 --- a/src/app/container/variables/vinternalvariable_p.h +++ b/src/libs/vpatterndb/variables/vinternalvariable_p.h @@ -30,7 +30,6 @@ #define VINTERNALVARIABLE_P_H #include -#include "../options.h" #ifdef Q_CC_GNU #pragma GCC diagnostic push diff --git a/src/app/container/variables/vlineangle.cpp b/src/libs/vpatterndb/variables/vlineangle.cpp similarity index 98% rename from src/app/container/variables/vlineangle.cpp rename to src/libs/vpatterndb/variables/vlineangle.cpp index 7d514539a..cb0f18bb9 100644 --- a/src/app/container/variables/vlineangle.cpp +++ b/src/libs/vpatterndb/variables/vlineangle.cpp @@ -28,8 +28,7 @@ #include "vlineangle.h" #include "vlineangle_p.h" -#include "../libs/vgeometry/vpointf.h" -#include "../core/vapplication.h" +#include "../vgeometry/vpointf.h" #include diff --git a/src/app/container/variables/vlineangle.h b/src/libs/vpatterndb/variables/vlineangle.h similarity index 100% rename from src/app/container/variables/vlineangle.h rename to src/libs/vpatterndb/variables/vlineangle.h diff --git a/src/app/container/variables/vlineangle_p.h b/src/libs/vpatterndb/variables/vlineangle_p.h similarity index 98% rename from src/app/container/variables/vlineangle_p.h rename to src/libs/vpatterndb/variables/vlineangle_p.h index fd3ca754c..0acb1c192 100644 --- a/src/app/container/variables/vlineangle_p.h +++ b/src/libs/vpatterndb/variables/vlineangle_p.h @@ -31,6 +31,8 @@ #include +#include "../ifc/ifcdef.h" + #ifdef Q_CC_GNU #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Weffc++" diff --git a/src/app/container/variables/vlinelength.cpp b/src/libs/vpatterndb/variables/vlinelength.cpp similarity index 91% rename from src/app/container/variables/vlinelength.cpp rename to src/libs/vpatterndb/variables/vlinelength.cpp index 281586dd9..0fc09989f 100644 --- a/src/app/container/variables/vlinelength.cpp +++ b/src/libs/vpatterndb/variables/vlinelength.cpp @@ -28,8 +28,7 @@ #include "vlinelength.h" #include "vlinelength_p.h" -#include "../libs/vgeometry/vpointf.h" -#include "../core/vapplication.h" +#include "../vgeometry/vpointf.h" #include @@ -41,8 +40,9 @@ VLengthLine::VLengthLine() } //--------------------------------------------------------------------------------------------------------------------- -VLengthLine::VLengthLine(const VPointF *p1, const quint32 &p1Id, const VPointF *p2, const quint32 &p2Id) - :VInternalVariable(), d(new VLengthLineData(p1Id, p2Id)) +VLengthLine::VLengthLine(const VPointF *p1, const quint32 &p1Id, const VPointF *p2, const quint32 &p2Id, + Unit patternUnit) + :VInternalVariable(), d(new VLengthLineData(p1Id, p2Id, patternUnit)) { SCASSERT(p1 != nullptr); SCASSERT(p2 != nullptr); @@ -85,7 +85,7 @@ void VLengthLine::SetValue(const VPointF *p1, const VPointF *p2) SCASSERT(p1 != nullptr); SCASSERT(p2 != nullptr); - VInternalVariable::SetValue(qApp->fromPixel(QLineF(p1->toQPointF(), p2->toQPointF()).length())); + VInternalVariable::SetValue(FromPixel(QLineF(p1->toQPointF(), p2->toQPointF()).length(), d->patternUnit)); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/container/variables/vlinelength.h b/src/libs/vpatterndb/variables/vlinelength.h similarity index 95% rename from src/app/container/variables/vlinelength.h rename to src/libs/vpatterndb/variables/vlinelength.h index bd52eae57..10932678d 100644 --- a/src/app/container/variables/vlinelength.h +++ b/src/libs/vpatterndb/variables/vlinelength.h @@ -30,6 +30,7 @@ #define VLINELENGTH_H #include "vinternalvariable.h" +#include "../ifc/ifcdef.h" class VPointF; class VLengthLineData; @@ -38,7 +39,7 @@ class VLengthLine :public VInternalVariable { public: VLengthLine(); - VLengthLine(const VPointF *p1, const quint32 &p1Id, const VPointF *p2, const quint32 &p2Id); + VLengthLine(const VPointF *p1, const quint32 &p1Id, const VPointF *p2, const quint32 &p2Id, Unit patternUnit); VLengthLine(const VLengthLine &var); VLengthLine &operator=(const VLengthLine &var); virtual ~VLengthLine(); diff --git a/src/app/container/variables/vlinelength_p.h b/src/libs/vpatterndb/variables/vlinelength_p.h similarity index 83% rename from src/app/container/variables/vlinelength_p.h rename to src/libs/vpatterndb/variables/vlinelength_p.h index ac0de76c5..8d149e48c 100644 --- a/src/app/container/variables/vlinelength_p.h +++ b/src/libs/vpatterndb/variables/vlinelength_p.h @@ -31,6 +31,8 @@ #include +#include "../ifc/ifcdef.h" + #ifdef Q_CC_GNU #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Weffc++" @@ -41,21 +43,22 @@ class VLengthLineData : public QSharedData public: VLengthLineData() - :p1Id(NULL_ID), p2Id(NULL_ID) + :p1Id(NULL_ID), p2Id(NULL_ID), patternUnit(Unit::Cm) {} - VLengthLineData(const quint32 &p1Id, const quint32 &p2Id) - :p1Id(p1Id), p2Id(p2Id) + VLengthLineData(const quint32 &p1Id, const quint32 &p2Id, Unit patternUnit) + :p1Id(p1Id), p2Id(p2Id), patternUnit(patternUnit) {} VLengthLineData(const VLengthLineData &var) - :QSharedData(var), p1Id(var.p1Id), p2Id(var.p2Id) + :QSharedData(var), p1Id(var.p1Id), p2Id(var.p2Id), patternUnit(var.patternUnit) {} virtual ~VLengthLineData(); quint32 p1Id; quint32 p2Id; + Unit patternUnit; }; VLengthLineData::~VLengthLineData() diff --git a/src/app/container/variables/vmeasurement.cpp b/src/libs/vpatterndb/variables/vmeasurement.cpp similarity index 91% rename from src/app/container/variables/vmeasurement.cpp rename to src/libs/vpatterndb/variables/vmeasurement.cpp index 810d6e291..ff6266214 100644 --- a/src/app/container/variables/vmeasurement.cpp +++ b/src/libs/vpatterndb/variables/vmeasurement.cpp @@ -28,8 +28,6 @@ #include "vmeasurement.h" #include "vmeasurement_p.h" -#include "../core/vapplication.h" -#include "../xml/vabstractmeasurements.h" //--------------------------------------------------------------------------------------------------------------------- /** @@ -97,10 +95,10 @@ VMeasurement::~VMeasurement() {} //--------------------------------------------------------------------------------------------------------------------- -QStringList VMeasurement::ListHeights(QMap heights) +QStringList VMeasurement::ListHeights(QMap heights, Unit patternUnit) { QStringList list; - if (qApp->patternUnit() == Unit::Inch) + if (patternUnit == Unit::Inch) { qWarning()<<"Standard table doesn't support inches."; return list; @@ -111,7 +109,7 @@ QStringList VMeasurement::ListHeights(QMap heights) { if (i.value() && i.key() != GHeights::ALL) { - ListValue(list, static_cast(i.key())); + ListValue(list, static_cast(i.key()), patternUnit); } ++i; } @@ -121,17 +119,17 @@ QStringList VMeasurement::ListHeights(QMap heights) // from 92 cm to 194 cm for (int i = 92; i<= 194; i = i+6) { - ListValue(list, i); + ListValue(list, i, patternUnit); } } return list; } //--------------------------------------------------------------------------------------------------------------------- -QStringList VMeasurement::ListSizes(QMap sizes) +QStringList VMeasurement::ListSizes(QMap sizes, Unit patternUnit) { QStringList list; - if (qApp->patternUnit() == Unit::Inch) + if (patternUnit == Unit::Inch) { qWarning()<<"Standard table doesn't support inches."; return list; @@ -142,7 +140,7 @@ QStringList VMeasurement::ListSizes(QMap sizes) { if (i.value() && i.key() != GSizes::ALL) { - ListValue(list, static_cast(i.key())); + ListValue(list, static_cast(i.key()), patternUnit); } ++i; } @@ -152,16 +150,16 @@ QStringList VMeasurement::ListSizes(QMap sizes) // from 22 cm to 56 cm for (int i = 22; i<= 56; i = i+2) { - ListValue(list, i); + ListValue(list, i, patternUnit); } } return list; } //--------------------------------------------------------------------------------------------------------------------- -void VMeasurement::ListValue(QStringList &list, qreal value) +void VMeasurement::ListValue(QStringList &list, qreal value, Unit patternUnit) { - qreal val = VAbstractMeasurements::UnitConvertor(value, Unit::Cm, qApp->patternUnit()); + qreal val = UnitConvertor(value, Unit::Cm, patternUnit); QString strVal = QString("%1").arg(val); list.append(strVal); } diff --git a/src/app/container/variables/vmeasurement.h b/src/libs/vpatterndb/variables/vmeasurement.h similarity index 89% rename from src/app/container/variables/vmeasurement.h rename to src/libs/vpatterndb/variables/vmeasurement.h index e0b645aad..890dc8748 100644 --- a/src/app/container/variables/vmeasurement.h +++ b/src/libs/vpatterndb/variables/vmeasurement.h @@ -30,7 +30,7 @@ #define VSTANDARDTABLEROW_H #include "vvariable.h" -#include "../options.h" +#include "../ifc/ifcdef.h" #include @@ -55,12 +55,12 @@ public: QString GetGuiText() const; QString TagName() const; void setTagName(const QString &TagName); - static QStringList ListHeights(QMap heights); - static QStringList ListSizes(QMap sizes); + static QStringList ListHeights(QMap heights, Unit patternUnit); + static QStringList ListSizes(QMap sizes, Unit patternUnit); private: QSharedDataPointer d; - static void ListValue(QStringList &list, qreal value); + static void ListValue(QStringList &list, qreal value, Unit patternUnit); }; #endif // VSTANDARDTABLEROW_H diff --git a/src/app/container/variables/vmeasurement_p.h b/src/libs/vpatterndb/variables/vmeasurement_p.h similarity index 100% rename from src/app/container/variables/vmeasurement_p.h rename to src/libs/vpatterndb/variables/vmeasurement_p.h diff --git a/src/app/container/variables/vsplineangle.cpp b/src/libs/vpatterndb/variables/vsplineangle.cpp similarity index 98% rename from src/app/container/variables/vsplineangle.cpp rename to src/libs/vpatterndb/variables/vsplineangle.cpp index e237d53f4..ff2aab200 100644 --- a/src/app/container/variables/vsplineangle.cpp +++ b/src/libs/vpatterndb/variables/vsplineangle.cpp @@ -27,7 +27,7 @@ *************************************************************************/ #include "vsplineangle.h" -#include "../libs/vgeometry/vabstractcurve.h" +#include "../vgeometry/vabstractcurve.h" //--------------------------------------------------------------------------------------------------------------------- VSplineAngle::VSplineAngle() diff --git a/src/app/container/variables/vsplineangle.h b/src/libs/vpatterndb/variables/vsplineangle.h similarity index 100% rename from src/app/container/variables/vsplineangle.h rename to src/libs/vpatterndb/variables/vsplineangle.h diff --git a/src/app/container/variables/vsplinelength.cpp b/src/libs/vpatterndb/variables/vsplinelength.cpp similarity index 94% rename from src/app/container/variables/vsplinelength.cpp rename to src/libs/vpatterndb/variables/vsplinelength.cpp index 0d3537de5..75cb80458 100644 --- a/src/app/container/variables/vsplinelength.cpp +++ b/src/libs/vpatterndb/variables/vsplinelength.cpp @@ -27,8 +27,7 @@ *************************************************************************/ #include "vsplinelength.h" -#include "../libs/vgeometry/vabstractcurve.h" -#include "../core/vapplication.h" +#include "../vgeometry/vabstractcurve.h" //--------------------------------------------------------------------------------------------------------------------- VSplineLength::VSplineLength() @@ -48,8 +47,8 @@ VSplineLength::VSplineLength(const quint32 &id, const quint32 &parentId, const Q } //--------------------------------------------------------------------------------------------------------------------- -VSplineLength::VSplineLength(const quint32 &id, const quint32 &parentId, const VAbstractCurve *path) - :VCurveLength(id, parentId, path) +VSplineLength::VSplineLength(const quint32 &id, const quint32 &parentId, const VAbstractCurve *path, Unit patternUnit) + :VCurveLength(id, parentId, path, patternUnit) { SetType(VarType::SplineLength); } diff --git a/src/app/container/variables/vsplinelength.h b/src/libs/vpatterndb/variables/vsplinelength.h similarity index 97% rename from src/app/container/variables/vsplinelength.h rename to src/libs/vpatterndb/variables/vsplinelength.h index 2f243915d..e54379b23 100644 --- a/src/app/container/variables/vsplinelength.h +++ b/src/libs/vpatterndb/variables/vsplinelength.h @@ -38,7 +38,7 @@ class VSplineLength :public VCurveLength public: VSplineLength(); VSplineLength(const quint32 &id, const quint32 &parentId, const QString &name, const qreal &value); - VSplineLength(const quint32 &id, const quint32 &parentId, const VAbstractCurve *path); + VSplineLength(const quint32 &id, const quint32 &parentId, const VAbstractCurve *path, Unit patternUnit); VSplineLength(const VSplineLength &var); VSplineLength &operator=(const VSplineLength &var); virtual ~VSplineLength(); diff --git a/src/app/container/variables/vvariable.cpp b/src/libs/vpatterndb/variables/vvariable.cpp similarity index 90% rename from src/app/container/variables/vvariable.cpp rename to src/libs/vpatterndb/variables/vvariable.cpp index a26d75dd2..dba562cd5 100644 --- a/src/app/container/variables/vvariable.cpp +++ b/src/libs/vpatterndb/variables/vvariable.cpp @@ -28,8 +28,6 @@ #include "vvariable.h" #include "vvariable_p.h" -#include "../core/vapplication.h" -#include "../xml/vabstractmeasurements.h" //--------------------------------------------------------------------------------------------------------------------- VVariable::VVariable() @@ -77,17 +75,17 @@ VVariable::~VVariable() {} //--------------------------------------------------------------------------------------------------------------------- -void VVariable::SetValue(const qreal &size, const qreal &height) +void VVariable::SetValue(const qreal &size, const qreal &height, Unit patternUnit) { - if (qApp->patternUnit() == Unit::Inch) + if (patternUnit == Unit::Inch) { qWarning("Gradation doesn't support inches"); return; } - const qreal baseSize = VAbstractMeasurements::UnitConvertor(50.0, Unit::Cm, qApp->patternUnit()); - const qreal baseHeight = VAbstractMeasurements::UnitConvertor(176.0, Unit::Cm, qApp->patternUnit()); - const qreal sizeIncrement = VAbstractMeasurements::UnitConvertor(2.0, Unit::Cm, qApp->patternUnit()); - const qreal heightIncrement = VAbstractMeasurements::UnitConvertor(6.0, Unit::Cm, qApp->patternUnit()); + const qreal baseSize = UnitConvertor(50.0, Unit::Cm, patternUnit); + const qreal baseHeight = UnitConvertor(176.0, Unit::Cm, patternUnit); + const qreal sizeIncrement = UnitConvertor(2.0, Unit::Cm, patternUnit); + const qreal heightIncrement = UnitConvertor(6.0, Unit::Cm, patternUnit); // Formula for calculation gradation const qreal k_size = ( size - baseSize ) / sizeIncrement; diff --git a/src/app/container/variables/vvariable.h b/src/libs/vpatterndb/variables/vvariable.h similarity index 95% rename from src/app/container/variables/vvariable.h rename to src/libs/vpatterndb/variables/vvariable.h index e3472e99e..6d52d4699 100644 --- a/src/app/container/variables/vvariable.h +++ b/src/libs/vpatterndb/variables/vvariable.h @@ -30,6 +30,7 @@ #define VVARIABLE_H #include "vinternalvariable.h" +#include "../ifc/ifcdef.h" class VVariableData; @@ -56,7 +57,7 @@ public: QString GetDescription() const; void SetDescription(const QString &desc); - void SetValue(const qreal &size, const qreal &height); + void SetValue(const qreal &size, const qreal &height, Unit patternUnit); virtual bool IsNotUsed() const; private: diff --git a/src/app/container/variables/vvariable_p.h b/src/libs/vpatterndb/variables/vvariable_p.h similarity index 100% rename from src/app/container/variables/vvariable_p.h rename to src/libs/vpatterndb/variables/vvariable_p.h diff --git a/src/app/container/vcontainer.cpp b/src/libs/vpatterndb/vcontainer.cpp similarity index 98% rename from src/app/container/vcontainer.cpp rename to src/libs/vpatterndb/vcontainer.cpp index 921c65f4c..cfb5194f7 100644 --- a/src/app/container/vcontainer.cpp +++ b/src/libs/vpatterndb/vcontainer.cpp @@ -27,8 +27,8 @@ *************************************************************************/ #include "vcontainer.h" -#include "../libs/vgeometry/varc.h" -#include "../libs/vgeometry/vsplinepath.h" +#include "../vgeometry/varc.h" +#include "../vgeometry/vsplinepath.h" #include "../../utils/logging.h" #include "vtranslatevars.h" @@ -314,7 +314,7 @@ void VContainer::AddLine(const quint32 &firstPointId, const quint32 &secondPoint const QSharedPointer first = GeometricObject(firstPointId); const QSharedPointer second = GeometricObject(secondPointId); - VLengthLine *length = new VLengthLine(first.data(), firstPointId, second.data(), secondPointId); + VLengthLine *length = new VLengthLine(first.data(), firstPointId, second.data(), secondPointId, *GetPatternUnit()); AddVariable(length->GetName(), length); VLineAngle *angle = new VLineAngle(first.data(), firstPointId, second.data(), secondPointId); @@ -326,10 +326,10 @@ void VContainer::AddArc(const quint32 &id, const quint32 &parentId) { const QSharedPointer arc = GeometricObject(id); - VArcLength *length = new VArcLength(id, parentId, arc.data()); + VArcLength *length = new VArcLength(id, parentId, arc.data(), *GetPatternUnit()); AddVariable(length->GetName(), length); - VArcRadius *radius = new VArcRadius(id, parentId, arc.data()); + VArcRadius *radius = new VArcRadius(id, parentId, arc.data(), *GetPatternUnit()); AddVariable(radius->GetName(), radius); VArcAngle *startAngle = new VArcAngle(id, parentId, arc.data(), CurveAngle::StartAngle); @@ -389,7 +389,7 @@ qreal VContainer::GetTableValue(const QString &name, MeasurementsType patternTyp QSharedPointer m = GetVariable(name); if (patternType == MeasurementsType::Standard) { - m->SetValue(size(), height()); + m->SetValue(size(), height(), *GetPatternUnit()); } return *m->GetValue(); } diff --git a/src/app/container/vcontainer.h b/src/libs/vpatterndb/vcontainer.h similarity index 98% rename from src/app/container/vcontainer.h rename to src/libs/vpatterndb/vcontainer.h index cd4d4dd89..7197c171a 100644 --- a/src/app/container/vcontainer.h +++ b/src/libs/vpatterndb/vcontainer.h @@ -30,10 +30,10 @@ #define VCONTAINER_H #include "variables.h" -#include "../geometry/vdetail.h" -#include "../libs/vgeometry/vgobject.h" -#include "../libs/ifc/exception/vexceptionbadid.h" -#include "../libs/vgeometry/vabstractcurve.h" +#include "vdetail.h" +#include "../vgeometry/vgobject.h" +#include "../ifc/exception/vexceptionbadid.h" +#include "../vgeometry/vabstractcurve.h" #include #include @@ -256,7 +256,7 @@ template void VContainer::AddCurve(const quint32 &id, const quint32 &parentId) { const QSharedPointer curve = GeometricObject(id); - VSplineLength *length = new VSplineLength(id, parentId, curve.data()); + VSplineLength *length = new VSplineLength(id, parentId, curve.data(), *GetPatternUnit()); AddVariable(length->GetName(), length); VSplineAngle *startAngle = new VSplineAngle(id, parentId, curve.data(), CurveAngle::StartAngle); diff --git a/src/app/geometry/vdetail.cpp b/src/libs/vpatterndb/vdetail.cpp similarity index 99% rename from src/app/geometry/vdetail.cpp rename to src/libs/vpatterndb/vdetail.cpp index c902c8f97..c8a4b382a 100644 --- a/src/app/geometry/vdetail.cpp +++ b/src/libs/vpatterndb/vdetail.cpp @@ -28,8 +28,8 @@ #include "vdetail.h" #include "vdetail_p.h" -#include "../container/vcontainer.h" -#include "../libs/vgeometry/vpointf.h" +#include "vcontainer.h" +#include "../vgeometry/vpointf.h" #include #include diff --git a/src/app/geometry/vdetail.h b/src/libs/vpatterndb/vdetail.h similarity index 98% rename from src/app/geometry/vdetail.h rename to src/libs/vpatterndb/vdetail.h index e3fa253eb..f9b7cacba 100644 --- a/src/app/geometry/vdetail.h +++ b/src/libs/vpatterndb/vdetail.h @@ -32,7 +32,7 @@ #include "vnodedetail.h" #include -#include "../libs/vlayout/vabstractdetail.h" +#include "../vlayout/vabstractdetail.h" class VDetailData; class VContainer; diff --git a/src/app/geometry/vdetail_p.h b/src/libs/vpatterndb/vdetail_p.h similarity index 98% rename from src/app/geometry/vdetail_p.h rename to src/libs/vpatterndb/vdetail_p.h index a6f1ae49a..28e5fcfa8 100644 --- a/src/app/geometry/vdetail_p.h +++ b/src/libs/vpatterndb/vdetail_p.h @@ -30,8 +30,8 @@ #define VDETAIL_P_H #include -#include "../options.h" #include "vnodedetail.h" +#include "../ifc/ifcdef.h" #ifdef Q_CC_GNU #pragma GCC diagnostic push diff --git a/src/app/geometry/vnodedetail.cpp b/src/libs/vpatterndb/vnodedetail.cpp similarity index 100% rename from src/app/geometry/vnodedetail.cpp rename to src/libs/vpatterndb/vnodedetail.cpp diff --git a/src/app/geometry/vnodedetail.h b/src/libs/vpatterndb/vnodedetail.h similarity index 99% rename from src/app/geometry/vnodedetail.h rename to src/libs/vpatterndb/vnodedetail.h index 4b89e17a0..14bef930c 100644 --- a/src/app/geometry/vnodedetail.h +++ b/src/libs/vpatterndb/vnodedetail.h @@ -29,10 +29,11 @@ #ifndef VNODEDETAIL_H #define VNODEDETAIL_H -#include "../options.h" #include #include +#include "../../utils/def.h" + class VNodeDetailData; /** diff --git a/src/app/geometry/vnodedetail_p.h b/src/libs/vpatterndb/vnodedetail_p.h similarity index 98% rename from src/app/geometry/vnodedetail_p.h rename to src/libs/vpatterndb/vnodedetail_p.h index a99a289d0..0490a603d 100644 --- a/src/app/geometry/vnodedetail_p.h +++ b/src/libs/vpatterndb/vnodedetail_p.h @@ -30,7 +30,7 @@ #define VNODEDETAIL_P_H #include -#include "../options.h" +#include "../ifc/ifcdef.h" #ifdef Q_CC_GNU #pragma GCC diagnostic push diff --git a/src/libs/vpatterndb/vpatterndb.pri b/src/libs/vpatterndb/vpatterndb.pri new file mode 100644 index 000000000..5cf261312 --- /dev/null +++ b/src/libs/vpatterndb/vpatterndb.pri @@ -0,0 +1,57 @@ +# ADD TO EACH PATH $$PWD VARIABLE!!!!!! +# This need for corect working file translations.pro + +SOURCES += \ + $$PWD/vcontainer.cpp \ + $$PWD/stable.cpp \ + $$PWD/calculator.cpp \ + $$PWD/vdetail.cpp \ + $$PWD/vnodedetail.cpp \ + $$PWD/vtranslatevars.cpp \ + $$PWD/variables/varcangle.cpp \ + $$PWD/variables/varclength.cpp \ + $$PWD/variables/varcradius.cpp \ + $$PWD/variables/vcurveangle.cpp \ + $$PWD/variables/vcurvelength.cpp \ + $$PWD/variables/vcurvevariable.cpp \ + $$PWD/variables/vincrement.cpp \ + $$PWD/variables/vinternalvariable.cpp \ + $$PWD/variables/vlineangle.cpp \ + $$PWD/variables/vlinelength.cpp \ + $$PWD/variables/vmeasurement.cpp \ + $$PWD/variables/vsplineangle.cpp \ + $$PWD/variables/vsplinelength.cpp \ + $$PWD/variables/vvariable.cpp + +HEADERS += \ + $$PWD/vcontainer.h \ + $$PWD/stable.h \ + $$PWD/calculator.h \ + $$PWD/variables.h \ + $$PWD/vdetail.h \ + $$PWD/vdetail_p.h \ + $$PWD/vnodedetail.h \ + $$PWD/vnodedetail_p.h \ + $$PWD/vtranslatevars.h \ + $$PWD/variables/varcangle.h \ + $$PWD/variables/varclength.h \ + $$PWD/variables/varcradius.h \ + $$PWD/variables/varcradius_p.h \ + $$PWD/variables/vcurveangle.h \ + $$PWD/variables/vcurvelength.h \ + $$PWD/variables/vcurvevariable.h \ + $$PWD/variables/vcurvevariable_p.h \ + $$PWD/variables/vincrement.h \ + $$PWD/variables/vincrement_p.h \ + $$PWD/variables/vinternalvariable.h \ + $$PWD/variables/vinternalvariable_p.h \ + $$PWD/variables/vlineangle.h \ + $$PWD/variables/vlineangle_p.h \ + $$PWD/variables/vlinelength.h \ + $$PWD/variables/vlinelength_p.h \ + $$PWD/variables/vmeasurement.h \ + $$PWD/variables/vmeasurement_p.h \ + $$PWD/variables/vsplineangle.h \ + $$PWD/variables/vsplinelength.h \ + $$PWD/variables/vvariable.h \ + $$PWD/variables/vvariable_p.h diff --git a/src/libs/vpatterndb/vpatterndb.pro b/src/libs/vpatterndb/vpatterndb.pro new file mode 100644 index 000000000..82cb7256e --- /dev/null +++ b/src/libs/vpatterndb/vpatterndb.pro @@ -0,0 +1,97 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2015-06-11T20:46:46 +# +#------------------------------------------------- + +# File with common stuff for whole project +include(../../../Valentina.pri) + +# Name of the library +TARGET = vpatterndb + +# We want create a library +TEMPLATE = lib + +CONFIG += \ + staticlib \# Making static library + c++11 # We use C++11 standard + +# Use out-of-source builds (shadow builds) +CONFIG -= debug_and_release debug_and_release_target + +# Since Qt 5.4.0 the source code location is recorded only in debug builds. +# We need this information also in release builds. For this need define QT_MESSAGELOGCONTEXT. +DEFINES += QT_MESSAGELOGCONTEXT + +include(vpatterndb.pri) +include(../../utils/utils.pri) + +# This is static library so no need in "make install" + +# directory for executable file +DESTDIR = bin + +# files created moc +MOC_DIR = moc + +# objecs files +OBJECTS_DIR = obj + +# Set using ccache. Function enable_ccache() defined in Valentina.pri. +$$enable_ccache() + +# Set precompiled headers. Function set_PCH() defined in Valentina.pri. +$$set_PCH() + +CONFIG(debug, debug|release){ + # Debug mode + unix { + #Turn on compilers warnings. + *-g++{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$GCC_DEBUG_CXXFLAGS # See Valentina.pri for more details. + + noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer + # do nothing + } else { + #gcc’s 4.8.0 Address Sanitizer + #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ + QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_LFLAGS += -fsanitize=address + } + } + clang*{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$CLANG_DEBUG_CXXFLAGS # See Valentina.pri for more details. + } + } else { + *-g++{ + QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See Valentina.pri for more details. + } + } + +}else{ + # Release mode + + !unix:*-g++{ + QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll + } + + noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols + # do nothing + } else { + !macx:!win32-msvc*{ + # Turn on debug symbols in release mode on Unix systems. + # On Mac OS X temporarily disabled. TODO: find way how to strip binary file. + QMAKE_CXXFLAGS_RELEASE += -g -gdwarf-3 + QMAKE_CFLAGS_RELEASE += -g -gdwarf-3 + QMAKE_LFLAGS_RELEASE = + } + } +} diff --git a/src/app/container/vtranslatevars.cpp b/src/libs/vpatterndb/vtranslatevars.cpp similarity index 99% rename from src/app/container/vtranslatevars.cpp rename to src/libs/vpatterndb/vtranslatevars.cpp index 5d50a3046..137e2db98 100644 --- a/src/app/container/vtranslatevars.cpp +++ b/src/libs/vpatterndb/vtranslatevars.cpp @@ -27,17 +27,18 @@ *************************************************************************/ #include "vtranslatevars.h" -#include "../options.h" -#include "../container/calculator.h" +#include "calculator.h" +#include "../../utils/def.h" +#include "../vgeometry/vgeometrydef.h" using namespace qmu; //--------------------------------------------------------------------------------------------------------------------- -VTranslateVars::VTranslateVars(const VSettings *settings) +VTranslateVars::VTranslateVars(bool osSeparator) :measurements(QMap()), guiTexts(QMap()), descriptions(QMap()), variables(QMap()), functions(QMap()), postfixOperators(QMap()), - stDescriptions(QMap()), settings(settings) + stDescriptions(QMap()), osSeparator(osSeparator) { InitMeasurements(); InitVariables(); @@ -1319,7 +1320,7 @@ QString VTranslateVars::STDescription(const QString &id) const * @param formula expression that need translate * @return translated expression */ -QString VTranslateVars::FormulaFromUser(const QString &formula) const +QString VTranslateVars::FormulaFromUser(const QString &formula, bool osSeparator) const { if (formula.isEmpty()) { @@ -1327,7 +1328,7 @@ QString VTranslateVars::FormulaFromUser(const QString &formula) const } QString newFormula = formula;// Local copy for making changes - Calculator *cal = new Calculator(formula);// Eval formula + Calculator *cal = new Calculator(formula, osSeparator);// Eval formula QMap tokens = cal->GetTokens();// Tokens (variables, measurements) QMap numbers = cal->GetNumbers();// All numbers in expression for changing decimal separator delete cal; @@ -1383,7 +1384,7 @@ QString VTranslateVars::FormulaFromUser(const QString &formula) const } QLocale loc = QLocale::system(); // User locale - if (loc != QLocale(QLocale::C) && settings->GetOsSeparator()) + if (loc != QLocale(QLocale::C) && osSeparator) {// User want use Os separator QList nKeys = numbers.keys();// Positions for all numbers in expression QList nValues = numbers.values(); @@ -1506,7 +1507,7 @@ QString VTranslateVars::FormulaToUser(const QString &formula) const } QLocale loc = QLocale::system();// User locale - if (loc != QLocale::C && settings->GetOsSeparator()) + if (loc != QLocale::C && osSeparator) {// User want use Os separator QList nKeys = numbers.keys();// Positions for all numbers in expression QList nValues = numbers.values(); diff --git a/src/app/container/vtranslatevars.h b/src/libs/vpatterndb/vtranslatevars.h similarity index 93% rename from src/app/container/vtranslatevars.h rename to src/libs/vpatterndb/vtranslatevars.h index 5f0c2ed65..ec813b17a 100644 --- a/src/app/container/vtranslatevars.h +++ b/src/libs/vpatterndb/vtranslatevars.h @@ -30,13 +30,12 @@ #define VTRANSLATEVARS_H #include -#include "../../libs/qmuparser/qmutranslation.h" -#include "../core/vsettings.h" +#include "../qmuparser/qmutranslation.h" class VTranslateVars { public: - VTranslateVars(const VSettings *settings); + VTranslateVars(bool osSeparator); ~VTranslateVars(); bool MeasurementsFromUser(QString &newFormula, int position, const QString &token, int &bias) const; @@ -53,7 +52,7 @@ public: QString PostfixOperator(const QString &name) const; QString STDescription(const QString &id) const; - QString FormulaFromUser(const QString &formula) const; + QString FormulaFromUser(const QString &formula, bool osSeparator) const; QString FormulaToUser(const QString &formula) const; private: @@ -65,7 +64,7 @@ private: QMap functions; QMap postfixOperators; QMap stDescriptions; - const VSettings *settings; + bool osSeparator; void InitMeasurements(); void InitVariables(); diff --git a/src/utils/def.cpp b/src/utils/def.cpp new file mode 100644 index 000000000..ac7f45c7f --- /dev/null +++ b/src/utils/def.cpp @@ -0,0 +1,218 @@ +/************************************************************************ + ** + ** @file def.cpp + ** @author Roman Telezhynskyi + ** @date 11 6, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#include "def.h" + +// Keep synchronize all names with initialization in VApllication class!!!!! +//measurements +//head and neck +const QString headGirth_M = QStringLiteral("head_girth"); +const QString midNeckGirth_M = QStringLiteral("mid_neck_girth"); +const QString neckBaseGirth_M = QStringLiteral("neck_base_girth"); +const QString headAndNeckLength_M = QStringLiteral("head_and_neck_length"); +//torso +const QString centerFrontWaistLength_M = QStringLiteral("center_front_waist_length"); +const QString centerBackWaistLength_M = QStringLiteral("center_back_waist_length"); +const QString shoulderLength_M = QStringLiteral("shoulder_length"); +const QString sideWaistLength_M = QStringLiteral("side_waist_length"); +const QString trunkLength_M = QStringLiteral("trunk_length"); +const QString shoulderGirth_M = QStringLiteral("shoulder_girth"); +const QString upperChestGirth_M = QStringLiteral("upper_chest_girth"); +const QString bustGirth_M = QStringLiteral("bust_girth"); +const QString underBustGirth_M = QStringLiteral("under_bust_girth"); +const QString waistGirth_M = QStringLiteral("waist_girth"); +const QString highHipGirth_M = QStringLiteral("high_hip_girth"); +const QString hipGirth_M = QStringLiteral("hip_girth"); +const QString upperFrontChestWidth_M = QStringLiteral("upper_front_chest_width"); +const QString frontChestWidth_M = QStringLiteral("front_chest_width"); +const QString acrossFrontShoulderWidth_M = QStringLiteral("across_front_shoulder_width"); +const QString acrossBackShoulderWidth_M = QStringLiteral("across_back_shoulder_width"); +const QString upperBackWidth_M = QStringLiteral("upper_back_width"); +const QString backWidth_M = QStringLiteral("back_width"); +const QString bustpointToBustpoint_M = QStringLiteral("bustpoint_to_bustpoint"); +const QString halterBustpointToBustpoint_M = QStringLiteral("halter_bustpoint_to_bustpoint"); +const QString neckToBustpoint_M = QStringLiteral("neck_to_bustpoint"); +const QString crotchLength_M = QStringLiteral("crotch_length"); +const QString riseHeight_M = QStringLiteral("rise_height"); +const QString shoulderDrop_M = QStringLiteral("shoulder_drop"); +const QString shoulderSlopeDegrees_M = QStringLiteral("shoulder_slope_degrees"); +const QString frontShoulderSlopeLength_M = QStringLiteral("front_shoulder_slope_length"); +const QString backShoulderSlopeLength_M = QStringLiteral("back_shoulder_slope_length"); +const QString frontShoulderToWaistLength_M = QStringLiteral("front_shoulder_to_waist_length"); +const QString backShoulderToWaistLength_M = QStringLiteral("back_shoulder_to_waist_length"); +const QString frontNeckArc_M = QStringLiteral("front_neck_arc"); +const QString backNeckArc_M = QStringLiteral("back_neck_arc"); +const QString frontUpperChestArc_M = QStringLiteral("front_upper_chest_arc"); +const QString backUpperChestArc_M = QStringLiteral("back_upper_chest_arc"); +const QString frontWaistArc_M = QStringLiteral("front_waist_arc"); +const QString backWaistArc_M = QStringLiteral("back_waist_arc"); +const QString frontUpperHipArc_M = QStringLiteral("front_upper_hip_arc"); +const QString backUpperHipArc_M = QStringLiteral("back_upper_hip_arc"); +const QString frontHipArc_M = QStringLiteral("front_hip_arc"); +const QString backHipArc_M = QStringLiteral("back_hip_arc"); +const QString chestSlope_M = QStringLiteral("chest_slope"); +const QString backSlope_M = QStringLiteral("back_slope"); +const QString frontWaistSlope_M = QStringLiteral("front_waist_slope"); +const QString backWaistSlope_M = QStringLiteral("back_waist_slope"); +const QString frontNeckToUpperChestHeight_M = QStringLiteral("front_neck_to_upper_chest_height"); +const QString frontNeckToBustHeight_M = QStringLiteral("front_neck_to_bust_height"); +const QString frontWaistToUpperChest_M = QStringLiteral("front_waist_to_upper_chest"); +const QString frontWaistToLowerBreast_M = QStringLiteral("front_waist_to_lower_breast"); +const QString backWaistToUpperChest_M = QStringLiteral("back_waist_to_upper_chest"); +const QString strapLength_M = QStringLiteral("strap_length"); +//arm +const QString armscyeGirth_M = QStringLiteral("armscye_girth"); +const QString elbowGirth_M = QStringLiteral("elbow_girth"); +const QString upperArmGirth_M = QStringLiteral("upper_arm_girth"); +const QString wristGirth_M = QStringLiteral("wrist_girth"); +const QString scyeDepth_M = QStringLiteral("scye_depth"); +const QString shoulderAndArmLength_M = QStringLiteral("shoulder_and_arm_length"); +const QString underarmLength_M = QStringLiteral("underarm_length"); +const QString cervicaleToWristLength_M = QStringLiteral("cervicale_to_wrist_length"); +const QString shoulderToElbowLength_M = QStringLiteral("shoulder_to_elbow_length"); +const QString armLength_M = QStringLiteral("arm_length"); +//hand +const QString handWidth_M = QStringLiteral("hand_width"); +const QString handLength_M = QStringLiteral("hand_length"); +const QString handGirth_M = QStringLiteral("hand_girth"); +//leg +const QString thighGirth_M = QStringLiteral("thigh_girth"); +const QString midThighGirth_M = QStringLiteral("mid_thigh_girth"); +const QString kneeGirth_M = QStringLiteral("knee_girth"); +const QString calfGirth_M = QStringLiteral("calf_girth"); +const QString ankleGirth_M = QStringLiteral("ankle_girth"); +const QString kneeHeight_M = QStringLiteral("knee_height"); +const QString ankleHeight_M = QStringLiteral("ankle_height"); +//foot +const QString footWidth_M = QStringLiteral("foot_width"); +const QString footLength_M = QStringLiteral("foot_length"); +//heights +const QString height_M = QStringLiteral("height"); +const QString cervicaleHeight_M = QStringLiteral("cervicale_height"); +const QString cervicaleToKneeHeight_M = QStringLiteral("cervicale_to_knee_height"); +const QString waistHeight_M = QStringLiteral("waist_height"); +const QString highHipHeight_M = QStringLiteral("high_hip_height"); +const QString hipHeight_M = QStringLiteral("hip_height"); +const QString waistToHipHeight_M = QStringLiteral("waist_to_hip_height"); +const QString waistToKneeHeight_M = QStringLiteral("waist_to_knee_height"); +const QString crotchHeight_M = QStringLiteral("crotch_height"); +//extended measurements +const QString size_M = QStringLiteral("size"); +const QString heightFrontNeckBasePoint_M = QStringLiteral("height_front_neck_base_point"); +const QString heightBaseNeckSidePoint_M = QStringLiteral("height_base_neck_side_point"); +const QString heightShoulderPoint_M = QStringLiteral("height_shoulder_point"); +const QString heightNipplePoint_M = QStringLiteral("height_nipple_point"); +const QString heightBackAngleAxilla_M = QStringLiteral("height_back_angle_axilla"); +const QString heightScapularPoint_M = QStringLiteral("height_scapular_point"); +const QString heightUnderButtockFolds_M = QStringLiteral("height_under_buttock_folds"); +const QString hipsExcludingProtrudingAbdomen_M = QStringLiteral("hips_excluding_protruding_abdomen"); +const QString girthFootInstep_M = QStringLiteral("girth_foot_instep"); +const QString sideWaistToFloor_M = QStringLiteral("side_waist_to_floor"); +const QString frontWaistToFloor_M = QStringLiteral("front_waist_to_floor"); +const QString arcThroughGroinArea_M = QStringLiteral("arc_through_groin_area"); +const QString waistToPlaneSeat_M = QStringLiteral("waist_to_plane_seat"); +const QString neckToRadialPoint_M = QStringLiteral("neck_to_radial_point"); +const QString neckToThirdFinger_M = QStringLiteral("neck_to_third_finger"); +const QString neckToFirstLineChestCircumference_M = QStringLiteral("neck_to_first_line_chest_circumference"); +const QString frontWaistLength_M = QStringLiteral("front_waist_length"); +const QString arcThroughShoulderJoint_M = QStringLiteral("arc_through_shoulder_joint"); +const QString neckToBackLineChestCircumference_M = QStringLiteral("neck_to_back_line_chest_circumference"); +const QString waistToNeckSide_M = QStringLiteral("waist_to_neck_side"); +const QString arcLengthUpperBody_M = QStringLiteral("arc_length_upper_body"); +const QString chestWidth_M = QStringLiteral("chest_width"); +const QString anteroposteriorDiameterHands_M = QStringLiteral("anteroposterior_diameter_hands"); +const QString heightClavicularPoint_M = QStringLiteral("height_clavicular_point"); +const QString heightArmholeSlash_M = QStringLiteral("height_armhole_slash"); +const QString slashShoulderHeight_M = QStringLiteral("slash_shoulder_height"); +const QString halfGirthNeck_M = QStringLiteral("half_girth_neck"); +const QString halfGirthNeckForShirts_M = QStringLiteral("half_girth_neck_for_shirts"); +const QString halfGirthChestFirst_M = QStringLiteral("half_girth_chest_first"); +const QString halfGirthChestSecond_M = QStringLiteral("half_girth_chest_second"); +const QString halfGirthChestThird_M = QStringLiteral("half_girth_chest_third"); +const QString halfGirthWaist_M = QStringLiteral("half_girth_waist"); +const QString halfGirthHipsConsideringProtrudingAbdomen_M += QStringLiteral("half_girth_hips_considering_protruding_abdomen"); +const QString halfGirthHipsExcludingProtrudingAbdomen_M += QStringLiteral("half_girth_hips_excluding_protruding_abdomen"); +const QString girthKneeFlexedFeet_M = QStringLiteral("girth_knee_flexed_feet"); +const QString neckTransverseDiameter_M = QStringLiteral("neck_transverse_diameter"); +const QString frontSlashShoulderHeight_M = QStringLiteral("front_slash_shoulder_height"); +const QString neckToFrontWaistLine_M = QStringLiteral("neck_to_front_waist_line"); +const QString handVerticalDiameter_M = QStringLiteral("hand_vertical_diameter"); +const QString neckToKneePoint_M = QStringLiteral("neck_to_knee_point"); +const QString waistToKnee_M = QStringLiteral("waist_to_knee"); +const QString shoulderHeight_M = QStringLiteral("shoulder_height"); +const QString headHeight_M = QStringLiteral("head_height"); +const QString bodyPosition_M = QStringLiteral("body_position"); +const QString arcBehindShoulderGirdle_M = QStringLiteral("arc_behind_shoulder_girdle"); +const QString neckToNeckBase_M = QStringLiteral("neck_to_neck_base"); +const QString depthWaistFirst_M = QStringLiteral("depth_waist_first"); +const QString depthWaistSecond_M = QStringLiteral("depth_waist_second"); + +//variables +const QString line_ = QStringLiteral("Line_"); +const QString angleLine_ = QStringLiteral("AngleLine_"); + +//functions +const QString sin_F = QStringLiteral("sin"); +const QString cos_F = QStringLiteral("cos"); +const QString tan_F = QStringLiteral("tan"); +const QString asin_F = QStringLiteral("asin"); +const QString acos_F = QStringLiteral("acos"); +const QString atan_F = QStringLiteral("atan"); +const QString sinh_F = QStringLiteral("sinh"); +const QString cosh_F = QStringLiteral("cosh"); +const QString tanh_F = QStringLiteral("tanh"); +const QString asinh_F = QStringLiteral("asinh"); +const QString acosh_F = QStringLiteral("acosh"); +const QString atanh_F = QStringLiteral("atanh"); +const QString log2_F = QStringLiteral("log2"); +const QString log10_F = QStringLiteral("log10"); +const QString log_F = QStringLiteral("log"); +const QString ln_F = QStringLiteral("ln"); +const QString exp_F = QStringLiteral("exp"); +const QString sqrt_F = QStringLiteral("sqrt"); +const QString sign_F = QStringLiteral("sign"); +const QString rint_F = QStringLiteral("rint"); +const QString abs_F = QStringLiteral("abs"); +const QString min_F = QStringLiteral("min"); +const QString max_F = QStringLiteral("max"); +const QString sum_F = QStringLiteral("sum"); +const QString avg_F = QStringLiteral("avg"); +const QString fmod_F = QStringLiteral("fmod"); + +const QStringList builInFunctions = QStringList() << sin_F << cos_F << tan_F << asin_F << acos_F << atan_F + << sinh_F << cosh_F << tanh_F << asinh_F << acosh_F << atanh_F + << log2_F << log10_F << log_F << ln_F << exp_F << sqrt_F + << sign_F << rint_F << abs_F << min_F << max_F << sum_F + << avg_F << fmod_F; + +// Postfix operators +const QString cm_Oprt = QStringLiteral("cm"); +const QString mm_Oprt = QStringLiteral("mm"); +const QString in_Oprt = QStringLiteral("in"); diff --git a/src/utils/def.h b/src/utils/def.h index daf5257ed..0e9668877 100644 --- a/src/utils/def.h +++ b/src/utils/def.h @@ -31,6 +31,94 @@ #include #include +#include + +enum class NodeDetail : char { Contour, Modeling }; + +enum class Tool : unsigned char +{ + Arrow, + Point, + LinePoint, + AbstractSpline, + Cut, + SinglePoint, + EndLine, + Line, + AlongLine, + ShoulderPoint, + Normal, + Bisector, + LineIntersect, + Spline, + CutSpline, + CutArc, + Arc, + ArcWithLength, + SplinePath, + CutSplinePath, + PointOfContact, + Detail, + NodePoint, + NodeArc, + NodeSpline, + NodeSplinePath, + Height, + Triangle, + LineIntersectAxis, + PointOfIntersectionArcs, + PointOfIntersectionCircles, + CurveIntersectAxis, + PointOfIntersection, + PointFromCircleAndTangent, + PointFromArcAndTangent, + UnionDetails // 35 +}; + +enum class Vis : unsigned char +{ + ControlPointSpline = 36, // increase this value if need more positions in Tool enum + GraphicsSimpleTextItem, + SimpleSplinePath, + Line, + Path, + ToolAlongLine, + ToolArc, + ToolArcWithLength, + ToolBisector, + ToolCutArc, + ToolEndLine, + ToolHeight, + ToolLine, + ToolLineIntersect, + ToolNormal, + ToolPointOfContact, + ToolPointOfIntersection, + ToolPointOfIntersectionArcs, + ToolPointOfIntersectionCircles, + ToolPointFromCircleAndTangent, + ToolPointFromArcAndTangent, + ToolShoulderPoint, + ToolSpline, + ToolTriangle, + ToolCutSpline, + ToolSplinePath, + ToolCutSplinePath, + ToolLineIntersectAxis, + ToolCurveIntersectAxis +}; + +enum class VarType : char { Measurement, Increment, LineLength, SplineLength, ArcLength, ArcRadius, LineAngle, ArcAngle, + SplineAngle, Unknown }; + +enum class GHeights : unsigned char { ALL, + H92=92, H98=98, H104=104, H110=110, H116=116, H122=122, H128=128, H134=134, + H140=140, H146=146, H152=152, H158=158, H164=164, H170=170, H176=176, H182=182, + H188=188, H194=194}; + +enum class GSizes : unsigned char { ALL, + S22=22, S24=24, S26=26, S28=28, S30=30, S32=32, S34=34, S36=36, S38=38, S40=40, + S42=42, S44=44, S46=46, S48=48, S50=50, S52=52, S54=54, S56=56 }; /* QImage supports a maximum of 32768x32768 px images (signed short). * This follows from the condition: width * height * colordepth < INT_MAX (4 billion) -> 32768 * 32768 * 4 = 4 billion. @@ -97,4 +185,186 @@ #define SCASSERT(cond) qt_noop(); #endif /* V_NO_ASSERT */ +// measurements +//head and neck +extern const QString headGirth_M; +extern const QString midNeckGirth_M; +extern const QString neckBaseGirth_M; +extern const QString headAndNeckLength_M; +//torso +extern const QString centerFrontWaistLength_M; +extern const QString centerBackWaistLength_M; +extern const QString shoulderLength_M; +extern const QString sideWaistLength_M; +extern const QString trunkLength_M; +extern const QString shoulderGirth_M; +extern const QString upperChestGirth_M; +extern const QString bustGirth_M; +extern const QString underBustGirth_M; +extern const QString waistGirth_M; +extern const QString highHipGirth_M; +extern const QString hipGirth_M; +extern const QString upperFrontChestWidth_M; +extern const QString frontChestWidth_M; +extern const QString acrossFrontShoulderWidth_M; +extern const QString acrossBackShoulderWidth_M; +extern const QString upperBackWidth_M; +extern const QString backWidth_M; +extern const QString bustpointToBustpoint_M; +extern const QString halterBustpointToBustpoint_M; +extern const QString neckToBustpoint_M; +extern const QString crotchLength_M; +extern const QString riseHeight_M; +extern const QString shoulderDrop_M; +extern const QString shoulderSlopeDegrees_M; +extern const QString frontShoulderSlopeLength_M; +extern const QString backShoulderSlopeLength_M; +extern const QString frontShoulderToWaistLength_M; +extern const QString backShoulderToWaistLength_M; +extern const QString frontNeckArc_M; +extern const QString backNeckArc_M; +extern const QString frontUpperChestArc_M; +extern const QString backUpperChestArc_M; +extern const QString frontWaistArc_M; +extern const QString backWaistArc_M; +extern const QString frontUpperHipArc_M; +extern const QString backUpperHipArc_M; +extern const QString frontHipArc_M; +extern const QString backHipArc_M; +extern const QString chestSlope_M; +extern const QString backSlope_M; +extern const QString frontWaistSlope_M; +extern const QString backWaistSlope_M; +extern const QString frontNeckToUpperChestHeight_M; +extern const QString frontNeckToBustHeight_M; +extern const QString frontWaistToUpperChest_M; +extern const QString frontWaistToLowerBreast_M; +extern const QString backWaistToUpperChest_M; +extern const QString strapLength_M; +//arm +extern const QString armscyeGirth_M; +extern const QString elbowGirth_M; +extern const QString upperArmGirth_M; +extern const QString wristGirth_M; +extern const QString scyeDepth_M; +extern const QString shoulderAndArmLength_M; +extern const QString underarmLength_M; +extern const QString cervicaleToWristLength_M; +extern const QString shoulderToElbowLength_M; +extern const QString armLength_M; +//hand +extern const QString handWidth_M; +extern const QString handLength_M; +extern const QString handGirth_M; +//leg +extern const QString thighGirth_M; +extern const QString midThighGirth_M; +extern const QString kneeGirth_M; +extern const QString calfGirth_M; +extern const QString ankleGirth_M; +extern const QString kneeHeight_M; +extern const QString ankleHeight_M; +//foot +extern const QString footWidth_M; +extern const QString footLength_M; +//heights +extern const QString height_M; +extern const QString cervicaleHeight_M; +extern const QString cervicaleToKneeHeight_M; +extern const QString waistHeight_M; +extern const QString highHipHeight_M; +extern const QString hipHeight_M; +extern const QString waistToHipHeight_M; +extern const QString waistToKneeHeight_M; +extern const QString crotchHeight_M; +//extended measurements +extern const QString size_M; +extern const QString heightFrontNeckBasePoint_M; +extern const QString heightBaseNeckSidePoint_M; +extern const QString heightShoulderPoint_M; +extern const QString heightNipplePoint_M; +extern const QString heightBackAngleAxilla_M; +extern const QString heightScapularPoint_M; +extern const QString heightUnderButtockFolds_M; +extern const QString hipsExcludingProtrudingAbdomen_M; +extern const QString girthFootInstep_M; +extern const QString sideWaistToFloor_M; +extern const QString frontWaistToFloor_M; +extern const QString arcThroughGroinArea_M; +extern const QString waistToPlaneSeat_M; +extern const QString neckToRadialPoint_M; +extern const QString neckToThirdFinger_M; +extern const QString neckToFirstLineChestCircumference_M; +extern const QString frontWaistLength_M; +extern const QString arcThroughShoulderJoint_M; +extern const QString neckToBackLineChestCircumference_M; +extern const QString waistToNeckSide_M; +extern const QString arcLengthUpperBody_M; +extern const QString chestWidth_M; +extern const QString anteroposteriorDiameterHands_M; +extern const QString heightClavicularPoint_M; +extern const QString heightArmholeSlash_M; +extern const QString slashShoulderHeight_M; +extern const QString halfGirthNeck_M; +extern const QString halfGirthNeckForShirts_M; +extern const QString halfGirthChestFirst_M; +extern const QString halfGirthChestSecond_M; +extern const QString halfGirthChestThird_M; +extern const QString halfGirthWaist_M; +extern const QString halfGirthHipsConsideringProtrudingAbdomen_M; +extern const QString halfGirthHipsExcludingProtrudingAbdomen_M; +extern const QString girthKneeFlexedFeet_M; +extern const QString neckTransverseDiameter_M; +extern const QString frontSlashShoulderHeight_M; +extern const QString neckToFrontWaistLine_M; +extern const QString handVerticalDiameter_M; +extern const QString neckToKneePoint_M; +extern const QString waistToKnee_M; +extern const QString shoulderHeight_M; +extern const QString headHeight_M; +extern const QString bodyPosition_M; +extern const QString arcBehindShoulderGirdle_M; +extern const QString neckToNeckBase_M; +extern const QString depthWaistFirst_M; +extern const QString depthWaistSecond_M; + +// variables name +extern const QString line_; +extern const QString angleLine_; + +// functions +extern const QString sin_F; +extern const QString cos_F; +extern const QString tan_F; +extern const QString asin_F; +extern const QString acos_F; +extern const QString atan_F; +extern const QString sinh_F; +extern const QString cosh_F; +extern const QString tanh_F; +extern const QString asinh_F; +extern const QString acosh_F; +extern const QString atanh_F; +extern const QString log2_F; +extern const QString log10_F; +extern const QString log_F; +extern const QString ln_F; +extern const QString exp_F; +extern const QString sqrt_F; +extern const QString sign_F; +extern const QString rint_F; +extern const QString abs_F; +extern const QString min_F; +extern const QString max_F; +extern const QString sum_F; +extern const QString avg_F; +extern const QString fmod_F; + +extern const QStringList builInFunctions; + +// Postfix operators +extern const QString cm_Oprt; +extern const QString mm_Oprt; +extern const QString in_Oprt; + #endif // DEF_H diff --git a/src/utils/utils.pri b/src/utils/utils.pri index 0fc1408a4..6cb4394d2 100644 --- a/src/utils/utils.pri +++ b/src/utils/utils.pri @@ -2,3 +2,6 @@ HEADERS += \ $$PWD/logging.h \ $$PWD/vmath.h \ $$PWD/def.h + +SOURCES += \ + $$PWD/def.cpp