Write/read label center pin point.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2017-03-13 16:10:25 +02:00
parent 94ec43d85e
commit 6802c6f154
3 changed files with 22 additions and 0 deletions

View File

@ -821,6 +821,7 @@ void VPattern::ParsePieceDataTag(const QDomElement &domElement, VPiece &detail)
ppData.SetLabelHeight(GetParametrString(domElement, VToolSeamAllowance::AttrHeight, "1"));
ppData.SetFontSize(static_cast<int>(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<int>(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));
}

View File

@ -495,6 +495,7 @@
<xs:attribute name="width" type="xs:string"/>
<xs:attribute name="height" type="xs:string"/>
<xs:attribute name="rotation" type="xs:string"/>
<xs:attribute name="centerPin" type="xs:unsignedInt"/>
<xs:attribute name="topLeftPin" type="xs:unsignedInt"/>
<xs:attribute name="bottomRightPin" type="xs:unsignedInt"/>
</xs:complexType>
@ -508,6 +509,7 @@
<xs:attribute name="width" type="xs:string"/>
<xs:attribute name="height" type="xs:string"/>
<xs:attribute name="rotation" type="xs:string"/>
<xs:attribute name="centerPin" type="xs:unsignedInt"/>
<xs:attribute name="topLeftPin" type="xs:unsignedInt"/>
<xs:attribute name="bottomRightPin" type="xs:unsignedInt"/>
</xs:complexType>

View File

@ -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());