Read and write local seam allowance width (before and after).
--HG-- branch : feature
This commit is contained in:
parent
6706f3b39d
commit
d0b0f55d19
|
@ -748,7 +748,9 @@ void VPattern::ParseDetailNodes(const QDomElement &domElement, VPiece &detail) c
|
||||||
if (not element.isNull() && element.tagName() == VToolSeamAllowance::TagNode)
|
if (not element.isNull() && element.tagName() == VToolSeamAllowance::TagNode)
|
||||||
{
|
{
|
||||||
const quint32 id = GetParametrUInt(element, AttrIdObject, NULL_ID_STR);
|
const quint32 id = GetParametrUInt(element, AttrIdObject, NULL_ID_STR);
|
||||||
const bool reverse = GetParametrUInt(element, VToolDetail::AttrReverse, "0");
|
const bool reverse = GetParametrUInt(element, VToolSeamAllowance::AttrNodeReverse, "0");
|
||||||
|
const qreal saBefore = GetParametrDouble(element, VToolSeamAllowance::AttrSABefore, "-1");
|
||||||
|
const qreal saAfter = GetParametrDouble(element, VToolSeamAllowance::AttrSAAfter, "-1");
|
||||||
|
|
||||||
const QString t = GetParametrString(element, AttrType, VToolSeamAllowance::NodePoint);
|
const QString t = GetParametrString(element, AttrType, VToolSeamAllowance::NodePoint);
|
||||||
Tool tool;
|
Tool tool;
|
||||||
|
@ -771,7 +773,10 @@ void VPattern::ParseDetailNodes(const QDomElement &domElement, VPiece &detail) c
|
||||||
VException e(tr("Wrong tag name '%1'.").arg(t));
|
VException e(tr("Wrong tag name '%1'.").arg(t));
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
detail.Append(VPieceNode(id, tool, reverse));
|
VPieceNode node(id, tool, reverse);
|
||||||
|
node.SetSABefore(saBefore);
|
||||||
|
node.SetSAAfter(saAfter);
|
||||||
|
detail.Append(node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -399,9 +399,11 @@
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element name="node" minOccurs="1" maxOccurs="unbounded">
|
<xs:element name="node" minOccurs="1" maxOccurs="unbounded">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:attribute name="type" type="xs:string"></xs:attribute>
|
<xs:attribute name="type" type="xs:string" use="required"></xs:attribute>
|
||||||
<xs:attribute name="idObject" type="xs:unsignedInt"></xs:attribute>
|
<xs:attribute name="idObject" type="xs:unsignedInt" use="required"></xs:attribute>
|
||||||
<xs:attribute name="reverse" type="xs:unsignedInt"></xs:attribute>
|
<xs:attribute name="reverse" type="xs:unsignedInt"></xs:attribute>
|
||||||
|
<xs:attribute name="before" type="xs:double"></xs:attribute>
|
||||||
|
<xs:attribute name="after" type="xs:double"></xs:attribute>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
|
|
|
@ -64,6 +64,8 @@ const QString VToolSeamAllowance::AttrNodeReverse = QStringLiteral("reverse")
|
||||||
const QString VToolSeamAllowance::AttrForbidFlipping = QStringLiteral("forbidFlipping");
|
const QString VToolSeamAllowance::AttrForbidFlipping = QStringLiteral("forbidFlipping");
|
||||||
const QString VToolSeamAllowance::AttrSeamAllowance = QStringLiteral("seamAllowance");
|
const QString VToolSeamAllowance::AttrSeamAllowance = QStringLiteral("seamAllowance");
|
||||||
const QString VToolSeamAllowance::AttrWidth = QStringLiteral("width");
|
const QString VToolSeamAllowance::AttrWidth = QStringLiteral("width");
|
||||||
|
const QString VToolSeamAllowance::AttrSABefore = QStringLiteral("before");
|
||||||
|
const QString VToolSeamAllowance::AttrSAAfter = QStringLiteral("after");
|
||||||
|
|
||||||
const QString VToolSeamAllowance::NodeArc = QStringLiteral("NodeArc");
|
const QString VToolSeamAllowance::NodeArc = QStringLiteral("NodeArc");
|
||||||
const QString VToolSeamAllowance::NodePoint = QStringLiteral("NodePoint");
|
const QString VToolSeamAllowance::NodePoint = QStringLiteral("NodePoint");
|
||||||
|
@ -204,12 +206,21 @@ void VToolSeamAllowance::AddNode(VAbstractPattern *doc, QDomElement &domElement,
|
||||||
|
|
||||||
doc->SetAttribute(nod, AttrIdObject, node.GetId());
|
doc->SetAttribute(nod, AttrIdObject, node.GetId());
|
||||||
|
|
||||||
if (node.GetTypeTool() != Tool::NodePoint)
|
const Tool type = node.GetTypeTool();
|
||||||
|
if (type != Tool::NodePoint)
|
||||||
{
|
{
|
||||||
doc->SetAttribute(nod, AttrNodeReverse, static_cast<quint8>(node.GetReverse()));
|
doc->SetAttribute(nod, AttrNodeReverse, static_cast<quint8>(node.GetReverse()));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const qreal w1 = node.GetSABefore();
|
||||||
|
w1 < 0 ? domElement.removeAttribute(AttrSABefore) : doc->SetAttribute(nod, AttrSABefore, w1);
|
||||||
|
|
||||||
switch (node.GetTypeTool())
|
const qreal w2 = node.GetSAAfter();
|
||||||
|
w2 < 0 ? domElement.removeAttribute(AttrSAAfter) : doc->SetAttribute(nod, AttrSAAfter, w2);
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (type)
|
||||||
{
|
{
|
||||||
case (Tool::NodeArc):
|
case (Tool::NodeArc):
|
||||||
doc->SetAttribute(nod, AttrType, NodeArc);
|
doc->SetAttribute(nod, AttrType, NodeArc);
|
||||||
|
|
|
@ -62,6 +62,8 @@ public:
|
||||||
static const QString AttrForbidFlipping;
|
static const QString AttrForbidFlipping;
|
||||||
static const QString AttrSeamAllowance;
|
static const QString AttrSeamAllowance;
|
||||||
static const QString AttrWidth;
|
static const QString AttrWidth;
|
||||||
|
static const QString AttrSABefore;
|
||||||
|
static const QString AttrSAAfter;
|
||||||
|
|
||||||
static const QString NodeArc;
|
static const QString NodeArc;
|
||||||
static const QString NodePoint;
|
static const QString NodePoint;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user