Fixed issue #464. Crash. Issue with modeling node objects.
(grafted from 291ce7d161d51618e7164f6f7addb929e27ee8ac) --HG-- branch : develop
This commit is contained in:
parent
371c352efc
commit
297b32d5d9
|
@ -19,6 +19,7 @@
|
||||||
- [#385] Add 'Open Recent' option in Tape.exe, 'File' dropdown menu.
|
- [#385] Add 'Open Recent' option in Tape.exe, 'File' dropdown menu.
|
||||||
|
|
||||||
# Version 0.4.4
|
# Version 0.4.4
|
||||||
|
- [#464] Crash. Issue with modeling node objects.
|
||||||
- [#463] Wrong export to DXF format.
|
- [#463] Wrong export to DXF format.
|
||||||
- Fixed issue with deleting detail nodes.
|
- Fixed issue with deleting detail nodes.
|
||||||
- [#458] Issue with segment of curve.
|
- [#458] Issue with segment of curve.
|
||||||
|
|
|
@ -1274,7 +1274,16 @@ void VPattern::ParseNodePoint(const QDomElement &domElement, const Document &par
|
||||||
PointsCommonAttributes(domElement, id, mx, my);
|
PointsCommonAttributes(domElement, id, mx, my);
|
||||||
const quint32 idObject = GetParametrUInt(domElement, VAbstractNode::AttrIdObject, NULL_ID_STR);
|
const quint32 idObject = GetParametrUInt(domElement, VAbstractNode::AttrIdObject, NULL_ID_STR);
|
||||||
const quint32 idTool = GetParametrUInt(domElement, VAbstractNode::AttrIdTool, NULL_ID_STR);
|
const quint32 idTool = GetParametrUInt(domElement, VAbstractNode::AttrIdTool, NULL_ID_STR);
|
||||||
const QSharedPointer<VPointF> point = data->GeometricObject<VPointF>(idObject );
|
QSharedPointer<VPointF> point;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
point = data->GeometricObject<VPointF>(idObject);
|
||||||
|
}
|
||||||
|
catch (const VExceptionBadId &e)
|
||||||
|
{ // Possible case. Parent was deleted, but the node object is still here.
|
||||||
|
Q_UNUSED(e);
|
||||||
|
return;// Just ignore
|
||||||
|
}
|
||||||
data->UpdateGObject(id, new VPointF(point->toQPointF(), point->name(), mx, my, idObject,
|
data->UpdateGObject(id, new VPointF(point->toQPointF(), point->name(), mx, my, idObject,
|
||||||
Draw::Modeling));
|
Draw::Modeling));
|
||||||
VNodePoint::Create(this, data, sceneDetail, id, idObject, parse, Source::FromFile, idTool);
|
VNodePoint::Create(this, data, sceneDetail, id, idObject, parse, Source::FromFile, idTool);
|
||||||
|
@ -2180,20 +2189,28 @@ void VPattern::ParseNodeSpline(const QDomElement &domElement, const Document &pa
|
||||||
quint32 idTool = 0;
|
quint32 idTool = 0;
|
||||||
|
|
||||||
SplinesCommonAttributes(domElement, id, idObject, idTool);
|
SplinesCommonAttributes(domElement, id, idObject, idTool);
|
||||||
const auto obj = data->GetGObject(idObject);
|
try
|
||||||
if (obj->getType() == GOType::Spline)
|
|
||||||
{
|
{
|
||||||
VSpline *spl = new VSpline(*data->GeometricObject<VSpline>(idObject));
|
const auto obj = data->GetGObject(idObject);
|
||||||
spl->setIdObject(idObject);
|
if (obj->getType() == GOType::Spline)
|
||||||
spl->setMode(Draw::Modeling);
|
{
|
||||||
data->UpdateGObject(id, spl);
|
VSpline *spl = new VSpline(*data->GeometricObject<VSpline>(idObject));
|
||||||
|
spl->setIdObject(idObject);
|
||||||
|
spl->setMode(Draw::Modeling);
|
||||||
|
data->UpdateGObject(id, spl);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
VCubicBezier *spl = new VCubicBezier(*data->GeometricObject<VCubicBezier>(idObject));
|
||||||
|
spl->setIdObject(idObject);
|
||||||
|
spl->setMode(Draw::Modeling);
|
||||||
|
data->UpdateGObject(id, spl);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
catch (const VExceptionBadId &e)
|
||||||
{
|
{ // Possible case. Parent was deleted, but the node object is still here.
|
||||||
VCubicBezier *spl = new VCubicBezier(*data->GeometricObject<VCubicBezier>(idObject));
|
Q_UNUSED(e);
|
||||||
spl->setIdObject(idObject);
|
return;// Just ignore
|
||||||
spl->setMode(Draw::Modeling);
|
|
||||||
data->UpdateGObject(id, spl);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VNodeSpline::Create(this, data, id, idObject, parse, Source::FromFile, idTool);
|
VNodeSpline::Create(this, data, id, idObject, parse, Source::FromFile, idTool);
|
||||||
|
@ -2218,20 +2235,28 @@ void VPattern::ParseNodeSplinePath(const QDomElement &domElement, const Document
|
||||||
quint32 idTool = 0;
|
quint32 idTool = 0;
|
||||||
|
|
||||||
SplinesCommonAttributes(domElement, id, idObject, idTool);
|
SplinesCommonAttributes(domElement, id, idObject, idTool);
|
||||||
const auto obj = data->GetGObject(idObject);
|
try
|
||||||
if (obj->getType() == GOType::SplinePath)
|
|
||||||
{
|
{
|
||||||
VSplinePath *path = new VSplinePath(*data->GeometricObject<VSplinePath>(idObject));
|
const auto obj = data->GetGObject(idObject);
|
||||||
path->setIdObject(idObject);
|
if (obj->getType() == GOType::SplinePath)
|
||||||
path->setMode(Draw::Modeling);
|
{
|
||||||
data->UpdateGObject(id, path);
|
VSplinePath *path = new VSplinePath(*data->GeometricObject<VSplinePath>(idObject));
|
||||||
|
path->setIdObject(idObject);
|
||||||
|
path->setMode(Draw::Modeling);
|
||||||
|
data->UpdateGObject(id, path);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
VCubicBezierPath *spl = new VCubicBezierPath(*data->GeometricObject<VCubicBezierPath>(idObject));
|
||||||
|
spl->setIdObject(idObject);
|
||||||
|
spl->setMode(Draw::Modeling);
|
||||||
|
data->UpdateGObject(id, spl);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
catch (const VExceptionBadId &e)
|
||||||
{
|
{ // Possible case. Parent was deleted, but the node object is still here.
|
||||||
VCubicBezierPath *spl = new VCubicBezierPath(*data->GeometricObject<VCubicBezierPath>(idObject));
|
Q_UNUSED(e);
|
||||||
spl->setIdObject(idObject);
|
return;// Just ignore
|
||||||
spl->setMode(Draw::Modeling);
|
|
||||||
data->UpdateGObject(id, spl);
|
|
||||||
}
|
}
|
||||||
VNodeSplinePath::Create(this, data, id, idObject, parse, Source::FromFile, idTool);
|
VNodeSplinePath::Create(this, data, id, idObject, parse, Source::FromFile, idTool);
|
||||||
}
|
}
|
||||||
|
@ -2300,7 +2325,16 @@ void VPattern::ParseNodeArc(const QDomElement &domElement, const Document &parse
|
||||||
ToolsCommonAttributes(domElement, id);
|
ToolsCommonAttributes(domElement, id);
|
||||||
const quint32 idObject = GetParametrUInt(domElement, VAbstractNode::AttrIdObject, NULL_ID_STR);
|
const quint32 idObject = GetParametrUInt(domElement, VAbstractNode::AttrIdObject, NULL_ID_STR);
|
||||||
const quint32 idTool = GetParametrUInt(domElement, VAbstractNode::AttrIdTool, NULL_ID_STR);
|
const quint32 idTool = GetParametrUInt(domElement, VAbstractNode::AttrIdTool, NULL_ID_STR);
|
||||||
VArc *arc = new VArc(*data->GeometricObject<VArc>(idObject));
|
VArc *arc = nullptr;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
arc = new VArc(*data->GeometricObject<VArc>(idObject));
|
||||||
|
}
|
||||||
|
catch (const VExceptionBadId &e)
|
||||||
|
{ // Possible case. Parent was deleted, but the node object is still here.
|
||||||
|
Q_UNUSED(e);
|
||||||
|
return;// Just ignore
|
||||||
|
}
|
||||||
arc->setIdObject(idObject);
|
arc->setIdObject(idObject);
|
||||||
arc->setMode(Draw::Modeling);
|
arc->setMode(Draw::Modeling);
|
||||||
data->UpdateGObject(id, arc);
|
data->UpdateGObject(id, arc);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user