From 6802c6f154cfd256391846a41d39a83bd97ff38f Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 13 Mar 2017 16:10:25 +0200 Subject: [PATCH] Write/read label center pin point. --HG-- branch : feature --- src/app/valentina/xml/vpattern.cpp | 2 ++ src/libs/ifc/schema/pattern/v0.4.4.xsd | 2 ++ src/libs/vtools/tools/vtoolseamallowance.cpp | 18 ++++++++++++++++++ 3 files changed, 22 insertions(+) diff --git a/src/app/valentina/xml/vpattern.cpp b/src/app/valentina/xml/vpattern.cpp index 6f415651e..e4a95f52d 100644 --- a/src/app/valentina/xml/vpattern.cpp +++ b/src/app/valentina/xml/vpattern.cpp @@ -821,6 +821,7 @@ void VPattern::ParsePieceDataTag(const QDomElement &domElement, VPiece &detail) ppData.SetLabelHeight(GetParametrString(domElement, VToolSeamAllowance::AttrHeight, "1")); ppData.SetFontSize(static_cast(GetParametrUInt(domElement, VToolSeamAllowance::AttrFont, "0"))); ppData.SetRotation(GetParametrString(domElement, AttrRotation, "0")); + ppData.SetCenterPin(GetParametrUInt(domElement, VToolSeamAllowance::AttrCenterPin, NULL_ID_STR)); ppData.SetTopLeftPin(GetParametrUInt(domElement, VToolSeamAllowance::AttrTopLeftPin, NULL_ID_STR)); ppData.SetBottomRightPin(GetParametrUInt(domElement, VToolSeamAllowance::AttrBottomRightPin, NULL_ID_STR)); @@ -850,6 +851,7 @@ void VPattern::ParsePiecePatternInfo(const QDomElement &domElement, VPiece &deta patternInfo.SetLabelHeight(GetParametrString(domElement, VToolSeamAllowance::AttrHeight, "1")); patternInfo.SetFontSize(static_cast(GetParametrUInt(domElement, VToolSeamAllowance::AttrFont, "0"))); patternInfo.SetRotation(GetParametrString(domElement, AttrRotation, "0")); + patternInfo.SetCenterPin(GetParametrUInt(domElement, VToolSeamAllowance::AttrCenterPin, NULL_ID_STR)); patternInfo.SetTopLeftPin(GetParametrUInt(domElement, VToolSeamAllowance::AttrTopLeftPin, NULL_ID_STR)); patternInfo.SetBottomRightPin(GetParametrUInt(domElement, VToolSeamAllowance::AttrBottomRightPin, NULL_ID_STR)); } diff --git a/src/libs/ifc/schema/pattern/v0.4.4.xsd b/src/libs/ifc/schema/pattern/v0.4.4.xsd index 04528e713..a92a2a950 100644 --- a/src/libs/ifc/schema/pattern/v0.4.4.xsd +++ b/src/libs/ifc/schema/pattern/v0.4.4.xsd @@ -495,6 +495,7 @@ + @@ -508,6 +509,7 @@ + diff --git a/src/libs/vtools/tools/vtoolseamallowance.cpp b/src/libs/vtools/tools/vtoolseamallowance.cpp index 58187c3f3..ac90a4801 100644 --- a/src/libs/vtools/tools/vtoolseamallowance.cpp +++ b/src/libs/vtools/tools/vtoolseamallowance.cpp @@ -258,6 +258,15 @@ void VToolSeamAllowance::AddPatternPieceData(VAbstractPattern *doc, QDomElement doc->SetAttribute(domData, AttrFont, data.GetFontSize()); doc->SetAttribute(domData, VAbstractPattern::AttrRotation, data.GetRotation()); + if (data.CenterPin() > NULL_ID) + { + doc->SetAttribute(domData, AttrCenterPin, data.CenterPin()); + } + else + { + domData.removeAttribute(AttrCenterPin); + } + if (data.TopLeftPin() > NULL_ID) { doc->SetAttribute(domData, AttrTopLeftPin, data.TopLeftPin()); @@ -305,6 +314,15 @@ void VToolSeamAllowance::AddPatternInfo(VAbstractPattern *doc, QDomElement &domE doc->SetAttribute(domData, AttrFont, geom.GetFontSize()); doc->SetAttribute(domData, VAbstractPattern::AttrRotation, geom.GetRotation()); + if (geom.CenterPin() > NULL_ID) + { + doc->SetAttribute(domData, AttrCenterPin, geom.CenterPin()); + } + else + { + domData.removeAttribute(AttrCenterPin); + } + if (geom.TopLeftPin() > NULL_ID) { doc->SetAttribute(domData, AttrTopLeftPin, geom.TopLeftPin());