Refactoring.
--HG-- branch : develop
This commit is contained in:
parent
1f9c1e623e
commit
2cf032461d
|
@ -140,16 +140,17 @@ VToolArc* VToolArc::Create(const quint32 _id, const quint32 ¢er, QString &ra
|
|||
if (typeCreation == Source::FromGui)
|
||||
{
|
||||
id = data->AddGObject(arc);
|
||||
data->AddLengthArc(id);
|
||||
}
|
||||
else
|
||||
{
|
||||
data->UpdateGObject(id, arc);
|
||||
data->AddLengthArc(id);
|
||||
if (parse != Document::FullParse)
|
||||
{
|
||||
doc->UpdateToolData(id, data);
|
||||
}
|
||||
}
|
||||
data->AddLengthArc(id);
|
||||
VDrawTool::AddRecord(id, Tool::ArcTool, doc);
|
||||
if (parse == Document::FullParse)
|
||||
{
|
||||
|
|
|
@ -138,36 +138,31 @@ VToolCutArc* VToolCutArc::Create(const quint32 _id, const QString &pointName, QS
|
|||
quint32 arc2id = 0;
|
||||
if (typeCreation == Source::FromGui)
|
||||
{
|
||||
VPointF *p = new VPointF(point, pointName, mx, my);
|
||||
id = data->AddGObject(p);
|
||||
id = data->AddGObject(new VPointF(point, pointName, mx, my));
|
||||
arc1id = data->AddGObject(new VArc(arc1));
|
||||
arc2id = data->AddGObject(new VArc(arc2));
|
||||
|
||||
VArc * ar1 = new VArc(arc1);
|
||||
arc1id = data->AddGObject(ar1);
|
||||
|
||||
VArc * ar2 = new VArc(arc2);
|
||||
arc2id = data->AddGObject(ar2);
|
||||
data->AddLengthArc(arc1id);
|
||||
data->AddLengthArc(arc2id);
|
||||
}
|
||||
else
|
||||
{
|
||||
VPointF *p = new VPointF(point, pointName, mx, my);
|
||||
data->UpdateGObject(id, p);
|
||||
data->UpdateGObject(id, new VPointF(point, pointName, mx, my));
|
||||
|
||||
arc1id = id + 1;
|
||||
arc2id = id + 2;
|
||||
|
||||
VArc * ar1 = new VArc(arc1);
|
||||
data->UpdateGObject(arc1id, ar1);
|
||||
data->UpdateGObject(arc1id, new VArc(arc1));
|
||||
data->UpdateGObject(arc2id, new VArc(arc2));
|
||||
|
||||
VArc * ar2 = new VArc(arc2);
|
||||
data->UpdateGObject(arc2id, ar2);
|
||||
data->AddLengthArc(arc1id);
|
||||
data->AddLengthArc(arc2id);
|
||||
|
||||
if (parse != Document::FullParse)
|
||||
{
|
||||
doc->UpdateToolData(id, data);
|
||||
}
|
||||
}
|
||||
data->AddLengthArc(arc1id);
|
||||
data->AddLengthArc(arc2id);
|
||||
|
||||
VDrawTool::AddRecord(id, Tool::CutArcTool, doc);
|
||||
if (parse == Document::FullParse)
|
||||
|
|
|
@ -44,8 +44,7 @@
|
|||
VToolLinePoint::VToolLinePoint(VPattern *doc, VContainer *data, const quint32 &id,
|
||||
const QString &typeLine, const QString &formula, const quint32 &basePointId,
|
||||
const qreal &angle, QGraphicsItem *parent)
|
||||
:VToolPoint(doc, data, id, parent), formula(formula), angle(angle), basePointId(basePointId),
|
||||
mainLine(nullptr)
|
||||
:VToolPoint(doc, data, id, parent), formula(formula), angle(angle), basePointId(basePointId), mainLine(nullptr)
|
||||
{
|
||||
this->typeLine = typeLine;
|
||||
Q_ASSERT_X(basePointId > 0, Q_FUNC_INFO, "basePointId <= 0");
|
||||
|
|
Loading…
Reference in New Issue
Block a user