diff --git a/src/app/container/vmeasurement.cpp b/src/app/container/vmeasurement.cpp
index e39460e61..b52b6e858 100644
--- a/src/app/container/vmeasurement.cpp
+++ b/src/app/container/vmeasurement.cpp
@@ -30,21 +30,18 @@
//---------------------------------------------------------------------------------------------------------------------
VMeasurement::VMeasurement()
- :base(0), ksize(50.0), kheight(176.0), gui_text(QString()), number(QString()), virtualM(false),
- _tagName(QString())
+ :base(0), ksize(50.0), kheight(176.0), gui_text(QString()), number(QString()), _tagName(QString())
{}
//---------------------------------------------------------------------------------------------------------------------
VMeasurement::VMeasurement(const qreal &base, const qreal &ksize, const qreal &kgrowth,
const QString &gui_text, const QString &number, const QString &tagName)
- :base(base), ksize(ksize), kheight(kgrowth), gui_text(gui_text), number(number), virtualM(false),
- _tagName(tagName)
+ :base(base), ksize(ksize), kheight(kgrowth), gui_text(gui_text), number(number), _tagName(tagName)
{}
//---------------------------------------------------------------------------------------------------------------------
VMeasurement::VMeasurement(const qreal &base, const QString &gui_text, const QString &number, const QString &tagName)
- :base(base), ksize(50.0), kheight(176.0), gui_text(gui_text), number(number), virtualM(false),
- _tagName(tagName)
+ :base(base), ksize(50.0), kheight(176.0), gui_text(gui_text), number(number), _tagName(tagName)
{}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/app/container/vmeasurement.h b/src/app/container/vmeasurement.h
index c4071a086..cf5ed3dc2 100644
--- a/src/app/container/vmeasurement.h
+++ b/src/app/container/vmeasurement.h
@@ -100,7 +100,6 @@ private:
*/
QString gui_text;
QString number;
- bool virtualM;
QString _tagName;
};
@@ -144,14 +143,4 @@ inline void VMeasurement::setTagName(const QString &tagName)
_tagName = tagName;
}
-inline bool VMeasurement::Virtual() const
-{
- return virtualM;
-}
-
-inline void VMeasurement::setVirtual(bool value)
-{
- virtualM = value;
-}
-
#endif // VSTANDARDTABLEROW_H
diff --git a/src/app/options.cpp b/src/app/options.cpp
index 6f9f270ff..7098b299e 100644
--- a/src/app/options.cpp
+++ b/src/app/options.cpp
@@ -110,6 +110,7 @@ const QString waistToHipHeight = QStringLiteral("waist_to_hip_height"
const QString waistToKneeHeight = QStringLiteral("waist_to_knee_height");
const QString crotchHeight = QStringLiteral("crotch_height");
//extended measurements
+const QString size = QStringLiteral("size");
const QString heightFrontNeckBasePoint = QStringLiteral("height_front_neck_base_point");
const QString heightBaseNeckSidePoint = QStringLiteral("height_base_neck_side_point");
const QString heightShoulderPoint = QStringLiteral("height_shoulder_point");
diff --git a/src/app/options.h b/src/app/options.h
index ba971440f..37dfe1c1f 100644
--- a/src/app/options.h
+++ b/src/app/options.h
@@ -194,6 +194,7 @@ extern const QString waistToHipHeight;
extern const QString waistToKneeHeight;
extern const QString crotchHeight;
//extended measurements
+extern const QString size;
extern const QString heightFrontNeckBasePoint;
extern const QString heightBaseNeckSidePoint;
extern const QString heightShoulderPoint;
diff --git a/src/app/share/resources/schema/individual_measurements.xsd b/src/app/share/resources/schema/individual_measurements.xsd
index ff023bcc2..17579d79f 100644
--- a/src/app/share/resources/schema/individual_measurements.xsd
+++ b/src/app/share/resources/schema/individual_measurements.xsd
@@ -83,7 +83,7 @@
-
+
@@ -203,12 +203,12 @@
-
+
-
+
@@ -223,12 +223,12 @@
-
+
-
+
@@ -263,12 +263,12 @@
-
+
-
+
@@ -289,7 +289,7 @@
-
+
diff --git a/src/app/share/resources/schema/standard_measurements.xsd b/src/app/share/resources/schema/standard_measurements.xsd
index 4d882d847..0d6a97418 100644
--- a/src/app/share/resources/schema/standard_measurements.xsd
+++ b/src/app/share/resources/schema/standard_measurements.xsd
@@ -108,7 +108,7 @@
-
+
@@ -276,14 +276,14 @@
-
+
-
+
@@ -304,14 +304,14 @@
-
+
-
+
@@ -360,14 +360,14 @@
-
+
-
+
@@ -394,7 +394,7 @@
-
+
diff --git a/src/app/share/resources/tables/individual/individual.vit b/src/app/share/resources/tables/individual/individual.vit
index 998e4430c..64fdba86f 100644
--- a/src/app/share/resources/tables/individual/individual.vit
+++ b/src/app/share/resources/tables/individual/individual.vit
@@ -48,25 +48,25 @@
-
-
+
+
-
-
+
+
-
-
+
+
-
+
diff --git a/src/app/share/resources/tables/standard/GOST_man_ru.vst b/src/app/share/resources/tables/standard/GOST_man_ru.vst
index 9f73960dd..0240a7df5 100644
--- a/src/app/share/resources/tables/standard/GOST_man_ru.vst
+++ b/src/app/share/resources/tables/standard/GOST_man_ru.vst
@@ -44,25 +44,25 @@
-
-
+
+
-
-
+
+
-
-
+
+
-
+
diff --git a/src/app/widgets/vapplication.cpp b/src/app/widgets/vapplication.cpp
index 6f849e518..4d0ba00d8 100644
--- a/src/app/widgets/vapplication.cpp
+++ b/src/app/widgets/vapplication.cpp
@@ -45,7 +45,7 @@ const qreal VApplication::PrintDPI = 96.0;
VApplication::VApplication(int &argc, char **argv)
: QApplication(argc, argv), _patternUnit(Valentina::Cm), _patternType(Pattern::Individual),
_widthMainLine(DefWidth), _widthHairLine(DefWidth/3.0), measurements(QMap()),
- guiText(QMap()), description(QMap()),
+ guiTexts(QMap()), descriptions(QMap()),
variables(QMap()), functions(QMap())
{
InitLineWidth();
@@ -569,7 +569,7 @@ void VApplication::InitMeasurements()
}
//---------------------------------------------------------------------------------------------------------------------
-void VApplication::InitMeasurement(const QString &measurement, const QString &guiTxt, const QString &desc)
+void VApplication::InitMeasurement(const QString &measurement, const QString &guiText, const QString &desc)
{
const QString context = QStringLiteral("Measurements");
const QString disambiguation1 = QStringLiteral("Short measurement name. Don't use math symbols in name!!!!");
@@ -577,8 +577,8 @@ void VApplication::InitMeasurement(const QString &measurement, const QString &gu
const QString disambiguation3 = QStringLiteral("Full measurement description");
measurements.insert(measurement, VTranslation::translate(context, measurement, disambiguation1));
- guiText.insert(measurement, VTranslation::translate(context, guiTxt, disambiguation2));
- description.insert(measurement, VTranslation::translate(context, desc, disambiguation3));
+ guiTexts.insert(measurement, VTranslation::translate(context, guiText, disambiguation2));
+ descriptions.insert(measurement, VTranslation::translate(context, desc, disambiguation3));
}
//---------------------------------------------------------------------------------------------------------------------
@@ -636,3 +636,33 @@ void VApplication::setPatternUnit(const Valentina::Units &patternUnit)
_patternUnit = patternUnit;
InitLineWidth();
}
+
+//---------------------------------------------------------------------------------------------------------------------
+QString VApplication::Measurement(const QString &measurement) const
+{
+ return measurements.value(measurement).translate();
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+QString VApplication::GuiText(const QString &measurement) const
+{
+ return guiTexts.value(measurement).translate();
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+QString VApplication::Description(const QString &measurement) const
+{
+ return descriptions.value(measurement).translate();
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+QString VApplication::Variable(const QString &name) const
+{
+ return variables.value(name).translate();
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+QString VApplication::Function(const QString &name) const
+{
+ return functions.value(name).translate();
+}
diff --git a/src/app/widgets/vapplication.h b/src/app/widgets/vapplication.h
index 8ac8c4ec5..63d2e763b 100644
--- a/src/app/widgets/vapplication.h
+++ b/src/app/widgets/vapplication.h
@@ -72,19 +72,24 @@ public:
QString pathToTables() const;
qreal widthMainLine() const;
qreal widthHairLine() const;
+ QString Measurement(const QString &measurement) const;
+ QString GuiText(const QString &measurement) const;
+ QString Description(const QString &measurement) const;
+ QString Variable(const QString &name) const;
+ QString Function(const QString &name) const;
private:
Valentina::Units _patternUnit;
Pattern::Measurements _patternType;
qreal _widthMainLine;
qreal _widthHairLine;
QMap measurements;
- QMap guiText;
- QMap description;
+ QMap guiTexts;
+ QMap descriptions;
QMap variables;
QMap functions;
void InitLineWidth();
void InitMeasurements();
- void InitMeasurement(const QString &measurement, const QString &guiTxt, const QString & desc);
+ void InitMeasurement(const QString &measurement, const QString &guiText, const QString & desc);
void InitVariables();
void InitFunctions();
diff --git a/src/app/widgets/vtranslation.cpp b/src/app/widgets/vtranslation.cpp
index d03a78683..be675def7 100644
--- a/src/app/widgets/vtranslation.cpp
+++ b/src/app/widgets/vtranslation.cpp
@@ -40,12 +40,15 @@ VTranslation VTranslation::translate(const QString &context, const QString &sour
return t;
}
+//---------------------------------------------------------------------------------------------------------------------
+VTranslation::VTranslation()
+ :mcontext(QString()), msourceText(QString()), mdisambiguation(QString()), mn(-1)
+{}
+
//---------------------------------------------------------------------------------------------------------------------
VTranslation::VTranslation(const QString &context, const QString &sourceText, const QString &disambiguation, int n)
:mcontext(context), msourceText(sourceText), mdisambiguation(disambiguation), mn(n)
-{
- mn = -1;
-}
+{}
//---------------------------------------------------------------------------------------------------------------------
QString VTranslation::VTranslation::translate() const
diff --git a/src/app/widgets/vtranslation.h b/src/app/widgets/vtranslation.h
index 2017be0f2..f36cdf45a 100644
--- a/src/app/widgets/vtranslation.h
+++ b/src/app/widgets/vtranslation.h
@@ -50,6 +50,7 @@
class VTranslation
{
public:
+ VTranslation();
VTranslation(const QString &context, const QString &sourceText, const QString &disambiguation = 0, int n = -1);
QString translate() const;
static VTranslation translate(const QString &context, const QString &sourceText, const QString &disambiguation = 0,
diff --git a/src/app/xml/vindividualmeasurements.cpp b/src/app/xml/vindividualmeasurements.cpp
index 57a98d5f9..8a6ceaefe 100644
--- a/src/app/xml/vindividualmeasurements.cpp
+++ b/src/app/xml/vindividualmeasurements.cpp
@@ -27,22 +27,15 @@
*************************************************************************/
#include "vindividualmeasurements.h"
+#include "../widgets/vapplication.h"
-const QString VIndividualMeasurements::AttrIgnore = QStringLiteral("ignore");
-const QString VIndividualMeasurements::AttrName = QStringLiteral("name");
-const QString VIndividualMeasurements::AttrM_number = QStringLiteral("m_number");
-const QString VIndividualMeasurements::AttrGui_text = QStringLiteral("gui_text");
const QString VIndividualMeasurements::AttrValue = QStringLiteral("value");
-const QString VIndividualMeasurements::AttrDescription = QStringLiteral("description");
-
-const QString VIndividualMeasurements::TagLang = QStringLiteral("lang");
const QString VIndividualMeasurements::TagFamily_name = QStringLiteral("family-name");
const QString VIndividualMeasurements::TagGiven_name = QStringLiteral("given-name");
const QString VIndividualMeasurements::TagBirth_date = QStringLiteral("birth-date");
const QString VIndividualMeasurements::TagSex = QStringLiteral("sex");
const QString VIndividualMeasurements::TagUnit = QStringLiteral("unit");
-const QString VIndividualMeasurements::TagEmail = QStringLiteral("email");
-
+const QString VIndividualMeasurements::TagEmail = QStringLiteral("email");
const QString VIndividualMeasurements::SexMale = QStringLiteral("male");
const QString VIndividualMeasurements::SexFemale = QStringLiteral("female");
@@ -67,92 +60,142 @@ void VIndividualMeasurements::setUnit(const Valentina::Units &unit)
void VIndividualMeasurements::Measurements()
{
//head and neck
- Measurement("head_girth");
- Measurement("mid_neck_girth");
- Measurement("neck_base_girth");
- Measurement("head_and_neck_length");
+ Measurement(headGirth);
+ Measurement(midNeckGirth);
+ Measurement(neckBaseGirth);
+ Measurement(headAndNeckLength);
//torso
- Measurement("center_front_waist_length");
- Measurement("center_back_waist_length");
- Measurement("shoulder_length");
- Measurement("side_waist_length");
- Measurement("trunk_length");
- Measurement("shoulder_girth");
- Measurement("upper_chest_girth");
- Measurement("bust__girth");
- Measurement("under_bust_girth");
- Measurement("waist_girth");
- Measurement("high_hip_girth");
- Measurement("hip_girth");
- Measurement("upper_front_chest_width");
- Measurement("front_chest_width");
- Measurement("across_front_shoulder_width");
- Measurement("across_back_shoulder_width");
- Measurement("upper_back_width");
- Measurement("back_width");
- Measurement("bustpoint_to_bustpoint");
- Measurement("halter_bustpoint_to_bustpoint");
- Measurement("neck_to_bustpoint");
- Measurement("crotch_length");
- Measurement("rise_height");
- Measurement("shoulder_drop");
- Measurement("shoulder_slope_degrees");
- Measurement("front_shoulder_slope_length");
- Measurement("back_shoulder_slope_length");
- Measurement("front_shoulder_to_waist_length");
- Measurement("back_shoulder_to_waist_length");
- Measurement("front_neck_arc");
- Measurement("back_neck_arc");
- Measurement("front_upper-bust_arc");
- Measurement("back_upper-bust_arc");
- Measurement("front_waist_arc");
- Measurement("back_waist_arc");
- Measurement("front_upper-hip_arc");
- Measurement("back_upper-hip_arc");
- Measurement("front_hip_arc");
- Measurement("back_hip_arc");
- Measurement("chest_slope");
- Measurement("back_slope");
- Measurement("front_waist_slope");
- Measurement("back_waist_slope");
- Measurement("front-neck_to_upper-chest_height");
- Measurement("front-neck_to_bust_height");
+ Measurement(centerFrontWaistLength);
+ Measurement(centerBackWaistLength);
+ Measurement(shoulderLength);
+ Measurement(sideWaistLength);
+ Measurement(trunkLength);
+ Measurement(shoulderGirth);
+ Measurement(upperChestGirth);
+ Measurement(bustGirth);
+ Measurement(underBustGirth);
+ Measurement(waistGirth);
+ Measurement(highHipGirth);
+ Measurement(hipGirth);
+ Measurement(upperFrontChestWidth);
+ Measurement(frontChestWidth);
+ Measurement(acrossFrontShoulderWidth);
+ Measurement(acrossBackShoulderWidth);
+ Measurement(upperBackWidth);
+ Measurement(backWidth);
+ Measurement(bustpointToBustpoint);
+ Measurement(halterBustpointToBustpoint);
+ Measurement(neckToBustpoint);
+ Measurement(crotchLength);
+ Measurement(riseHeight);
+ Measurement(shoulderDrop);
+ Measurement(shoulderSlopeDegrees);
+ Measurement(frontShoulderSlopeLength);
+ Measurement(backShoulderSlopeLength);
+ Measurement(frontShoulderToWaistLength);
+ Measurement(backShoulderToWaistLength);
+ Measurement(frontNeckArc);
+ Measurement(backNeckArc);
+ Measurement(frontUpperChestArc);
+ Measurement(backUpperChestArc);
+ Measurement(frontWaistArc);
+ Measurement(backWaistArc);
+ Measurement(frontUpperHipArc);
+ Measurement(backUpperHipArc);
+ Measurement(frontHipArc);
+ Measurement(backHipArc);
+ Measurement(chestSlope);
+ Measurement(backSlope);
+ Measurement(frontWaistSlope);
+ Measurement(backWaistSlope);
+ Measurement(frontNeckToUpperChestHeight);
+ Measurement(frontNeckToBustHeight);
//arm
- Measurement("armscye_girth");
- Measurement("elbow_girth");
- Measurement("upper-arm_girth");
- Measurement("wrist_girth");
- Measurement("scye_depth");
- Measurement("shoulder_and_arm_length");
- Measurement("underarm_length");
- Measurement("cervicale_to_wrist_length");
- Measurement("shoulder_to_elbow_length");
- Measurement("arm_length");
+ Measurement(armscyeGirth);
+ Measurement(elbowGirth);
+ Measurement(upperArmGirth);
+ Measurement(wristGirth);
+ Measurement(scyeDepth);
+ Measurement(shoulderAndArmLength);
+ Measurement(underarmLength);
+ Measurement(cervicaleToWristLength);
+ Measurement(shoulderToElbowLength);
+ Measurement(armLength);
//hand
- Measurement("hand_width");
- Measurement("hand_length");
- Measurement("hand_girth");
+ Measurement(handWidth);
+ Measurement(handLength);
+ Measurement(handGirth);
//leg
- Measurement("thigh_girth");
- Measurement("mid_thigh_girth");
- Measurement("knee_girth");
- Measurement("calf_girth");
- Measurement("ankle_girth");
- Measurement("knee_height");
- Measurement("ankle_height");
+ Measurement(thighGirth);
+ Measurement(midThighGirth);
+ Measurement(kneeGirth);
+ Measurement(calfGirth);
+ Measurement(ankleGirth);
+ Measurement(kneeHeight);
+ Measurement(ankleHeight);
//foot
- Measurement("foot_width");
- Measurement("foot_length");
+ Measurement(footWidth);
+ Measurement(footLength);
//heights
- Measurement("height");
- Measurement("cervicale_height");
- Measurement("cervicale_to_knee_height");
- Measurement("waist_height");
- Measurement("high_hip_height");
- Measurement("hip_height");
- Measurement("waist_to_hip_height");
- Measurement("waist_to_knee_height");
- Measurement("crotch_height");
+ Measurement(height);
+ Measurement(cervicaleHeight);
+ Measurement(cervicaleToKneeHeight);
+ Measurement(waistHeight);
+ Measurement(highHipHeight);
+ Measurement(hipHeight);
+ Measurement(waistToHipHeight);
+ Measurement(waistToKneeHeight);
+ Measurement(crotchHeight);
+ //extended
+ Measurement(size);
+ Measurement(heightFrontNeckBasePoint);
+ Measurement(heightBaseNeckSidePoint);
+ Measurement(heightShoulderPoint);
+ Measurement(heightNipplePoint);
+ Measurement(heightBackAngleAxilla);
+ Measurement(heightScapularPoint);
+ Measurement(heightUnderButtockFolds);
+ Measurement(hipsExcludingProtrudingAbdomen);
+ Measurement(girthFootInstep);
+ Measurement(sideWaistToFloor);
+ Measurement(frontWaistToFloor);
+ Measurement(arcThroughGroinArea);
+ Measurement(waistToPlaneSeat);
+ Measurement(neckToRadialPoint);
+ Measurement(neckToThirdFinger);
+ Measurement(neckToFirstLineChestCircumference);
+ Measurement(frontWaistLength);
+ Measurement(arcThroughShoulderJoint);
+ Measurement(neckToBackLineChestCircumference);
+ Measurement(waistToNeckSide);
+ Measurement(arcLengthUpperBody);
+ Measurement(chestWidth);
+ Measurement(anteroposteriorDiameterHands);
+ Measurement(heightClavicularPoint);
+ Measurement(heightArmholeSlash);
+ Measurement(slashShoulderHeight);
+ Measurement(halfGirthNeck);
+ Measurement(halfGirthNeckForShirts);
+ Measurement(halfGirthChestFirst);
+ Measurement(halfGirthChestSecond);
+ Measurement(halfGirthChestThird);
+ Measurement(halfGirthWaist);
+ Measurement(halfGirthHipsConsideringProtrudingAbdomen);
+ Measurement(halfGirthHipsExcludingProtrudingAbdomen);
+ Measurement(girthKneeFlexedFeet);
+ Measurement(neckTransverseDiameter);
+ Measurement(frontSlashShoulderHeight);
+ Measurement(neckToFrontWaistLine);
+ Measurement(handVerticalDiameter);
+ Measurement(neckToKneePoint);
+ Measurement(waistToKnee);
+ Measurement(shoulderHeight);
+ Measurement(headHeight);
+ Measurement(bodyPosition);
+ Measurement(arcBehindShoulderGirdle);
+ Measurement(neckToNeckBase);
+ Measurement(depthWaistFirst);
+ Measurement(depthWaistSecond);
}
//---------------------------------------------------------------------------------------------------------------------
@@ -172,62 +215,18 @@ void VIndividualMeasurements::Measurement(const QString &tag)
const QDomElement domElement = domNode.toElement();
if (domElement.isNull() == false)
{
- const bool ignore = QVariant(GetParametrString(domElement, AttrIgnore, "false")).toBool();
- if (ignore)
- {
- return;
- }
- const QString name = GetParametrString(domElement, AttrName, "");
- if (name.isEmpty())
- {
- return;
- }
- const QString m_number = GetParametrString(domElement, AttrM_number, "");
- const QString gui_text = GetParametrString(domElement, AttrGui_text, "");
- const qreal value = GetParametrDouble(domElement, AttrValue, "0.0");
- const QString description = GetParametrString(domElement, AttrDescription, "");
+ qreal value = GetParametrDouble(domElement, AttrValue, "0.0");
if (Unit() == Valentina::Mm)//Convert to Cm.
{
- data->AddMeasurement(name, VMeasurement(value/10.0, gui_text, description, tag));
- if (m_number.isEmpty())
- {
- qDebug()<<"Can't find language-independent measurement name for "<< tag;
- return;
- }
- else
- {
- VMeasurement m(value/10.0, gui_text, description, tag);
- m.setVirtual(true);
- data->AddMeasurement(m_number, m);
- }
- }
- else//Cm or inch.
- {
- data->AddMeasurement(name, VMeasurement(value, gui_text, description, tag));
- if (m_number.isEmpty())
- {
- qDebug()<<"Can't find language-independent measurement name for "<< tag;
- return;
- }
- else
- {
- VMeasurement m(value, gui_text, description, tag);
- m.setVirtual(true);
- data->AddMeasurement(m_number, m);
- }
+ value = value / 10.0;
}
+ data->AddMeasurement(tag, VMeasurement(value, qApp->GuiText(tag), qApp->Description(tag), tag));
}
}
}
}
-//---------------------------------------------------------------------------------------------------------------------
-QString VIndividualMeasurements::Language() const
-{
- return UniqueTagText(TagLang, "en");
-}
-
//---------------------------------------------------------------------------------------------------------------------
QString VIndividualMeasurements::FamilyName() const
{
diff --git a/src/app/xml/vindividualmeasurements.h b/src/app/xml/vindividualmeasurements.h
index d5894bd4a..148121bd9 100644
--- a/src/app/xml/vindividualmeasurements.h
+++ b/src/app/xml/vindividualmeasurements.h
@@ -42,7 +42,6 @@ public:
Valentina::Units Unit() const;
void setUnit(const Valentina::Units &unit);
void Measurements();
- QString Language() const;
QString FamilyName() const;
void setFamilyName(const QString &text);
QString GivenName() const;
@@ -53,21 +52,13 @@ public:
void setSex(const VIndividualMeasurements::Genders &sex);
QString Mail() const;
void setMail(const QString &text);
- static const QString AttrIgnore;
- static const QString AttrName;
- static const QString AttrM_number;
- static const QString AttrGui_text;
static const QString AttrValue;
- static const QString AttrDescription;
-
- static const QString TagLang;
static const QString TagFamily_name;
static const QString TagGiven_name;
static const QString TagBirth_date;
static const QString TagSex;
static const QString TagUnit;
static const QString TagEmail;
-
static const QString SexMale;
static const QString SexFemale;