From 4a9302ee4e8b0e14b3f0055f2fdbe0142e7c4687 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 15 Mar 2016 17:32:12 +0200 Subject: [PATCH] For modeling no need to seek parent tool id. (grafted from b84438717fd8436e747b3982461cee3c4124d935) --HG-- branch : develop --- src/libs/vtools/undocommands/vundocommand.cpp | 40 +------------------ 1 file changed, 2 insertions(+), 38 deletions(-) diff --git a/src/libs/vtools/undocommands/vundocommand.cpp b/src/libs/vtools/undocommands/vundocommand.cpp index f12fcb9f6..208d8a13f 100644 --- a/src/libs/vtools/undocommands/vundocommand.cpp +++ b/src/libs/vtools/undocommands/vundocommand.cpp @@ -73,25 +73,7 @@ void VUndoCommand::IncrementReferences(const QVector &nodes) const { for (qint32 i = 0; i < nodes.size(); ++i) { - switch (nodes.at(i).getTypeTool()) - { - case (Tool::NodePoint): - { - auto tool = qobject_cast(doc->getTool(nodeId)); - SCASSERT(tool != nullptr); - const auto point = tool->getData()->GeometricObject(nodes.at(i).getId()); - doc->IncrementReferens(point->getIdTool()); - break; - } - case (Tool::NodeArc): - case (Tool::NodeSpline): - case (Tool::NodeSplinePath): - doc->IncrementReferens(nodes.at(i).getId()); - break; - default: - qDebug()<<"Get wrong tool type. Ignore."; - break; - } + doc->IncrementReferens(nodes.at(i).getId()); } } @@ -100,24 +82,6 @@ void VUndoCommand::DecrementReferences(const QVector &nodes) const { for (qint32 i = 0; i < nodes.size(); ++i) { - switch (nodes.at(i).getTypeTool()) - { - case (Tool::NodePoint): - { - auto tool = qobject_cast(doc->getTool(nodeId)); - SCASSERT(tool != nullptr); - const auto point = tool->getData()->GeometricObject(nodes.at(i).getId()); - doc->DecrementReferens(point->getIdTool()); - break; - } - case (Tool::NodeArc): - case (Tool::NodeSpline): - case (Tool::NodeSplinePath): - doc->DecrementReferens(nodes.at(i).getId()); - break; - default: - qDebug()<<"Get wrong tool type. Ignore."; - break; - } + doc->DecrementReferens(nodes.at(i).getId()); } }