Tool seam allowance add support for elliptical arc.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2016-12-20 17:50:39 +02:00
parent 0882313f1e
commit b6d0aa1a1f
2 changed files with 14 additions and 1 deletions

View File

@ -577,7 +577,8 @@ VPieceNode VPattern::ParseSANode(const QDomElement &domElement) const
const QStringList types = QStringList() << VAbstractPattern::NodePoint
<< VAbstractPattern::NodeArc
<< VAbstractPattern::NodeSpline
<< VAbstractPattern::NodeSplinePath;
<< VAbstractPattern::NodeSplinePath
<< VAbstractPattern::NodeElArc;
switch (types.indexOf(t))
{
@ -593,6 +594,9 @@ VPieceNode VPattern::ParseSANode(const QDomElement &domElement) const
case 3: // VAbstractPattern::NodeSplinePath
tool = Tool::NodeSplinePath;
break;
case 4: // NodeElArc
tool = Tool::NodeElArc;
break;
default:
VException e(tr("Wrong tag name '%1'.").arg(t));
throw e;

View File

@ -31,11 +31,13 @@
#include "../vpatterndb/vpiecenode.h"
#include "../vpatterndb/vpiecepath.h"
#include "nodeDetails/vnodearc.h"
#include "nodeDetails/vnodeellipticalarc.h"
#include "nodeDetails/vnodepoint.h"
#include "nodeDetails/vnodespline.h"
#include "nodeDetails/vnodesplinepath.h"
#include "nodeDetails/vtoolpiecepath.h"
#include "../vgeometry/varc.h"
#include "../vgeometry/vellipticalarc.h"
#include "../vgeometry/vcubicbezier.h"
#include "../vgeometry/vcubicbezierpath.h"
#include "../vgeometry/vpointf.h"
@ -106,6 +108,12 @@ VToolSeamAllowance *VToolSeamAllowance::Create(DialogTool *dialog, VMainGraphics
VNodeArc::Create(doc, data, id, nodeD.GetId(), Document::FullParse, Source::FromGui);
}
break;
case (Tool::NodeElArc):
{
id = CreateNode<VEllipticalArc>(data, nodeD.GetId());
VNodeEllipticalArc::Create(doc, data, id, nodeD.GetId(), Document::FullParse, Source::FromGui);
}
break;
case (Tool::NodeSpline):
{
const auto obj = data->GetGObject(nodeD.GetId());
@ -736,6 +744,7 @@ void VToolSeamAllowance::InitNodes(const VPiece &detail, VMainGraphicsScene *sce
break;
}
case (Tool::NodeArc):
case (Tool::NodeElArc):
case (Tool::NodeSpline):
case (Tool::NodeSplinePath):
doc->IncrementReferens(detail.GetPath().at(i).GetId());