From cdf2e02eef0abe1df84ee1acf804382284312f4e Mon Sep 17 00:00:00 2001 From: dismine Date: Tue, 24 Dec 2013 11:58:23 +0200 Subject: [PATCH] History records for tools "CutSpline" and "CutSplinePath". --HG-- branch : feature --- src/dialogs/dialoghistory.cpp | 38 +++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/dialogs/dialoghistory.cpp b/src/dialogs/dialoghistory.cpp index c99b81bd9..9c25c253a 100644 --- a/src/dialogs/dialoghistory.cpp +++ b/src/dialogs/dialoghistory.cpp @@ -32,6 +32,8 @@ #include "../geometry/vspline.h" #include "../geometry/vsplinepath.h" #include "../tools/vabstracttool.h" +#include "../tools/drawTools/vtoolcutspline.h" +#include "../tools/drawTools/vtoolcutsplinepath.h" #include #include @@ -320,6 +322,42 @@ QString DialogHistory::Record(const VToolRecord &tool) data->GetPoint(firstPointId).name(), data->GetPoint(secondPointId).name()); break; } + case Tool::CutSplineTool: + { + qint64 splineId = 0; + domElement = doc->elementById(QString().setNum(tool.getId())); + if (domElement.isElement()) + { + splineId = doc->GetParametrLongLong(domElement, VToolCutSpline::AttrSpline, "0"); + } + VSpline spl = data->GetSpline(splineId); + record = QString(tr("%1 - cut curve %2_%3")).arg(data->GetPoint(tool.getId()).name(), + data->GetPoint(spl.GetP1()).name(), + data->GetPoint(spl.GetP4()).name()); + } + break; + case Tool::CutSplinePathTool: + { + qint64 splinePathId = 0; + domElement = doc->elementById(QString().setNum(tool.getId())); + if (domElement.isElement()) + { + splinePathId = doc->GetParametrLongLong(domElement, VToolCutSplinePath::AttrSplinePath, "0"); + } + VSplinePath splPath = data->GetSplinePath(splinePathId); + QVector points = splPath.GetSplinePath(); + if (points.size() != 0 ) + { + record = QString(tr("%1 - cut curve point %2")).arg(data->GetPoint(tool.getId()).name(), + data->GetPoint(points[0].P()).name()); + for (qint32 i = 1; i< points.size(); ++i) + { + QString name = QString("_%1").arg(data->GetPoint(points[i].P()).name()); + record.append(name); + } + } + } + break; default: qWarning()<