From a3caf574cb037e03835001b86abf408b50b7a555 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 11 Jun 2015 13:15:57 +0300 Subject: [PATCH 01/10] Refactoring. Move translation variables outside VApplication. --HG-- branch : feature --- src/app/container/container.pri | 6 +- src/app/container/vcontainer.cpp | 2 +- src/app/container/vformula.cpp | 8 +- src/app/container/vtranslatevars.cpp | 1538 +++++++++++++++++ src/app/container/vtranslatevars.h | 83 + src/app/core/vapplication.cpp | 1514 +--------------- src/app/core/vapplication.h | 38 +- src/app/dialogs/app/dialogincrements.cpp | 5 +- src/app/dialogs/tools/dialogalongline.cpp | 4 +- src/app/dialogs/tools/dialogarc.cpp | 12 +- src/app/dialogs/tools/dialogarcwithlength.cpp | 12 +- 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 +- .../dialogs/tools/dialogeditwrongformula.cpp | 34 +- src/app/dialogs/tools/dialogendline.cpp | 8 +- .../dialogs/tools/dialoglineintersectaxis.cpp | 4 +- src/app/dialogs/tools/dialognormal.cpp | 4 +- .../tools/dialogpointfromcircleandtangent.cpp | 4 +- .../dialogs/tools/dialogpointofcontact.cpp | 4 +- .../dialogpointofintersectioncircles.cpp | 8 +- src/app/dialogs/tools/dialogshoulderpoint.cpp | 4 +- src/app/dialogs/tools/dialogtool.cpp | 2 +- src/app/main.cpp | 2 + src/app/tools/drawTools/vtoolalongline.cpp | 2 +- src/app/tools/drawTools/vtoolarc.cpp | 6 +- .../tools/drawTools/vtoolarcwithlength.cpp | 6 +- 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 | 4 +- .../drawTools/vtoollineintersectaxis.cpp | 2 +- src/app/tools/drawTools/vtoolnormal.cpp | 2 +- .../tools/drawTools/vtoolpointofcontact.cpp | 2 +- .../tools/drawTools/vtoolshoulderpoint.cpp | 2 +- src/app/visualization/visualization.cpp | 2 +- src/app/xml/vindividualmeasurements.cpp | 3 +- src/app/xml/vstandardmeasurements.cpp | 6 +- 42 files changed, 1739 insertions(+), 1624 deletions(-) create mode 100644 src/app/container/vtranslatevars.cpp create mode 100644 src/app/container/vtranslatevars.h diff --git a/src/app/container/container.pri b/src/app/container/container.pri index 095565326..e1c016619 100644 --- a/src/app/container/container.pri +++ b/src/app/container/container.pri @@ -18,7 +18,8 @@ SOURCES += \ $$PWD/variables/vcurvevariable.cpp \ container/variables/vcurveangle.cpp \ container/variables/varcangle.cpp \ - container/variables/vsplineangle.cpp + container/variables/vsplineangle.cpp \ + container/vtranslatevars.cpp HEADERS += \ $$PWD/vcontainer.h \ @@ -45,4 +46,5 @@ HEADERS += \ $$PWD/variables/vcurvevariable_p.h \ container/variables/vcurveangle.h \ container/variables/varcangle.h \ - container/variables/vsplineangle.h + container/variables/vsplineangle.h \ + container/vtranslatevars.h diff --git a/src/app/container/vcontainer.cpp b/src/app/container/vcontainer.cpp index cd8164ac4..bfc72a4ea 100644 --- a/src/app/container/vcontainer.cpp +++ b/src/app/container/vcontainer.cpp @@ -489,7 +489,7 @@ const QMap > VContainer::DataVar(const VarType &type) if (i.value()->GetType() == type) { QSharedPointer var = GetVariable(i.key()); - map.insert(qApp->VarToUser(i.key()), var); + map.insert(qApp->TrVars()->VarToUser(i.key()), var); } } return map; diff --git a/src/app/container/vformula.cpp b/src/app/container/vformula.cpp index 232a70ac6..b897cf4bf 100644 --- a/src/app/container/vformula.cpp +++ b/src/app/container/vformula.cpp @@ -42,7 +42,7 @@ VFormula::VFormula() //--------------------------------------------------------------------------------------------------------------------- VFormula::VFormula(const QString &formula, const VContainer *container) - :formula(qApp->FormulaToUser(formula)), value(QString(tr("Error"))), checkZero(true), data(container), + :formula(qApp->TrVars()->FormulaToUser(formula)), value(QString(tr("Error"))), checkZero(true), data(container), toolId(NULL_ID), postfix(QString()), _error(true), dValue(0) { this->formula.replace("\n", " ");// Replace line return with spaces for calc if exist @@ -102,7 +102,7 @@ QString VFormula::GetFormula(FormulaType type) const } else { - return qApp->FormulaFromUser(formula); + return qApp->TrVars()->FormulaFromUser(formula); } } @@ -113,7 +113,7 @@ void VFormula::SetFormula(const QString &value, FormulaType type) { if (type == FormulaType::ToUser) { - formula = qApp->FormulaToUser(value); + formula = qApp->TrVars()->FormulaToUser(value); } else { @@ -226,7 +226,7 @@ void VFormula::Eval() try { Calculator *cal = new Calculator(data); - QString expression = qApp->FormulaFromUser(formula); + QString expression = qApp->TrVars()->FormulaFromUser(formula); const qreal result = cal->EvalFormula(expression); delete cal; diff --git a/src/app/container/vtranslatevars.cpp b/src/app/container/vtranslatevars.cpp new file mode 100644 index 000000000..5d50a3046 --- /dev/null +++ b/src/app/container/vtranslatevars.cpp @@ -0,0 +1,1538 @@ +/************************************************************************ + ** + ** @file vtranslatevars.cpp + ** @author Roman Telezhynskyi + ** @date 10 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 "vtranslatevars.h" +#include "../options.h" +#include "../container/calculator.h" + +using namespace qmu; + +//--------------------------------------------------------------------------------------------------------------------- +VTranslateVars::VTranslateVars(const VSettings *settings) + :measurements(QMap()), guiTexts(QMap()), + descriptions(QMap()), variables(QMap()), + functions(QMap()), postfixOperators(QMap()), + stDescriptions(QMap()), settings(settings) +{ + InitMeasurements(); + InitVariables(); + InitFunctions(); + InitPostfixOperators(); + InitSTDescriptions(); +} + +//--------------------------------------------------------------------------------------------------------------------- +VTranslateVars::~VTranslateVars() +{} + +//--------------------------------------------------------------------------------------------------------------------- +void VTranslateVars::InitMeasurements() +{ + //Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't + //mark such string to translation. + QmuTranslation m; + QmuTranslation g; + QmuTranslation d; + + //================================================================================================================= + // head_and_neck + m = QmuTranslation::translate("Measurements", "head_girth", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Head girth", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Around fullest part of Head", + "Full measurement description"); + InitMeasurement(headGirth_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "mid_neck_girth", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Mid-neck girth", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Around middle part of Neck", + "Full measurement description"); + InitMeasurement(midNeckGirth_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "neck_base_girth", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Neck Base girth", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Around Neck at base", "Full measurement description"); + InitMeasurement(neckBaseGirth_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "head_and_neck_length", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Head and Neck length", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Vertical Distance from Crown to Nape", + "Full measurement description"); + InitMeasurement(headAndNeckLength_M, m, g, d); + //================================================================================================================= + // torso + m = QmuTranslation::translate("Measurements", "center_front_waist_length", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Front Center length", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Front Neck Center over tape at Bustline to Front Waist " + "Center", "Full measurement description"); + InitMeasurement(centerFrontWaistLength_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "center_back_waist_length", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Back Center length", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Back Neck Center to Back Waist Center", + "Full measurement description"); + InitMeasurement(centerBackWaistLength_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "shoulder_length", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Shoulder length", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "NeckPoint to ShoulderTip", + "Full measurement description"); + InitMeasurement(shoulderLength_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "side_waist_length", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Side Waist length", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Armpit to Waist side", "Full measurement description"); + InitMeasurement(sideWaistLength_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "trunk_length", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Trunk length", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", + "Around Body from middle of Shoulder length to BustPoint to Crotch up back to " + "beginning point", "Full measurement description"); + InitMeasurement(trunkLength_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "shoulder_girth", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Shoulder girth", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Around Arms and Torso, at bicep level parallel to " + "floor, with arms hanging at the sides", "Full measurement description"); + InitMeasurement(shoulderGirth_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "upper_chest_girth", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Upper Chest girth", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Around Chest at Armfold level, will be parallel to " + "floor across back, will not be parallel to floor across front chest", + "Full measurement description"); + InitMeasurement(upperChestGirth_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "bust_girth", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Bust girth", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Around fullest part of Bust, parallel to floor", + "Full measurement description"); + InitMeasurement(bustGirth_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "under_bust_girth", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Under Bust girth", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Around Chest below the Bust, parallel to floor", + "Full measurement description"); + InitMeasurement(underBustGirth_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "waist_girth", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Waist girth", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Tie a string around smallest part of waist, keep string " + "tied while taking meaasurements. Not usually parallel to floor for front waist or " + "back waist.", + "Full measurement description"); + InitMeasurement(waistGirth_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "high_hip_girth", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "HighHip girth", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Around HighHip, parallel to floor", + "Full measurement description"); + InitMeasurement(highHipGirth_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "hip_girth", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Hip girth", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Around Hip, parallel to floor", + "Full measurement description"); + InitMeasurement(hipGirth_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "upper_front_chest_width", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Front Upper Chest width", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Across Front UpperChest, smallest width from armscye to " + "armscye", "Full measurement description"); + InitMeasurement(upperFrontChestWidth_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "front_chest_width", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Front Chest width", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Across Front Chest, from armfold to armfold", + "Full measurement description"); + InitMeasurement(frontChestWidth_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "across_front_shoulder_width", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Front Across Shoulder width", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "From ShoulderTip to ShoulderTip, across Front", + "Full measurement description"); + InitMeasurement(acrossFrontShoulderWidth_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "across_back_shoulder_width", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Back Across Shoulder width", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "From ShoulderTip to ShoulderTip, across Back", + "Full measurement description"); + InitMeasurement(acrossBackShoulderWidth_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "upper_back_width", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Back Upper Chest width", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Across Back UpperChest, smallest width from armscye to " + "armscye", "Full measurement description"); + InitMeasurement(upperBackWidth_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "back_width", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Back Chest width", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Across Back Chest, from armfold to armfold", + "Full measurement description"); + InitMeasurement(backWidth_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "bustpoint_to_bustpoint", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "BustPoint to BustPoint", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Distance between BustPoints, across Chest", + "Full measurement description"); + InitMeasurement(bustpointToBustpoint_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "halter_bustpoint_to_bustpoint", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Halter Bustpoint to Bustpoint", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Distance from Bustpoint, behind neck, down to Bustpoint", + "Full measurement description"); + InitMeasurement(halterBustpointToBustpoint_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "neck_to_bustpoint", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "NeckPoint to BustPoint", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "From NeckPoint to BustPoint", + "Full measurement description"); + InitMeasurement(neckToBustpoint_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "crotch_length", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Crotch length", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "From Front Waist Center, down to crotch, up to Back " + "Waist Center", "Full measurement description"); + InitMeasurement(crotchLength_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "rise_height", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Rise height", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Sit on hard chair, measure from side waist straight " + "down to chair bottom", "Full measurement description"); + InitMeasurement(riseHeight_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "shoulder_drop", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Shoulder Drop", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Vertical Distance from NeckPoint level to ShoulderTip " + "level", "Full measurement description"); + InitMeasurement(shoulderDrop_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "shoulder_slope_degrees", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Shoulder Slope degrees", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Degrees of angle from NeckPoint to ShoulderTip – " + "requires goniometer", "Full measurement description"); + InitMeasurement(shoulderSlopeDegrees_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "front_shoulder_slope_length", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Front Shoulder Balance", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "ShoulderTip to Front Waist Center", + "Full measurement description"); + InitMeasurement(frontShoulderSlopeLength_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "back_shoulder_slope_length", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Back Shoulder Balance", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "ShoulderTip to Back Waist Center", + "Full measurement description"); + InitMeasurement(backShoulderSlopeLength_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "front_shoulder_to_waist_length", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Front Full Length", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "NeckPoint straight down front chest to Waistline", + "Full measurement description"); + InitMeasurement(frontShoulderToWaistLength_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "back_shoulder_to_waist_length", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Back Full Length", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Back NeckPoint straight down back chest to Waistline", + "Full measurement description"); + InitMeasurement(backShoulderToWaistLength_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "front_neck_arc", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Front Neck arc", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "NeckPoint to NeckPoint through Front Neck Center", + "Full measurement description"); + InitMeasurement(frontNeckArc_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "back_neck_arc", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Back Neck arc", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "NeckPoint to NeckPoint across Nape", + "Full measurement description"); + InitMeasurement(backNeckArc_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "front_upper_chest_arc", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Front upper-bust arc", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Front upper-bust arc", "Full measurement description"); + InitMeasurement(frontUpperChestArc_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "back_upper_chest_arc", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Back UpperBust arc", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Back UpperBust side to side", + "Full measurement description"); + InitMeasurement(backUpperChestArc_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "front_waist_arc", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Front Waist arc", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Front Waist side to side", + "Full measurement description"); + InitMeasurement(frontWaistArc_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "back_waist_arc", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Back Waist arc", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Back Waist side to side", + "Full measurement description"); + InitMeasurement(backWaistArc_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "front_upper_hip_arc", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Front UpperHip arc", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Front UpperHip side to side", + "Full measurement description"); + InitMeasurement(frontUpperHipArc_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "back_upper_hip_arc", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Back UpperHip arc", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Back UpperHip side to side", + "Full measurement description"); + InitMeasurement(backUpperHipArc_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "front_hip_arc", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Front Hip arc", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Front Hip side to side", + "Full measurement description"); + InitMeasurement(frontHipArc_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "back_hip_arc", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Back Hip arc", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Back Hip side to side", "Full measurement description"); + InitMeasurement(backHipArc_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "chest_slope", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Chest Balance", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "NeckPoint to Front ArmfoldPoint", + "Full measurement description"); + InitMeasurement(chestSlope_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "back_slope", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Back Balance", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "NeckPoint to Back ArmfoldPoint", + "Full measurement description"); + InitMeasurement(backSlope_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "front_waist_slope", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Front Waist Balance", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "NeckPoint across Front Chest to Waist side", + "Full measurement description"); + InitMeasurement(frontWaistSlope_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "back_waist_slope", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Back Waist Balance", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "NeckPoint across Back Chest to Waist side", + "Full measurement description"); + InitMeasurement(backWaistSlope_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "front_neck_to_upper_chest_height", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Front UpperChest height", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Front Neck Center straight down to UpperChest line", + "Full measurement description"); + InitMeasurement(frontNeckToUpperChestHeight_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "front_neck_to_bust_height", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Bust height", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Front Neck Center straight down to Bust line", + "Full measurement description"); + InitMeasurement(frontNeckToBustHeight_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "front_waist_to_upper_chest", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Front Upper chest waist", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Front Upper chest waist", + "Full measurement description"); + InitMeasurement(frontWaistToUpperChest_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "front_waist_to_lower_breast", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Front waist to lower breast", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Front waist to lower breast", + "Full measurement description"); + InitMeasurement(frontWaistToLowerBreast_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "back_waist_to_upper_chest", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Back waist to upper chest", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Back waist to upper chest", + "Full measurement description"); + InitMeasurement(backWaistToUpperChest_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "strap_length", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Strap length", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Strap length", + "Full measurement description"); + InitMeasurement(strapLength_M, m, g, d); + //================================================================================================================= + // arm + m = QmuTranslation::translate("Measurements", "armscye_girth", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Armscye Girth", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Around Armscye", "Full measurement description"); + InitMeasurement(armscyeGirth_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "elbow_girth", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Elbow Girth", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Around Elbow with elbow bent", + "Full measurement description"); + InitMeasurement(elbowGirth_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "upper_arm_girth", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Upperarm Girth", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Around UpperArm", "Full measurement description"); + InitMeasurement(upperArmGirth_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "wrist_girth", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Wrist girth", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Around Wrist", "Full measurement description"); + InitMeasurement(wristGirth_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "scye_depth", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Armscye depth", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Nape straight down to UnderBust line (same as Back " + "UpperBust height)", "Full measurement description"); + InitMeasurement(scyeDepth_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "shoulder_and_arm_length", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Shoulder and Arm length", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "NeckPoint to ShoulderTip to Wrist, with elbow bent and " + "hand on hip", "Full measurement description"); + InitMeasurement(shoulderAndArmLength_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "underarm_length", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Underarm length", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Armpit to Wrist, with arm straight and hanging at side", + "Full measurement description"); + InitMeasurement(underarmLength_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "cervicale_to_wrist_length", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Nape to wrist length", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Nape to Wrist, with elbow bent and hand on hip", + "Full measurement description"); + InitMeasurement(cervicaleToWristLength_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "shoulder_to_elbow_length", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Elbow length", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "ShoulderTip to Elbow, with elbow bent and hand on hip", + "Full measurement description"); + InitMeasurement(shoulderToElbowLength_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "arm_length", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Arm length", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "ShoulderTip to Wrist, with elbow bent and hand on hip", + "Full measurement description"); + InitMeasurement(armLength_M, m, g, d); + //================================================================================================================= + // hand + m = QmuTranslation::translate("Measurements", "hand_width", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Hand width", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Hand side to side", "Full measurement description"); + InitMeasurement(handWidth_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "hand_length", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Hand length", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Hand Middle Finger tip to wrist", + "Full measurement description"); + InitMeasurement(handLength_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "hand_girth", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Hand girth", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Around Hand", "Full measurement description"); + InitMeasurement(handGirth_M, m, g, d); + //================================================================================================================= + // leg + m = QmuTranslation::translate("Measurements", "thigh_girth", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Thigh girth", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Around Thigh", "Full measurement description"); + InitMeasurement(thighGirth_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "mid_thigh_girth", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Midthigh girth", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Around MidThigh", "Full measurement description"); + InitMeasurement(midThighGirth_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "knee_girth", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Knee girth", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Around Knee", "Full measurement description"); + InitMeasurement(kneeGirth_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "calf_girth", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Calf girth", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Around Calf", "Full measurement description"); + InitMeasurement(calfGirth_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "ankle_girth", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Ankle girth", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Around Ankle", "Full measurement description"); + InitMeasurement(ankleGirth_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "knee_height", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Knee height", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Knee to Floor", "Full measurement description"); + InitMeasurement(kneeHeight_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "ankle_height", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Ankle height", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Ankle to Floor", "Full measurement description"); + InitMeasurement(ankleHeight_M, m, g, d); + //================================================================================================================= + // foot + m = QmuTranslation::translate("Measurements", "foot_width", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Foot width", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Widest part of Foot side to side", + "Full measurement description"); + InitMeasurement(footWidth_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "foot_length", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Foot length", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Tip of Longest Toe straight to back of heel", + "Full measurement description"); + InitMeasurement(footLength_M, m, g, d); + //================================================================================================================= + // heights + m = QmuTranslation::translate("Measurements", "height", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Total Height", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Top of head to floor", "Full measurement description"); + InitMeasurement(height_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "cervicale_height", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Nape height", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Nape to Floor", "Full measurement description"); + InitMeasurement(cervicaleHeight_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "cervicale_to_knee_height", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Nape to knee height", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Nape to Knee", "Full measurement description"); + InitMeasurement(cervicaleToKneeHeight_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "waist_height", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Waist height", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Waist side to floor", "Full measurement description"); + InitMeasurement(waistHeight_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "high_hip_height", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "HighHip height", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "HighHip side to Floor", "Full measurement description"); + InitMeasurement(highHipHeight_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "hip_height", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Hip height", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Hip side to Floor", "Full measurement description"); + InitMeasurement(hipHeight_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "waist_to_hip_height", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Waist to Hip height", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Waist side to Hip", "Full measurement description"); + InitMeasurement(waistToHipHeight_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "waist_to_knee_height", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Waist to Knee height", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Waist side to Knee", "Full measurement description"); + InitMeasurement(waistToKneeHeight_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "crotch_height", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Crotch height/Inseam", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Crotch to Floor along inside leg", + "Full measurement description"); + InitMeasurement(crotchHeight_M, m, g, d); + //================================================================================================================= + //extended + m = QmuTranslation::translate("Measurements", "size", "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Size", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Size", "Full measurement description"); + InitMeasurement(size_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "height_front_neck_base_point", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Height front neck base point", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Height of the point base of the neck in front", + "Full measurement description"); + InitMeasurement(heightFrontNeckBasePoint_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "height_base_neck_side_point", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Height base neck side point", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Height of the base of the neck side point", + "Full measurement description"); + InitMeasurement(heightBaseNeckSidePoint_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "height_shoulder_point", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Height shoulder point", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "The height of the shoulder point", + "Full measurement description"); + InitMeasurement(heightShoulderPoint_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "height_nipple_point", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Height nipple point", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Height nipple point", "Full measurement description"); + InitMeasurement(heightNipplePoint_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "height_back_angle_axilla", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Height back angle axilla", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Height back angle axilla", + "Full measurement description"); + InitMeasurement(heightBackAngleAxilla_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "height_scapular_point", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Height scapular point", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Height scapular point", "Full measurement description"); + InitMeasurement(heightScapularPoint_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "height_under_buttock_folds", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Height under buttock folds", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Height under buttock folds", + "Full measurement description"); + InitMeasurement(heightUnderButtockFolds_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "hips_excluding_protruding_abdomen", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Hips excluding protruding abdomen", + "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Hips excluding protruding abdomen", + "Full measurement description"); + InitMeasurement(hipsExcludingProtrudingAbdomen_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "girth_foot_instep", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Girth foot instep", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Girth foot instep", "Full measurement description"); + InitMeasurement(girthFootInstep_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "side_waist_to_floor", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Side waist to floor", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "The distance from the side waist to floor", + "Full measurement description"); + InitMeasurement(sideWaistToFloor_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "front_waist_to_floor", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Front waist to floor", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "The distance from the front waist to floor", + "Full measurement description"); + InitMeasurement(frontWaistToFloor_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "arc_through_groin_area", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Arc through groin area", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Arc through groin area", "Full measurement description"); + InitMeasurement(arcThroughGroinArea_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "waist_to_plane_seat", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Waist to plane seat", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "The distance from the waist to the plane seat", + "Full measurement description"); + InitMeasurement(waistToPlaneSeat_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "neck_to_radial_point", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Neck to radial point", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "The distance from the base of the neck to the side of " + "the radial point", "Full measurement description"); + InitMeasurement(neckToRadialPoint_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "neck_to_third_finger", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Neck to third finger", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Distance from the base of the neck side point to the " + "end of the third finger", "Full measurement description"); + InitMeasurement(neckToThirdFinger_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "neck_to_first_line_chest_circumference", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Neck to first line chest circumference", + "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "The distance from the base of the neck to the side of " + "the first line in front of chest circumference", "Full measurement description"); + InitMeasurement(neckToFirstLineChestCircumference_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "front_waist_length", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Front waist length", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "The distance from the base of the neck to the waist " + "side front (waist length in the front)", "Full measurement description"); + InitMeasurement(frontWaistLength_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "arc_through_shoulder_joint", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Arc through shoulder joint", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Arc through the highest point of the shoulder joint", + "Full measurement description"); + InitMeasurement(arcThroughShoulderJoint_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "neck_to_back_line_chest_circumference", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Neck to back line chest circumference", + "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "The distance from the base of the neck to the back line " + "of chest circumference of the first and the second based on ledge vanes", + "Full measurement description"); + InitMeasurement(neckToBackLineChestCircumference_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "waist_to_neck_side", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Waist to neck side", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "The distance from the waist to the back base of the " + "neck side point", "Full measurement description"); + InitMeasurement(waistToNeckSide_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "arc_length_upper_body", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Arc length upper body", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Arc length of the upper body through the base of the " + "neck side point", "Full measurement description"); + InitMeasurement(arcLengthUpperBody_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "chest_width", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Chest width", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Chest width", "Full measurement description"); + InitMeasurement(chestWidth_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "anteroposterior_diameter_hands", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Anteroposterior diameter hands", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Anteroposterior diameter of the hands", + "Full measurement description"); + InitMeasurement(anteroposteriorDiameterHands_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "height_clavicular_point", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Height clavicular point", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Height clavicular point", + "Full measurement description"); + InitMeasurement(heightClavicularPoint_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "height_armhole_slash", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Height armhole slash", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "The distance from the point to the cervical level of " + "the posterior angle of the front armpit (underarm height oblique)", + "Full measurement description"); + InitMeasurement(heightArmholeSlash_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "slash_shoulder_height", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Slash shoulder height", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Slash shoulder height", "Full measurement description"); + InitMeasurement(slashShoulderHeight_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "half_girth_neck", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Half girth neck", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Half girth neck", "Full measurement description"); + InitMeasurement(halfGirthNeck_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "half_girth_neck_for_shirts", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Half girth neck for shirts", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Half girth neck for shirts", + "Full measurement description"); + InitMeasurement(halfGirthNeckForShirts_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "half_girth_chest_first", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Half girth chest first", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Half girth chest first", "Full measurement description"); + InitMeasurement(halfGirthChestFirst_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "half_girth_chest_second", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Half girth chest second", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Half girth chest second", + "Full measurement description"); + InitMeasurement(halfGirthChestSecond_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "half_girth_chest_third", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Half girth chest third", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Half girth chest third", "Full measurement description"); + InitMeasurement(halfGirthChestThird_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "half_girth_waist", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Half girth waist", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Half girth waist", "Full measurement description"); + InitMeasurement(halfGirthWaist_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "half_girth_hips_considering_protruding_abdomen", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Half girth hips considering protruding abdomen", + "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Half girth hips considering protruding abdomen", + "Full measurement description"); + InitMeasurement(halfGirthHipsConsideringProtrudingAbdomen_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "half_girth_hips_excluding_protruding_abdomen", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Half girth hips excluding protruding abdomen", + "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Half girth hips excluding protruding abdomen", + "Full measurement description"); + InitMeasurement(halfGirthHipsExcludingProtrudingAbdomen_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "girth_knee_flexed_feet", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Girth knee flexed feet", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Girth knee flexed feet", "Full measurement description"); + InitMeasurement(girthKneeFlexedFeet_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "neck_transverse_diameter", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Neck transverse diameter", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Neck transverse diameter", + "Full measurement description"); + InitMeasurement(neckTransverseDiameter_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "front_slash_shoulder_height", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Front slash shoulder height", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Front slash shoulder height", + "Full measurement description"); + InitMeasurement(frontSlashShoulderHeight_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "neck_to_front_waist_line", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Neck to front waist line", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "The distance from the base of the neck to the waist " + "line front", "Full measurement description"); + InitMeasurement(neckToFrontWaistLine_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "hand_vertical_diameter", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Hand vertical diameter", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Hand vertical diameter", "Full measurement description"); + InitMeasurement(handVerticalDiameter_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "neck_to_knee_point", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Neck to knee point", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Distance from neck to knee point", + "Full measurement description"); + InitMeasurement(neckToKneePoint_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "waist_to_knee", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Waist to knee", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "The distance from the waist to the knee", + "Full measurement description"); + InitMeasurement(waistToKnee_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "shoulder_height", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Shoulder height", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Shoulder height", "Full measurement description"); + InitMeasurement(shoulderHeight_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "head_height", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Head height", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Head height", "Full measurement description"); + InitMeasurement(headHeight_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "body_position", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Body position", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Body position", "Full measurement description"); + InitMeasurement(bodyPosition_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "arc_behind_shoulder_girdle", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Arc behind shoulder girdle", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Arc behind the shoulder girdle", + "Full measurement description"); + InitMeasurement(arcBehindShoulderGirdle_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "neck_to_neck_base", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Neck to neck base", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Distance from neck point to point on the base of the " + "neck side neck girth measurement line", "Full measurement description"); + InitMeasurement(neckToNeckBase_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "depth_waist_first", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Depth waist first", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Depth waist first", "Full measurement description"); + InitMeasurement(depthWaistFirst_M, m, g, d); + //================================================================================================================= + m = QmuTranslation::translate("Measurements", "depth_waist_second", + "Short measurement name. Don't use math symbols in name!!!!"); + g = QmuTranslation::translate("MeasurementsFullNames", "Depth waist second", "Full measurement name"); + d = QmuTranslation::translate("MeasurementsDescriptions", "Depth waist second", "Full measurement description"); + InitMeasurement(depthWaistSecond_M, m, g, d); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VTranslateVars::InitVariables() +{ + variables.insert(line_, QmuTranslation::translate("Variables", "Line_", "Left symbol _ in name")); + variables.insert(angleLine_, QmuTranslation::translate("Variables", "AngleLine_", "Left symbol _ in name")); + variables.insert(arc_, QmuTranslation::translate("Variables", "Arc_", "Left symbol _ in name")); + variables.insert(spl_, QmuTranslation::translate("Variables", "Spl_", "Left symbol _ in name")); + variables.insert(splPath, QmuTranslation::translate("Variables", "SplPath", + "Do not add symbol _ to the end of name")); + variables.insert(radiusArc_, QmuTranslation::translate("Variables", "RadiusArc_", "Left symbol _ in name")); + variables.insert(angle1Arc_, QmuTranslation::translate("Variables", "Angle1Arc_", "Left symbol _ in name")); + variables.insert(angle2Arc_, QmuTranslation::translate("Variables", "Angle2Arc_", "Left symbol _ in name")); + variables.insert(angle1Spl_, QmuTranslation::translate("Variables", "Angle1Spl_", "Left symbol _ in name")); + variables.insert(angle2Spl_, QmuTranslation::translate("Variables", "Angle2Spl_", "Left symbol _ in name")); + variables.insert(angle1SplPath, QmuTranslation::translate("Variables", "Angle1SplPath", + "Do not add symbol _ to the end of name")); + variables.insert(angle2SplPath, QmuTranslation::translate("Variables", "Angle2SplPath", + "Do not add symbol _ to the end of name")); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VTranslateVars::InitFunctions() +{ + functions.insert(sin_F, QmuTranslation::translate("Functions", "sin", "sine function")); + functions.insert(cos_F, QmuTranslation::translate("Functions", "cos", "cosine function")); + functions.insert(tan_F, QmuTranslation::translate("Functions", "tan", "tangens function")); + functions.insert(asin_F, QmuTranslation::translate("Functions", "asin", "arcus sine function")); + functions.insert(acos_F, QmuTranslation::translate("Functions", "acos", "arcus cosine function")); + functions.insert(atan_F, QmuTranslation::translate("Functions", "atan", "arcus tangens function")); + functions.insert(sinh_F, QmuTranslation::translate("Functions", "sinh", "hyperbolic sine function")); + functions.insert(cosh_F, QmuTranslation::translate("Functions", "cosh", "hyperbolic cosine")); + functions.insert(tanh_F, QmuTranslation::translate("Functions", "tanh", "hyperbolic tangens function")); + functions.insert(asinh_F, QmuTranslation::translate("Functions", "asinh", "hyperbolic arcus sine function")); + functions.insert(acosh_F, QmuTranslation::translate("Functions", "acosh", "hyperbolic arcus tangens function")); + functions.insert(atanh_F, QmuTranslation::translate("Functions", "atanh", "hyperbolic arcur tangens function")); + functions.insert(log2_F, QmuTranslation::translate("Functions", "log2", "logarithm to the base 2")); + functions.insert(log10_F, QmuTranslation::translate("Functions", "log10", "logarithm to the base 10")); + functions.insert(log_F, QmuTranslation::translate("Functions", "log", "logarithm to the base 10")); + functions.insert(ln_F, QmuTranslation::translate("Functions", "ln", "logarithm to base e (2.71828...)")); + functions.insert(exp_F, QmuTranslation::translate("Functions", "exp", "e raised to the power of x")); + functions.insert(sqrt_F, QmuTranslation::translate("Functions", "sqrt", "square root of a value")); + functions.insert(sign_F, QmuTranslation::translate("Functions", "sign", "sign function -1 if x<0; 1 if x>0")); + functions.insert(rint_F, QmuTranslation::translate("Functions", "rint", "round to nearest integer")); + functions.insert(abs_F, QmuTranslation::translate("Functions", "abs", "absolute value")); + functions.insert(min_F, QmuTranslation::translate("Functions", "min", "min of all arguments")); + functions.insert(max_F, QmuTranslation::translate("Functions", "max", "max of all arguments")); + functions.insert(sum_F, QmuTranslation::translate("Functions", "sum", "sum of all arguments")); + functions.insert(avg_F, QmuTranslation::translate("Functions", "avg", "mean value of all arguments")); + functions.insert(fmod_F, QmuTranslation::translate("Functions", "fmod", + "Returns the floating-point remainder of numer/denom (rounded towards zero)")); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VTranslateVars::InitPostfixOperators() +{ + postfixOperators.insert(cm_Oprt, QmuTranslation::translate("PostfixOperators", "cm", "centimeter")); + postfixOperators.insert(mm_Oprt, QmuTranslation::translate("PostfixOperators", "mm", "millimeter")); + postfixOperators.insert(in_Oprt, QmuTranslation::translate("PostfixOperators", "in", "inch")); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VTranslateVars::InitSTDescriptions() +{ + stDescriptions.insert("0", QmuTranslation::translate("STDescriptions", + "Standard figures of men 1st group, chest 100 cm", + "Standard table description")); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VTranslateVars::InitMeasurement(const QString &name, const QmuTranslation &m, const QmuTranslation &g, + const QmuTranslation &d) +{ + measurements.insert(name, m); + guiTexts.insert(name, g); + descriptions.insert(name, d); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief CorrectionsPositions correct position tokens in expression after token translation. + * + * Because translated string can have different length compare to original need make correction after each translation. + * If bias = 0 correction will not happens. + * + * @param position position currecnt token in expression + * @param bias difference between original token length and translated + * @param tokens all tokens + * @param numbers all numbers + */ +void VTranslateVars::CorrectionsPositions(int position, int bias, QMap &tokens, + QMap &numbers) const +{ + if (bias == 0) + { + return;// Nothing to correct; + } + + BiasTokens(position, bias, tokens); + BiasTokens(position, bias, numbers); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief BiasTokens change position for each token that have position more then "position". + * @param position token position + * @param bias difference between original token length and translated + * @param tokens all tokens + */ +void VTranslateVars::BiasTokens(int position, int bias, QMap &tokens) const +{ + QMap newTokens; + QMap::const_iterator i = tokens.constBegin(); + while (i != tokens.constEnd()) + { + if (i.key()<= position) + { // Tokens before position "position" did not change his positions. + newTokens.insert(i.key(), i.value()); + } + else + { + newTokens.insert(i.key()-bias, i.value()); + } + ++i; + } + tokens = newTokens; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief MeasurementsFromUser translate measurement to internal look. + * @param newFormula [in|out] expression to translate + * @param position token position + * @param token token to translate + * @param bias hold change of length between translated and origin token string + * @return true if was found measurement with same name. + */ +bool VTranslateVars::MeasurementsFromUser(QString &newFormula, int position, const QString &token, int &bias) const +{ + QMap::const_iterator i = measurements.constBegin(); + while (i != measurements.constEnd()) + { + if (token == i.value().translate()) + { + newFormula.replace(position, token.length(), i.key()); + bias = token.length() - i.key().length(); + return true; + } + ++i; + } + return false; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VariablesFromUser translate variable to internal look. + * @param newFormula [in|out] expression to translate + * @param position token position + * @param token token to translate + * @param bias hold change of length between translated and origin token string + * @return true if was found variable with same name. + */ +bool VTranslateVars::VariablesFromUser(QString &newFormula, int position, const QString &token, int &bias) const +{ + QMap::const_iterator i = variables.constBegin(); + while (i != variables.constEnd()) + { + if (token.indexOf( i.value().translate() ) == 0) + { + newFormula.replace(position, i.value().translate().length(), i.key()); + QString newToken = token; + newToken.replace(0, i.value().translate().length(), i.key()); + bias = token.length() - newToken.length(); + return true; + } + ++i; + } + return false; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief PostfixOperatorsFromUser translate postfix operator to internal look. + * @param newFormula [in|out] expression to translate + * @param position token position + * @param token token to translate + * @param bias hold change of length between translated and origin token string + * @return true if was found postfix operator with same name. + */ +bool VTranslateVars::PostfixOperatorsFromUser(QString &newFormula, int position, const QString &token, int &bias) const +{ + QMap::const_iterator i = postfixOperators.constBegin(); + while (i != postfixOperators.constEnd()) + { + if (token == i.value().translate()) + { + newFormula.replace(position, token.length(), i.key()); + bias = token.length() - i.key().length(); + return true; + } + ++i; + } + return false; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief FunctionsFromUser translate function name to internal look. + * @param newFormula [in|out] expression to translate + * @param position token position + * @param token token to translate + * @param bias hold change of length between translated and origin token string + * @return true if was found function with same name. + */ +bool VTranslateVars::FunctionsFromUser(QString &newFormula, int position, const QString &token, int &bias) const +{ + QMap::const_iterator i = functions.constBegin(); + while (i != functions.constEnd()) + { + if (token == i.value().translate()) + { + newFormula.replace(position, token.length(), i.key()); + bias = token.length() - i.key().length(); + return true; + } + ++i; + } + return false; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VariablesToUser translate variable name to user. + * @param newFormula [in|out] expression to translate + * @param position token position + * @param token token to translate + * @param bias hold change of length between translated and origin token string + * @return true if was found variable with same name. + */ +bool VTranslateVars::VariablesToUser(QString &newFormula, int position, const QString &token, int &bias) const +{ + QMap::const_iterator i = variables.constBegin(); + while (i != variables.constEnd()) + { + if (token.indexOf( i.key() ) == 0) + { + newFormula.replace(position, i.key().length(), i.value().translate()); + + QString newToken = token; + newToken.replace(0, i.key().length(), i.value().translate()); + bias = token.length() - newToken.length(); + return true; + } + ++i; + } + return false; +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VTranslateVars::VarToUser(const QString &var) const +{ + if (measurements.contains(var)) + { + return measurements.value(var).translate(); + } + + if (functions.contains(var)) + { + return functions.value(var).translate(); + } + + if (postfixOperators.contains(var)) + { + return postfixOperators.value(var).translate(); + } + + QString newVar = var; + int bias = 0; + if (VariablesToUser(newVar, 0, var, bias)) + { + return newVar; + } + return newVar; +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VTranslateVars::VarFromUser(const QString &var) const +{ + QString newVar = var; + int bias = 0; + if (MeasurementsFromUser(newVar, 0, var, bias)) + { + return newVar; + } + + if (VariablesFromUser(newVar, 0, var, bias)) + { + return newVar; + } + + if (PostfixOperatorsFromUser(newVar, 0, var, bias)) + { + return newVar; + } + + if (FunctionsFromUser(newVar, 0, var, bias)) + { + return newVar; + } + return newVar; +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VTranslateVars::GuiText(const QString &measurement) const +{ + return guiTexts.value(measurement).translate(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VTranslateVars::Description(const QString &measurement) const +{ + return descriptions.value(measurement).translate(); +} + +//--------------------------------------------------------------------------------------------------------------------- +// cppcheck-suppress unusedFunction +QString VTranslateVars::PostfixOperator(const QString &name) const +{ + return postfixOperators.value(name).translate(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VTranslateVars::STDescription(const QString &id) const +{ + if (stDescriptions.contains(id)) + { + return stDescriptions.value(id).translate(); + } + else + { + qDebug()<<"Unknown id number. Got"< tokens = cal->GetTokens();// Tokens (variables, measurements) + QMap numbers = cal->GetNumbers();// All numbers in expression for changing decimal separator + delete cal; + + QList tKeys = tokens.keys();// Take all tokens positions + QList tValues = tokens.values(); + for (int i = 0; i < tKeys.size(); ++i) + { + int bias = 0; + if (MeasurementsFromUser(newFormula, tKeys.at(i), tValues.at(i), bias)) + { + if (bias != 0) + {// Translated token has different length than original. Position next tokens need to be corrected. + CorrectionsPositions(tKeys.at(i), bias, tokens, numbers); + tKeys = tokens.keys(); + tValues = tokens.values(); + } + continue; + } + + if (VariablesFromUser(newFormula, tKeys.at(i), tValues.at(i), bias)) + { + if (bias != 0) + {// Translated token has different length than original. Position next tokens need to be corrected. + CorrectionsPositions(tKeys.at(i), bias, tokens, numbers); + tKeys = tokens.keys(); + tValues = tokens.values(); + } + continue; + } + + if (PostfixOperatorsFromUser(newFormula, tKeys.at(i), tValues.at(i), bias)) + { + if (bias != 0) + {// Translated token has different length than original. Position next tokens need to be corrected. + CorrectionsPositions(tKeys.at(i), bias, tokens, numbers); + tKeys = tokens.keys(); + tValues = tokens.values(); + } + continue; + } + + if (FunctionsFromUser(newFormula, tKeys.at(i), tValues.at(i), bias)) + { + if (bias != 0) + {// Translated token has different length than original. Position next tokens need to be corrected. + CorrectionsPositions(tKeys.at(i), bias, tokens, numbers); + tKeys = tokens.keys(); + tValues = tokens.values(); + } + continue; + } + } + + QLocale loc = QLocale::system(); // User locale + if (loc != QLocale(QLocale::C) && settings->GetOsSeparator()) + {// User want use Os separator + QList nKeys = numbers.keys();// Positions for all numbers in expression + QList nValues = numbers.values(); + for (int i = 0; i < nKeys.size(); ++i) + { + loc = QLocale::system();// From system locale + bool ok = false; + const qreal d = loc.toDouble(nValues.at(i), &ok); + if (ok == false) + { + qDebug()<<"Can't convert to double token"< tokens; + QMap numbers; + try + { + Calculator *cal = new Calculator(formula, false);// Eval formula + tokens = cal->GetTokens();// Tokens (variables, measurements) + numbers = cal->GetNumbers();// All numbers in expression for changing decimal separator + delete cal; + } + catch (qmu::QmuParserError &e) + { + qDebug() << "\nMath parser error:\n" + << "--------------------------------------\n" + << "Message: " << e.GetMsg() << "\n" + << "Expression: " << e.GetExpr() << "\n" + << "--------------------------------------"; + return newFormula; + } + + QList tKeys = tokens.keys(); + QList tValues = tokens.values(); + for (int i = 0; i < tKeys.size(); ++i) + { + if (measurements.contains(tValues.at(i))) + { + newFormula.replace(tKeys.at(i), tValues.at(i).length(), measurements.value(tValues.at(i)).translate()); + int bias = tValues.at(i).length() - measurements.value(tValues.at(i)).translate().length(); + if (bias != 0) + {// Translated token has different length than original. Position next tokens need to be corrected. + CorrectionsPositions(tKeys.at(i), bias, tokens, numbers); + tKeys = tokens.keys(); + tValues = tokens.values(); + } + continue; + } + + if (functions.contains(tValues.at(i))) + { + newFormula.replace(tKeys.at(i), tValues.at(i).length(), functions.value(tValues.at(i)).translate()); + int bias = tValues.at(i).length() - functions.value(tValues.at(i)).translate().length(); + if (bias != 0) + {// Translated token has different length than original. Position next tokens need to be corrected. + CorrectionsPositions(tKeys.at(i), bias, tokens, numbers); + tKeys = tokens.keys(); + tValues = tokens.values(); + } + continue; + } + + if (postfixOperators.contains(tValues.at(i))) + { + newFormula.replace(tKeys.at(i), tValues.at(i).length(), postfixOperators.value(tValues.at(i)).translate()); + int bias = tValues.at(i).length() - postfixOperators.value(tValues.at(i)).translate().length(); + if (bias != 0) + {// Translated token has different length than original. Position next tokens need to be corrected. + CorrectionsPositions(tKeys.at(i), bias, tokens, numbers); + tKeys = tokens.keys(); + tValues = tokens.values(); + } + continue; + } + + int bias = 0; + if (VariablesToUser(newFormula, tKeys.at(i), tValues.at(i), bias)) + { + if (bias != 0) + {// Translated token has different length than original. Position next tokens need to be corrected. + CorrectionsPositions(tKeys.at(i), bias, tokens, numbers); + tKeys = tokens.keys(); + tValues = tokens.values(); + } + continue; + } + } + + QLocale loc = QLocale::system();// User locale + if (loc != QLocale::C && settings->GetOsSeparator()) + {// User want use Os separator + QList nKeys = numbers.keys();// Positions for all numbers in expression + QList nValues = numbers.values(); + for (int i = 0; i < nKeys.size(); ++i) + { + loc = QLocale(QLocale::C);// From pattern locale + bool ok = false; + const qreal d = loc.toDouble(nValues.at(i), &ok); + if (ok == false) + { + qDebug()<<"Can't convert to double token"< + ** @date 10 6, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef VTRANSLATEVARS_H +#define VTRANSLATEVARS_H + +#include +#include "../../libs/qmuparser/qmutranslation.h" +#include "../core/vsettings.h" + +class VTranslateVars +{ +public: + VTranslateVars(const VSettings *settings); + ~VTranslateVars(); + + bool MeasurementsFromUser(QString &newFormula, int position, const QString &token, int &bias) const; + bool VariablesFromUser(QString &newFormula, int position, const QString &token, int &bias) const; + bool PostfixOperatorsFromUser(QString &newFormula, int position, const QString &token, int &bias) const; + bool FunctionsFromUser(QString &newFormula, int position, const QString &token, int &bias) const; + bool VariablesToUser(QString &newFormula, int position, const QString &token, int &bias) const; + + QString VarToUser(const QString &var) const; + QString VarFromUser(const QString &var) const; + + QString GuiText(const QString &measurement) const; + QString Description(const QString &measurement) const; + QString PostfixOperator(const QString &name) const; + QString STDescription(const QString &id) const; + + QString FormulaFromUser(const QString &formula) const; + QString FormulaToUser(const QString &formula) const; + +private: + Q_DISABLE_COPY(VTranslateVars) + QMap measurements; + QMap guiTexts; + QMap descriptions; + QMap variables; + QMap functions; + QMap postfixOperators; + QMap stDescriptions; + const VSettings *settings; + + void InitMeasurements(); + void InitVariables(); + void InitFunctions(); + void InitPostfixOperators(); + void InitSTDescriptions(); + + void InitMeasurement(const QString &name, const qmu::QmuTranslation &m, const qmu::QmuTranslation &g, + const qmu::QmuTranslation &d); + + void CorrectionsPositions(int position, int bias, QMap &tokens, QMap &numbers) const; + void BiasTokens(int position, int bias, QMap &tokens) const; +}; + +#endif // VTRANSLATEVARS_H diff --git a/src/app/core/vapplication.cpp b/src/app/core/vapplication.cpp index 97dc99e64..7d54a830b 100644 --- a/src/app/core/vapplication.cpp +++ b/src/app/core/vapplication.cpp @@ -33,7 +33,6 @@ #include "../libs/ifc/exception/vexceptionemptyparameter.h" #include "../libs/ifc/exception/vexceptionwrongid.h" #include "vmaingraphicsview.h" -#include "../container/calculator.h" #include "../version.h" #include "../../utils/logging.h" @@ -54,8 +53,6 @@ #endif #include -using namespace qmu; - Q_LOGGING_CATEGORY(vApp, "v.application") //--------------------------------------------------------------------------------------------------------------------- @@ -162,10 +159,7 @@ const QString VApplication::GistFileName = QStringLiteral("gist.json"); */ VApplication::VApplication(int &argc, char **argv) : QApplication(argc, argv), _patternUnit(Unit::Cm), _patternType(MeasurementsType::Individual), - _widthMainLine(DefWidth), _widthHairLine(DefWidth/3.0), measurements(QMap()), - guiTexts(QMap()), descriptions(QMap()), - variables(QMap()), functions(QMap()), - postfixOperators(QMap()), stDescriptions(QMap()), + _widthMainLine(DefWidth), _widthHairLine(DefWidth/3.0), trVars(nullptr), undoStack(nullptr), sceneView(nullptr), currentScene(nullptr), autoSaveTimer(nullptr), mainWindow(nullptr), openingPattern(false), settings(nullptr), doc(nullptr), log(nullptr), #if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0) @@ -177,11 +171,6 @@ VApplication::VApplication(int &argc, char **argv) undoStack = new QUndoStack(this); InitLineWidth(); - InitMeasurements(); - InitVariables(); - InitFunctions(); - InitPostfixOperators(); - InitSTDescriptions(); } //--------------------------------------------------------------------------------------------------------------------- @@ -199,6 +188,8 @@ VApplication::~VApplication() delete logLock; #endif } + + delete trVars; } //--------------------------------------------------------------------------------------------------------------------- @@ -431,15 +422,6 @@ void VApplication::InitLineWidth() _widthHairLine = _widthMainLine/3.0; } -//--------------------------------------------------------------------------------------------------------------------- -void VApplication::InitMeasurement(const QString &name, const QmuTranslation &m, const QmuTranslation &g, - const QmuTranslation &d) -{ - measurements.insert(name, m); - guiTexts.insert(name, g); - descriptions.insert(name, d); -} - //--------------------------------------------------------------------------------------------------------------------- QString VApplication::LogDirPath() const { @@ -559,1172 +541,6 @@ void VApplication::ClearOldLogs() const } } -//--------------------------------------------------------------------------------------------------------------------- -void VApplication::InitMeasurements() -{ - //Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't - //mark such string to translation. - QmuTranslation m; - QmuTranslation g; - QmuTranslation d; - - //================================================================================================================= - // head_and_neck - m = QmuTranslation::translate("Measurements", "head_girth", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Head girth", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Around fullest part of Head", - "Full measurement description"); - InitMeasurement(headGirth_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "mid_neck_girth", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Mid-neck girth", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Around middle part of Neck", - "Full measurement description"); - InitMeasurement(midNeckGirth_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "neck_base_girth", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Neck Base girth", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Around Neck at base", "Full measurement description"); - InitMeasurement(neckBaseGirth_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "head_and_neck_length", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Head and Neck length", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Vertical Distance from Crown to Nape", - "Full measurement description"); - InitMeasurement(headAndNeckLength_M, m, g, d); - //================================================================================================================= - // torso - m = QmuTranslation::translate("Measurements", "center_front_waist_length", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Front Center length", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Front Neck Center over tape at Bustline to Front Waist " - "Center", "Full measurement description"); - InitMeasurement(centerFrontWaistLength_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "center_back_waist_length", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Back Center length", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Back Neck Center to Back Waist Center", - "Full measurement description"); - InitMeasurement(centerBackWaistLength_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "shoulder_length", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Shoulder length", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "NeckPoint to ShoulderTip", - "Full measurement description"); - InitMeasurement(shoulderLength_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "side_waist_length", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Side Waist length", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Armpit to Waist side", "Full measurement description"); - InitMeasurement(sideWaistLength_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "trunk_length", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Trunk length", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", - "Around Body from middle of Shoulder length to BustPoint to Crotch up back to " - "beginning point", "Full measurement description"); - InitMeasurement(trunkLength_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "shoulder_girth", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Shoulder girth", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Around Arms and Torso, at bicep level parallel to " - "floor, with arms hanging at the sides", "Full measurement description"); - InitMeasurement(shoulderGirth_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "upper_chest_girth", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Upper Chest girth", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Around Chest at Armfold level, will be parallel to " - "floor across back, will not be parallel to floor across front chest", - "Full measurement description"); - InitMeasurement(upperChestGirth_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "bust_girth", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Bust girth", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Around fullest part of Bust, parallel to floor", - "Full measurement description"); - InitMeasurement(bustGirth_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "under_bust_girth", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Under Bust girth", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Around Chest below the Bust, parallel to floor", - "Full measurement description"); - InitMeasurement(underBustGirth_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "waist_girth", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Waist girth", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Tie a string around smallest part of waist, keep string " - "tied while taking meaasurements. Not usually parallel to floor for front waist or " - "back waist.", - "Full measurement description"); - InitMeasurement(waistGirth_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "high_hip_girth", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "HighHip girth", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Around HighHip, parallel to floor", - "Full measurement description"); - InitMeasurement(highHipGirth_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "hip_girth", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Hip girth", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Around Hip, parallel to floor", - "Full measurement description"); - InitMeasurement(hipGirth_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "upper_front_chest_width", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Front Upper Chest width", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Across Front UpperChest, smallest width from armscye to " - "armscye", "Full measurement description"); - InitMeasurement(upperFrontChestWidth_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "front_chest_width", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Front Chest width", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Across Front Chest, from armfold to armfold", - "Full measurement description"); - InitMeasurement(frontChestWidth_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "across_front_shoulder_width", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Front Across Shoulder width", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "From ShoulderTip to ShoulderTip, across Front", - "Full measurement description"); - InitMeasurement(acrossFrontShoulderWidth_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "across_back_shoulder_width", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Back Across Shoulder width", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "From ShoulderTip to ShoulderTip, across Back", - "Full measurement description"); - InitMeasurement(acrossBackShoulderWidth_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "upper_back_width", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Back Upper Chest width", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Across Back UpperChest, smallest width from armscye to " - "armscye", "Full measurement description"); - InitMeasurement(upperBackWidth_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "back_width", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Back Chest width", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Across Back Chest, from armfold to armfold", - "Full measurement description"); - InitMeasurement(backWidth_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "bustpoint_to_bustpoint", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "BustPoint to BustPoint", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Distance between BustPoints, across Chest", - "Full measurement description"); - InitMeasurement(bustpointToBustpoint_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "halter_bustpoint_to_bustpoint", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Halter Bustpoint to Bustpoint", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Distance from Bustpoint, behind neck, down to Bustpoint", - "Full measurement description"); - InitMeasurement(halterBustpointToBustpoint_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "neck_to_bustpoint", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "NeckPoint to BustPoint", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "From NeckPoint to BustPoint", - "Full measurement description"); - InitMeasurement(neckToBustpoint_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "crotch_length", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Crotch length", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "From Front Waist Center, down to crotch, up to Back " - "Waist Center", "Full measurement description"); - InitMeasurement(crotchLength_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "rise_height", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Rise height", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Sit on hard chair, measure from side waist straight " - "down to chair bottom", "Full measurement description"); - InitMeasurement(riseHeight_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "shoulder_drop", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Shoulder Drop", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Vertical Distance from NeckPoint level to ShoulderTip " - "level", "Full measurement description"); - InitMeasurement(shoulderDrop_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "shoulder_slope_degrees", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Shoulder Slope degrees", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Degrees of angle from NeckPoint to ShoulderTip – " - "requires goniometer", "Full measurement description"); - InitMeasurement(shoulderSlopeDegrees_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "front_shoulder_slope_length", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Front Shoulder Balance", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "ShoulderTip to Front Waist Center", - "Full measurement description"); - InitMeasurement(frontShoulderSlopeLength_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "back_shoulder_slope_length", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Back Shoulder Balance", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "ShoulderTip to Back Waist Center", - "Full measurement description"); - InitMeasurement(backShoulderSlopeLength_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "front_shoulder_to_waist_length", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Front Full Length", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "NeckPoint straight down front chest to Waistline", - "Full measurement description"); - InitMeasurement(frontShoulderToWaistLength_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "back_shoulder_to_waist_length", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Back Full Length", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Back NeckPoint straight down back chest to Waistline", - "Full measurement description"); - InitMeasurement(backShoulderToWaistLength_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "front_neck_arc", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Front Neck arc", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "NeckPoint to NeckPoint through Front Neck Center", - "Full measurement description"); - InitMeasurement(frontNeckArc_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "back_neck_arc", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Back Neck arc", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "NeckPoint to NeckPoint across Nape", - "Full measurement description"); - InitMeasurement(backNeckArc_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "front_upper_chest_arc", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Front upper-bust arc", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Front upper-bust arc", "Full measurement description"); - InitMeasurement(frontUpperChestArc_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "back_upper_chest_arc", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Back UpperBust arc", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Back UpperBust side to side", - "Full measurement description"); - InitMeasurement(backUpperChestArc_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "front_waist_arc", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Front Waist arc", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Front Waist side to side", - "Full measurement description"); - InitMeasurement(frontWaistArc_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "back_waist_arc", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Back Waist arc", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Back Waist side to side", - "Full measurement description"); - InitMeasurement(backWaistArc_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "front_upper_hip_arc", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Front UpperHip arc", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Front UpperHip side to side", - "Full measurement description"); - InitMeasurement(frontUpperHipArc_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "back_upper_hip_arc", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Back UpperHip arc", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Back UpperHip side to side", - "Full measurement description"); - InitMeasurement(backUpperHipArc_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "front_hip_arc", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Front Hip arc", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Front Hip side to side", - "Full measurement description"); - InitMeasurement(frontHipArc_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "back_hip_arc", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Back Hip arc", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Back Hip side to side", "Full measurement description"); - InitMeasurement(backHipArc_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "chest_slope", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Chest Balance", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "NeckPoint to Front ArmfoldPoint", - "Full measurement description"); - InitMeasurement(chestSlope_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "back_slope", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Back Balance", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "NeckPoint to Back ArmfoldPoint", - "Full measurement description"); - InitMeasurement(backSlope_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "front_waist_slope", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Front Waist Balance", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "NeckPoint across Front Chest to Waist side", - "Full measurement description"); - InitMeasurement(frontWaistSlope_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "back_waist_slope", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Back Waist Balance", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "NeckPoint across Back Chest to Waist side", - "Full measurement description"); - InitMeasurement(backWaistSlope_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "front_neck_to_upper_chest_height", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Front UpperChest height", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Front Neck Center straight down to UpperChest line", - "Full measurement description"); - InitMeasurement(frontNeckToUpperChestHeight_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "front_neck_to_bust_height", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Bust height", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Front Neck Center straight down to Bust line", - "Full measurement description"); - InitMeasurement(frontNeckToBustHeight_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "front_waist_to_upper_chest", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Front Upper chest waist", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Front Upper chest waist", - "Full measurement description"); - InitMeasurement(frontWaistToUpperChest_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "front_waist_to_lower_breast", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Front waist to lower breast", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Front waist to lower breast", - "Full measurement description"); - InitMeasurement(frontWaistToLowerBreast_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "back_waist_to_upper_chest", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Back waist to upper chest", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Back waist to upper chest", - "Full measurement description"); - InitMeasurement(backWaistToUpperChest_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "strap_length", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Strap length", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Strap length", - "Full measurement description"); - InitMeasurement(strapLength_M, m, g, d); - //================================================================================================================= - // arm - m = QmuTranslation::translate("Measurements", "armscye_girth", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Armscye Girth", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Around Armscye", "Full measurement description"); - InitMeasurement(armscyeGirth_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "elbow_girth", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Elbow Girth", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Around Elbow with elbow bent", - "Full measurement description"); - InitMeasurement(elbowGirth_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "upper_arm_girth", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Upperarm Girth", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Around UpperArm", "Full measurement description"); - InitMeasurement(upperArmGirth_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "wrist_girth", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Wrist girth", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Around Wrist", "Full measurement description"); - InitMeasurement(wristGirth_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "scye_depth", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Armscye depth", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Nape straight down to UnderBust line (same as Back " - "UpperBust height)", "Full measurement description"); - InitMeasurement(scyeDepth_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "shoulder_and_arm_length", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Shoulder and Arm length", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "NeckPoint to ShoulderTip to Wrist, with elbow bent and " - "hand on hip", "Full measurement description"); - InitMeasurement(shoulderAndArmLength_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "underarm_length", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Underarm length", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Armpit to Wrist, with arm straight and hanging at side", - "Full measurement description"); - InitMeasurement(underarmLength_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "cervicale_to_wrist_length", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Nape to wrist length", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Nape to Wrist, with elbow bent and hand on hip", - "Full measurement description"); - InitMeasurement(cervicaleToWristLength_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "shoulder_to_elbow_length", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Elbow length", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "ShoulderTip to Elbow, with elbow bent and hand on hip", - "Full measurement description"); - InitMeasurement(shoulderToElbowLength_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "arm_length", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Arm length", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "ShoulderTip to Wrist, with elbow bent and hand on hip", - "Full measurement description"); - InitMeasurement(armLength_M, m, g, d); - //================================================================================================================= - // hand - m = QmuTranslation::translate("Measurements", "hand_width", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Hand width", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Hand side to side", "Full measurement description"); - InitMeasurement(handWidth_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "hand_length", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Hand length", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Hand Middle Finger tip to wrist", - "Full measurement description"); - InitMeasurement(handLength_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "hand_girth", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Hand girth", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Around Hand", "Full measurement description"); - InitMeasurement(handGirth_M, m, g, d); - //================================================================================================================= - // leg - m = QmuTranslation::translate("Measurements", "thigh_girth", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Thigh girth", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Around Thigh", "Full measurement description"); - InitMeasurement(thighGirth_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "mid_thigh_girth", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Midthigh girth", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Around MidThigh", "Full measurement description"); - InitMeasurement(midThighGirth_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "knee_girth", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Knee girth", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Around Knee", "Full measurement description"); - InitMeasurement(kneeGirth_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "calf_girth", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Calf girth", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Around Calf", "Full measurement description"); - InitMeasurement(calfGirth_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "ankle_girth", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Ankle girth", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Around Ankle", "Full measurement description"); - InitMeasurement(ankleGirth_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "knee_height", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Knee height", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Knee to Floor", "Full measurement description"); - InitMeasurement(kneeHeight_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "ankle_height", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Ankle height", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Ankle to Floor", "Full measurement description"); - InitMeasurement(ankleHeight_M, m, g, d); - //================================================================================================================= - // foot - m = QmuTranslation::translate("Measurements", "foot_width", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Foot width", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Widest part of Foot side to side", - "Full measurement description"); - InitMeasurement(footWidth_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "foot_length", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Foot length", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Tip of Longest Toe straight to back of heel", - "Full measurement description"); - InitMeasurement(footLength_M, m, g, d); - //================================================================================================================= - // heights - m = QmuTranslation::translate("Measurements", "height", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Total Height", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Top of head to floor", "Full measurement description"); - InitMeasurement(height_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "cervicale_height", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Nape height", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Nape to Floor", "Full measurement description"); - InitMeasurement(cervicaleHeight_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "cervicale_to_knee_height", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Nape to knee height", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Nape to Knee", "Full measurement description"); - InitMeasurement(cervicaleToKneeHeight_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "waist_height", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Waist height", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Waist side to floor", "Full measurement description"); - InitMeasurement(waistHeight_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "high_hip_height", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "HighHip height", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "HighHip side to Floor", "Full measurement description"); - InitMeasurement(highHipHeight_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "hip_height", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Hip height", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Hip side to Floor", "Full measurement description"); - InitMeasurement(hipHeight_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "waist_to_hip_height", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Waist to Hip height", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Waist side to Hip", "Full measurement description"); - InitMeasurement(waistToHipHeight_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "waist_to_knee_height", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Waist to Knee height", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Waist side to Knee", "Full measurement description"); - InitMeasurement(waistToKneeHeight_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "crotch_height", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Crotch height/Inseam", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Crotch to Floor along inside leg", - "Full measurement description"); - InitMeasurement(crotchHeight_M, m, g, d); - //================================================================================================================= - //extended - m = QmuTranslation::translate("Measurements", "size", "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Size", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Size", "Full measurement description"); - InitMeasurement(size_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "height_front_neck_base_point", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Height front neck base point", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Height of the point base of the neck in front", - "Full measurement description"); - InitMeasurement(heightFrontNeckBasePoint_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "height_base_neck_side_point", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Height base neck side point", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Height of the base of the neck side point", - "Full measurement description"); - InitMeasurement(heightBaseNeckSidePoint_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "height_shoulder_point", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Height shoulder point", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "The height of the shoulder point", - "Full measurement description"); - InitMeasurement(heightShoulderPoint_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "height_nipple_point", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Height nipple point", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Height nipple point", "Full measurement description"); - InitMeasurement(heightNipplePoint_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "height_back_angle_axilla", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Height back angle axilla", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Height back angle axilla", - "Full measurement description"); - InitMeasurement(heightBackAngleAxilla_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "height_scapular_point", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Height scapular point", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Height scapular point", "Full measurement description"); - InitMeasurement(heightScapularPoint_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "height_under_buttock_folds", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Height under buttock folds", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Height under buttock folds", - "Full measurement description"); - InitMeasurement(heightUnderButtockFolds_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "hips_excluding_protruding_abdomen", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Hips excluding protruding abdomen", - "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Hips excluding protruding abdomen", - "Full measurement description"); - InitMeasurement(hipsExcludingProtrudingAbdomen_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "girth_foot_instep", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Girth foot instep", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Girth foot instep", "Full measurement description"); - InitMeasurement(girthFootInstep_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "side_waist_to_floor", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Side waist to floor", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "The distance from the side waist to floor", - "Full measurement description"); - InitMeasurement(sideWaistToFloor_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "front_waist_to_floor", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Front waist to floor", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "The distance from the front waist to floor", - "Full measurement description"); - InitMeasurement(frontWaistToFloor_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "arc_through_groin_area", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Arc through groin area", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Arc through groin area", "Full measurement description"); - InitMeasurement(arcThroughGroinArea_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "waist_to_plane_seat", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Waist to plane seat", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "The distance from the waist to the plane seat", - "Full measurement description"); - InitMeasurement(waistToPlaneSeat_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "neck_to_radial_point", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Neck to radial point", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "The distance from the base of the neck to the side of " - "the radial point", "Full measurement description"); - InitMeasurement(neckToRadialPoint_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "neck_to_third_finger", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Neck to third finger", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Distance from the base of the neck side point to the " - "end of the third finger", "Full measurement description"); - InitMeasurement(neckToThirdFinger_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "neck_to_first_line_chest_circumference", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Neck to first line chest circumference", - "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "The distance from the base of the neck to the side of " - "the first line in front of chest circumference", "Full measurement description"); - InitMeasurement(neckToFirstLineChestCircumference_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "front_waist_length", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Front waist length", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "The distance from the base of the neck to the waist " - "side front (waist length in the front)", "Full measurement description"); - InitMeasurement(frontWaistLength_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "arc_through_shoulder_joint", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Arc through shoulder joint", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Arc through the highest point of the shoulder joint", - "Full measurement description"); - InitMeasurement(arcThroughShoulderJoint_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "neck_to_back_line_chest_circumference", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Neck to back line chest circumference", - "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "The distance from the base of the neck to the back line " - "of chest circumference of the first and the second based on ledge vanes", - "Full measurement description"); - InitMeasurement(neckToBackLineChestCircumference_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "waist_to_neck_side", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Waist to neck side", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "The distance from the waist to the back base of the " - "neck side point", "Full measurement description"); - InitMeasurement(waistToNeckSide_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "arc_length_upper_body", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Arc length upper body", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Arc length of the upper body through the base of the " - "neck side point", "Full measurement description"); - InitMeasurement(arcLengthUpperBody_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "chest_width", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Chest width", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Chest width", "Full measurement description"); - InitMeasurement(chestWidth_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "anteroposterior_diameter_hands", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Anteroposterior diameter hands", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Anteroposterior diameter of the hands", - "Full measurement description"); - InitMeasurement(anteroposteriorDiameterHands_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "height_clavicular_point", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Height clavicular point", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Height clavicular point", - "Full measurement description"); - InitMeasurement(heightClavicularPoint_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "height_armhole_slash", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Height armhole slash", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "The distance from the point to the cervical level of " - "the posterior angle of the front armpit (underarm height oblique)", - "Full measurement description"); - InitMeasurement(heightArmholeSlash_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "slash_shoulder_height", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Slash shoulder height", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Slash shoulder height", "Full measurement description"); - InitMeasurement(slashShoulderHeight_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "half_girth_neck", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Half girth neck", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Half girth neck", "Full measurement description"); - InitMeasurement(halfGirthNeck_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "half_girth_neck_for_shirts", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Half girth neck for shirts", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Half girth neck for shirts", - "Full measurement description"); - InitMeasurement(halfGirthNeckForShirts_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "half_girth_chest_first", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Half girth chest first", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Half girth chest first", "Full measurement description"); - InitMeasurement(halfGirthChestFirst_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "half_girth_chest_second", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Half girth chest second", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Half girth chest second", - "Full measurement description"); - InitMeasurement(halfGirthChestSecond_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "half_girth_chest_third", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Half girth chest third", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Half girth chest third", "Full measurement description"); - InitMeasurement(halfGirthChestThird_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "half_girth_waist", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Half girth waist", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Half girth waist", "Full measurement description"); - InitMeasurement(halfGirthWaist_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "half_girth_hips_considering_protruding_abdomen", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Half girth hips considering protruding abdomen", - "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Half girth hips considering protruding abdomen", - "Full measurement description"); - InitMeasurement(halfGirthHipsConsideringProtrudingAbdomen_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "half_girth_hips_excluding_protruding_abdomen", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Half girth hips excluding protruding abdomen", - "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Half girth hips excluding protruding abdomen", - "Full measurement description"); - InitMeasurement(halfGirthHipsExcludingProtrudingAbdomen_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "girth_knee_flexed_feet", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Girth knee flexed feet", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Girth knee flexed feet", "Full measurement description"); - InitMeasurement(girthKneeFlexedFeet_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "neck_transverse_diameter", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Neck transverse diameter", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Neck transverse diameter", - "Full measurement description"); - InitMeasurement(neckTransverseDiameter_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "front_slash_shoulder_height", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Front slash shoulder height", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Front slash shoulder height", - "Full measurement description"); - InitMeasurement(frontSlashShoulderHeight_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "neck_to_front_waist_line", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Neck to front waist line", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "The distance from the base of the neck to the waist " - "line front", "Full measurement description"); - InitMeasurement(neckToFrontWaistLine_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "hand_vertical_diameter", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Hand vertical diameter", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Hand vertical diameter", "Full measurement description"); - InitMeasurement(handVerticalDiameter_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "neck_to_knee_point", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Neck to knee point", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Distance from neck to knee point", - "Full measurement description"); - InitMeasurement(neckToKneePoint_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "waist_to_knee", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Waist to knee", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "The distance from the waist to the knee", - "Full measurement description"); - InitMeasurement(waistToKnee_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "shoulder_height", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Shoulder height", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Shoulder height", "Full measurement description"); - InitMeasurement(shoulderHeight_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "head_height", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Head height", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Head height", "Full measurement description"); - InitMeasurement(headHeight_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "body_position", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Body position", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Body position", "Full measurement description"); - InitMeasurement(bodyPosition_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "arc_behind_shoulder_girdle", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Arc behind shoulder girdle", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Arc behind the shoulder girdle", - "Full measurement description"); - InitMeasurement(arcBehindShoulderGirdle_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "neck_to_neck_base", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Neck to neck base", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Distance from neck point to point on the base of the " - "neck side neck girth measurement line", "Full measurement description"); - InitMeasurement(neckToNeckBase_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "depth_waist_first", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Depth waist first", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Depth waist first", "Full measurement description"); - InitMeasurement(depthWaistFirst_M, m, g, d); - //================================================================================================================= - m = QmuTranslation::translate("Measurements", "depth_waist_second", - "Short measurement name. Don't use math symbols in name!!!!"); - g = QmuTranslation::translate("MeasurementsFullNames", "Depth waist second", "Full measurement name"); - d = QmuTranslation::translate("MeasurementsDescriptions", "Depth waist second", "Full measurement description"); - InitMeasurement(depthWaistSecond_M, m, g, d); -} - -//--------------------------------------------------------------------------------------------------------------------- -void VApplication::InitVariables() -{ - variables.insert(line_, QmuTranslation::translate("Variables", "Line_", "Left symbol _ in name")); - variables.insert(angleLine_, QmuTranslation::translate("Variables", "AngleLine_", "Left symbol _ in name")); - variables.insert(arc_, QmuTranslation::translate("Variables", "Arc_", "Left symbol _ in name")); - variables.insert(spl_, QmuTranslation::translate("Variables", "Spl_", "Left symbol _ in name")); - variables.insert(splPath, QmuTranslation::translate("Variables", "SplPath", - "Do not add symbol _ to the end of name")); - variables.insert(radiusArc_, QmuTranslation::translate("Variables", "RadiusArc_", "Left symbol _ in name")); - variables.insert(angle1Arc_, QmuTranslation::translate("Variables", "Angle1Arc_", "Left symbol _ in name")); - variables.insert(angle2Arc_, QmuTranslation::translate("Variables", "Angle2Arc_", "Left symbol _ in name")); - variables.insert(angle1Spl_, QmuTranslation::translate("Variables", "Angle1Spl_", "Left symbol _ in name")); - variables.insert(angle2Spl_, QmuTranslation::translate("Variables", "Angle2Spl_", "Left symbol _ in name")); - variables.insert(angle1SplPath, QmuTranslation::translate("Variables", "Angle1SplPath", - "Do not add symbol _ to the end of name")); - variables.insert(angle2SplPath, QmuTranslation::translate("Variables", "Angle2SplPath", - "Do not add symbol _ to the end of name")); -} - -//--------------------------------------------------------------------------------------------------------------------- -void VApplication::InitFunctions() -{ - functions.insert(sin_F, QmuTranslation::translate("Functions", "sin", "sine function")); - functions.insert(cos_F, QmuTranslation::translate("Functions", "cos", "cosine function")); - functions.insert(tan_F, QmuTranslation::translate("Functions", "tan", "tangens function")); - functions.insert(asin_F, QmuTranslation::translate("Functions", "asin", "arcus sine function")); - functions.insert(acos_F, QmuTranslation::translate("Functions", "acos", "arcus cosine function")); - functions.insert(atan_F, QmuTranslation::translate("Functions", "atan", "arcus tangens function")); - functions.insert(sinh_F, QmuTranslation::translate("Functions", "sinh", "hyperbolic sine function")); - functions.insert(cosh_F, QmuTranslation::translate("Functions", "cosh", "hyperbolic cosine")); - functions.insert(tanh_F, QmuTranslation::translate("Functions", "tanh", "hyperbolic tangens function")); - functions.insert(asinh_F, QmuTranslation::translate("Functions", "asinh", "hyperbolic arcus sine function")); - functions.insert(acosh_F, QmuTranslation::translate("Functions", "acosh", "hyperbolic arcus tangens function")); - functions.insert(atanh_F, QmuTranslation::translate("Functions", "atanh", "hyperbolic arcur tangens function")); - functions.insert(log2_F, QmuTranslation::translate("Functions", "log2", "logarithm to the base 2")); - functions.insert(log10_F, QmuTranslation::translate("Functions", "log10", "logarithm to the base 10")); - functions.insert(log_F, QmuTranslation::translate("Functions", "log", "logarithm to the base 10")); - functions.insert(ln_F, QmuTranslation::translate("Functions", "ln", "logarithm to base e (2.71828...)")); - functions.insert(exp_F, QmuTranslation::translate("Functions", "exp", "e raised to the power of x")); - functions.insert(sqrt_F, QmuTranslation::translate("Functions", "sqrt", "square root of a value")); - functions.insert(sign_F, QmuTranslation::translate("Functions", "sign", "sign function -1 if x<0; 1 if x>0")); - functions.insert(rint_F, QmuTranslation::translate("Functions", "rint", "round to nearest integer")); - functions.insert(abs_F, QmuTranslation::translate("Functions", "abs", "absolute value")); - functions.insert(min_F, QmuTranslation::translate("Functions", "min", "min of all arguments")); - functions.insert(max_F, QmuTranslation::translate("Functions", "max", "max of all arguments")); - functions.insert(sum_F, QmuTranslation::translate("Functions", "sum", "sum of all arguments")); - functions.insert(avg_F, QmuTranslation::translate("Functions", "avg", "mean value of all arguments")); - functions.insert(fmod_F, QmuTranslation::translate("Functions", "fmod", - "Returns the floating-point remainder of numer/denom (rounded towards zero)")); -} - -//--------------------------------------------------------------------------------------------------------------------- -void VApplication::InitPostfixOperators() -{ - postfixOperators.insert(cm_Oprt, QmuTranslation::translate("PostfixOperators", "cm", "centimeter")); - postfixOperators.insert(mm_Oprt, QmuTranslation::translate("PostfixOperators", "mm", "millimeter")); - postfixOperators.insert(in_Oprt, QmuTranslation::translate("PostfixOperators", "in", "inch")); -} - -//--------------------------------------------------------------------------------------------------------------------- -void VApplication::InitSTDescriptions() -{ - stDescriptions.insert("0", QmuTranslation::translate("STDescriptions", - "Standard figures of men 1st group, chest 100 cm", - "Standard table description")); -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief VApplication::MeasurementsFromUser translate measurement to internal look. - * @param newFormula [in|out] expression to translate - * @param position token position - * @param token token to translate - * @param bias hold change of length between translated and origin token string - * @return true if was found measurement with same name. - */ -bool VApplication::MeasurementsFromUser(QString &newFormula, int position, const QString &token, int &bias) const -{ - QMap::const_iterator i = measurements.constBegin(); - while (i != measurements.constEnd()) - { - if (token == i.value().translate()) - { - newFormula.replace(position, token.length(), i.key()); - bias = token.length() - i.key().length(); - return true; - } - ++i; - } - return false; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief VApplication::VariablesFromUser translate variable to internal look. - * @param newFormula [in|out] expression to translate - * @param position token position - * @param token token to translate - * @param bias hold change of length between translated and origin token string - * @return true if was found variable with same name. - */ -bool VApplication::VariablesFromUser(QString &newFormula, int position, const QString &token, int &bias) const -{ - QMap::const_iterator i = variables.constBegin(); - while (i != variables.constEnd()) - { - if (token.indexOf( i.value().translate() ) == 0) - { - newFormula.replace(position, i.value().translate().length(), i.key()); - QString newToken = token; - newToken.replace(0, i.value().translate().length(), i.key()); - bias = token.length() - newToken.length(); - return true; - } - ++i; - } - return false; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief VApplication::PostfixOperatorsFromUser translate postfix operator to internal look. - * @param newFormula [in|out] expression to translate - * @param position token position - * @param token token to translate - * @param bias hold change of length between translated and origin token string - * @return true if was found postfix operator with same name. - */ -bool VApplication::PostfixOperatorsFromUser(QString &newFormula, int position, const QString &token, int &bias) const -{ - QMap::const_iterator i = postfixOperators.constBegin(); - while (i != postfixOperators.constEnd()) - { - if (token == i.value().translate()) - { - newFormula.replace(position, token.length(), i.key()); - bias = token.length() - i.key().length(); - return true; - } - ++i; - } - return false; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief VApplication::FunctionsFromUser translate function name to internal look. - * @param newFormula [in|out] expression to translate - * @param position token position - * @param token token to translate - * @param bias hold change of length between translated and origin token string - * @return true if was found function with same name. - */ -bool VApplication::FunctionsFromUser(QString &newFormula, int position, const QString &token, int &bias) const -{ - QMap::const_iterator i = functions.constBegin(); - while (i != functions.constEnd()) - { - if (token == i.value().translate()) - { - newFormula.replace(position, token.length(), i.key()); - bias = token.length() - i.key().length(); - return true; - } - ++i; - } - return false; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief VApplication::VariablesToUser translate variable name to user. - * @param newFormula [in|out] expression to translate - * @param position token position - * @param token token to translate - * @param bias hold change of length between translated and origin token string - * @return true if was found variable with same name. - */ -bool VApplication::VariablesToUser(QString &newFormula, int position, const QString &token, int &bias) const -{ - QMap::const_iterator i = variables.constBegin(); - while (i != variables.constEnd()) - { - if (token.indexOf( i.key() ) == 0) - { - newFormula.replace(position, i.key().length(), i.value().translate()); - - QString newToken = token; - newToken.replace(0, i.key().length(), i.value().translate()); - bias = token.length() - newToken.length(); - return true; - } - ++i; - } - return false; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief VApplication::CorrectionsPositions correct position tokens in expression after token translation. - * - * Because translated string can have different length compare to original need make correction after each translation. - * If bias = 0 correction will not happens. - * - * @param position position currecnt token in expression - * @param bias difference between original token length and translated - * @param tokens all tokens - * @param numbers all numbers - */ -void VApplication::CorrectionsPositions(int position, int bias, QMap &tokens, - QMap &numbers) -{ - if (bias == 0) - { - return;// Nothing to correct; - } - - BiasTokens(position, bias, tokens); - BiasTokens(position, bias, numbers); -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief VApplication::BiasTokens change position for each token that have position more then "position". - * @param position token position - * @param bias difference between original token length and translated - * @param tokens all tokens - */ -void VApplication::BiasTokens(int position, int bias, QMap &tokens) const -{ - QMap newTokens; - QMap::const_iterator i = tokens.constBegin(); - while (i != tokens.constEnd()) - { - if (i.key()<= position) - { // Tokens before position "position" did not change his positions. - newTokens.insert(i.key(), i.value()); - } - else - { - newTokens.insert(i.key()-bias, i.value()); - } - ++i; - } - tokens = newTokens; -} - //--------------------------------------------------------------------------------------------------------------------- void VApplication::setPatternUnit(const Unit &patternUnit) { @@ -1732,304 +548,6 @@ void VApplication::setPatternUnit(const Unit &patternUnit) InitLineWidth(); } -//--------------------------------------------------------------------------------------------------------------------- -QString VApplication::VarToUser(const QString &var) const -{ - if (measurements.contains(var)) - { - return measurements.value(var).translate(); - } - - if (functions.contains(var)) - { - return functions.value(var).translate(); - } - - if (postfixOperators.contains(var)) - { - return postfixOperators.value(var).translate(); - } - - QString newVar = var; - int bias = 0; - if (VariablesToUser(newVar, 0, var, bias)) - { - return newVar; - } - return newVar; -} - -//--------------------------------------------------------------------------------------------------------------------- -QString VApplication::VarFromUser(const QString &var) const -{ - QString newVar = var; - int bias = 0; - if (MeasurementsFromUser(newVar, 0, var, bias)) - { - return newVar; - } - - if (VariablesFromUser(newVar, 0, var, bias)) - { - return newVar; - } - - if (PostfixOperatorsFromUser(newVar, 0, var, bias)) - { - return newVar; - } - - if (FunctionsFromUser(newVar, 0, var, bias)) - { - return newVar; - } - return newVar; -} - -//--------------------------------------------------------------------------------------------------------------------- -QString VApplication::GuiText(const QString &measurement) const -{ - return guiTexts.value(measurement).translate(); -} - -//--------------------------------------------------------------------------------------------------------------------- -QString VApplication::Description(const QString &measurement) const -{ - return descriptions.value(measurement).translate(); -} - -//--------------------------------------------------------------------------------------------------------------------- -// cppcheck-suppress unusedFunction -QString VApplication::PostfixOperator(const QString &name) const -{ - return postfixOperators.value(name).translate(); -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief VApplication::FormulaFromUser replace all known tokens in formula to internal look. Also change decimal - * separator in numbers. - * @param formula expression that need translate - * @return translated expression - */ -QString VApplication::FormulaFromUser(const QString &formula) -{ - if (formula.isEmpty()) - { - return formula; - } - QString newFormula = formula;// Local copy for making changes - - Calculator *cal = new Calculator(formula);// Eval formula - QMap tokens = cal->GetTokens();// Tokens (variables, measurements) - QMap numbers = cal->GetNumbers();// All numbers in expression for changing decimal separator - delete cal; - - QList tKeys = tokens.keys();// Take all tokens positions - QList tValues = tokens.values(); - for (int i = 0; i < tKeys.size(); ++i) - { - int bias = 0; - if (MeasurementsFromUser(newFormula, tKeys.at(i), tValues.at(i), bias)) - { - if (bias != 0) - {// Translated token has different length than original. Position next tokens need to be corrected. - CorrectionsPositions(tKeys.at(i), bias, tokens, numbers); - tKeys = tokens.keys(); - tValues = tokens.values(); - } - continue; - } - - if (VariablesFromUser(newFormula, tKeys.at(i), tValues.at(i), bias)) - { - if (bias != 0) - {// Translated token has different length than original. Position next tokens need to be corrected. - CorrectionsPositions(tKeys.at(i), bias, tokens, numbers); - tKeys = tokens.keys(); - tValues = tokens.values(); - } - continue; - } - - if (PostfixOperatorsFromUser(newFormula, tKeys.at(i), tValues.at(i), bias)) - { - if (bias != 0) - {// Translated token has different length than original. Position next tokens need to be corrected. - CorrectionsPositions(tKeys.at(i), bias, tokens, numbers); - tKeys = tokens.keys(); - tValues = tokens.values(); - } - continue; - } - - if (FunctionsFromUser(newFormula, tKeys.at(i), tValues.at(i), bias)) - { - if (bias != 0) - {// Translated token has different length than original. Position next tokens need to be corrected. - CorrectionsPositions(tKeys.at(i), bias, tokens, numbers); - tKeys = tokens.keys(); - tValues = tokens.values(); - } - continue; - } - } - - QLocale loc = QLocale::system(); // User locale - if (loc != QLocale(QLocale::C) && getSettings()->GetOsSeparator()) - {// User want use Os separator - QList nKeys = numbers.keys();// Positions for all numbers in expression - QList nValues = numbers.values(); - for (int i = 0; i < nKeys.size(); ++i) - { - loc = QLocale::system();// From system locale - bool ok = false; - const qreal d = loc.toDouble(nValues.at(i), &ok); - if (ok == false) - { - qDebug()<<"Can't convert to double token"< tokens; - QMap numbers; - try - { - Calculator *cal = new Calculator(formula, false);// Eval formula - tokens = cal->GetTokens();// Tokens (variables, measurements) - numbers = cal->GetNumbers();// All numbers in expression for changing decimal separator - delete cal; - } - catch (qmu::QmuParserError &e) - { - qDebug() << "\nMath parser error:\n" - << "--------------------------------------\n" - << "Message: " << e.GetMsg() << "\n" - << "Expression: " << e.GetExpr() << "\n" - << "--------------------------------------"; - return newFormula; - } - - QList tKeys = tokens.keys(); - QList tValues = tokens.values(); - for (int i = 0; i < tKeys.size(); ++i) - { - if (measurements.contains(tValues.at(i))) - { - newFormula.replace(tKeys.at(i), tValues.at(i).length(), measurements.value(tValues.at(i)).translate()); - int bias = tValues.at(i).length() - measurements.value(tValues.at(i)).translate().length(); - if (bias != 0) - {// Translated token has different length than original. Position next tokens need to be corrected. - CorrectionsPositions(tKeys.at(i), bias, tokens, numbers); - tKeys = tokens.keys(); - tValues = tokens.values(); - } - continue; - } - - if (functions.contains(tValues.at(i))) - { - newFormula.replace(tKeys.at(i), tValues.at(i).length(), functions.value(tValues.at(i)).translate()); - int bias = tValues.at(i).length() - functions.value(tValues.at(i)).translate().length(); - if (bias != 0) - {// Translated token has different length than original. Position next tokens need to be corrected. - CorrectionsPositions(tKeys.at(i), bias, tokens, numbers); - tKeys = tokens.keys(); - tValues = tokens.values(); - } - continue; - } - - if (postfixOperators.contains(tValues.at(i))) - { - newFormula.replace(tKeys.at(i), tValues.at(i).length(), postfixOperators.value(tValues.at(i)).translate()); - int bias = tValues.at(i).length() - postfixOperators.value(tValues.at(i)).translate().length(); - if (bias != 0) - {// Translated token has different length than original. Position next tokens need to be corrected. - CorrectionsPositions(tKeys.at(i), bias, tokens, numbers); - tKeys = tokens.keys(); - tValues = tokens.values(); - } - continue; - } - - int bias = 0; - if (VariablesToUser(newFormula, tKeys.at(i), tValues.at(i), bias)) - { - if (bias != 0) - {// Translated token has different length than original. Position next tokens need to be corrected. - CorrectionsPositions(tKeys.at(i), bias, tokens, numbers); - tKeys = tokens.keys(); - tValues = tokens.values(); - } - continue; - } - } - - QLocale loc = QLocale::system();// User locale - if (loc != QLocale::C && getSettings()->GetOsSeparator()) - {// User want use Os separator - QList nKeys = numbers.keys();// Positions for all numbers in expression - QList nValues = numbers.values(); - for (int i = 0; i < nKeys.size(); ++i) - { - loc = QLocale(QLocale::C);// From pattern locale - bool ok = false; - const qreal d = loc.toDouble(nValues.at(i), &ok); - if (ok == false) - { - qDebug()<<"Can't convert to double token"< #include "../options.h" #include "../widgets/vmaingraphicsview.h" -#include "../../libs/qmuparser/qmutranslation.h" +#include "../container/vtranslatevars.h" #include "vsettings.h" class VApplication;// used in define @@ -79,14 +79,6 @@ public: QString translationsPath() const; qreal widthMainLine() const; qreal widthHairLine() const; - QString VarToUser(const QString &var) const; - QString VarFromUser(const QString &var) const; - QString GuiText(const QString &measurement) const; - QString Description(const QString &measurement) const; - QString PostfixOperator(const QString &name) const; - - QString FormulaFromUser(const QString &formula); - QString FormulaToUser(const QString &formula); template QString LocaleToString(const T &value) @@ -119,11 +111,13 @@ public: static void restoreOverrideCursor(const QString & pixmapPath); static QStringList LabelLanguages(); - QString STDescription(const QString &id)const; void StartLogging(); QTextStream *LogFile(); + const VTranslateVars *TrVars(); + void InitTrVars(); + #if defined(Q_OS_WIN) && defined(Q_CC_GNU) static void DrMingw(); @@ -141,13 +135,7 @@ private: MeasurementsType _patternType; qreal _widthMainLine; qreal _widthHairLine; - QMap measurements; - QMap guiTexts; - QMap descriptions; - QMap variables; - QMap functions; - QMap postfixOperators; - QMap stDescriptions; + VTranslateVars *trVars; QUndoStack *undoStack; VMainGraphicsView *sceneView; QGraphicsScene *currentScene; @@ -174,22 +162,6 @@ private: QLockFile *logLock; #endif void InitLineWidth(); - void InitMeasurements(); - void InitVariables(); - void InitFunctions(); - void InitPostfixOperators(); - void InitSTDescriptions(); - bool MeasurementsFromUser(QString &newFormula, int position, const QString &token, int &bias) const; - bool VariablesFromUser(QString &newFormula, int position, const QString &token, int &bias) const; - bool PostfixOperatorsFromUser(QString &newFormula, int position, const QString &token, - int &bias) const; - bool FunctionsFromUser(QString &newFormula, int position, const QString &token, int &bias) const; - bool VariablesToUser(QString &newFormula, int position, const QString &token, int &bias) const; - void CorrectionsPositions(int position, int bias, QMap &tokens, - QMap &numbers); - void BiasTokens(int position, int bias, QMap &tokens) const; - void InitMeasurement(const QString &name, const qmu::QmuTranslation &m, const qmu::QmuTranslation &g, - const qmu::QmuTranslation &d); #if defined(Q_OS_WIN) && defined(Q_CC_GNU) static const QString GistFileName; diff --git a/src/app/dialogs/app/dialogincrements.cpp b/src/app/dialogs/app/dialogincrements.cpp index 9be173577..d88e9e1bf 100644 --- a/src/app/dialogs/app/dialogincrements.cpp +++ b/src/app/dialogs/app/dialogincrements.cpp @@ -214,7 +214,7 @@ void DialogIncrements::FillMeasurements() if (qApp->patternType() == MeasurementsType::Standard) { QTableWidgetItem *item = new QTableWidgetItem(qApp->LocaleToString( - data->GetTableValue(qApp->VarFromUser(iMap.key())))); + data->GetTableValue(qApp->TrVars()->VarFromUser(iMap.key())))); item->setTextAlignment(Qt::AlignHCenter); SetItemViewOnly(item); ui->tableWidgetMeasurements->setItem(currentRow, 1, item);// calculated value @@ -915,7 +915,8 @@ void DialogIncrements::MeasurementChanged(qint32 row, qint32 column) const QTableWidgetItem *itemName = ui->tableWidgetMeasurements->item(row, 0);// name column QTableWidgetItem *item = ui->tableWidgetMeasurements->item(row, 2); - QSharedPointer measur = data->GetVariable(qApp->VarFromUser(itemName->text())); + QSharedPointer measur = data->GetVariable( + qApp->TrVars()->VarFromUser(itemName->text())); const QString tag = measur->TagName(); QDomNodeList list = m->elementsByTagName(tag); QDomElement domElement = list.at(0).toElement(); diff --git a/src/app/dialogs/tools/dialogalongline.cpp b/src/app/dialogs/tools/dialogalongline.cpp index d26e3e455..df922edd5 100644 --- a/src/app/dialogs/tools/dialogalongline.cpp +++ b/src/app/dialogs/tools/dialogalongline.cpp @@ -240,7 +240,7 @@ void DialogAlongLine::SetFirstPointId(const quint32 &value) */ void DialogAlongLine::SetFormula(const QString &value) { - formula = qApp->FormulaToUser(value); + formula = qApp->TrVars()->FormulaToUser(value); // increase height if needed. if (formula.length() > 80) { @@ -306,7 +306,7 @@ QString DialogAlongLine::GetTypeLine() const */ QString DialogAlongLine::GetFormula() const { - return qApp->FormulaFromUser(formula); + return qApp->TrVars()->FormulaFromUser(formula); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogarc.cpp b/src/app/dialogs/tools/dialogarc.cpp index 9b88f12fa..7ee1167c2 100644 --- a/src/app/dialogs/tools/dialogarc.cpp +++ b/src/app/dialogs/tools/dialogarc.cpp @@ -134,7 +134,7 @@ void DialogArc::SetCenter(const quint32 &value) */ void DialogArc::SetF2(const QString &value) { - f2 = qApp->FormulaToUser(value); + f2 = qApp->TrVars()->FormulaToUser(value); // increase height if needed. if (f2.length() > 80) { @@ -168,7 +168,7 @@ void DialogArc::SetColor(const QString &value) */ void DialogArc::SetF1(const QString &value) { - f1 = qApp->FormulaToUser(value); + f1 = qApp->TrVars()->FormulaToUser(value); // increase height if needed. if (f1.length() > 80) { @@ -190,7 +190,7 @@ void DialogArc::SetF1(const QString &value) */ void DialogArc::SetRadius(const QString &value) { - radius = qApp->FormulaToUser(value); + radius = qApp->TrVars()->FormulaToUser(value); // increase height if needed. if (radius.length() > 80) { @@ -424,7 +424,7 @@ quint32 DialogArc::GetCenter() const */ QString DialogArc::GetRadius() const { - return qApp->FormulaFromUser(radius); + return qApp->TrVars()->FormulaFromUser(radius); } //--------------------------------------------------------------------------------------------------------------------- @@ -434,7 +434,7 @@ QString DialogArc::GetRadius() const */ QString DialogArc::GetF1() const { - return qApp->FormulaFromUser(f1); + return qApp->TrVars()->FormulaFromUser(f1); } //--------------------------------------------------------------------------------------------------------------------- @@ -444,5 +444,5 @@ QString DialogArc::GetF1() const */ QString DialogArc::GetF2() const { - return qApp->FormulaFromUser(f2); + return qApp->TrVars()->FormulaFromUser(f2); } diff --git a/src/app/dialogs/tools/dialogarcwithlength.cpp b/src/app/dialogs/tools/dialogarcwithlength.cpp index f8d718081..37570b10a 100644 --- a/src/app/dialogs/tools/dialogarcwithlength.cpp +++ b/src/app/dialogs/tools/dialogarcwithlength.cpp @@ -109,13 +109,13 @@ void DialogArcWithLength::SetCenter(const quint32 &value) //--------------------------------------------------------------------------------------------------------------------- QString DialogArcWithLength::GetRadius() const { - return qApp->FormulaFromUser(radius); + return qApp->TrVars()->FormulaFromUser(radius); } //--------------------------------------------------------------------------------------------------------------------- void DialogArcWithLength::SetRadius(const QString &value) { - radius = qApp->FormulaToUser(value); + radius = qApp->TrVars()->FormulaToUser(value); // increase height if needed. if (radius.length() > 80) { @@ -133,12 +133,12 @@ void DialogArcWithLength::SetRadius(const QString &value) //--------------------------------------------------------------------------------------------------------------------- QString DialogArcWithLength::GetF1() const { - return qApp->FormulaFromUser(f1); + return qApp->TrVars()->FormulaFromUser(f1); } void DialogArcWithLength::SetF1(const QString &value) { - f1 = qApp->FormulaToUser(value); + f1 = qApp->TrVars()->FormulaToUser(value); // increase height if needed. if (f1.length() > 80) { @@ -156,13 +156,13 @@ void DialogArcWithLength::SetF1(const QString &value) //--------------------------------------------------------------------------------------------------------------------- QString DialogArcWithLength::GetLength() const { - return qApp->FormulaFromUser(length); + return qApp->TrVars()->FormulaFromUser(length); } //--------------------------------------------------------------------------------------------------------------------- void DialogArcWithLength::SetLength(const QString &value) { - length = qApp->FormulaToUser(value); + length = qApp->TrVars()->FormulaToUser(value); // increase height if needed. if (length.length() > 80) { diff --git a/src/app/dialogs/tools/dialogbisector.cpp b/src/app/dialogs/tools/dialogbisector.cpp index 402da2f1b..858e52274 100644 --- a/src/app/dialogs/tools/dialogbisector.cpp +++ b/src/app/dialogs/tools/dialogbisector.cpp @@ -230,7 +230,7 @@ void DialogBisector::SetTypeLine(const QString &value) */ void DialogBisector::SetFormula(const QString &value) { - formula = qApp->FormulaToUser(value); + formula = qApp->TrVars()->FormulaToUser(value); // increase height if needed. if (formula.length() > 80) { @@ -342,7 +342,7 @@ QString DialogBisector::GetTypeLine() const */ QString DialogBisector::GetFormula() const { - return qApp->FormulaFromUser(formula); + return qApp->TrVars()->FormulaFromUser(formula); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp b/src/app/dialogs/tools/dialogcurveintersectaxis.cpp index f1febff37..a5134227a 100644 --- a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp +++ b/src/app/dialogs/tools/dialogcurveintersectaxis.cpp @@ -99,13 +99,13 @@ void DialogCurveIntersectAxis::SetTypeLine(const QString &value) //--------------------------------------------------------------------------------------------------------------------- QString DialogCurveIntersectAxis::GetAngle() const { - return qApp->FormulaFromUser(formulaAngle); + return qApp->TrVars()->FormulaFromUser(formulaAngle); } //--------------------------------------------------------------------------------------------------------------------- void DialogCurveIntersectAxis::SetAngle(const QString &value) { - formulaAngle = qApp->FormulaToUser(value); + formulaAngle = qApp->TrVars()->FormulaToUser(value); // increase height if needed. TODO : see if I can get the max number of caracters in one line // of this PlainTextEdit to change 80 to this value if (formulaAngle.length() > 80) diff --git a/src/app/dialogs/tools/dialogcutarc.cpp b/src/app/dialogs/tools/dialogcutarc.cpp index 3a4a8a279..a66ffe870 100644 --- a/src/app/dialogs/tools/dialogcutarc.cpp +++ b/src/app/dialogs/tools/dialogcutarc.cpp @@ -183,7 +183,7 @@ void DialogCutArc::SetColor(const QString &value) */ void DialogCutArc::SetFormula(const QString &value) { - formula = qApp->FormulaToUser(value); + formula = qApp->TrVars()->FormulaToUser(value); // increase height if needed. if (formula.length() > 80) { @@ -216,7 +216,7 @@ void DialogCutArc::SetPointName(const QString &value) */ QString DialogCutArc::GetFormula() const { - return qApp->FormulaFromUser(formula); + return qApp->TrVars()->FormulaFromUser(formula); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogcutspline.cpp b/src/app/dialogs/tools/dialogcutspline.cpp index d2fae9c24..a9ccc1915 100644 --- a/src/app/dialogs/tools/dialogcutspline.cpp +++ b/src/app/dialogs/tools/dialogcutspline.cpp @@ -91,7 +91,7 @@ void DialogCutSpline::SetPointName(const QString &value) */ void DialogCutSpline::SetFormula(const QString &value) { - formula = qApp->FormulaToUser(value); + formula = qApp->TrVars()->FormulaToUser(value); // increase height if needed. TODO : see if I can get the max number of caracters in one line // of this PlainTextEdit to change 80 to this value if (formula.length() > 80) @@ -210,7 +210,7 @@ void DialogCutSpline::ShowVisualization() */ QString DialogCutSpline::GetFormula() const { - return qApp->FormulaFromUser(formula); + return qApp->TrVars()->FormulaFromUser(formula); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogcutsplinepath.cpp b/src/app/dialogs/tools/dialogcutsplinepath.cpp index 993b856c4..714c46962 100644 --- a/src/app/dialogs/tools/dialogcutsplinepath.cpp +++ b/src/app/dialogs/tools/dialogcutsplinepath.cpp @@ -91,7 +91,7 @@ void DialogCutSplinePath::SetPointName(const QString &value) */ void DialogCutSplinePath::SetFormula(const QString &value) { - formula = qApp->FormulaToUser(value); + formula = qApp->TrVars()->FormulaToUser(value); // increase height if needed. TODO : see if I can get the max number of caracters in one line // of this PlainTextEdit to change 80 to this value if (formula.length() > 80) @@ -210,7 +210,7 @@ void DialogCutSplinePath::ShowVisualization() */ QString DialogCutSplinePath::GetFormula() const { - return qApp->FormulaFromUser(formula); + return qApp->TrVars()->FormulaFromUser(formula); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogeditwrongformula.cpp b/src/app/dialogs/tools/dialogeditwrongformula.cpp index 90325da76..61769e145 100644 --- a/src/app/dialogs/tools/dialogeditwrongformula.cpp +++ b/src/app/dialogs/tools/dialogeditwrongformula.cpp @@ -135,7 +135,7 @@ void DialogEditWrongFormula::ValChenged(int row) } if (ui->radioButtonStandardTable->isChecked()) { - const QString name = qApp->VarFromUser(item->text()); + const QString name = qApp->TrVars()->VarFromUser(item->text()); const QSharedPointer stable = data->GetVariable(name); const QString desc = QString("%1(%2) - %3").arg(item->text()).arg(data->GetTableValue(name)) .arg(stable->GetGuiText()); @@ -153,56 +153,56 @@ void DialogEditWrongFormula::ValChenged(int row) if (ui->radioButtonLengthLine->isChecked()) { const QString desc = QString("%1(%2) - %3").arg(item->text()) - .arg(*data->GetVariable(qApp->VarFromUser(item->text()))->GetValue()) - .arg(tr("Line length")); + .arg(*data->GetVariable(qApp->TrVars()->VarFromUser(item->text()))->GetValue()) + .arg(tr("Line length")); ui->labelDescription->setText(desc); return; } if (ui->radioButtonLengthArc->isChecked()) { const QString desc = QString("%1(%2) - %3").arg(item->text()) - .arg(*data->GetVariable(qApp->VarFromUser(item->text()))->GetValue()) - .arg(tr("Arc length")); + .arg(*data->GetVariable(qApp->TrVars()->VarFromUser(item->text()))->GetValue()) + .arg(tr("Arc length")); ui->labelDescription->setText(desc); return; } if (ui->radioButtonLengthSpline->isChecked()) { const QString desc = QString("%1(%2) - %3").arg(item->text()) - .arg(*data->GetVariable(qApp->VarFromUser(item->text()))->GetValue()) - .arg(tr("Curve length")); + .arg(*data->GetVariable(qApp->TrVars()->VarFromUser(item->text()))->GetValue()) + .arg(tr("Curve length")); ui->labelDescription->setText(desc); return; } if (ui->radioButtonAngleLine->isChecked()) { const QString desc = QString("%1(%2) - %3").arg(item->text()) - .arg(*data->GetVariable(qApp->VarFromUser(item->text()))->GetValue()) - .arg(tr("Line Angle")); + .arg(*data->GetVariable(qApp->TrVars()->VarFromUser(item->text()))->GetValue()) + .arg(tr("Line Angle")); ui->labelDescription->setText(desc); return; } if (ui->radioButtonRadiusesArcs->isChecked()) { const QString desc = QString("%1(%2) - %3").arg(item->text()) - .arg(*data->GetVariable(qApp->VarFromUser(item->text()))->GetValue()) - .arg(tr("Arc radius")); + .arg(*data->GetVariable(qApp->TrVars()->VarFromUser(item->text()))->GetValue()) + .arg(tr("Arc radius")); ui->labelDescription->setText(desc); return; } if (ui->radioButtonAnglesArcs->isChecked()) { const QString desc = QString("%1(%2) - %3").arg(item->text()) - .arg(*data->GetVariable(qApp->VarFromUser(item->text()))->GetValue()) - .arg(tr("Arc angle")); + .arg(*data->GetVariable(qApp->TrVars()->VarFromUser(item->text()))->GetValue()) + .arg(tr("Arc angle")); ui->labelDescription->setText(desc); return; } if (ui->radioButtonAnglesCurves->isChecked()) { const QString desc = QString("%1(%2) - %3").arg(item->text()) - .arg(*data->GetVariable(qApp->VarFromUser(item->text()))->GetValue()) - .arg(tr("Curve angle")); + .arg(*data->GetVariable(qApp->TrVars()->VarFromUser(item->text()))->GetValue()) + .arg(tr("Curve angle")); ui->labelDescription->setText(desc); return; } @@ -357,7 +357,7 @@ void DialogEditWrongFormula::closeEvent(QCloseEvent *event) //--------------------------------------------------------------------------------------------------------------------- void DialogEditWrongFormula::SetFormula(const QString &value) { - formula = qApp->FormulaToUser(value); + formula = qApp->TrVars()->FormulaToUser(value); // increase height if needed. TODO : see if I can get the max number of caracters in one line // of this PlainTextEdit to change 80 to this value if (formula.length() > 80) @@ -383,7 +383,7 @@ void DialogEditWrongFormula::setPostfix(const QString &value) //--------------------------------------------------------------------------------------------------------------------- QString DialogEditWrongFormula::GetFormula() const { - return qApp->FormulaFromUser(formula); + return qApp->TrVars()->FormulaFromUser(formula); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogendline.cpp b/src/app/dialogs/tools/dialogendline.cpp index 57160defa..88e362040 100644 --- a/src/app/dialogs/tools/dialogendline.cpp +++ b/src/app/dialogs/tools/dialogendline.cpp @@ -195,7 +195,7 @@ void DialogEndLine::SetTypeLine(const QString &value) */ void DialogEndLine::SetFormula(const QString &value) { - formulaLength = qApp->FormulaToUser(value); + formulaLength = qApp->TrVars()->FormulaToUser(value); // increase height if needed. TODO : see if I can get the max number of caracters in one line // of this PlainTextEdit to change 80 to this value if (formulaLength.length() > 80) @@ -218,7 +218,7 @@ void DialogEndLine::SetFormula(const QString &value) */ void DialogEndLine::SetAngle(const QString &value) { - formulaAngle = qApp->FormulaToUser(value); + formulaAngle = qApp->TrVars()->FormulaToUser(value); // increase height if needed. TODO : see if I can get the max number of caracters in one line // of this PlainTextEdit to change 80 to this value if (formulaAngle.length() > 80) @@ -355,7 +355,7 @@ QString DialogEndLine::GetTypeLine() const */ QString DialogEndLine::GetFormula() const { - return qApp->FormulaFromUser(formulaLength); + return qApp->TrVars()->FormulaFromUser(formulaLength); } //--------------------------------------------------------------------------------------------------------------------- @@ -365,7 +365,7 @@ QString DialogEndLine::GetFormula() const */ QString DialogEndLine::GetAngle() const { - return qApp->FormulaFromUser(formulaAngle); + return qApp->TrVars()->FormulaFromUser(formulaAngle); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.cpp b/src/app/dialogs/tools/dialoglineintersectaxis.cpp index 9143047c1..153028627 100644 --- a/src/app/dialogs/tools/dialoglineintersectaxis.cpp +++ b/src/app/dialogs/tools/dialoglineintersectaxis.cpp @@ -107,13 +107,13 @@ void DialogLineIntersectAxis::SetTypeLine(const QString &value) //--------------------------------------------------------------------------------------------------------------------- QString DialogLineIntersectAxis::GetAngle() const { - return qApp->FormulaFromUser(formulaAngle); + return qApp->TrVars()->FormulaFromUser(formulaAngle); } //--------------------------------------------------------------------------------------------------------------------- void DialogLineIntersectAxis::SetAngle(const QString &value) { - formulaAngle = qApp->FormulaToUser(value); + formulaAngle = qApp->TrVars()->FormulaToUser(value); // increase height if needed. TODO : see if I can get the max number of caracters in one line // of this PlainTextEdit to change 80 to this value if (formulaAngle.length() > 80) diff --git a/src/app/dialogs/tools/dialognormal.cpp b/src/app/dialogs/tools/dialognormal.cpp index edbee2001..8d8b79e40 100644 --- a/src/app/dialogs/tools/dialognormal.cpp +++ b/src/app/dialogs/tools/dialognormal.cpp @@ -261,7 +261,7 @@ void DialogNormal::SetAngle(const qreal &value) */ void DialogNormal::SetFormula(const QString &value) { - formula = qApp->FormulaToUser(value); + formula = qApp->TrVars()->FormulaToUser(value); // increase height if needed. if (formula.length() > 80) { @@ -315,7 +315,7 @@ QString DialogNormal::GetTypeLine() const */ QString DialogNormal::GetFormula() const { - return qApp->FormulaFromUser(formula); + return qApp->TrVars()->FormulaFromUser(formula); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogpointfromcircleandtangent.cpp b/src/app/dialogs/tools/dialogpointfromcircleandtangent.cpp index 40988afd4..03cecf995 100644 --- a/src/app/dialogs/tools/dialogpointfromcircleandtangent.cpp +++ b/src/app/dialogs/tools/dialogpointfromcircleandtangent.cpp @@ -111,13 +111,13 @@ void DialogPointFromCircleAndTangent::SetCircleCenterId(const quint32 &value) //--------------------------------------------------------------------------------------------------------------------- QString DialogPointFromCircleAndTangent::GetCircleRadius() const { - return qApp->FormulaFromUser(ui->plainTextEditRadius->toPlainText()); + return qApp->TrVars()->FormulaFromUser(ui->plainTextEditRadius->toPlainText()); } //--------------------------------------------------------------------------------------------------------------------- void DialogPointFromCircleAndTangent::SetCircleRadius(const QString &value) { - const QString formula = qApp->FormulaToUser(value); + const QString formula = qApp->TrVars()->FormulaToUser(value); // increase height if needed. if (formula.length() > 80) { diff --git a/src/app/dialogs/tools/dialogpointofcontact.cpp b/src/app/dialogs/tools/dialogpointofcontact.cpp index 0dbd1de0d..0e796f900 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.cpp +++ b/src/app/dialogs/tools/dialogpointofcontact.cpp @@ -271,7 +271,7 @@ void DialogPointOfContact::setCenter(const quint32 &value) */ void DialogPointOfContact::setRadius(const QString &value) { - radius = qApp->FormulaToUser(value); + radius = qApp->TrVars()->FormulaToUser(value); // increase height if needed. if (radius.length() > 80) { @@ -304,7 +304,7 @@ void DialogPointOfContact::SetPointName(const QString &value) */ QString DialogPointOfContact::getRadius() const { - return qApp->FormulaFromUser(radius); + return qApp->TrVars()->FormulaFromUser(radius); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogpointofintersectioncircles.cpp b/src/app/dialogs/tools/dialogpointofintersectioncircles.cpp index 770a5dd41..d97546eef 100644 --- a/src/app/dialogs/tools/dialogpointofintersectioncircles.cpp +++ b/src/app/dialogs/tools/dialogpointofintersectioncircles.cpp @@ -143,13 +143,13 @@ void DialogPointOfIntersectionCircles::SetSecondCircleCenterId(const quint32 &va //--------------------------------------------------------------------------------------------------------------------- QString DialogPointOfIntersectionCircles::GetFirstCircleRadius() const { - return qApp->FormulaFromUser(ui->plainTextEditCircle1Radius->toPlainText()); + return qApp->TrVars()->FormulaFromUser(ui->plainTextEditCircle1Radius->toPlainText()); } //--------------------------------------------------------------------------------------------------------------------- void DialogPointOfIntersectionCircles::SetFirstCircleRadius(const QString &value) { - const QString formula = qApp->FormulaToUser(value); + const QString formula = qApp->TrVars()->FormulaToUser(value); // increase height if needed. if (formula.length() > 80) { @@ -167,13 +167,13 @@ void DialogPointOfIntersectionCircles::SetFirstCircleRadius(const QString &value //--------------------------------------------------------------------------------------------------------------------- QString DialogPointOfIntersectionCircles::GetSecondCircleRadius() const { - return qApp->FormulaFromUser(ui->plainTextEditCircle2Radius->toPlainText()); + return qApp->TrVars()->FormulaFromUser(ui->plainTextEditCircle2Radius->toPlainText()); } //--------------------------------------------------------------------------------------------------------------------- void DialogPointOfIntersectionCircles::SetSecondCircleRadius(const QString &value) { - const QString formula = qApp->FormulaToUser(value); + const QString formula = qApp->TrVars()->FormulaToUser(value); // increase height if needed. if (formula.length() > 80) { diff --git a/src/app/dialogs/tools/dialogshoulderpoint.cpp b/src/app/dialogs/tools/dialogshoulderpoint.cpp index 09bae04ab..f1db9e5ad 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.cpp +++ b/src/app/dialogs/tools/dialogshoulderpoint.cpp @@ -288,7 +288,7 @@ void DialogShoulderPoint::SetP1Line(const quint32 &value) */ void DialogShoulderPoint::SetFormula(const QString &value) { - formula = qApp->FormulaToUser(value); + formula = qApp->TrVars()->FormulaToUser(value); // increase height if needed. if (formula.length() > 80) { @@ -341,7 +341,7 @@ QString DialogShoulderPoint::GetTypeLine() const */ QString DialogShoulderPoint::GetFormula() const { - return qApp->FormulaFromUser(formula); + return qApp->TrVars()->FormulaFromUser(formula); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogtool.cpp b/src/app/dialogs/tools/dialogtool.cpp index cedbfdae4..e8e64a717 100644 --- a/src/app/dialogs/tools/dialogtool.cpp +++ b/src/app/dialogs/tools/dialogtool.cpp @@ -460,7 +460,7 @@ 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->FormulaFromUser(formula);// Translate to internal look. + formula = qApp->TrVars()->FormulaFromUser(formula);// Translate to internal look. Calculator *cal = new Calculator(data); result = cal->EvalFormula(formula); delete cal; diff --git a/src/app/main.cpp b/src/app/main.cpp index 0bbb8004a..03f087598 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -105,6 +105,8 @@ int main(int argc, char *argv[]) appTranslator.load("valentina_" + checkedLocale, qApp->translationsPath()); app.installTranslator(&appTranslator); + app.InitTrVars();//Very important do it after load QM files. + static const char * GENERIC_ICON_TO_CHECK = "document-open"; if (QIcon::hasThemeIcon(GENERIC_ICON_TO_CHECK) == false) { diff --git a/src/app/tools/drawTools/vtoolalongline.cpp b/src/app/tools/drawTools/vtoolalongline.cpp index 0bc69c320..e2c927473 100644 --- a/src/app/tools/drawTools/vtoolalongline.cpp +++ b/src/app/tools/drawTools/vtoolalongline.cpp @@ -136,7 +136,7 @@ void VToolAlongLine::SetVisualization() SCASSERT(visual != nullptr) visual->setPoint1Id(basePointId); visual->setPoint2Id(secondPointId); - visual->setLength(qApp->FormulaToUser(formulaLength)); + visual->setLength(qApp->TrVars()->FormulaToUser(formulaLength)); visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); } diff --git a/src/app/tools/drawTools/vtoolarc.cpp b/src/app/tools/drawTools/vtoolarc.cpp index 30776e08f..b80d642e7 100644 --- a/src/app/tools/drawTools/vtoolarc.cpp +++ b/src/app/tools/drawTools/vtoolarc.cpp @@ -345,9 +345,9 @@ void VToolArc::SetVisualization() SCASSERT(visual != nullptr) visual->setPoint1Id(arc->GetCenter().id()); - visual->setRadius(qApp->FormulaToUser(arc->GetFormulaRadius())); - visual->setF1(qApp->FormulaToUser(arc->GetFormulaF1())); - visual->setF2(qApp->FormulaToUser(arc->GetFormulaF2())); + visual->setRadius(qApp->TrVars()->FormulaToUser(arc->GetFormulaRadius())); + visual->setF1(qApp->TrVars()->FormulaToUser(arc->GetFormulaF1())); + visual->setF2(qApp->TrVars()->FormulaToUser(arc->GetFormulaF2())); visual->RefreshGeometry(); } } diff --git a/src/app/tools/drawTools/vtoolarcwithlength.cpp b/src/app/tools/drawTools/vtoolarcwithlength.cpp index 176d6b3a7..8386360ac 100644 --- a/src/app/tools/drawTools/vtoolarcwithlength.cpp +++ b/src/app/tools/drawTools/vtoolarcwithlength.cpp @@ -302,9 +302,9 @@ void VToolArcWithLength::SetVisualization() SCASSERT(visual != nullptr) visual->setPoint1Id(arc->GetCenter().id()); - visual->setRadius(qApp->FormulaToUser(arc->GetFormulaRadius())); - visual->setF1(qApp->FormulaToUser(arc->GetFormulaF1())); - visual->setLength(qApp->FormulaToUser(arc->GetFormulaLength())); + visual->setRadius(qApp->TrVars()->FormulaToUser(arc->GetFormulaRadius())); + visual->setF1(qApp->TrVars()->FormulaToUser(arc->GetFormulaF1())); + visual->setLength(qApp->TrVars()->FormulaToUser(arc->GetFormulaLength())); visual->RefreshGeometry(); } } diff --git a/src/app/tools/drawTools/vtoolbisector.cpp b/src/app/tools/drawTools/vtoolbisector.cpp index 497115c17..c439ed48f 100644 --- a/src/app/tools/drawTools/vtoolbisector.cpp +++ b/src/app/tools/drawTools/vtoolbisector.cpp @@ -296,7 +296,7 @@ void VToolBisector::SetVisualization() visual->setPoint1Id(firstPointId); visual->setPoint2Id(basePointId); visual->setPoint3Id(thirdPointId); - visual->setLength(qApp->FormulaToUser(formulaLength)); + visual->setLength(qApp->TrVars()->FormulaToUser(formulaLength)); visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); } diff --git a/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp b/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp index 0c45bc0c1..1132a9452 100644 --- a/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp +++ b/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp @@ -269,7 +269,7 @@ void VToolCurveIntersectAxis::SetVisualization() visual->setPoint1Id(curveId); visual->setAxisPointId(basePointId); - visual->SetAngle(qApp->FormulaToUser(formulaAngle)); + visual->SetAngle(qApp->TrVars()->FormulaToUser(formulaAngle)); visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); } diff --git a/src/app/tools/drawTools/vtoolcutarc.cpp b/src/app/tools/drawTools/vtoolcutarc.cpp index 8f1a35d89..ddd61441d 100644 --- a/src/app/tools/drawTools/vtoolcutarc.cpp +++ b/src/app/tools/drawTools/vtoolcutarc.cpp @@ -269,7 +269,7 @@ void VToolCutArc::SetVisualization() SCASSERT(visual != nullptr); visual->setPoint1Id(curveCutId); - visual->setLength(qApp->FormulaToUser(formula)); + visual->setLength(qApp->TrVars()->FormulaToUser(formula)); visual->RefreshGeometry(); } } diff --git a/src/app/tools/drawTools/vtoolcutspline.cpp b/src/app/tools/drawTools/vtoolcutspline.cpp index baa132c12..5ecdf1772 100644 --- a/src/app/tools/drawTools/vtoolcutspline.cpp +++ b/src/app/tools/drawTools/vtoolcutspline.cpp @@ -279,7 +279,7 @@ void VToolCutSpline::SetVisualization() SCASSERT(visual != nullptr); visual->setPoint1Id(curveCutId); - visual->setLength(qApp->FormulaToUser(formula)); + visual->setLength(qApp->TrVars()->FormulaToUser(formula)); visual->RefreshGeometry(); } } diff --git a/src/app/tools/drawTools/vtoolcutsplinepath.cpp b/src/app/tools/drawTools/vtoolcutsplinepath.cpp index 71bd85353..5ef0291f4 100644 --- a/src/app/tools/drawTools/vtoolcutsplinepath.cpp +++ b/src/app/tools/drawTools/vtoolcutsplinepath.cpp @@ -325,7 +325,7 @@ void VToolCutSplinePath::SetVisualization() SCASSERT(visual != nullptr); visual->setPoint1Id(curveCutId); - visual->setLength(qApp->FormulaToUser(formula)); + visual->setLength(qApp->TrVars()->FormulaToUser(formula)); visual->RefreshGeometry(); } } diff --git a/src/app/tools/drawTools/vtoolendline.cpp b/src/app/tools/drawTools/vtoolendline.cpp index 05296f911..3bb4ab45c 100644 --- a/src/app/tools/drawTools/vtoolendline.cpp +++ b/src/app/tools/drawTools/vtoolendline.cpp @@ -231,8 +231,8 @@ void VToolEndLine::SetVisualization() SCASSERT(visual != nullptr); visual->setPoint1Id(basePointId); - visual->setLength(qApp->FormulaToUser(formulaLength)); - visual->SetAngle(qApp->FormulaToUser(formulaAngle)); + visual->setLength(qApp->TrVars()->FormulaToUser(formulaLength)); + visual->SetAngle(qApp->TrVars()->FormulaToUser(formulaAngle)); visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); } diff --git a/src/app/tools/drawTools/vtoollineintersectaxis.cpp b/src/app/tools/drawTools/vtoollineintersectaxis.cpp index 492609bf2..be4dc5ab5 100644 --- a/src/app/tools/drawTools/vtoollineintersectaxis.cpp +++ b/src/app/tools/drawTools/vtoollineintersectaxis.cpp @@ -285,7 +285,7 @@ void VToolLineIntersectAxis::SetVisualization() visual->setPoint1Id(firstPointId); visual->setPoint2Id(secondPointId); visual->setAxisPointId(basePointId); - visual->SetAngle(qApp->FormulaToUser(formulaAngle)); + visual->SetAngle(qApp->TrVars()->FormulaToUser(formulaAngle)); visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); } diff --git a/src/app/tools/drawTools/vtoolnormal.cpp b/src/app/tools/drawTools/vtoolnormal.cpp index ab244d951..598645ba6 100644 --- a/src/app/tools/drawTools/vtoolnormal.cpp +++ b/src/app/tools/drawTools/vtoolnormal.cpp @@ -272,7 +272,7 @@ void VToolNormal::SetVisualization() visual->setPoint1Id(basePointId); visual->setPoint2Id(secondPointId); - visual->setLength(qApp->FormulaToUser(formulaLength)); + visual->setLength(qApp->TrVars()->FormulaToUser(formulaLength)); visual->SetAngle(angle); visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); diff --git a/src/app/tools/drawTools/vtoolpointofcontact.cpp b/src/app/tools/drawTools/vtoolpointofcontact.cpp index 1db6b2292..043920482 100644 --- a/src/app/tools/drawTools/vtoolpointofcontact.cpp +++ b/src/app/tools/drawTools/vtoolpointofcontact.cpp @@ -313,7 +313,7 @@ void VToolPointOfContact::SetVisualization() visual->setPoint1Id(firstPointId); visual->setLineP2Id(secondPointId); visual->setRadiusId(center); - visual->setRadius(qApp->FormulaToUser(arcRadius)); + visual->setRadius(qApp->TrVars()->FormulaToUser(arcRadius)); visual->RefreshGeometry(); } } diff --git a/src/app/tools/drawTools/vtoolshoulderpoint.cpp b/src/app/tools/drawTools/vtoolshoulderpoint.cpp index 2165bdd40..1af652200 100644 --- a/src/app/tools/drawTools/vtoolshoulderpoint.cpp +++ b/src/app/tools/drawTools/vtoolshoulderpoint.cpp @@ -300,7 +300,7 @@ void VToolShoulderPoint::SetVisualization() visual->setPoint1Id(pShoulder); visual->setLineP1Id(basePointId); visual->setLineP2Id(p2Line); - visual->setLength(qApp->FormulaToUser(formulaLength)); + visual->setLength(qApp->TrVars()->FormulaToUser(formulaLength)); visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); } diff --git a/src/app/visualization/visualization.cpp b/src/app/visualization/visualization.cpp index f14f3a9c7..fdac90ee9 100644 --- a/src/app/visualization/visualization.cpp +++ b/src/app/visualization/visualization.cpp @@ -145,7 +145,7 @@ qreal Visualization::FindVal(const QString &expression) // Replace line return with spaces for calc if exist QString formula = expression; formula.replace("\n", " "); - formula = qApp->FormulaFromUser(formula); + formula = qApp->TrVars()->FormulaFromUser(formula); Calculator *cal = new Calculator(Visualization::data); val = cal->EvalFormula(formula); delete cal; diff --git a/src/app/xml/vindividualmeasurements.cpp b/src/app/xml/vindividualmeasurements.cpp index 580b57a85..de7ff2ba6 100644 --- a/src/app/xml/vindividualmeasurements.cpp +++ b/src/app/xml/vindividualmeasurements.cpp @@ -70,7 +70,8 @@ void VIndividualMeasurements::ReadMeasurement(const QDomElement &domElement, con { qreal value = GetParametrDouble(domElement, AttrValue, "0.0"); value = UnitConvertor(value, MUnit(), qApp->patternUnit()); - data->AddVariable(tag, new VMeasurement(tag, value, qApp->GuiText(tag), qApp->Description(tag), tag)); + data->AddVariable(tag, new VMeasurement(tag, value, qApp->TrVars()->GuiText(tag), + qApp->TrVars()->Description(tag), tag)); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/xml/vstandardmeasurements.cpp b/src/app/xml/vstandardmeasurements.cpp index 49424aca2..5cf706ac0 100644 --- a/src/app/xml/vstandardmeasurements.cpp +++ b/src/app/xml/vstandardmeasurements.cpp @@ -64,7 +64,7 @@ QString VStandardMeasurements::OrigDescription () //--------------------------------------------------------------------------------------------------------------------- QString VStandardMeasurements::TrDescription() { - const QString trDesc = qApp->STDescription(Id()); + const QString trDesc = qApp->TrVars()->STDescription(Id()); if (trDesc.isEmpty() == false) { return trDesc; @@ -115,8 +115,8 @@ void VStandardMeasurements::ReadMeasurement(const QDomElement &domElement, const qWarning()<<"Standard table can't use inch unit."; } - data->AddVariable(tag, new VMeasurement(tag, value, size_increase, height_increase, qApp->GuiText(tag), - qApp->Description(tag), tag)); + data->AddVariable(tag, new VMeasurement(tag, value, size_increase, height_increase, qApp->TrVars()->GuiText(tag), + qApp->TrVars()->Description(tag), tag)); } From 4c7033492ac4aefb359831285dea0d908f3ee7ad Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 11 Jun 2015 15:24:38 +0300 Subject: [PATCH 02/10] Refactoring. --HG-- branch : feature --- src/app/core/vapplication.cpp | 64 +++++++++++++++++++++++++++++++++ src/app/core/vapplication.h | 2 ++ src/app/main.cpp | 68 +---------------------------------- 3 files changed, 67 insertions(+), 67 deletions(-) diff --git a/src/app/core/vapplication.cpp b/src/app/core/vapplication.cpp index 7d54a830b..63bfefc49 100644 --- a/src/app/core/vapplication.cpp +++ b/src/app/core/vapplication.cpp @@ -548,6 +548,70 @@ void VApplication::setPatternUnit(const Unit &patternUnit) InitLineWidth(); } +//--------------------------------------------------------------------------------------------------------------------- +void VApplication::InitOptions() +{ + setApplicationDisplayName(VER_PRODUCTNAME_STR); + setApplicationName(VER_INTERNALNAME_STR); + setOrganizationName(VER_COMPANYNAME_STR); + setOrganizationDomain(VER_COMPANYDOMAIN_STR); + // Setting the Application version + setApplicationVersion(APP_VERSION_STR); + + OpenSettings(); + +#if defined(Q_OS_WIN) && defined(Q_CC_GNU) + // Catch and send report + VApplication::DrMingw(); + this->CollectReports(); +#endif + + // Run creation log after sending crash report + StartLogging(); + + qDebug()<<"Version:"<arguments(); + qDebug()<<"Process ID:"<applicationPid(); + + const QString checkedLocale = getSettings()->GetLocale(); + qDebug()<<"Checked locale:"<load("qt_" + checkedLocale, translationsPath()); +#else + qtTranslator->load("qt_" + checkedLocale, QLibraryInfo::location(QLibraryInfo::TranslationsPath)); +#endif + installTranslator(qtTranslator); + + QTranslator *qtxmlTranslator = new QTranslator(this); +#if defined(Q_OS_WIN) + qtxmlTranslator->load("qtxmlpatterns_" + checkedLocale, translationsPath()); +#else + qtxmlTranslator->load("qtxmlpatterns_" + checkedLocale, QLibraryInfo::location(QLibraryInfo::TranslationsPath)); +#endif + installTranslator(qtxmlTranslator); + + QTranslator *appTranslator = new QTranslator(this); + appTranslator->load("valentina_" + checkedLocale, translationsPath()); + installTranslator(appTranslator); + + InitTrVars();//Very important do it after load QM files. + + static const char * GENERIC_ICON_TO_CHECK = "document-open"; + if (QIcon::hasThemeIcon(GENERIC_ICON_TO_CHECK) == false) + { + //If there is no default working icon theme then we should + //use an icon theme that we provide via a .qrc file + //This case happens under Windows and Mac OS X + //This does not happen under GNOME or KDE + QIcon::setThemeName("win.icon.theme"); + } +} + //--------------------------------------------------------------------------------------------------------------------- QWidget *VApplication::getMainWindow() const { diff --git a/src/app/core/vapplication.h b/src/app/core/vapplication.h index cc3f469ae..1afbea2f0 100644 --- a/src/app/core/vapplication.h +++ b/src/app/core/vapplication.h @@ -66,6 +66,8 @@ public: MeasurementsType patternType() const; void setPatternType(const MeasurementsType &patternType); + void InitOptions(); + double toPixel(double val, const Unit &unit) const; double toPixel(double val) const; double fromPixel(double pix, const Unit &unit) const; diff --git a/src/app/main.cpp b/src/app/main.cpp index 03f087598..6a35142bf 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -28,19 +28,12 @@ #include "mainwindow.h" #include "core/vapplication.h" -#include "core/vsettings.h" -#include "version.h" -#include -#include -#include #if QT_VERSION < QT_VERSION_CHECK(5, 2, 0) # include "../core/backport/qcommandlineparser.h" #else # include #endif -#include -#include //--------------------------------------------------------------------------------------------------------------------- int main(int argc, char *argv[]) @@ -56,66 +49,7 @@ int main(int argc, char *argv[]) QT_REQUIRE_VERSION(argc, argv, "5.0.0"); VApplication app(argc, argv); - - app.setApplicationDisplayName(VER_PRODUCTNAME_STR); - app.setApplicationName(VER_INTERNALNAME_STR); - app.setOrganizationName(VER_COMPANYNAME_STR); - app.setOrganizationDomain(VER_COMPANYDOMAIN_STR); - // Setting the Application version - app.setApplicationVersion(APP_VERSION_STR); - - app.OpenSettings(); - -#if defined(Q_OS_WIN) && defined(Q_CC_GNU) - // Catch and send report - VApplication::DrMingw(); - app.CollectReports(); -#endif - - // Run creation log after sending crash report - app.StartLogging(); - - qDebug()<<"Version:"<getSettings()->GetLocale(); - qDebug()<<"Checked locale:"<translationsPath()); -#else - qtTranslator.load("qt_" + checkedLocale, QLibraryInfo::location(QLibraryInfo::TranslationsPath)); -#endif - app.installTranslator(&qtTranslator); - - QTranslator qtxmlTranslator; -#if defined(Q_OS_WIN) - qtxmlTranslator.load("qtxmlpatterns_" + checkedLocale, qApp->translationsPath()); -#else - qtxmlTranslator.load("qtxmlpatterns_" + checkedLocale, QLibraryInfo::location(QLibraryInfo::TranslationsPath)); -#endif - app.installTranslator(&qtxmlTranslator); - - QTranslator appTranslator; - appTranslator.load("valentina_" + checkedLocale, qApp->translationsPath()); - app.installTranslator(&appTranslator); - - app.InitTrVars();//Very important do it after load QM files. - - static const char * GENERIC_ICON_TO_CHECK = "document-open"; - if (QIcon::hasThemeIcon(GENERIC_ICON_TO_CHECK) == false) - { - //If there is no default working icon theme then we should - //use an icon theme that we provide via a .qrc file - //This case happens under Windows and Mac OS X - //This does not happen under GNOME or KDE - QIcon::setThemeName("win.icon.theme"); - } + app.InitOptions(); MainWindow w; app.setWindowIcon(QIcon(":/icon/64x64/icon64x64.png")); From 8e8422c5fdbad8260465e8a2ca5fd06e25c469d7 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 11 Jun 2015 15:40:43 +0300 Subject: [PATCH 03/10] Refactoring. VContainer is more independent now. --HG-- branch : feature --- src/app/container/vcontainer.cpp | 12 ++++++------ src/app/container/vcontainer.h | 15 ++++++++++----- src/app/dialogs/app/dialogincrements.cpp | 5 +++-- src/app/dialogs/tools/dialogeditwrongformula.cpp | 6 ++++-- src/app/mainwindowsnogui.cpp | 2 +- 5 files changed, 24 insertions(+), 16 deletions(-) diff --git a/src/app/container/vcontainer.cpp b/src/app/container/vcontainer.cpp index bfc72a4ea..928d03c9a 100644 --- a/src/app/container/vcontainer.cpp +++ b/src/app/container/vcontainer.cpp @@ -27,10 +27,10 @@ *************************************************************************/ #include "vcontainer.h" -#include "../core/vapplication.h" #include "../libs/vgeometry/varc.h" #include "../libs/vgeometry/vsplinepath.h" #include "../../utils/logging.h" +#include "vtranslatevars.h" #include #include @@ -47,8 +47,8 @@ QSet VContainer::uniqueNames = QSet(); /** * @brief VContainer create empty container */ -VContainer::VContainer() - :d(new VContainerData) +VContainer::VContainer(const VTranslateVars *trVars) + :d(new VContainerData(trVars)) {} //--------------------------------------------------------------------------------------------------------------------- @@ -384,10 +384,10 @@ void VContainer::UpdateDetail(quint32 id, const VDetail &detail) } //--------------------------------------------------------------------------------------------------------------------- -qreal VContainer::GetTableValue(const QString &name) const +qreal VContainer::GetTableValue(const QString &name, MeasurementsType patternType) const { QSharedPointer m = GetVariable(name); - if (qApp->patternType() == MeasurementsType::Standard) + if (patternType == MeasurementsType::Standard) { m->SetValue(size(), height()); } @@ -489,7 +489,7 @@ const QMap > VContainer::DataVar(const VarType &type) if (i.value()->GetType() == type) { QSharedPointer var = GetVariable(i.key()); - map.insert(qApp->TrVars()->VarToUser(i.key()), var); + map.insert(d->trVars->VarToUser(i.key()), var); } } return map; diff --git a/src/app/container/vcontainer.h b/src/app/container/vcontainer.h index d0caf76c6..2ec693afd 100644 --- a/src/app/container/vcontainer.h +++ b/src/app/container/vcontainer.h @@ -40,6 +40,8 @@ #include #include +class VTranslateVars; + #ifdef Q_CC_GNU #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Weffc++" @@ -49,14 +51,15 @@ class VContainerData : public QSharedData { public: - VContainerData() + VContainerData(const VTranslateVars *trVars) :sizeName(size_M), heightName(height_M), gObjects(QHash >()), - variables(QHash > ()), details(QHash()) + variables(QHash > ()), details(QHash()), + trVars(trVars) {} VContainerData(const VContainerData &data) :QSharedData(data), sizeName(data.sizeName), heightName(data.heightName), gObjects(data.gObjects), - variables(data.variables), details(data.details) + variables(data.variables), details(data.details), trVars(data.trVars) {} virtual ~VContainerData(); @@ -76,6 +79,8 @@ public: * @brief details container of details */ QHash details; + + const VTranslateVars *trVars; }; #ifdef Q_CC_GNU @@ -89,7 +94,7 @@ class VContainer { Q_DECLARE_TR_FUNCTIONS(VContainer) public: - VContainer(); + VContainer(const VTranslateVars *trVars); VContainer &operator=(const VContainer &data); VContainer(const VContainer &data); ~VContainer(); @@ -98,7 +103,7 @@ public: const QSharedPointer GeometricObject(const quint32 &id) const; const QSharedPointer GetGObject(quint32 id) const; const VDetail GetDetail(quint32 id) const; - qreal GetTableValue(const QString& name) const; + qreal GetTableValue(const QString& name, MeasurementsType patternType) const; template QSharedPointer GetVariable(QString name) const; static quint32 getId(); diff --git a/src/app/dialogs/app/dialogincrements.cpp b/src/app/dialogs/app/dialogincrements.cpp index d88e9e1bf..e1c0ae2ac 100644 --- a/src/app/dialogs/app/dialogincrements.cpp +++ b/src/app/dialogs/app/dialogincrements.cpp @@ -214,7 +214,8 @@ void DialogIncrements::FillMeasurements() if (qApp->patternType() == MeasurementsType::Standard) { QTableWidgetItem *item = new QTableWidgetItem(qApp->LocaleToString( - data->GetTableValue(qApp->TrVars()->VarFromUser(iMap.key())))); + data->GetTableValue(qApp->TrVars()->VarFromUser(iMap.key()), + qApp->patternType()))); item->setTextAlignment(Qt::AlignHCenter); SetItemViewOnly(item); ui->tableWidgetMeasurements->setItem(currentRow, 1, item);// calculated value @@ -286,7 +287,7 @@ void DialogIncrements::FillIncrements() if (qApp->patternType() == MeasurementsType::Standard) { - item = new QTableWidgetItem(qApp->LocaleToString(data->GetTableValue(iMap.value()))); + item = new QTableWidgetItem(qApp->LocaleToString(data->GetTableValue(iMap.value(), qApp->patternType()))); item->setTextAlignment(Qt::AlignHCenter); SetItemViewOnly(item); ui->tableWidgetIncrement->setItem(currentRow, 1, item); diff --git a/src/app/dialogs/tools/dialogeditwrongformula.cpp b/src/app/dialogs/tools/dialogeditwrongformula.cpp index 61769e145..c009b5819 100644 --- a/src/app/dialogs/tools/dialogeditwrongformula.cpp +++ b/src/app/dialogs/tools/dialogeditwrongformula.cpp @@ -137,7 +137,8 @@ void DialogEditWrongFormula::ValChenged(int row) { const QString name = qApp->TrVars()->VarFromUser(item->text()); const QSharedPointer stable = data->GetVariable(name); - const QString desc = QString("%1(%2) - %3").arg(item->text()).arg(data->GetTableValue(name)) + const QString desc = QString("%1(%2) - %3").arg(item->text()) + .arg(data->GetTableValue(name, qApp->patternType())) .arg(stable->GetGuiText()); ui->labelDescription->setText(desc); return; @@ -145,7 +146,8 @@ void DialogEditWrongFormula::ValChenged(int row) if (ui->radioButtonIncrements->isChecked()) { const QSharedPointer incr = data->GetVariable(item->text()); - const QString desc = QString("%1(%2) - %3").arg(item->text()).arg(data->GetTableValue(item->text())) + const QString desc = QString("%1(%2) - %3").arg(item->text()) + .arg(data->GetTableValue(item->text(), qApp->patternType())) .arg(incr->GetDescription()); ui->labelDescription->setText(desc); return; diff --git a/src/app/mainwindowsnogui.cpp b/src/app/mainwindowsnogui.cpp index b289d9f83..28e837907 100644 --- a/src/app/mainwindowsnogui.cpp +++ b/src/app/mainwindowsnogui.cpp @@ -57,7 +57,7 @@ //--------------------------------------------------------------------------------------------------------------------- MainWindowsNoGUI::MainWindowsNoGUI(QWidget *parent) : QMainWindow(parent), listDetails(QVector()), currentScene(nullptr), tempSceneLayout(nullptr), - pattern(new VContainer()), doc(nullptr), papers(QList()), shadows(QList()), + pattern(new VContainer(qApp->TrVars())), doc(nullptr), papers(QList()), shadows(QList()), scenes(QList()), details(QList >()), undoAction(nullptr), redoAction(nullptr), actionDockWidgetToolOptions(nullptr), curFile(QString()), isLayoutStale(true), isTiled(false) { From 0322457ece1f7aed8d1df801289b28be27837b44 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 11 Jun 2015 20:36:17 +0300 Subject: [PATCH 04/10] Refactoring. Make class VDetail more independent. --HG-- branch : feature --- src/app/container/vcontainer.cpp | 10 ++- src/app/container/vcontainer.h | 11 ++-- src/app/core/vapplication.cpp | 64 ++++--------------- src/app/core/vapplication.h | 10 ++- src/app/dialogs/app/dialoglayoutsettings.cpp | 16 ++--- .../tools/dialogcurveintersectaxis.cpp | 2 +- src/app/dialogs/tools/dialogendline.cpp | 2 +- .../dialogs/tools/dialoglineintersectaxis.cpp | 2 +- src/app/geometry/vdetail.cpp | 9 +-- src/app/mainwindowsnogui.cpp | 25 ++++---- src/app/tools/drawTools/vtoolpoint.cpp | 4 +- src/app/tools/nodeDetails/vnodepoint.cpp | 4 +- src/app/visualization/vcontrolpointspline.cpp | 2 +- src/app/visualization/visualization.cpp | 2 +- src/app/xml/vabstractmeasurements.cpp | 12 ++-- src/libs/ifc/ifc.pri | 3 +- src/libs/ifc/ifcdef.cpp | 31 +++++++++ src/libs/ifc/ifcdef.h | 40 ++++++++++++ 18 files changed, 148 insertions(+), 101 deletions(-) create mode 100644 src/libs/ifc/ifcdef.cpp diff --git a/src/app/container/vcontainer.cpp b/src/app/container/vcontainer.cpp index 928d03c9a..921c65f4c 100644 --- a/src/app/container/vcontainer.cpp +++ b/src/app/container/vcontainer.cpp @@ -47,8 +47,8 @@ QSet VContainer::uniqueNames = QSet(); /** * @brief VContainer create empty container */ -VContainer::VContainer(const VTranslateVars *trVars) - :d(new VContainerData(trVars)) +VContainer::VContainer(const VTranslateVars *trVars, const Unit *patternUnit) + :d(new VContainerData(trVars, patternUnit)) {} //--------------------------------------------------------------------------------------------------------------------- @@ -465,6 +465,12 @@ bool VContainer::IsUnique(const QString &name) return (!uniqueNames.contains(name) && !builInFunctions.contains(name)); } +//--------------------------------------------------------------------------------------------------------------------- +const Unit *VContainer::GetPatternUnit() const +{ + return d->patternUnit; +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief VariableExist check if exist variable this same name. diff --git a/src/app/container/vcontainer.h b/src/app/container/vcontainer.h index 2ec693afd..cd4d4dd89 100644 --- a/src/app/container/vcontainer.h +++ b/src/app/container/vcontainer.h @@ -51,15 +51,15 @@ class VContainerData : public QSharedData { public: - VContainerData(const VTranslateVars *trVars) + VContainerData(const VTranslateVars *trVars, const Unit *patternUnit) :sizeName(size_M), heightName(height_M), gObjects(QHash >()), variables(QHash > ()), details(QHash()), - trVars(trVars) + trVars(trVars), patternUnit(patternUnit) {} VContainerData(const VContainerData &data) :QSharedData(data), sizeName(data.sizeName), heightName(data.heightName), gObjects(data.gObjects), - variables(data.variables), details(data.details), trVars(data.trVars) + variables(data.variables), details(data.details), trVars(data.trVars), patternUnit(data.patternUnit) {} virtual ~VContainerData(); @@ -81,6 +81,7 @@ public: QHash details; const VTranslateVars *trVars; + const Unit *patternUnit; }; #ifdef Q_CC_GNU @@ -94,7 +95,7 @@ class VContainer { Q_DECLARE_TR_FUNCTIONS(VContainer) public: - VContainer(const VTranslateVars *trVars); + VContainer(const VTranslateVars *trVars, const Unit *patternUnit); VContainer &operator=(const VContainer &data); VContainer(const VContainer &data); ~VContainer(); @@ -159,6 +160,8 @@ public: static bool IsUnique(const QString &name); + const Unit *GetPatternUnit() const; + private: /** * @brief _id current id. New object will have value +1. For empty class equal 0. diff --git a/src/app/core/vapplication.cpp b/src/app/core/vapplication.cpp index 63bfefc49..ccbbeb309 100644 --- a/src/app/core/vapplication.cpp +++ b/src/app/core/vapplication.cpp @@ -143,8 +143,6 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con //--------------------------------------------------------------------------------------------------------------------- -const qreal VApplication::PrintDPI = 96.0; - #if defined(Q_OS_WIN) && defined(Q_CC_GNU) const QString VApplication::GistFileName = QStringLiteral("gist.json"); #endif // defined(Q_OS_WIN) && defined(Q_CC_GNU) @@ -288,56 +286,6 @@ bool VApplication::notify(QObject *receiver, QEvent *event) return false; } -//--------------------------------------------------------------------------------------------------------------------- -double VApplication::toPixel(double val, const Unit &unit) const -{ - switch (unit) - { - case Unit::Mm: - return (val / 25.4) * PrintDPI; - case Unit::Cm: - return ((val * 10.0) / 25.4) * PrintDPI; - case Unit::Inch: - return val * PrintDPI; - case Unit::Px: - return val; - default: - break; - } - return 0; -} - -//--------------------------------------------------------------------------------------------------------------------- -double VApplication::toPixel(double val) const -{ - return toPixel(val, _patternUnit); -} - -//--------------------------------------------------------------------------------------------------------------------- -double VApplication::fromPixel(double pix, const Unit &unit) const -{ - switch (unit) - { - case Unit::Mm: - return (pix / PrintDPI) * 25.4; - case Unit::Cm: - return ((pix / PrintDPI) * 25.4) / 10.0; - case Unit::Inch: - return pix / PrintDPI; - case Unit::Px: - return pix; - default: - break; - } - return 0; -} - -//--------------------------------------------------------------------------------------------------------------------- -double VApplication::fromPixel(double pix) const -{ - return fromPixel(pix, _patternUnit); -} - #if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0) //--------------------------------------------------------------------------------------------------------------------- bool VApplication::TryLock(QLockFile *lock) @@ -612,6 +560,18 @@ void VApplication::InitOptions() } } +//--------------------------------------------------------------------------------------------------------------------- +double VApplication::toPixel(double val) const +{ + return ToPixel(val, _patternUnit); +} + +//--------------------------------------------------------------------------------------------------------------------- +double VApplication::fromPixel(double pix) const +{ + return FromPixel(pix, _patternUnit); +} + //--------------------------------------------------------------------------------------------------------------------- QWidget *VApplication::getMainWindow() const { diff --git a/src/app/core/vapplication.h b/src/app/core/vapplication.h index 1afbea2f0..e8a89c5f9 100644 --- a/src/app/core/vapplication.h +++ b/src/app/core/vapplication.h @@ -62,22 +62,20 @@ public: static void CheckFactor(qreal &oldFactor, const qreal &Newfactor); virtual bool notify(QObject * receiver, QEvent * event); Unit patternUnit() const; + const Unit *patternUnitP() const; void setPatternUnit(const Unit &patternUnit); MeasurementsType patternType() const; void setPatternType(const MeasurementsType &patternType); void InitOptions(); - double toPixel(double val, const Unit &unit) const; double toPixel(double val) const; - double fromPixel(double pix, const Unit &unit) const; double fromPixel(double pix) const; #if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0) static bool TryLock(QLockFile *lock); #endif //QT_VERSION >= QT_VERSION_CHECK(5, 1, 0) - static const qreal PrintDPI; QString translationsPath() const; qreal widthMainLine() const; qreal widthHairLine() const; @@ -188,6 +186,12 @@ inline Unit VApplication::patternUnit() const return _patternUnit; } +//--------------------------------------------------------------------------------------------------------------------- +inline const Unit *VApplication::patternUnitP() const +{ + return &_patternUnit; +} + //--------------------------------------------------------------------------------------------------------------------- inline MeasurementsType VApplication::patternType() const { diff --git a/src/app/dialogs/app/dialoglayoutsettings.cpp b/src/app/dialogs/app/dialoglayoutsettings.cpp index aa380e119..f840af433 100644 --- a/src/app/dialogs/app/dialoglayoutsettings.cpp +++ b/src/app/dialogs/app/dialoglayoutsettings.cpp @@ -254,8 +254,8 @@ void DialogLayoutSettings::ConvertPaperSize() const qreal width = ui->doubleSpinBoxPaperWidth->value(); const qreal height = ui->doubleSpinBoxPaperHeight->value(); - ui->doubleSpinBoxPaperWidth->setMaximum(qApp->fromPixel(QIMAGE_MAX, paperUnit)); - ui->doubleSpinBoxPaperHeight->setMaximum(qApp->fromPixel(QIMAGE_MAX, paperUnit)); + 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)); @@ -271,8 +271,8 @@ void DialogLayoutSettings::ConvertLayoutSize() const qreal layoutWidth = ui->doubleSpinBoxLayoutWidth->value(); const qreal shift = ui->doubleSpinBoxShift->value(); - ui->doubleSpinBoxLayoutWidth->setMaximum(qApp->fromPixel(QIMAGE_MAX, unit)); - ui->doubleSpinBoxShift->setMaximum(qApp->fromPixel(QIMAGE_MAX, unit)); + 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)); @@ -389,7 +389,7 @@ void DialogLayoutSettings::InitTemplates() { const QIcon icoPaper("://icon/16x16/template.png"); const QIcon icoRoll("://icon/16x16/roll.png"); - const QString pdi = QString("(%1ppi)").arg(VApplication::PrintDPI); + const QString pdi = QString("(%1ppi)").arg(PrintDPI); ui->comboBoxTemplates->addItem(icoPaper, "A0 "+pdi, QVariant(static_cast(PaperSizeTemplate::A0))); ui->comboBoxTemplates->addItem(icoPaper, "A1 "+pdi, QVariant(static_cast(PaperSizeTemplate::A1))); @@ -582,7 +582,7 @@ void DialogLayoutSettings::Label() Unit::Px)); const int height = qFloor(VAbstractMeasurements::UnitConvertor(ui->doubleSpinBoxPaperHeight->value(), PaperUnit(), Unit::Px)); - QString text = QString("%1 x %2 px, \n%3 ppi").arg(width).arg(height).arg(VApplication::PrintDPI); + QString text = QString("%1 x %2 px, \n%3 ppi").arg(width).arg(height).arg(PrintDPI); ui->labelSizeDescription->setText(text); } @@ -645,8 +645,8 @@ void DialogLayoutSettings::WriteSettings() const void DialogLayoutSettings::SheetSize(const QSizeF &size) { oldPaperUnit = PaperUnit(); - ui->doubleSpinBoxPaperWidth->setMaximum(qApp->fromPixel(QIMAGE_MAX, oldPaperUnit)); - ui->doubleSpinBoxPaperHeight->setMaximum(qApp->fromPixel(QIMAGE_MAX, oldPaperUnit)); + ui->doubleSpinBoxPaperWidth->setMaximum(FromPixel(QIMAGE_MAX, oldPaperUnit)); + ui->doubleSpinBoxPaperHeight->setMaximum(FromPixel(QIMAGE_MAX, oldPaperUnit)); ui->doubleSpinBoxPaperWidth->setValue(size.width()); ui->doubleSpinBoxPaperHeight->setValue(size.height()); diff --git a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp b/src/app/dialogs/tools/dialogcurveintersectaxis.cpp index a5134227a..62aa33b15 100644 --- a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp +++ b/src/app/dialogs/tools/dialogcurveintersectaxis.cpp @@ -179,7 +179,7 @@ void DialogCurveIntersectAxis::ShowDialog(bool click) QLineF line = QLineF(point->toQPointF(), scene->getScenePos()); //Radius of point circle, but little bigger. Need handle with hover sizes. - qreal radius = qApp->toPixel(DefPointRadius/*mm*/, Unit::Mm)*1.5; + qreal radius = ToPixel(DefPointRadius/*mm*/, Unit::Mm)*1.5; if (line.length() <= radius) { return; diff --git a/src/app/dialogs/tools/dialogendline.cpp b/src/app/dialogs/tools/dialogendline.cpp index 88e362040..91ec9114a 100644 --- a/src/app/dialogs/tools/dialogendline.cpp +++ b/src/app/dialogs/tools/dialogendline.cpp @@ -278,7 +278,7 @@ void DialogEndLine::ShowDialog(bool click) QLineF line = QLineF(point->toQPointF(), scene->getScenePos()); //Radius of point circle, but little bigger. Need handle with hover sizes. - qreal radius = qApp->toPixel(DefPointRadius/*mm*/, Unit::Mm)*1.5; + qreal radius = ToPixel(DefPointRadius/*mm*/, Unit::Mm)*1.5; if (line.length() <= radius) { return; diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.cpp b/src/app/dialogs/tools/dialoglineintersectaxis.cpp index 153028627..60c399fde 100644 --- a/src/app/dialogs/tools/dialoglineintersectaxis.cpp +++ b/src/app/dialogs/tools/dialoglineintersectaxis.cpp @@ -203,7 +203,7 @@ void DialogLineIntersectAxis::ShowDialog(bool click) QLineF line = QLineF(point->toQPointF(), scene->getScenePos()); //Radius of point circle, but little bigger. Need handle with hover sizes. - qreal radius = qApp->toPixel(DefPointRadius/*mm*/, Unit::Mm)*1.5; + qreal radius = ToPixel(DefPointRadius/*mm*/, Unit::Mm)*1.5; if (line.length() <= radius) { return; diff --git a/src/app/geometry/vdetail.cpp b/src/app/geometry/vdetail.cpp index 72ced0fa1..c902c8f97 100644 --- a/src/app/geometry/vdetail.cpp +++ b/src/app/geometry/vdetail.cpp @@ -29,8 +29,7 @@ #include "vdetail.h" #include "vdetail_p.h" #include "../container/vcontainer.h" -#include "vpointf.h" -#include "../core/vapplication.h" +#include "../libs/vgeometry/vpointf.h" #include #include @@ -428,11 +427,13 @@ QVector VDetail::SeamAllowancePoints(const VContainer *data) const if (getClosed() == true) { - pointsEkv = Equidistant(pointsEkv, EquidistantType::CloseEquidistant, qApp->toPixel(getWidth())); + pointsEkv = Equidistant(pointsEkv, EquidistantType::CloseEquidistant, ToPixel(getWidth(), + *data->GetPatternUnit())); } else { - pointsEkv = Equidistant(pointsEkv, EquidistantType::OpenEquidistant, qApp->toPixel(getWidth())); + pointsEkv = Equidistant(pointsEkv, EquidistantType::OpenEquidistant, ToPixel(getWidth(), + *data->GetPatternUnit())); } return pointsEkv; } diff --git a/src/app/mainwindowsnogui.cpp b/src/app/mainwindowsnogui.cpp index 28e837907..f12399b06 100644 --- a/src/app/mainwindowsnogui.cpp +++ b/src/app/mainwindowsnogui.cpp @@ -57,9 +57,10 @@ //--------------------------------------------------------------------------------------------------------------------- MainWindowsNoGUI::MainWindowsNoGUI(QWidget *parent) : QMainWindow(parent), listDetails(QVector()), currentScene(nullptr), tempSceneLayout(nullptr), - pattern(new VContainer(qApp->TrVars())), doc(nullptr), papers(QList()), shadows(QList()), - scenes(QList()), details(QList >()), undoAction(nullptr), - redoAction(nullptr), actionDockWidgetToolOptions(nullptr), curFile(QString()), isLayoutStale(true), isTiled(false) + pattern(new VContainer(qApp->TrVars(), qApp->patternUnitP())), doc(nullptr), papers(QList()), + shadows(QList()), scenes(QList()), details(QList >()), + undoAction(nullptr), redoAction(nullptr), actionDockWidgetToolOptions(nullptr), curFile(QString()), + isLayoutStale(true), isTiled(false) { InitTempLayoutScene(); } @@ -502,7 +503,7 @@ void MainWindowsNoGUI::SvgFile(const QString &name, int i) const generator.setViewBox(paper->rect()); generator.setTitle("Valentina. Pattern layout"); generator.setDescription(doc->GetDescription()); - generator.setResolution(static_cast(qApp->PrintDPI)); + generator.setResolution(static_cast(PrintDPI)); QPainter painter; painter.begin(&generator); painter.setFont( QFont( "Arial", 8, QFont::Normal ) ); @@ -556,7 +557,7 @@ void MainWindowsNoGUI::PdfFile(const QString &name, int i) const printer.setOutputFileName(name); printer.setDocName(FileName()); const QRectF r = paper->rect(); - printer.setResolution(static_cast(qApp->PrintDPI)); + printer.setResolution(static_cast(PrintDPI)); // Set orientation if (paper->rect().height()>= paper->rect().width()) { @@ -566,7 +567,7 @@ void MainWindowsNoGUI::PdfFile(const QString &name, int i) const { printer.setOrientation(QPrinter::Landscape); } - printer.setPaperSize ( QSizeF(qApp->fromPixel(r.width(), Unit::Mm), qApp->fromPixel(r.height(), Unit::Mm)), + printer.setPaperSize ( QSizeF(FromPixel(r.width(), Unit::Mm), FromPixel(r.height(), Unit::Mm)), QPrinter::Millimeter ); QPainter painter; if (painter.begin( &printer ) == false) @@ -652,7 +653,7 @@ void MainWindowsNoGUI::ObjFile(const QString &name, int i) const VObjPaintDevice generator; generator.setFileName(name); generator.setSize(paper->rect().size().toSize()); - generator.setResolution(static_cast(qApp->PrintDPI)); + generator.setResolution(static_cast(PrintDPI)); QPainter painter; painter.begin(&generator); scenes.at(i)->render(&painter, paper->rect(), paper->rect(), Qt::IgnoreAspectRatio); @@ -730,7 +731,7 @@ void MainWindowsNoGUI::SaveLayoutAs() qApp->getSettings()->SetPathLayout(f.absolutePath()); printer.setOutputFileName(fileName); - printer.setResolution(static_cast(VApplication::PrintDPI)); + printer.setResolution(static_cast(PrintDPI)); PrintPages( &printer ); } } @@ -764,7 +765,7 @@ void MainWindowsNoGUI::PrintPreview() } QPrinter printer(def, QPrinter::ScreenResolution); - printer.setResolution(static_cast(VApplication::PrintDPI)); + printer.setResolution(static_cast(PrintDPI)); SetPrinterSettings(&printer); // display print preview dialog QPrintPreviewDialog preview(&printer); @@ -790,7 +791,7 @@ void MainWindowsNoGUI::LayoutPrint() dialog.setOption(QPrintDialog::PrintCurrentPage, false); if ( dialog.exec() == QDialog::Accepted ) { - printer.setResolution(static_cast(VApplication::PrintDPI)); + printer.setResolution(static_cast(PrintDPI)); PrintPages( &printer ); } } @@ -820,8 +821,8 @@ void MainWindowsNoGUI::SetPrinterSettings(QPrinter *printer) { QGraphicsRectItem *paper = qgraphicsitem_cast(papers.at(0)); SCASSERT(paper != nullptr) - printer->setPaperSize ( QSizeF(qApp->fromPixel(paper->rect().width(), Unit::Mm), - qApp->fromPixel(paper->rect().height(), Unit::Mm)), QPrinter::Millimeter ); + printer->setPaperSize ( QSizeF(FromPixel(paper->rect().width(), Unit::Mm), + FromPixel(paper->rect().height(), Unit::Mm)), QPrinter::Millimeter ); } printer->setDocName(FileName()); diff --git a/src/app/tools/drawTools/vtoolpoint.cpp b/src/app/tools/drawTools/vtoolpoint.cpp index 1da449d57..33a9fac30 100644 --- a/src/app/tools/drawTools/vtoolpoint.cpp +++ b/src/app/tools/drawTools/vtoolpoint.cpp @@ -50,7 +50,7 @@ VToolPoint::VToolPoint(VPattern *doc, VContainer *data, quint32 id, QGraphicsIte :VDrawTool(doc, data, id), QGraphicsEllipseItem(parent), radius(DefPointRadius), namePoint(nullptr), lineName(nullptr) { - radius = qApp->toPixel(DefPointRadius/*mm*/, Unit::Mm); + radius = ToPixel(DefPointRadius/*mm*/, Unit::Mm); namePoint = new VGraphicsSimpleTextItem(this); connect(namePoint, &VGraphicsSimpleTextItem::ShowContextMenu, this, &VToolPoint::contextMenuEvent); connect(namePoint, &VGraphicsSimpleTextItem::DeleteTool, this, &VToolPoint::DeleteFromLabel); @@ -279,7 +279,7 @@ void VToolPoint::RefreshLine() lineName->setLine(QLineF(p1, pRec - scenePos())); lineName->setPen(QPen(CorrectColor(Qt::black), qApp->toPixel(qApp->widthHairLine())/factor)); - if (QLineF(p1, pRec - scenePos()).length() <= qApp->toPixel(4, Unit::Mm)) + if (QLineF(p1, pRec - scenePos()).length() <= ToPixel(4, Unit::Mm)) { lineName->setVisible(false); } diff --git a/src/app/tools/nodeDetails/vnodepoint.cpp b/src/app/tools/nodeDetails/vnodepoint.cpp index c080edf5c..3318a0e63 100644 --- a/src/app/tools/nodeDetails/vnodepoint.cpp +++ b/src/app/tools/nodeDetails/vnodepoint.cpp @@ -55,7 +55,7 @@ VNodePoint::VNodePoint(VPattern *doc, VContainer *data, quint32 id, quint32 idPo :VAbstractNode(doc, data, id, idPoint, idTool, qoParent), QGraphicsEllipseItem(parent), radius(0), namePoint(nullptr), lineName(nullptr) { - radius = qApp->toPixel(DefPointRadius/*mm*/, Unit::Mm); + radius = ToPixel(DefPointRadius/*mm*/, Unit::Mm); namePoint = new VGraphicsSimpleTextItem(this); lineName = new QGraphicsLineItem(this); connect(namePoint, &VGraphicsSimpleTextItem::NameChangePosition, this, @@ -286,7 +286,7 @@ void VNodePoint::RefreshLine() VGObject::LineIntersectCircle(QPointF(), radius, QLineF(QPointF(), nameRec.center()- scenePos()), p1, p2); QPointF pRec = VGObject::LineIntersectRect(nameRec, QLineF(scenePos(), nameRec.center())); lineName->setLine(QLineF(p1, pRec - scenePos())); - if (QLineF(p1, pRec - scenePos()).length() <= qApp->toPixel(4, Unit::Mm)) + if (QLineF(p1, pRec - scenePos()).length() <= ToPixel(4, Unit::Mm)) { lineName->setVisible(false); } diff --git a/src/app/visualization/vcontrolpointspline.cpp b/src/app/visualization/vcontrolpointspline.cpp index 11cc17cd0..5b1a91d48 100644 --- a/src/app/visualization/vcontrolpointspline.cpp +++ b/src/app/visualization/vcontrolpointspline.cpp @@ -49,7 +49,7 @@ VControlPointSpline::VControlPointSpline(const qint32 &indexSpline, SplinePointP :QGraphicsEllipseItem(parent), radius(0), controlLine(nullptr), indexSpline(indexSpline), position(position) { //create circle - radius = (1.5/*mm*/ / 25.4) * VApplication::PrintDPI; + radius = (1.5/*mm*/ / 25.4) * PrintDPI; QRectF rec = QRectF(0, 0, radius*2, radius*2); rec.translate(-rec.center().x(), -rec.center().y()); this->setRect(rec); diff --git a/src/app/visualization/visualization.cpp b/src/app/visualization/visualization.cpp index fdac90ee9..ade0be1ae 100644 --- a/src/app/visualization/visualization.cpp +++ b/src/app/visualization/visualization.cpp @@ -110,7 +110,7 @@ QGraphicsEllipseItem *Visualization::InitPoint(const QColor &color, QGraphicsIte point->setZValue(1); point->setBrush(QBrush(Qt::NoBrush)); point->setPen(QPen(color, qApp->toPixel(qApp->widthMainLine())/factor)); - point->setRect(PointRect(qApp->toPixel(DefPointRadius/*mm*/, Unit::Mm))); + point->setRect(PointRect(ToPixel(DefPointRadius/*mm*/, Unit::Mm))); point->setFlags(QGraphicsItem::ItemStacksBehindParent); point->setVisible(false); return point; diff --git a/src/app/xml/vabstractmeasurements.cpp b/src/app/xml/vabstractmeasurements.cpp index 97be9fb28..4c87b9fc2 100644 --- a/src/app/xml/vabstractmeasurements.cpp +++ b/src/app/xml/vabstractmeasurements.cpp @@ -216,7 +216,7 @@ qreal VAbstractMeasurements::UnitConvertor(qreal value, const Unit &from, const case Unit::Inch: return value / 25.4; case Unit::Px: - return (value / 25.4) * VApplication::PrintDPI; + return (value / 25.4) * PrintDPI; default: break; } @@ -231,7 +231,7 @@ qreal VAbstractMeasurements::UnitConvertor(qreal value, const Unit &from, const case Unit::Inch: return value / 2.54; case Unit::Px: - return ((value * 10.0) / 25.4) * VApplication::PrintDPI; + return ((value * 10.0) / 25.4) * PrintDPI; default: break; } @@ -246,7 +246,7 @@ qreal VAbstractMeasurements::UnitConvertor(qreal value, const Unit &from, const case Unit::Inch: return value; case Unit::Px: - return value * VApplication::PrintDPI; + return value * PrintDPI; default: break; } @@ -255,11 +255,11 @@ qreal VAbstractMeasurements::UnitConvertor(qreal value, const Unit &from, const switch (to) { case Unit::Mm: - return (value / VApplication::PrintDPI) * 25.4; + return (value / PrintDPI) * 25.4; case Unit::Cm: - return ((value / VApplication::PrintDPI) * 25.4) / 10.0; + return ((value / PrintDPI) * 25.4) / 10.0; case Unit::Inch: - return value / VApplication::PrintDPI; + return value / PrintDPI; case Unit::Px: return value; default: diff --git a/src/libs/ifc/ifc.pri b/src/libs/ifc/ifc.pri index 124d558f1..b95b3e813 100644 --- a/src/libs/ifc/ifc.pri +++ b/src/libs/ifc/ifc.pri @@ -10,4 +10,5 @@ HEADERS += \ $$PWD/ifcdef.h SOURCES += \ - $$PWD/stable.cpp + $$PWD/stable.cpp \ + ifcdef.cpp diff --git a/src/libs/ifc/ifcdef.cpp b/src/libs/ifc/ifcdef.cpp new file mode 100644 index 000000000..75410d596 --- /dev/null +++ b/src/libs/ifc/ifcdef.cpp @@ -0,0 +1,31 @@ +/************************************************************************ + ** + ** @file ifcdef.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 "ifcdef.h" + +const qreal PrintDPI = 96.0; diff --git a/src/libs/ifc/ifcdef.h b/src/libs/ifc/ifcdef.h index 506533397..9b0e7a03a 100644 --- a/src/libs/ifc/ifcdef.h +++ b/src/libs/ifc/ifcdef.h @@ -59,4 +59,44 @@ static const quint32 null_id = 0; # define V_NOEXCEPT_EXPR(x) # endif +extern const qreal PrintDPI; + +//--------------------------------------------------------------------------------------------------------------------- +inline double ToPixel(double val, const Unit &unit) +{ + switch (unit) + { + case Unit::Mm: + return (val / 25.4) * PrintDPI; + case Unit::Cm: + return ((val * 10.0) / 25.4) * PrintDPI; + case Unit::Inch: + return val * PrintDPI; + case Unit::Px: + return val; + default: + break; + } + return 0; +} + +//--------------------------------------------------------------------------------------------------------------------- +inline double FromPixel(double pix, const Unit &unit) +{ + switch (unit) + { + case Unit::Mm: + return (pix / PrintDPI) * 25.4; + case Unit::Cm: + return ((pix / PrintDPI) * 25.4) / 10.0; + case Unit::Inch: + return pix / PrintDPI; + case Unit::Px: + return pix; + default: + break; + } + return 0; +} + #endif // IFCDEF_H From f8c6a65962ba96fdbe67f72b2ded65775a548d70 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 12 Jun 2015 11:55:44 +0300 Subject: [PATCH 05/10] 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 From fbeabaa8a9d4b51ab28ee2222c68af4e00d4067c Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 12 Jun 2015 12:10:52 +0300 Subject: [PATCH 06/10] Remove CONFIG += ordered. --HG-- branch : feature --- src/libs/libs.pro | 3 ++- src/src.pro | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/libs/libs.pro b/src/libs/libs.pro index 81690d91a..92bfad3c8 100644 --- a/src/libs/libs.pro +++ b/src/libs/libs.pro @@ -1,5 +1,4 @@ TEMPLATE = subdirs -CONFIG += ordered SUBDIRS = \ qmuparser \ vpropertyexplorer \ @@ -8,3 +7,5 @@ SUBDIRS = \ vlayout \ vgeometry \ vpatterndb + +vgeometry.depends = ifc diff --git a/src/src.pro b/src/src.pro index 4ae343d2a..93b34592a 100644 --- a/src/src.pro +++ b/src/src.pro @@ -1,8 +1,8 @@ TEMPLATE = subdirs -CONFIG += ordered - -# Order is important SUBDIRS = \ libs \ app \ test + +app.depends = libs +test.depends = libs From f331f6fa5f55095002e671241565f390e1c8fa44 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 12 Jun 2015 12:15:59 +0300 Subject: [PATCH 07/10] Cppcheck warnings. --HG-- branch : feature --- src/app/visualization/vistoolpointfromarcandtangent.cpp | 3 --- src/libs/vpatterndb/vtranslatevars.cpp | 2 +- src/libs/vpatterndb/vtranslatevars.h | 2 +- src/test/ValentinaTest/tst_nameregexp.cpp | 2 ++ src/test/ValentinaTest/tst_vabstractdetail.cpp | 1 + src/test/ValentinaTest/tst_varc.cpp | 2 ++ 6 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/app/visualization/vistoolpointfromarcandtangent.cpp b/src/app/visualization/vistoolpointfromarcandtangent.cpp index 8e72f7ad6..08945dd6d 100644 --- a/src/app/visualization/vistoolpointfromarcandtangent.cpp +++ b/src/app/visualization/vistoolpointfromarcandtangent.cpp @@ -99,12 +99,9 @@ void VisToolPointFromArcAndTangent::FindRays(const QPointF &p, const VArc *arc) case 2: { int localRes = 0; - bool flagP1 = false; - if (arc->IsIntersectLine(r1Arc)) { ++localRes; - flagP1 = true; } if (arc->IsIntersectLine(r2Arc)) diff --git a/src/libs/vpatterndb/vtranslatevars.cpp b/src/libs/vpatterndb/vtranslatevars.cpp index 137e2db98..4f10fe0f1 100644 --- a/src/libs/vpatterndb/vtranslatevars.cpp +++ b/src/libs/vpatterndb/vtranslatevars.cpp @@ -1077,7 +1077,7 @@ void VTranslateVars::CorrectionsPositions(int position, int bias, QMap &tokens) const +void VTranslateVars::BiasTokens(int position, int bias, QMap &tokens) { QMap newTokens; QMap::const_iterator i = tokens.constBegin(); diff --git a/src/libs/vpatterndb/vtranslatevars.h b/src/libs/vpatterndb/vtranslatevars.h index ec813b17a..08e4f0f5a 100644 --- a/src/libs/vpatterndb/vtranslatevars.h +++ b/src/libs/vpatterndb/vtranslatevars.h @@ -76,7 +76,7 @@ private: const qmu::QmuTranslation &d); void CorrectionsPositions(int position, int bias, QMap &tokens, QMap &numbers) const; - void BiasTokens(int position, int bias, QMap &tokens) const; + static void BiasTokens(int position, int bias, QMap &tokens); }; #endif // VTRANSLATEVARS_H diff --git a/src/test/ValentinaTest/tst_nameregexp.cpp b/src/test/ValentinaTest/tst_nameregexp.cpp index d1ad988f6..edad988c3 100644 --- a/src/test/ValentinaTest/tst_nameregexp.cpp +++ b/src/test/ValentinaTest/tst_nameregexp.cpp @@ -38,6 +38,7 @@ TST_NameRegExp::TST_NameRegExp(QObject *parent) : } //--------------------------------------------------------------------------------------------------------------------- +// cppcheck-suppress unusedFunction void TST_NameRegExp::TestNameRegExp_data() { QTest::addColumn("name"); @@ -97,6 +98,7 @@ void TST_NameRegExp::TestNameRegExp_data() } //--------------------------------------------------------------------------------------------------------------------- +// cppcheck-suppress unusedFunction void TST_NameRegExp::TestNameRegExp() { const QRegularExpression re(NameRegExp()); diff --git a/src/test/ValentinaTest/tst_vabstractdetail.cpp b/src/test/ValentinaTest/tst_vabstractdetail.cpp index 2e2582ae6..99a1c9d96 100644 --- a/src/test/ValentinaTest/tst_vabstractdetail.cpp +++ b/src/test/ValentinaTest/tst_vabstractdetail.cpp @@ -39,6 +39,7 @@ TST_VAbstractDetail::TST_VAbstractDetail(QObject *parent) } //--------------------------------------------------------------------------------------------------------------------- +// cppcheck-suppress unusedFunction void TST_VAbstractDetail::EquidistantRemoveLoop() const { // These are two real cases where equdistant has loop. diff --git a/src/test/ValentinaTest/tst_varc.cpp b/src/test/ValentinaTest/tst_varc.cpp index 629f2a723..bc9d8d34f 100644 --- a/src/test/ValentinaTest/tst_varc.cpp +++ b/src/test/ValentinaTest/tst_varc.cpp @@ -37,6 +37,7 @@ TST_VArc::TST_VArc(QObject *parent) {} //--------------------------------------------------------------------------------------------------------------------- +// cppcheck-suppress unusedFunction void TST_VArc::CompareTwoWays() { const VPointF center; @@ -59,6 +60,7 @@ void TST_VArc::CompareTwoWays() } //--------------------------------------------------------------------------------------------------------------------- +// cppcheck-suppress unusedFunction void TST_VArc::NegativeArc() { const VPointF center; From fdb45fdc769a6c9672e9e1dbf568b3fe923ac1d0 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 12 Jun 2015 12:22:25 +0300 Subject: [PATCH 08/10] Move class VFormula to core folder. --HG-- branch : feature --- src/app/app.pri | 1 - src/app/container/container.pri | 8 -------- src/app/core/core.pri | 6 ++++-- src/app/{container => core}/vformula.cpp | 0 src/app/{container => core}/vformula.h | 0 src/app/tools/drawTools/vtoolarc.cpp | 2 +- src/app/tools/drawTools/vtoolarcwithlength.cpp | 2 +- src/app/tools/drawTools/vtoolcut.cpp | 2 +- src/app/tools/drawTools/vtoollinepoint.h | 2 +- .../tools/drawTools/vtoolpointfromcircleandtangent.cpp | 2 +- src/app/tools/drawTools/vtoolpointofcontact.cpp | 2 +- .../tools/drawTools/vtoolpointofintersectioncircles.cpp | 2 +- src/app/widgets/vformulaproperty.cpp | 2 +- src/app/widgets/vformulapropertyeditor.h | 2 +- src/app/widgets/vtooloptionspropertybrowser.cpp | 2 +- 15 files changed, 14 insertions(+), 21 deletions(-) delete mode 100644 src/app/container/container.pri rename src/app/{container => core}/vformula.cpp (100%) rename src/app/{container => core}/vformula.h (100%) diff --git a/src/app/app.pri b/src/app/app.pri index ba5f59840..7f5d8d065 100644 --- a/src/app/app.pri +++ b/src/app/app.pri @@ -1,5 +1,4 @@ # Suport subdirectories. Just better project code tree. -include(container/container.pri) include(dialogs/dialogs.pri) include(tools/tools.pri) include(widgets/widgets.pri) diff --git a/src/app/container/container.pri b/src/app/container/container.pri deleted file mode 100644 index 44e5c9e4e..000000000 --- a/src/app/container/container.pri +++ /dev/null @@ -1,8 +0,0 @@ -# ADD TO EACH PATH $$PWD VARIABLE!!!!!! -# This need for corect working file translations.pro - -SOURCES += \ - $$PWD/vformula.cpp - -HEADERS += \ - $$PWD/vformula.h diff --git a/src/app/core/core.pri b/src/app/core/core.pri index b4a9799f2..5b7e0e14d 100644 --- a/src/app/core/core.pri +++ b/src/app/core/core.pri @@ -6,11 +6,13 @@ HEADERS += \ $$PWD/undoevent.h \ $$PWD/vsettings.h \ $$PWD/backport/qcommandlineoption.h \ - $$PWD/backport/qcommandlineparser.h + $$PWD/backport/qcommandlineparser.h \ + $$PWD/vformula.h SOURCES += \ $$PWD/vapplication.cpp \ $$PWD/undoevent.cpp \ $$PWD/vsettings.cpp \ $$PWD/backport/qcommandlineoption.cpp \ - $$PWD/backport/qcommandlineparser.cpp + $$PWD/backport/qcommandlineparser.cpp \ + $$PWD/vformula.cpp diff --git a/src/app/container/vformula.cpp b/src/app/core/vformula.cpp similarity index 100% rename from src/app/container/vformula.cpp rename to src/app/core/vformula.cpp diff --git a/src/app/container/vformula.h b/src/app/core/vformula.h similarity index 100% rename from src/app/container/vformula.h rename to src/app/core/vformula.h diff --git a/src/app/tools/drawTools/vtoolarc.cpp b/src/app/tools/drawTools/vtoolarc.cpp index af0dfd106..b4c77d517 100644 --- a/src/app/tools/drawTools/vtoolarc.cpp +++ b/src/app/tools/drawTools/vtoolarc.cpp @@ -30,7 +30,7 @@ #include "../../libs/vpatterndb/calculator.h" #include "../../dialogs/tools/dialogarc.h" #include "../../libs/vgeometry/varc.h" -#include "../container/vformula.h" +#include "../core/vformula.h" #include "../../visualization/vistoolarc.h" #include diff --git a/src/app/tools/drawTools/vtoolarcwithlength.cpp b/src/app/tools/drawTools/vtoolarcwithlength.cpp index 34f53b611..af2a1ed3c 100644 --- a/src/app/tools/drawTools/vtoolarcwithlength.cpp +++ b/src/app/tools/drawTools/vtoolarcwithlength.cpp @@ -30,7 +30,7 @@ #include "../../libs/vpatterndb/calculator.h" #include "../../dialogs/tools/dialogarcwithlength.h" #include "../../libs/vgeometry/varc.h" -#include "../container/vformula.h" +#include "../core/vformula.h" #include "../../visualization/vistoolarcwithlength.h" #include diff --git a/src/app/tools/drawTools/vtoolcut.cpp b/src/app/tools/drawTools/vtoolcut.cpp index a688c68ac..746533674 100644 --- a/src/app/tools/drawTools/vtoolcut.cpp +++ b/src/app/tools/drawTools/vtoolcut.cpp @@ -28,7 +28,7 @@ #include "vtoolcut.h" #include "../../libs/vgeometry/vpointf.h" -#include "../../container/vformula.h" +#include "../../core/vformula.h" //--------------------------------------------------------------------------------------------------------------------- VToolCut::VToolCut(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula, diff --git a/src/app/tools/drawTools/vtoollinepoint.h b/src/app/tools/drawTools/vtoollinepoint.h index e957d5679..6b840ce4b 100644 --- a/src/app/tools/drawTools/vtoollinepoint.h +++ b/src/app/tools/drawTools/vtoollinepoint.h @@ -30,7 +30,7 @@ #define VTOOLLINEPOINT_H #include "vtoolpoint.h" -#include "../container/vformula.h" +#include "../core/vformula.h" /** * @brief The VToolLinePoint class parent for all tools what create point with line. diff --git a/src/app/tools/drawTools/vtoolpointfromcircleandtangent.cpp b/src/app/tools/drawTools/vtoolpointfromcircleandtangent.cpp index 745b93d10..2a9b08f25 100644 --- a/src/app/tools/drawTools/vtoolpointfromcircleandtangent.cpp +++ b/src/app/tools/drawTools/vtoolpointfromcircleandtangent.cpp @@ -31,7 +31,7 @@ #include "../../libs/vgeometry/vpointf.h" #include "../../libs/vgeometry/varc.h" #include "../../visualization/vistoolpointfromcircleandtangent.h" -#include "../container/vformula.h" +#include "../core/vformula.h" const QString VToolPointFromCircleAndTangent::ToolType = QStringLiteral("pointFromCircleAndTangent"); diff --git a/src/app/tools/drawTools/vtoolpointofcontact.cpp b/src/app/tools/drawTools/vtoolpointofcontact.cpp index 91e4d8781..026529f95 100644 --- a/src/app/tools/drawTools/vtoolpointofcontact.cpp +++ b/src/app/tools/drawTools/vtoolpointofcontact.cpp @@ -30,7 +30,7 @@ #include "../../libs/vpatterndb/calculator.h" #include "../../dialogs/tools/dialogpointofcontact.h" #include "../../libs/vgeometry/vpointf.h" -#include "../../container/vformula.h" +#include "../../core/vformula.h" #include "../../visualization/vistoolpointofcontact.h" #include diff --git a/src/app/tools/drawTools/vtoolpointofintersectioncircles.cpp b/src/app/tools/drawTools/vtoolpointofintersectioncircles.cpp index 9b5ce9f3b..f9adc78fa 100644 --- a/src/app/tools/drawTools/vtoolpointofintersectioncircles.cpp +++ b/src/app/tools/drawTools/vtoolpointofintersectioncircles.cpp @@ -31,7 +31,7 @@ #include "../../libs/vgeometry/vpointf.h" #include "../../libs/vgeometry/varc.h" #include "../../visualization/vistoolpointofintersectioncircles.h" -#include "../container/vformula.h" +#include "../core/vformula.h" const QString VToolPointOfIntersectionCircles::ToolType = QStringLiteral("pointOfIntersectionCircles"); diff --git a/src/app/widgets/vformulaproperty.cpp b/src/app/widgets/vformulaproperty.cpp index c9f468e46..7ec0625eb 100644 --- a/src/app/widgets/vformulaproperty.cpp +++ b/src/app/widgets/vformulaproperty.cpp @@ -32,7 +32,7 @@ #include "../../libs/vpropertyexplorer/vproperty_p.h" #include "vformulapropertyeditor.h" #include "../../libs/vpropertyexplorer/vproperties.h" -#include "../container/vformula.h" +#include "../core/vformula.h" enum class ChildType : char {Invalid = 0, Value = 1, Formula = 2}; diff --git a/src/app/widgets/vformulapropertyeditor.h b/src/app/widgets/vformulapropertyeditor.h index e3d25b0c9..3d3c529aa 100644 --- a/src/app/widgets/vformulapropertyeditor.h +++ b/src/app/widgets/vformulapropertyeditor.h @@ -35,7 +35,7 @@ #include #include -#include "../container/vformula.h" +#include "../core/vformula.h" class VFormulaPropertyEditor : public QWidget { diff --git a/src/app/widgets/vtooloptionspropertybrowser.cpp b/src/app/widgets/vtooloptionspropertybrowser.cpp index 0f10f6a66..0ef4f58e9 100644 --- a/src/app/widgets/vtooloptionspropertybrowser.cpp +++ b/src/app/widgets/vtooloptionspropertybrowser.cpp @@ -34,7 +34,7 @@ #include "../visualization/vcontrolpointspline.h" #include "../../libs/vpropertyexplorer/vproperties.h" #include "vformulaproperty.h" -#include "../container/vformula.h" +#include "../core/vformula.h" #include #include From 48cd74cabd0144156447d3fb094911bcad29b42c Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 12 Jun 2015 12:49:35 +0300 Subject: [PATCH 09/10] Move class VToolRecord to library IFC. --HG-- branch : feature --- src/app/xml/vpattern.h | 2 +- src/app/xml/xml.pri | 2 -- src/libs/ifc/ifc.pri | 2 +- src/{app => libs/ifc}/xml/vtoolrecord.cpp | 1 + src/{app => libs/ifc}/xml/vtoolrecord.h | 2 +- src/libs/ifc/xml/xml.pri | 6 ++++-- 6 files changed, 8 insertions(+), 7 deletions(-) rename src/{app => libs/ifc}/xml/vtoolrecord.cpp (99%) rename src/{app => libs/ifc}/xml/vtoolrecord.h (99%) diff --git a/src/app/xml/vpattern.h b/src/app/xml/vpattern.h index d0afc0219..9dc53bdff 100644 --- a/src/app/xml/vpattern.h +++ b/src/app/xml/vpattern.h @@ -30,7 +30,7 @@ #define VPATTERN_H #include "../libs/ifc/xml/vdomdocument.h" -#include "vtoolrecord.h" +#include "../libs/ifc/xml/vtoolrecord.h" #include "../libs/vpatterndb/vcontainer.h" class VDataTool; diff --git a/src/app/xml/xml.pri b/src/app/xml/xml.pri index a26d7d4aa..83491ded1 100644 --- a/src/app/xml/xml.pri +++ b/src/app/xml/xml.pri @@ -2,14 +2,12 @@ # This need for corect working file translations.pro HEADERS += \ - $$PWD/vtoolrecord.h \ $$PWD/vpattern.h \ $$PWD/vstandardmeasurements.h \ $$PWD/vindividualmeasurements.h \ $$PWD/vabstractmeasurements.h SOURCES += \ - $$PWD/vtoolrecord.cpp \ $$PWD/vpattern.cpp \ $$PWD/vstandardmeasurements.cpp \ $$PWD/vindividualmeasurements.cpp \ diff --git a/src/libs/ifc/ifc.pri b/src/libs/ifc/ifc.pri index b95b3e813..e999dd096 100644 --- a/src/libs/ifc/ifc.pri +++ b/src/libs/ifc/ifc.pri @@ -11,4 +11,4 @@ HEADERS += \ SOURCES += \ $$PWD/stable.cpp \ - ifcdef.cpp + $$PWD/ifcdef.cpp diff --git a/src/app/xml/vtoolrecord.cpp b/src/libs/ifc/xml/vtoolrecord.cpp similarity index 99% rename from src/app/xml/vtoolrecord.cpp rename to src/libs/ifc/xml/vtoolrecord.cpp index 12bbc3660..4202c1f6e 100644 --- a/src/app/xml/vtoolrecord.cpp +++ b/src/libs/ifc/xml/vtoolrecord.cpp @@ -27,6 +27,7 @@ *************************************************************************/ #include "vtoolrecord.h" +#include "../ifcdef.h" //--------------------------------------------------------------------------------------------------------------------- /** diff --git a/src/app/xml/vtoolrecord.h b/src/libs/ifc/xml/vtoolrecord.h similarity index 99% rename from src/app/xml/vtoolrecord.h rename to src/libs/ifc/xml/vtoolrecord.h index 836f0a779..dd927a999 100644 --- a/src/app/xml/vtoolrecord.h +++ b/src/libs/ifc/xml/vtoolrecord.h @@ -29,7 +29,7 @@ #ifndef VTOOLRECORD_H #define VTOOLRECORD_H -#include "../options.h" +#include "../../utils/def.h" #include diff --git a/src/libs/ifc/xml/xml.pri b/src/libs/ifc/xml/xml.pri index c64e090e9..81fd98886 100644 --- a/src/libs/ifc/xml/xml.pri +++ b/src/libs/ifc/xml/xml.pri @@ -4,9 +4,11 @@ HEADERS += \ $$PWD/vabstractconverter.h \ $$PWD/vdomdocument.h \ - $$PWD/vpatternconverter.h + $$PWD/vpatternconverter.h \ + $$PWD/vtoolrecord.h SOURCES += \ $$PWD/vabstractconverter.cpp \ $$PWD/vdomdocument.cpp \ - $$PWD/vpatternconverter.cpp + $$PWD/vpatternconverter.cpp \ + $$PWD/vtoolrecord.cpp From 792784de24a0adb767ddd103fb8201af4a25bb67 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 12 Jun 2015 12:49:52 +0300 Subject: [PATCH 10/10] Refactoring. --HG-- branch : feature --- src/app/widgets/vformulaproperty.cpp | 1 + src/app/xml/vabstractmeasurements.cpp | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/widgets/vformulaproperty.cpp b/src/app/widgets/vformulaproperty.cpp index 7ec0625eb..e42887c09 100644 --- a/src/app/widgets/vformulaproperty.cpp +++ b/src/app/widgets/vformulaproperty.cpp @@ -72,6 +72,7 @@ QVariant VFormulaProperty::data (int column, int role) const } } +//--------------------------------------------------------------------------------------------------------------------- Qt::ItemFlags VFormulaProperty::flags(int column) const { if (column == DPC_Name || column == DPC_Data) diff --git a/src/app/xml/vabstractmeasurements.cpp b/src/app/xml/vabstractmeasurements.cpp index 5f5d1984a..de8b74aa8 100644 --- a/src/app/xml/vabstractmeasurements.cpp +++ b/src/app/xml/vabstractmeasurements.cpp @@ -27,7 +27,6 @@ *************************************************************************/ #include "vabstractmeasurements.h" -#include "../core/vapplication.h" const QString VAbstractMeasurements::TagUnit = QStringLiteral("unit"); const QString VAbstractMeasurements::AttrValue = QStringLiteral("value");