Refactor to avoid hidding class member.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2017-09-17 09:45:18 +03:00
parent fa74e32769
commit dbe1981eb5
53 changed files with 317 additions and 317 deletions

View File

@ -151,7 +151,7 @@ void VToolFlippingByAxis::SetAxisType(AxisType value)
{
m_axisType = value;
QSharedPointer<VGObject> obj = VContainer::GetFakeGObject(id);
QSharedPointer<VGObject> obj = VContainer::GetFakeGObject(m_id);
SaveOption(obj);
}

View File

@ -51,7 +51,7 @@ void VAbstractOperation::SetSuffix(const QString &suffix)
{
// Don't know if need check name here.
this->suffix = suffix;
QSharedPointer<VGObject> obj = VContainer::GetFakeGObject(id);
QSharedPointer<VGObject> obj = VContainer::GetFakeGObject(m_id);
SaveOption(obj);
}
@ -371,7 +371,7 @@ void VAbstractOperation::Disable(bool disable, const QString &namePP)
//---------------------------------------------------------------------------------------------------------------------
void VAbstractOperation::ObjectSelected(bool selected, quint32 objId)
{
emit ChangedToolSelection(selected, objId, id);
emit ChangedToolSelection(selected, objId, m_id);
}
//---------------------------------------------------------------------------------------------------------------------
@ -420,7 +420,7 @@ VAbstractOperation::VAbstractOperation(VAbstractPattern *doc, VContainer *data,
void VAbstractOperation::AddToFile()
{
QDomElement domElement = doc->createElement(getTagName());
QSharedPointer<VGObject> obj = VContainer::GetFakeGObject(id);
QSharedPointer<VGObject> obj = VContainer::GetFakeGObject(m_id);
SaveOptions(domElement, obj);
AddToCalculation(domElement);
}
@ -429,7 +429,7 @@ void VAbstractOperation::AddToFile()
void VAbstractOperation::UpdateNamePosition(quint32 id)
{
const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(id);
auto moveLabel = new OperationMoveLabel(this->id, doc, point->mx(), point->my(), id);
auto moveLabel = new OperationMoveLabel(m_id, doc, point->mx(), point->my(), id);
connect(moveLabel, &OperationMoveLabel::ChangePosition, this, &VAbstractOperation::DoChangePosition);
qApp->getUndoStack()->push(moveLabel);
}

View File

@ -239,7 +239,7 @@ VFormula VToolMove::GetFormulaAngle() const
{
VFormula fAngle(formulaAngle, getData());
fAngle.setCheckZero(false);
fAngle.setToolId(id);
fAngle.setToolId(m_id);
fAngle.setPostfix(degreeSymbol);
return fAngle;
}
@ -251,7 +251,7 @@ void VToolMove::SetFormulaAngle(const VFormula &value)
{
formulaAngle = value.GetFormula(FormulaType::FromUser);
QSharedPointer<VGObject> obj = VContainer::GetFakeGObject(id);
QSharedPointer<VGObject> obj = VContainer::GetFakeGObject(m_id);
SaveOption(obj);
}
}
@ -261,7 +261,7 @@ VFormula VToolMove::GetFormulaLength() const
{
VFormula fLength(formulaLength, getData());
fLength.setCheckZero(true);
fLength.setToolId(id);
fLength.setToolId(m_id);
fLength.setPostfix(UnitsToStr(qApp->patternUnit()));
return fLength;
}
@ -273,7 +273,7 @@ void VToolMove::SetFormulaLength(const VFormula &value)
{
formulaLength = value.GetFormula(FormulaType::FromUser);
QSharedPointer<VGObject> obj = VContainer::GetFakeGObject(id);
QSharedPointer<VGObject> obj = VContainer::GetFakeGObject(m_id);
SaveOption(obj);
}
}

View File

@ -262,7 +262,7 @@ VFormula VToolRotation::GetFormulaAngle() const
{
VFormula fAngle(formulaAngle, getData());
fAngle.setCheckZero(false);
fAngle.setToolId(id);
fAngle.setToolId(m_id);
fAngle.setPostfix(degreeSymbol);
return fAngle;
}
@ -274,7 +274,7 @@ void VToolRotation::SetFormulaAngle(const VFormula &value)
{
formulaAngle = value.GetFormula(FormulaType::FromUser);
QSharedPointer<VGObject> obj = VContainer::GetFakeGObject(id);
QSharedPointer<VGObject> obj = VContainer::GetFakeGObject(m_id);
SaveOption(obj);
}
}

View File

@ -69,7 +69,7 @@ VAbstractSpline::VAbstractSpline(VAbstractPattern *doc, VContainer *data, quint3
//---------------------------------------------------------------------------------------------------------------------
QPainterPath VAbstractSpline::shape() const
{
const QSharedPointer<VAbstractCurve> curve = VAbstractTool::data.GeometricObject<VAbstractCurve>(id);
const QSharedPointer<VAbstractCurve> curve = VAbstractTool::data.GeometricObject<VAbstractCurve>(m_id);
const QVector<QPointF> points = curve->GetPoints();
QPainterPath path;
@ -94,7 +94,7 @@ void VAbstractSpline::paint(QPainter *painter, const QStyleOptionGraphicsItem *o
{
const qreal width = ScaleWidth(m_isHovered ? widthMainLine : widthHairLine, SceneScale(scene()));
const QSharedPointer<VAbstractCurve> curve = VAbstractTool::data.GeometricObject<VAbstractCurve>(id);
const QSharedPointer<VAbstractCurve> curve = VAbstractTool::data.GeometricObject<VAbstractCurve>(m_id);
setPen(QPen(CorrectColor(this, curve->GetColor()), width, LineStyleToPenStyle(curve->GetPenStyle()), Qt::RoundCap));
RefreshCtrlPoints();
@ -166,7 +166,7 @@ void VAbstractSpline::AllowSelecting(bool enabled)
//---------------------------------------------------------------------------------------------------------------------
QString VAbstractSpline::MakeToolTip() const
{
const QSharedPointer<VAbstractCurve> curve = VAbstractTool::data.GeometricObject<VAbstractCurve>(id);
const QSharedPointer<VAbstractCurve> curve = VAbstractTool::data.GeometricObject<VAbstractCurve>(m_id);
const QString toolTip = QString("<table>"
"<tr> <td><b>%1:</b> %2 %3</td> </tr>"
@ -232,7 +232,7 @@ QVariant VAbstractSpline::itemChange(QGraphicsItem::GraphicsItemChange change, c
{
if (change == QGraphicsItem::ItemSelectedChange)
{
emit ChangedToolSelection(value.toBool(), id, id);
emit ChangedToolSelection(value.toBool(), m_id, m_id);
}
return QGraphicsPathItem::itemChange(change, value);
@ -288,7 +288,7 @@ void VAbstractSpline::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
if (event->button() == Qt::LeftButton)
{
emit ChoosedTool(id, sceneType);
emit ChoosedTool(m_id, sceneType);
}
QGraphicsPathItem::mouseReleaseEvent(event);
}
@ -392,7 +392,7 @@ VSpline VAbstractSpline::CorrectedSpline(const VSpline &spline, const SplinePoin
//---------------------------------------------------------------------------------------------------------------------
void VAbstractSpline::InitDefShape()
{
const QSharedPointer<VAbstractCurve> curve = VAbstractTool::data.GeometricObject<VAbstractCurve>(id);
const QSharedPointer<VAbstractCurve> curve = VAbstractTool::data.GeometricObject<VAbstractCurve>(m_id);
this->setPath(curve->GetPath());
}
@ -408,14 +408,14 @@ void VAbstractSpline::ShowHandles(bool show)
//---------------------------------------------------------------------------------------------------------------------
QString VAbstractSpline::GetLineColor() const
{
const QSharedPointer<VAbstractCurve> curve = VAbstractTool::data.GeometricObject<VAbstractCurve>(id);
const QSharedPointer<VAbstractCurve> curve = VAbstractTool::data.GeometricObject<VAbstractCurve>(m_id);
return curve->GetColor();
}
//---------------------------------------------------------------------------------------------------------------------
void VAbstractSpline::SetLineColor(const QString &value)
{
QSharedPointer<VAbstractCurve> curve = VAbstractTool::data.GeometricObject<VAbstractCurve>(id);
QSharedPointer<VAbstractCurve> curve = VAbstractTool::data.GeometricObject<VAbstractCurve>(m_id);
curve->SetColor(value);
QSharedPointer<VGObject> obj = qSharedPointerCast<VGObject>(curve);
SaveOption(obj);
@ -424,14 +424,14 @@ void VAbstractSpline::SetLineColor(const QString &value)
//---------------------------------------------------------------------------------------------------------------------
QString VAbstractSpline::GetPenStyle() const
{
const QSharedPointer<VAbstractCurve> curve = VAbstractTool::data.GeometricObject<VAbstractCurve>(id);
const QSharedPointer<VAbstractCurve> curve = VAbstractTool::data.GeometricObject<VAbstractCurve>(m_id);
return curve->GetPenStyle();
}
//---------------------------------------------------------------------------------------------------------------------
void VAbstractSpline::SetPenStyle(const QString &value)
{
QSharedPointer<VAbstractCurve> curve = VAbstractTool::data.GeometricObject<VAbstractCurve>(id);
QSharedPointer<VAbstractCurve> curve = VAbstractTool::data.GeometricObject<VAbstractCurve>(m_id);
curve->SetPenStyle(value);
QSharedPointer<VGObject> obj = qSharedPointerCast<VGObject>(curve);
SaveOption(obj);
@ -440,7 +440,7 @@ void VAbstractSpline::SetPenStyle(const QString &value)
//---------------------------------------------------------------------------------------------------------------------
QString VAbstractSpline::name() const
{
return ObjectName<VAbstractCurve>(id);
return ObjectName<VAbstractCurve>(m_id);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -87,7 +87,7 @@ void VToolArc::setDialog()
SCASSERT(not m_dialog.isNull())
QSharedPointer<DialogArc> dialogTool = m_dialog.objectCast<DialogArc>();
SCASSERT(not dialogTool.isNull())
const QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(id);
const QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(m_id);
dialogTool->SetCenter(arc->GetCenter().id());
dialogTool->SetF1(arc->GetFormulaF1());
dialogTool->SetF2(arc->GetFormulaF2());
@ -198,7 +198,7 @@ QString VToolArc::CenterPointName() const
//---------------------------------------------------------------------------------------------------------------------
quint32 VToolArc::getCenter() const
{
QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(id);
QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(m_id);
SCASSERT(arc.isNull() == false)
return arc->GetCenter().id();
@ -209,7 +209,7 @@ void VToolArc::setCenter(const quint32 &value)
{
if (value != NULL_ID)
{
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
QSharedPointer<VArc> arc = qSharedPointerDynamicCast<VArc>(obj);
QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(value);
@ -221,12 +221,12 @@ void VToolArc::setCenter(const quint32 &value)
//---------------------------------------------------------------------------------------------------------------------
VFormula VToolArc::GetFormulaRadius() const
{
QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(id);
QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(m_id);
SCASSERT(arc.isNull() == false)
VFormula radius(arc->GetFormulaRadius(), getData());
radius.setCheckZero(true);
radius.setToolId(id);
radius.setToolId(m_id);
radius.setPostfix(UnitsToStr(qApp->patternUnit()));
return radius;
}
@ -238,7 +238,7 @@ void VToolArc::SetFormulaRadius(const VFormula &value)
{
if (value.getDoubleValue() > 0)// Formula don't check this, but radius can't be 0 or negative
{
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
QSharedPointer<VArc> arc = qSharedPointerDynamicCast<VArc>(obj);
arc->SetFormulaRadius(value.GetFormula(FormulaType::FromUser), value.getDoubleValue());
SaveOption(obj);
@ -249,12 +249,12 @@ void VToolArc::SetFormulaRadius(const VFormula &value)
//---------------------------------------------------------------------------------------------------------------------
VFormula VToolArc::GetFormulaF1() const
{
QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(id);
QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(m_id);
SCASSERT(arc.isNull() == false)
VFormula f1(arc->GetFormulaF1(), getData());
f1.setCheckZero(false);
f1.setToolId(id);
f1.setToolId(m_id);
f1.setPostfix(degreeSymbol);
return f1;
}
@ -264,7 +264,7 @@ void VToolArc::SetFormulaF1(const VFormula &value)
{
if (value.error() == false)
{
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
QSharedPointer<VArc> arc = qSharedPointerDynamicCast<VArc>(obj);
if (not VFuzzyComparePossibleNulls(value.getDoubleValue(), arc->GetEndAngle()))// Angles can't be equal
@ -278,12 +278,12 @@ void VToolArc::SetFormulaF1(const VFormula &value)
//---------------------------------------------------------------------------------------------------------------------
VFormula VToolArc::GetFormulaF2() const
{
QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(id);
QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(m_id);
SCASSERT(arc.isNull() == false)
VFormula f2(arc->GetFormulaF2(), getData());
f2.setCheckZero(false);
f2.setToolId(id);
f2.setToolId(m_id);
f2.setPostfix(degreeSymbol);
return f2;
}
@ -293,7 +293,7 @@ void VToolArc::SetFormulaF2(const VFormula &value)
{
if (value.error() == false)
{
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
QSharedPointer<VArc> arc = qSharedPointerDynamicCast<VArc>(obj);
if (not VFuzzyComparePossibleNulls(value.getDoubleValue(), arc->GetStartAngle()))// Angles can't be equal
{
@ -329,7 +329,7 @@ void VToolArc::ShowContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 id
*/
void VToolArc::RemoveReferens()
{
const auto arc = VAbstractTool::data.GeometricObject<VArc>(id);
const auto arc = VAbstractTool::data.GeometricObject<VArc>(m_id);
doc->DecrementReferens(arc->GetCenter().getIdTool());
}
@ -370,7 +370,7 @@ void VToolArc::SetVisualization()
{
if (not vis.isNull())
{
const QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(id);
const QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(m_id);
VisToolArc *visual = qobject_cast<VisToolArc *>(vis);
SCASSERT(visual != nullptr)
@ -387,7 +387,7 @@ void VToolArc::SetVisualization()
//---------------------------------------------------------------------------------------------------------------------
QString VToolArc::MakeToolTip() const
{
const QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(id);
const QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(m_id);
const QString toolTip = QString("<table>"
"<tr> <td><b>%1:</b> %2 %3</td> </tr>"

View File

@ -76,7 +76,7 @@ void VToolArcWithLength::setDialog()
SCASSERT(not m_dialog.isNull())
QSharedPointer<DialogArcWithLength> dialogTool = m_dialog.objectCast<DialogArcWithLength>();
SCASSERT(not dialogTool.isNull())
const QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(id);
const QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(m_id);
dialogTool->SetCenter(arc->GetCenter().id());
dialogTool->SetF1(arc->GetFormulaF1());
dialogTool->SetLength(arc->GetFormulaLength());
@ -167,7 +167,7 @@ QString VToolArcWithLength::CenterPointName() const
//---------------------------------------------------------------------------------------------------------------------
quint32 VToolArcWithLength::getCenter() const
{
QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(id);
QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(m_id);
SCASSERT(arc.isNull() == false)
return arc->GetCenter().id();
@ -178,7 +178,7 @@ void VToolArcWithLength::setCenter(const quint32 &value)
{
if (value != NULL_ID)
{
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
QSharedPointer<VArc> arc = qSharedPointerDynamicCast<VArc>(obj);
QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(value);
@ -190,12 +190,12 @@ void VToolArcWithLength::setCenter(const quint32 &value)
//---------------------------------------------------------------------------------------------------------------------
VFormula VToolArcWithLength::GetFormulaRadius() const
{
QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(id);
QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(m_id);
SCASSERT(arc.isNull() == false)
VFormula radius(arc->GetFormulaRadius(), getData());
radius.setCheckZero(true);
radius.setToolId(id);
radius.setToolId(m_id);
radius.setPostfix(UnitsToStr(qApp->patternUnit()));
return radius;
}
@ -207,7 +207,7 @@ void VToolArcWithLength::SetFormulaRadius(const VFormula &value)
{
if (value.getDoubleValue() > 0)// Formula don't check this, but radius can't be 0 or negative
{
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
QSharedPointer<VArc> arc = qSharedPointerDynamicCast<VArc>(obj);
arc->SetFormulaRadius(value.GetFormula(FormulaType::FromUser), value.getDoubleValue());
SaveOption(obj);
@ -218,12 +218,12 @@ void VToolArcWithLength::SetFormulaRadius(const VFormula &value)
//---------------------------------------------------------------------------------------------------------------------
VFormula VToolArcWithLength::GetFormulaF1() const
{
QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(id);
QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(m_id);
SCASSERT(arc.isNull() == false)
VFormula f1(arc->GetFormulaF1(), getData());
f1.setCheckZero(false);
f1.setToolId(id);
f1.setToolId(m_id);
f1.setPostfix(degreeSymbol);
return f1;
}
@ -233,7 +233,7 @@ void VToolArcWithLength::SetFormulaF1(const VFormula &value)
{
if (value.error() == false)
{
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
QSharedPointer<VArc> arc = qSharedPointerDynamicCast<VArc>(obj);
if (not VFuzzyComparePossibleNulls(value.getDoubleValue(), arc->GetEndAngle()))// Angles can't be equal
@ -247,12 +247,12 @@ void VToolArcWithLength::SetFormulaF1(const VFormula &value)
//---------------------------------------------------------------------------------------------------------------------
VFormula VToolArcWithLength::GetFormulaLength() const
{
QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(id);
QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(m_id);
SCASSERT(arc.isNull() == false)
VFormula radius(arc->GetFormulaLength(), getData());
radius.setCheckZero(true);
radius.setToolId(id);
radius.setToolId(m_id);
radius.setPostfix(UnitsToStr(qApp->patternUnit()));
return radius;
}
@ -262,7 +262,7 @@ void VToolArcWithLength::SetFormulaLength(const VFormula &value)
{
if (value.error() == false)
{
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
QSharedPointer<VArc> arc = qSharedPointerDynamicCast<VArc>(obj);
arc->SetFormulaLength(value.GetFormula(FormulaType::FromUser), value.getDoubleValue());
SaveOption(obj);
@ -292,7 +292,7 @@ void VToolArcWithLength::ShowContextMenu(QGraphicsSceneContextMenuEvent *event,
//---------------------------------------------------------------------------------------------------------------------
void VToolArcWithLength::RemoveReferens()
{
const auto arc = VAbstractTool::data.GeometricObject<VArc>(id);
const auto arc = VAbstractTool::data.GeometricObject<VArc>(m_id);
doc->DecrementReferens(arc->GetCenter().getIdTool());
}
@ -330,7 +330,7 @@ void VToolArcWithLength::SetVisualization()
{
if (not vis.isNull())
{
const QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(id);
const QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(m_id);
VisToolArcWithLength *visual = qobject_cast<VisToolArcWithLength *>(vis);
SCASSERT(visual != nullptr)
@ -347,7 +347,7 @@ void VToolArcWithLength::SetVisualization()
//---------------------------------------------------------------------------------------------------------------------
QString VToolArcWithLength::MakeToolTip() const
{
const QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(id);
const QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(m_id);
const QString toolTip = QString("<table>"
"<tr> <td><b>%1:</b> %2 %3</td> </tr>"

View File

@ -74,7 +74,7 @@ void VToolCubicBezier::setDialog()
SCASSERT(not m_dialog.isNull())
auto dialogTool = qobject_cast<DialogCubicBezier*>(m_dialog);
SCASSERT(dialogTool != nullptr)
const auto spl = VAbstractTool::data.GeometricObject<VCubicBezier>(id);
const auto spl = VAbstractTool::data.GeometricObject<VCubicBezier>(m_id);
dialogTool->SetSpline(*spl);
dialogTool->SetColor(spl->GetColor());
dialogTool->SetPenStyle(spl->GetPenStyle());
@ -141,42 +141,42 @@ VToolCubicBezier *VToolCubicBezier::Create(const quint32 _id, VCubicBezier *spli
//---------------------------------------------------------------------------------------------------------------------
QString VToolCubicBezier::FirstPointName() const
{
auto spline = VAbstractTool::data.GeometricObject<VCubicBezier>(id);
auto spline = VAbstractTool::data.GeometricObject<VCubicBezier>(m_id);
return spline->GetP1().name();
}
//---------------------------------------------------------------------------------------------------------------------
QString VToolCubicBezier::SecondPointName() const
{
auto spline = VAbstractTool::data.GeometricObject<VCubicBezier>(id);
auto spline = VAbstractTool::data.GeometricObject<VCubicBezier>(m_id);
return spline->GetP2().name();
}
//---------------------------------------------------------------------------------------------------------------------
QString VToolCubicBezier::ThirdPointName() const
{
auto spline = VAbstractTool::data.GeometricObject<VCubicBezier>(id);
auto spline = VAbstractTool::data.GeometricObject<VCubicBezier>(m_id);
return spline->GetP3().name();
}
//---------------------------------------------------------------------------------------------------------------------
QString VToolCubicBezier::ForthPointName() const
{
auto spline = VAbstractTool::data.GeometricObject<VCubicBezier>(id);
auto spline = VAbstractTool::data.GeometricObject<VCubicBezier>(m_id);
return spline->GetP4().name();
}
//---------------------------------------------------------------------------------------------------------------------
VCubicBezier VToolCubicBezier::getSpline() const
{
auto spline = VAbstractTool::data.GeometricObject<VCubicBezier>(id);
auto spline = VAbstractTool::data.GeometricObject<VCubicBezier>(m_id);
return *spline.data();
}
//---------------------------------------------------------------------------------------------------------------------
void VToolCubicBezier::setSpline(const VCubicBezier &spl)
{
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
QSharedPointer<VCubicBezier> spline = qSharedPointerDynamicCast<VCubicBezier>(obj);
*spline.data() = spl;
SaveOption(obj);
@ -205,7 +205,7 @@ void VToolCubicBezier::ShowContextMenu(QGraphicsSceneContextMenuEvent *event, qu
//---------------------------------------------------------------------------------------------------------------------
void VToolCubicBezier::RemoveReferens()
{
const auto spl = VAbstractTool::data.GeometricObject<VCubicBezier>(id);
const auto spl = VAbstractTool::data.GeometricObject<VCubicBezier>(m_id);
doc->DecrementReferens(spl->GetP1().getIdTool());
doc->DecrementReferens(spl->GetP2().getIdTool());
doc->DecrementReferens(spl->GetP3().getIdTool());
@ -244,7 +244,7 @@ void VToolCubicBezier::SetVisualization()
auto visual = qobject_cast<VisToolCubicBezier *>(vis);
SCASSERT(visual != nullptr)
const QSharedPointer<VCubicBezier> spl = VAbstractTool::data.GeometricObject<VCubicBezier>(id);
const QSharedPointer<VCubicBezier> spl = VAbstractTool::data.GeometricObject<VCubicBezier>(m_id);
visual->setObject1Id(spl->GetP1().id());
visual->setObject2Id(spl->GetP2().id());
visual->setObject3Id(spl->GetP3().id());
@ -258,7 +258,7 @@ void VToolCubicBezier::SetVisualization()
//---------------------------------------------------------------------------------------------------------------------
void VToolCubicBezier::RefreshGeometry()
{
const QSharedPointer<VCubicBezier> spl = VAbstractTool::data.GeometricObject<VCubicBezier>(id);
const QSharedPointer<VCubicBezier> spl = VAbstractTool::data.GeometricObject<VCubicBezier>(m_id);
this->setPath(spl->GetPath());
SetVisualization();

View File

@ -76,7 +76,7 @@ void VToolCubicBezierPath::setDialog()
SCASSERT(not m_dialog.isNull())
auto dialogTool = qobject_cast<DialogCubicBezierPath*>(m_dialog);
SCASSERT(dialogTool != nullptr)
const QSharedPointer<VCubicBezierPath> splPath = VAbstractTool::data.GeometricObject<VCubicBezierPath>(id);
const QSharedPointer<VCubicBezierPath> splPath = VAbstractTool::data.GeometricObject<VCubicBezierPath>(m_id);
dialogTool->SetPath(*splPath);
dialogTool->SetColor(splPath->GetColor());
dialogTool->SetPenStyle(splPath->GetPenStyle());
@ -153,14 +153,14 @@ void VToolCubicBezierPath::UpdatePathPoints(VAbstractPattern *doc, QDomElement &
//---------------------------------------------------------------------------------------------------------------------
VCubicBezierPath VToolCubicBezierPath::getSplinePath() const
{
QSharedPointer<VCubicBezierPath> splPath = VAbstractTool::data.GeometricObject<VCubicBezierPath>(id);
QSharedPointer<VCubicBezierPath> splPath = VAbstractTool::data.GeometricObject<VCubicBezierPath>(m_id);
return *splPath.data();
}
//---------------------------------------------------------------------------------------------------------------------
void VToolCubicBezierPath::setSplinePath(const VCubicBezierPath &splPath)
{
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
QSharedPointer<VCubicBezierPath> splinePath = qSharedPointerDynamicCast<VCubicBezierPath>(obj);
*splinePath.data() = splPath;
SaveOption(obj);
@ -189,7 +189,7 @@ void VToolCubicBezierPath::ShowContextMenu(QGraphicsSceneContextMenuEvent *event
//---------------------------------------------------------------------------------------------------------------------
void VToolCubicBezierPath::RemoveReferens()
{
const QSharedPointer<VCubicBezierPath> splPath = VAbstractTool::data.GeometricObject<VCubicBezierPath>(id);
const QSharedPointer<VCubicBezierPath> splPath = VAbstractTool::data.GeometricObject<VCubicBezierPath>(m_id);
for (qint32 i = 0; i < splPath->CountSubSpl(); ++i)
{
doc->DecrementReferens(splPath->at(i).getIdTool());
@ -227,7 +227,7 @@ void VToolCubicBezierPath::SetVisualization()
auto visual = qobject_cast<VisToolCubicBezierPath *>(vis);
SCASSERT(visual != nullptr)
QSharedPointer<VCubicBezierPath> splPath = VAbstractTool::data.GeometricObject<VCubicBezierPath>(id);
QSharedPointer<VCubicBezierPath> splPath = VAbstractTool::data.GeometricObject<VCubicBezierPath>(m_id);
visual->setPath(*splPath.data());
visual->setLineStyle(LineStyleToPenStyle(splPath->GetPenStyle()));
visual->SetMode(Mode::Show);
@ -238,7 +238,7 @@ void VToolCubicBezierPath::SetVisualization()
//---------------------------------------------------------------------------------------------------------------------
void VToolCubicBezierPath::RefreshGeometry()
{
QSharedPointer<VCubicBezierPath> splPath = VAbstractTool::data.GeometricObject<VCubicBezierPath>(id);
QSharedPointer<VCubicBezierPath> splPath = VAbstractTool::data.GeometricObject<VCubicBezierPath>(m_id);
setPath(splPath->GetPath());
SetVisualization();

View File

@ -87,7 +87,7 @@ void VToolEllipticalArc::setDialog()
SCASSERT(not m_dialog.isNull())
QSharedPointer<DialogEllipticalArc> dialogTool = m_dialog.objectCast<DialogEllipticalArc>();
SCASSERT(not dialogTool.isNull())
const QSharedPointer<VEllipticalArc> elArc = VAbstractTool::data.GeometricObject<VEllipticalArc>(id);
const QSharedPointer<VEllipticalArc> elArc = VAbstractTool::data.GeometricObject<VEllipticalArc>(m_id);
dialogTool->SetCenter(elArc->GetCenter().id());
dialogTool->SetF1(elArc->GetFormulaF1());
dialogTool->SetF2(elArc->GetFormulaF2());
@ -211,7 +211,7 @@ QString VToolEllipticalArc::CenterPointName() const
//---------------------------------------------------------------------------------------------------------------------
quint32 VToolEllipticalArc::getCenter() const
{
QSharedPointer<VEllipticalArc> elArc = VAbstractTool::data.GeometricObject<VEllipticalArc>(id);
QSharedPointer<VEllipticalArc> elArc = VAbstractTool::data.GeometricObject<VEllipticalArc>(m_id);
SCASSERT(elArc.isNull() == false)
return elArc->GetCenter().id();
@ -222,7 +222,7 @@ void VToolEllipticalArc::setCenter(const quint32 &value)
{
if (value != NULL_ID)
{
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
QSharedPointer<VEllipticalArc> elArc = qSharedPointerDynamicCast<VEllipticalArc>(obj);
QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(value);
@ -234,12 +234,12 @@ void VToolEllipticalArc::setCenter(const quint32 &value)
//---------------------------------------------------------------------------------------------------------------------
VFormula VToolEllipticalArc::GetFormulaRadius1() const
{
QSharedPointer<VEllipticalArc> elArc = VAbstractTool::data.GeometricObject<VEllipticalArc>(id);
QSharedPointer<VEllipticalArc> elArc = VAbstractTool::data.GeometricObject<VEllipticalArc>(m_id);
SCASSERT(elArc.isNull() == false)
VFormula radius1(elArc->GetFormulaRadius1(), getData());
radius1.setCheckZero(true);
radius1.setToolId(id);
radius1.setToolId(m_id);
radius1.setPostfix(UnitsToStr(qApp->patternUnit()));
return radius1;
}
@ -251,7 +251,7 @@ void VToolEllipticalArc::SetFormulaRadius1(const VFormula &value)
{
if (value.getDoubleValue() > 0)// Formula don't check this, but radius1 can't be 0 or negative
{
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
QSharedPointer<VEllipticalArc> elArc = qSharedPointerDynamicCast<VEllipticalArc>(obj);
elArc->SetFormulaRadius1(value.GetFormula(FormulaType::FromUser), value.getDoubleValue());
SaveOption(obj);
@ -262,12 +262,12 @@ void VToolEllipticalArc::SetFormulaRadius1(const VFormula &value)
//---------------------------------------------------------------------------------------------------------------------
VFormula VToolEllipticalArc::GetFormulaRadius2() const
{
QSharedPointer<VEllipticalArc> elArc = VAbstractTool::data.GeometricObject<VEllipticalArc>(id);
QSharedPointer<VEllipticalArc> elArc = VAbstractTool::data.GeometricObject<VEllipticalArc>(m_id);
SCASSERT(elArc.isNull() == false)
VFormula radius2(elArc->GetFormulaRadius2(), getData());
radius2.setCheckZero(true);
radius2.setToolId(id);
radius2.setToolId(m_id);
radius2.setPostfix(UnitsToStr(qApp->patternUnit()));
return radius2;
}
@ -279,7 +279,7 @@ void VToolEllipticalArc::SetFormulaRadius2(const VFormula &value)
{
if (value.getDoubleValue() > 0)// Formula don't check this, but radius2 can't be 0 or negative
{
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
QSharedPointer<VEllipticalArc> elArc = qSharedPointerDynamicCast<VEllipticalArc>(obj);
elArc->SetFormulaRadius2(value.GetFormula(FormulaType::FromUser), value.getDoubleValue());
SaveOption(obj);
@ -290,12 +290,12 @@ void VToolEllipticalArc::SetFormulaRadius2(const VFormula &value)
//---------------------------------------------------------------------------------------------------------------------
VFormula VToolEllipticalArc::GetFormulaF1() const
{
QSharedPointer<VEllipticalArc> elArc = VAbstractTool::data.GeometricObject<VEllipticalArc>(id);
QSharedPointer<VEllipticalArc> elArc = VAbstractTool::data.GeometricObject<VEllipticalArc>(m_id);
SCASSERT(elArc.isNull() == false)
VFormula f1(elArc->GetFormulaF1(), getData());
f1.setCheckZero(false);
f1.setToolId(id);
f1.setToolId(m_id);
f1.setPostfix(degreeSymbol);
return f1;
}
@ -305,7 +305,7 @@ void VToolEllipticalArc::SetFormulaF1(const VFormula &value)
{
if (value.error() == false)
{
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
QSharedPointer<VEllipticalArc> elArc = qSharedPointerDynamicCast<VEllipticalArc>(obj);
if (not VFuzzyComparePossibleNulls(value.getDoubleValue(), elArc->GetEndAngle()))// Angles can't be equal
@ -319,12 +319,12 @@ void VToolEllipticalArc::SetFormulaF1(const VFormula &value)
//---------------------------------------------------------------------------------------------------------------------
VFormula VToolEllipticalArc::GetFormulaF2() const
{
QSharedPointer<VEllipticalArc> elArc = VAbstractTool::data.GeometricObject<VEllipticalArc>(id);
QSharedPointer<VEllipticalArc> elArc = VAbstractTool::data.GeometricObject<VEllipticalArc>(m_id);
SCASSERT(elArc.isNull() == false)
VFormula f2(elArc->GetFormulaF2(), getData());
f2.setCheckZero(false);
f2.setToolId(id);
f2.setToolId(m_id);
f2.setPostfix(degreeSymbol);
return f2;
}
@ -334,7 +334,7 @@ void VToolEllipticalArc::SetFormulaF2(const VFormula &value)
{
if (value.error() == false)
{
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
QSharedPointer<VEllipticalArc> elArc = qSharedPointerDynamicCast<VEllipticalArc>(obj);
if (not VFuzzyComparePossibleNulls(value.getDoubleValue(), elArc->GetStartAngle()))// Angles can't be equal
{
@ -347,12 +347,12 @@ void VToolEllipticalArc::SetFormulaF2(const VFormula &value)
//---------------------------------------------------------------------------------------------------------------------
VFormula VToolEllipticalArc::GetFormulaRotationAngle() const
{
QSharedPointer<VEllipticalArc> elArc = VAbstractTool::data.GeometricObject<VEllipticalArc>(id);
QSharedPointer<VEllipticalArc> elArc = VAbstractTool::data.GeometricObject<VEllipticalArc>(m_id);
SCASSERT(elArc.isNull() == false)
VFormula rotationAngle(elArc->GetFormulaRotationAngle(), getData());
rotationAngle.setCheckZero(false);
rotationAngle.setToolId(id);
rotationAngle.setToolId(m_id);
rotationAngle.setPostfix(degreeSymbol);
return rotationAngle;
}
@ -362,7 +362,7 @@ void VToolEllipticalArc::SetFormulaRotationAngle(const VFormula &value)
{
if (value.error() == false)
{
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
QSharedPointer<VEllipticalArc> elArc = qSharedPointerDynamicCast<VEllipticalArc>(obj);
elArc->SetFormulaRotationAngle(value.GetFormula(FormulaType::FromUser), value.getDoubleValue());
SaveOption(obj);
@ -395,7 +395,7 @@ void VToolEllipticalArc::ShowContextMenu(QGraphicsSceneContextMenuEvent *event,
*/
void VToolEllipticalArc::RemoveReferens()
{
const auto elArc = VAbstractTool::data.GeometricObject<VEllipticalArc>(id);
const auto elArc = VAbstractTool::data.GeometricObject<VEllipticalArc>(m_id);
doc->DecrementReferens(elArc->GetCenter().getIdTool());
}
@ -440,7 +440,7 @@ void VToolEllipticalArc::SetVisualization()
{
if (not vis.isNull())
{
const QSharedPointer<VEllipticalArc> elArc = VAbstractTool::data.GeometricObject<VEllipticalArc>(id);
const QSharedPointer<VEllipticalArc> elArc = VAbstractTool::data.GeometricObject<VEllipticalArc>(m_id);
VisToolEllipticalArc *visual = qobject_cast<VisToolEllipticalArc *>(vis);
SCASSERT(visual != nullptr)
@ -460,7 +460,7 @@ void VToolEllipticalArc::SetVisualization()
//---------------------------------------------------------------------------------------------------------------------
QString VToolEllipticalArc::MakeToolTip() const
{
const QSharedPointer<VEllipticalArc> elArc = VAbstractTool::data.GeometricObject<VEllipticalArc>(id);
const QSharedPointer<VEllipticalArc> elArc = VAbstractTool::data.GeometricObject<VEllipticalArc>(m_id);
const QString toolTip = QString("<table>"
"<tr> <td><b>%1:</b> %2 %3</td> </tr>"

View File

@ -131,7 +131,7 @@ void VToolSpline::setDialog()
SCASSERT(not m_dialog.isNull())
QSharedPointer<DialogSpline> dialogTool = m_dialog.objectCast<DialogSpline>();
SCASSERT(not dialogTool.isNull())
const auto spl = VAbstractTool::data.GeometricObject<VSpline>(id);
const auto spl = VAbstractTool::data.GeometricObject<VSpline>(m_id);
dialogTool->SetSpline(*spl);
dialogTool->SetColor(spl->GetColor());
dialogTool->SetPenStyle(spl->GetPenStyle());
@ -242,14 +242,14 @@ VToolSpline *VToolSpline::Create(const quint32 _id, quint32 point1, quint32 poin
//---------------------------------------------------------------------------------------------------------------------
VSpline VToolSpline::getSpline() const
{
auto spline = VAbstractTool::data.GeometricObject<VSpline>(id);
auto spline = VAbstractTool::data.GeometricObject<VSpline>(m_id);
return *spline.data();
}
//---------------------------------------------------------------------------------------------------------------------
void VToolSpline::setSpline(const VSpline &spl)
{
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
QSharedPointer<VSpline> spline = qSharedPointerDynamicCast<VSpline>(obj);
*spline.data() = spl;
SaveOption(obj);
@ -272,10 +272,10 @@ void VToolSpline::ControlPointChangePosition(const qint32 &indexSpline, const Sp
const QPointF &pos)
{
Q_UNUSED(indexSpline)
const QSharedPointer<VSpline> spline = VAbstractTool::data.GeometricObject<VSpline>(id);
const QSharedPointer<VSpline> spline = VAbstractTool::data.GeometricObject<VSpline>(m_id);
const VSpline spl = CorrectedSpline(*spline, position, pos);
MoveSpline *moveSpl = new MoveSpline(doc, spline.data(), spl, id);
MoveSpline *moveSpl = new MoveSpline(doc, spline.data(), spl, m_id);
connect(moveSpl, &MoveSpline::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree);
qApp->getUndoStack()->push(moveSpl);
}
@ -292,7 +292,7 @@ void VToolSpline::EnableToolMove(bool move)
*/
void VToolSpline::RemoveReferens()
{
const auto spl = VAbstractTool::data.GeometricObject<VSpline>(id);
const auto spl = VAbstractTool::data.GeometricObject<VSpline>(m_id);
doc->DecrementReferens(spl->GetP1().getIdTool());
doc->DecrementReferens(spl->GetP4().getIdTool());
}
@ -380,7 +380,7 @@ void VToolSpline::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
// "weight" describes how the influence of the drag should be distributed
// among the handles; 0 = front handle only, 1 = back handle only.
const auto spline = VAbstractTool::data.GeometricObject<VSpline>(id);
const auto spline = VAbstractTool::data.GeometricObject<VSpline>(m_id);
const qreal t = spline->ParamT(oldPosition);
if (qFloor(t) == -1)
@ -417,7 +417,7 @@ void VToolSpline::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
VSpline spl = VSpline(spline->GetP1(), p2, p3, spline->GetP4());
MoveSpline *moveSpl = new MoveSpline(doc, spline.data(), spl, id);
MoveSpline *moveSpl = new MoveSpline(doc, spline.data(), spl, m_id);
connect(moveSpl, &MoveSpline::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree);
qApp->getUndoStack()->push(moveSpl);
@ -480,7 +480,7 @@ void VToolSpline::SetVisualization()
VisToolSpline *visual = qobject_cast<VisToolSpline *>(vis);
SCASSERT(visual != nullptr)
const QSharedPointer<VSpline> spl = VAbstractTool::data.GeometricObject<VSpline>(id);
const QSharedPointer<VSpline> spl = VAbstractTool::data.GeometricObject<VSpline>(m_id);
visual->setObject1Id(spl->GetP1().id());
visual->setObject4Id(spl->GetP4().id());
visual->SetAngle1(spl->GetStartAngle());
@ -497,7 +497,7 @@ void VToolSpline::SetVisualization()
//---------------------------------------------------------------------------------------------------------------------
bool VToolSpline::IsMovable() const
{
const auto spline = VAbstractTool::data.GeometricObject<VSpline>(id);
const auto spline = VAbstractTool::data.GeometricObject<VSpline>(m_id);
return qmu::QmuTokenParser::IsSingle(spline->GetStartAngleFormula()) &&
qmu::QmuTokenParser::IsSingle(spline->GetEndAngleFormula()) &&
@ -514,7 +514,7 @@ void VToolSpline::RefreshCtrlPoints()
point->setFlag(QGraphicsItem::ItemSendsGeometryChanges, false);
}
const auto spl = VAbstractTool::data.GeometricObject<VSpline>(id);
const auto spl = VAbstractTool::data.GeometricObject<VSpline>(m_id);
controlPoints[0]->blockSignals(true);
controlPoints[1]->blockSignals(true);

View File

@ -140,7 +140,7 @@ void VToolSplinePath::setDialog()
SCASSERT(not m_dialog.isNull())
QSharedPointer<DialogSplinePath> dialogTool = m_dialog.objectCast<DialogSplinePath>();
SCASSERT(not dialogTool.isNull())
const QSharedPointer<VSplinePath> splPath = VAbstractTool::data.GeometricObject<VSplinePath>(id);
const QSharedPointer<VSplinePath> splPath = VAbstractTool::data.GeometricObject<VSplinePath>(m_id);
dialogTool->SetPath(*splPath);
dialogTool->SetColor(splPath->GetColor());
dialogTool->SetPenStyle(splPath->GetPenStyle());
@ -265,12 +265,12 @@ VToolSplinePath *VToolSplinePath::Create(const quint32 _id, const QVector<quint3
void VToolSplinePath::ControlPointChangePosition(const qint32 &indexSpline, const SplinePointPosition &position,
const QPointF &pos)
{
const VSplinePath oldSplPath = *VAbstractTool::data.GeometricObject<VSplinePath>(id);
const VSplinePath oldSplPath = *VAbstractTool::data.GeometricObject<VSplinePath>(m_id);
VSplinePath newSplPath = oldSplPath;
const VSpline spl = CorrectedSpline(newSplPath.GetSpline(indexSpline), position, pos);
UpdateControlPoints(spl, newSplPath, indexSpline);
MoveSplinePath *moveSplPath = new MoveSplinePath(doc, oldSplPath, newSplPath, id);
MoveSplinePath *moveSplPath = new MoveSplinePath(doc, oldSplPath, newSplPath, m_id);
connect(moveSplPath, &VUndoCommand::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree);
qApp->getUndoStack()->push(moveSplPath);
}
@ -359,14 +359,14 @@ void VToolSplinePath::UpdatePathPoints(VAbstractPattern *doc, QDomElement &eleme
//---------------------------------------------------------------------------------------------------------------------
VSplinePath VToolSplinePath::getSplinePath() const
{
QSharedPointer<VSplinePath> splPath = VAbstractTool::data.GeometricObject<VSplinePath>(id);
QSharedPointer<VSplinePath> splPath = VAbstractTool::data.GeometricObject<VSplinePath>(m_id);
return *splPath.data();
}
//---------------------------------------------------------------------------------------------------------------------
void VToolSplinePath::setSplinePath(const VSplinePath &splPath)
{
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
QSharedPointer<VSplinePath> splinePath = qSharedPointerDynamicCast<VSplinePath>(obj);
*splinePath.data() = splPath;
SaveOption(obj);
@ -419,7 +419,7 @@ void VToolSplinePath::AddPathPoint(VAbstractPattern *doc, QDomElement &domElemen
*/
void VToolSplinePath::RemoveReferens()
{
const QSharedPointer<VSplinePath> splPath = VAbstractTool::data.GeometricObject<VSplinePath>(id);
const QSharedPointer<VSplinePath> splPath = VAbstractTool::data.GeometricObject<VSplinePath>(m_id);
for (qint32 i = 0; i < splPath->CountSubSpl(); ++i)
{
doc->DecrementReferens(splPath->at(i).P().getIdTool());
@ -476,7 +476,7 @@ void VToolSplinePath::mousePressEvent(QGraphicsSceneMouseEvent *event)
if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick)
{
oldPosition = event->scenePos();
const auto splPath = VAbstractTool::data.GeometricObject<VSplinePath>(id);
const auto splPath = VAbstractTool::data.GeometricObject<VSplinePath>(m_id);
splIndex = splPath->Segment(oldPosition);
if (IsMovable(splIndex))
{
@ -511,7 +511,7 @@ void VToolSplinePath::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
if (IsMovable(splIndex))
{
VSplinePath oldSplPath = *VAbstractTool::data.GeometricObject<VSplinePath>(id);
VSplinePath oldSplPath = *VAbstractTool::data.GeometricObject<VSplinePath>(m_id);
VSplinePath newSplPath = oldSplPath;
VSpline spline = newSplPath.GetSpline(splIndex);
@ -557,7 +557,7 @@ void VToolSplinePath::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
UpdateControlPoints(spl, newSplPath, splIndex);
MoveSplinePath *moveSplPath = new MoveSplinePath(doc, oldSplPath, newSplPath, id);
MoveSplinePath *moveSplPath = new MoveSplinePath(doc, oldSplPath, newSplPath, m_id);
connect(moveSplPath, &VUndoCommand::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree);
qApp->getUndoStack()->push(moveSplPath);
@ -590,7 +590,7 @@ void VToolSplinePath::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
if (flags() & QGraphicsItem::ItemIsMovable)
{
oldPosition = event->scenePos();
const auto splPath = VAbstractTool::data.GeometricObject<VSplinePath>(id);
const auto splPath = VAbstractTool::data.GeometricObject<VSplinePath>(m_id);
splIndex = splPath->Segment(oldPosition);
if (IsMovable(splIndex))
{
@ -621,7 +621,7 @@ void VToolSplinePath::SetVisualization()
VisToolSplinePath *visual = qobject_cast<VisToolSplinePath *>(vis);
SCASSERT(visual != nullptr)
QSharedPointer<VSplinePath> splPath = VAbstractTool::data.GeometricObject<VSplinePath>(id);
QSharedPointer<VSplinePath> splPath = VAbstractTool::data.GeometricObject<VSplinePath>(m_id);
visual->setPath(*splPath.data());
visual->setLineStyle(LineStyleToPenStyle(splPath->GetPenStyle()));
visual->SetMode(Mode::Show);
@ -632,7 +632,7 @@ void VToolSplinePath::SetVisualization()
//---------------------------------------------------------------------------------------------------------------------
bool VToolSplinePath::IsMovable(int index) const
{
const auto splPath = VAbstractTool::data.GeometricObject<VSplinePath>(id);
const auto splPath = VAbstractTool::data.GeometricObject<VSplinePath>(m_id);
//index == -1 - can delete, but decided to left
if (index == -1 || index < 1 || index > splPath->CountSubSpl())
@ -655,7 +655,7 @@ void VToolSplinePath::RefreshCtrlPoints()
point->setFlag(QGraphicsItem::ItemSendsGeometryChanges, false);
}
const auto splPath = VAbstractTool::data.GeometricObject<VSplinePath>(id);
const auto splPath = VAbstractTool::data.GeometricObject<VSplinePath>(m_id);
for (qint32 i = 1; i<=splPath->CountSubSpl(); ++i)
{

View File

@ -162,13 +162,13 @@ void VToolDoublePoint::Point2Choosed()
//---------------------------------------------------------------------------------------------------------------------
void VToolDoublePoint::Point1Selected(bool selected)
{
emit ChangedToolSelection(selected, p1id, id);
emit ChangedToolSelection(selected, p1id, m_id);
}
//---------------------------------------------------------------------------------------------------------------------
void VToolDoublePoint::Point2Selected(bool selected)
{
emit ChangedToolSelection(selected, p2id, id);
emit ChangedToolSelection(selected, p2id, m_id);
}
//---------------------------------------------------------------------------------------------------------------------
@ -244,7 +244,7 @@ void VToolDoublePoint::UpdateNamePosition(quint32 id)
{
const VPointF *p1 = VAbstractTool::data.GeometricObject<VPointF>(p1id).data();
auto moveLabel = new MoveDoubleLabel(doc, p1->mx(), p1->my(), DoublePoint::FirstPoint, this->id, p1id);
auto moveLabel = new MoveDoubleLabel(doc, p1->mx(), p1->my(), DoublePoint::FirstPoint, m_id, p1id);
connect(moveLabel, &MoveDoubleLabel::ChangePosition, this, &VToolDoublePoint::DoChangePosition);
qApp->getUndoStack()->push(moveLabel);
}
@ -252,7 +252,7 @@ void VToolDoublePoint::UpdateNamePosition(quint32 id)
{
const VPointF *p2 = VAbstractTool::data.GeometricObject<VPointF>(p2id).data();
auto moveLabel = new MoveDoubleLabel(doc, p2->mx(), p2->my(), DoublePoint::SecondPoint, this->id, p2id);
auto moveLabel = new MoveDoubleLabel(doc, p2->mx(), p2->my(), DoublePoint::SecondPoint, m_id, p2id);
connect(moveLabel, &MoveDoubleLabel::ChangePosition, this, &VToolDoublePoint::DoChangePosition);
qApp->getUndoStack()->push(moveLabel);
}
@ -359,7 +359,7 @@ void VToolDoublePoint::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &o
void VToolDoublePoint::AddToFile()
{
QDomElement domElement = doc->createElement(getTagName());
QSharedPointer<VGObject> obj = VContainer::GetFakeGObject(id);
QSharedPointer<VGObject> obj = VContainer::GetFakeGObject(m_id);
SaveOptions(domElement, obj);
AddToCalculation(domElement);
}

View File

@ -256,7 +256,7 @@ void VToolTrueDarts::SetBaseLineP1Id(const quint32 &value)
{
baseLineP1Id = value;
QSharedPointer<VGObject> obj = VContainer::GetFakeGObject(id);
QSharedPointer<VGObject> obj = VContainer::GetFakeGObject(m_id);
SaveOption(obj);
}
}
@ -274,7 +274,7 @@ void VToolTrueDarts::SetBaseLineP2Id(const quint32 &value)
{
baseLineP2Id = value;
QSharedPointer<VGObject> obj = VContainer::GetFakeGObject(id);
QSharedPointer<VGObject> obj = VContainer::GetFakeGObject(m_id);
SaveOption(obj);
}
}
@ -292,7 +292,7 @@ void VToolTrueDarts::SetDartP1Id(const quint32 &value)
{
dartP1Id = value;
QSharedPointer<VGObject> obj = VContainer::GetFakeGObject(id);
QSharedPointer<VGObject> obj = VContainer::GetFakeGObject(m_id);
SaveOption(obj);
}
}
@ -310,7 +310,7 @@ void VToolTrueDarts::SetDartP2Id(const quint32 &value)
{
dartP2Id = value;
QSharedPointer<VGObject> obj = VContainer::GetFakeGObject(id);
QSharedPointer<VGObject> obj = VContainer::GetFakeGObject(m_id);
SaveOption(obj);
}
}
@ -328,7 +328,7 @@ void VToolTrueDarts::SetDartP3Id(const quint32 &value)
{
dartP3Id = value;
QSharedPointer<VGObject> obj = VContainer::GetFakeGObject(id);
QSharedPointer<VGObject> obj = VContainer::GetFakeGObject(m_id);
SaveOption(obj);
}
}

View File

@ -105,7 +105,7 @@ void VToolCut::setCurveCutId(const quint32 &value)
if (value != NULL_ID)
{
curveCutId = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}
@ -115,7 +115,7 @@ VFormula VToolCut::GetFormula() const
{
VFormula val(formula, getData());
val.setCheckZero(true);
val.setToolId(id);
val.setToolId(m_id);
val.setPostfix(UnitsToStr(qApp->patternUnit()));
return val;
}
@ -127,7 +127,7 @@ void VToolCut::SetFormula(const VFormula &value)
{
formula = value.GetFormula(FormulaType::FromUser);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}
@ -144,7 +144,7 @@ QString VToolCut::CurveName() const
*/
void VToolCut::RefreshGeometry()
{
VToolSinglePoint::RefreshPointGeometry(*VDrawTool::data.GeometricObject<VPointF>(id));
VToolSinglePoint::RefreshPointGeometry(*VDrawTool::data.GeometricObject<VPointF>(m_id));
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -83,7 +83,7 @@ void VToolCutArc::setDialog()
SCASSERT(not m_dialog.isNull())
QSharedPointer<DialogCutArc> dialogTool = m_dialog.objectCast<DialogCutArc>();
SCASSERT(not dialogTool.isNull())
const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(id);
const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(m_id);
dialogTool->SetFormula(formula);
dialogTool->setArcId(curveCutId);
dialogTool->SetPointName(point->name());

View File

@ -86,7 +86,7 @@ void VToolCutSpline::setDialog()
SCASSERT(not m_dialog.isNull())
QSharedPointer<DialogCutSpline> dialogTool = m_dialog.objectCast<DialogCutSpline>();
SCASSERT(not dialogTool.isNull())
const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(id);
const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(m_id);
dialogTool->SetFormula(formula);
dialogTool->setSplineId(curveCutId);
dialogTool->SetPointName(point->name());

View File

@ -90,7 +90,7 @@ void VToolCutSplinePath::setDialog()
SCASSERT(not m_dialog.isNull())
QSharedPointer<DialogCutSplinePath> dialogTool = m_dialog.objectCast<DialogCutSplinePath>();
SCASSERT(not dialogTool.isNull())
const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(id);
const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(m_id);
dialogTool->SetFormula(formula);
dialogTool->setSplinePathId(curveCutId);
dialogTool->SetPointName(point->name());

View File

@ -149,7 +149,7 @@ QString VToolAlongLine::MakeToolTip() const
{
const QSharedPointer<VPointF> basePoint = VAbstractTool::data.GeometricObject<VPointF>(basePointId);
const QSharedPointer<VPointF> secondPoint = VAbstractTool::data.GeometricObject<VPointF>(secondPointId);
const QSharedPointer<VPointF> current = VAbstractTool::data.GeometricObject<VPointF>(id);
const QSharedPointer<VPointF> current = VAbstractTool::data.GeometricObject<VPointF>(m_id);
const QLineF curLine(static_cast<QPointF>(*basePoint), static_cast<QPointF>(*current));
const QLineF curToSecond(static_cast<QPointF>(*current), static_cast<QPointF>(*secondPoint));
@ -184,7 +184,7 @@ void VToolAlongLine::SetSecondPointId(const quint32 &value)
{
secondPointId = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}
@ -218,7 +218,7 @@ void VToolAlongLine::setDialog()
SCASSERT(not m_dialog.isNull())
QSharedPointer<DialogAlongLine> dialogTool = m_dialog.objectCast<DialogAlongLine>();
SCASSERT(not dialogTool.isNull())
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(m_id);
dialogTool->SetTypeLine(m_lineType);
dialogTool->SetLineColor(lineColor);
dialogTool->SetFormula(formulaLength);

View File

@ -124,7 +124,7 @@ void VToolBisector::setDialog()
SCASSERT(not m_dialog.isNull())
QSharedPointer<DialogBisector> dialogTool = m_dialog.objectCast<DialogBisector>();
SCASSERT(not dialogTool.isNull())
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(m_id);
dialogTool->SetTypeLine(m_lineType);
dialogTool->SetLineColor(lineColor);
dialogTool->SetFormula(formulaLength);
@ -326,7 +326,7 @@ void VToolBisector::SetThirdPointId(const quint32 &value)
{
thirdPointId = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}
@ -364,7 +364,7 @@ void VToolBisector::SetFirstPointId(const quint32 &value)
{
firstPointId = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}

View File

@ -88,7 +88,7 @@ void VToolCurveIntersectAxis::setDialog()
m_dialog->setModal(true);
QSharedPointer<DialogCurveIntersectAxis> dialogTool = m_dialog.objectCast<DialogCurveIntersectAxis>();
SCASSERT(not dialogTool.isNull())
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(m_id);
dialogTool->SetTypeLine(m_lineType);
dialogTool->SetLineColor(lineColor);
dialogTool->SetAngle(formulaAngle);
@ -214,7 +214,7 @@ VFormula VToolCurveIntersectAxis::GetFormulaAngle() const
{
VFormula fAngle(formulaAngle, getData());
fAngle.setCheckZero(false);
fAngle.setToolId(id);
fAngle.setToolId(m_id);
fAngle.setPostfix(degreeSymbol);
return fAngle;
}
@ -226,7 +226,7 @@ void VToolCurveIntersectAxis::SetFormulaAngle(const VFormula &value)
{
formulaAngle = value.GetFormula(FormulaType::FromUser);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}
@ -250,7 +250,7 @@ void VToolCurveIntersectAxis::setCurveId(const quint32 &value)
{
curveId = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}

View File

@ -88,7 +88,7 @@ void VToolEndLine::setDialog()
m_dialog->setModal(true);
QSharedPointer<DialogEndLine> dialogTool = m_dialog.objectCast<DialogEndLine>();
SCASSERT(not dialogTool.isNull())
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(m_id);
dialogTool->SetTypeLine(m_lineType);
dialogTool->SetLineColor(lineColor);
dialogTool->SetFormula(formulaLength);
@ -248,7 +248,7 @@ VFormula VToolEndLine::GetFormulaAngle() const
{
VFormula fAngle(formulaAngle, getData());
fAngle.setCheckZero(false);
fAngle.setToolId(id);
fAngle.setToolId(m_id);
fAngle.setPostfix(degreeSymbol);
return fAngle;
}
@ -260,7 +260,7 @@ void VToolEndLine::SetFormulaAngle(const VFormula &value)
{
formulaAngle = value.GetFormula(FormulaType::FromUser);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}

View File

@ -83,7 +83,7 @@ void VToolHeight::setDialog()
SCASSERT(not m_dialog.isNull())
QSharedPointer<DialogHeight> dialogTool = m_dialog.objectCast<DialogHeight>();
SCASSERT(not dialogTool.isNull())
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(m_id);
dialogTool->SetTypeLine(m_lineType);
dialogTool->SetLineColor(lineColor);
dialogTool->SetBasePointId(basePointId);
@ -273,7 +273,7 @@ QString VToolHeight::MakeToolTip() const
const QSharedPointer<VPointF> basePoint = VAbstractTool::data.GeometricObject<VPointF>(basePointId);
const QSharedPointer<VPointF> p1Line = VAbstractTool::data.GeometricObject<VPointF>(p1LineId);
const QSharedPointer<VPointF> p2Line = VAbstractTool::data.GeometricObject<VPointF>(p2LineId);
const QSharedPointer<VPointF> current = VAbstractTool::data.GeometricObject<VPointF>(id);
const QSharedPointer<VPointF> current = VAbstractTool::data.GeometricObject<VPointF>(m_id);
const QLineF curLine(static_cast<QPointF>(*basePoint), static_cast<QPointF>(*current));
const QLineF p1ToCur(static_cast<QPointF>(*p1Line), static_cast<QPointF>(*current));
@ -310,7 +310,7 @@ void VToolHeight::SetP2LineId(const quint32 &value)
{
p2LineId = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}
@ -348,7 +348,7 @@ void VToolHeight::SetP1LineId(const quint32 &value)
{
p1LineId = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}

View File

@ -74,7 +74,7 @@ void VToolLineIntersectAxis::setDialog()
m_dialog->setModal(true);
QSharedPointer<DialogLineIntersectAxis> dialogTool = m_dialog.objectCast<DialogLineIntersectAxis>();
SCASSERT(not dialogTool.isNull())
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(m_id);
dialogTool->SetTypeLine(m_lineType);
dialogTool->SetLineColor(lineColor);
dialogTool->SetAngle(formulaAngle);
@ -204,7 +204,7 @@ VFormula VToolLineIntersectAxis::GetFormulaAngle() const
{
VFormula fAngle(formulaAngle, getData());
fAngle.setCheckZero(false);
fAngle.setToolId(id);
fAngle.setToolId(m_id);
fAngle.setPostfix(degreeSymbol);
return fAngle;
}
@ -216,7 +216,7 @@ void VToolLineIntersectAxis::SetFormulaAngle(const VFormula &value)
{
formulaAngle = value.GetFormula(FormulaType::FromUser);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}
@ -234,7 +234,7 @@ void VToolLineIntersectAxis::SetFirstPointId(const quint32 &value)
{
firstPointId = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}
@ -252,7 +252,7 @@ void VToolLineIntersectAxis::SetSecondPointId(const quint32 &value)
{
secondPointId = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}
@ -338,7 +338,7 @@ QString VToolLineIntersectAxis::MakeToolTip() const
const QSharedPointer<VPointF> basePoint = VAbstractTool::data.GeometricObject<VPointF>(basePointId);
const QSharedPointer<VPointF> firstPoint = VAbstractTool::data.GeometricObject<VPointF>(firstPointId);
const QSharedPointer<VPointF> secondPoint = VAbstractTool::data.GeometricObject<VPointF>(secondPointId);
const QSharedPointer<VPointF> current = VAbstractTool::data.GeometricObject<VPointF>(id);
const QSharedPointer<VPointF> current = VAbstractTool::data.GeometricObject<VPointF>(m_id);
const QLineF curLine(static_cast<QPointF>(*basePoint), static_cast<QPointF>(*current));
const QLineF firstToCur(static_cast<QPointF>(*firstPoint), static_cast<QPointF>(*current));

View File

@ -104,8 +104,8 @@ void VToolLinePoint::paint(QPainter *painter, const QStyleOptionGraphicsItem *op
*/
void VToolLinePoint::RefreshGeometry()
{
VToolSinglePoint::RefreshPointGeometry(*VDrawTool::data.GeometricObject<VPointF>(id));
QPointF point = static_cast<QPointF>(*VDrawTool::data.GeometricObject<VPointF>(id));
VToolSinglePoint::RefreshPointGeometry(*VDrawTool::data.GeometricObject<VPointF>(m_id));
QPointF point = static_cast<QPointF>(*VDrawTool::data.GeometricObject<VPointF>(m_id));
QPointF basePoint = static_cast<QPointF>(*VDrawTool::data.GeometricObject<VPointF>(basePointId));
mainLine->setLine(QLineF(basePoint - point, QPointF()));
}
@ -147,7 +147,7 @@ void VToolLinePoint::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
QString VToolLinePoint::MakeToolTip() const
{
const QSharedPointer<VPointF> first = VAbstractTool::data.GeometricObject<VPointF>(basePointId);
const QSharedPointer<VPointF> second = VAbstractTool::data.GeometricObject<VPointF>(id);
const QSharedPointer<VPointF> second = VAbstractTool::data.GeometricObject<VPointF>(m_id);
const QLineF line(static_cast<QPointF>(*first), static_cast<QPointF>(*second));
@ -191,7 +191,7 @@ qreal VToolLinePoint::GetAngle() const
void VToolLinePoint::SetAngle(const qreal &value)
{
angle = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
@ -206,7 +206,7 @@ void VToolLinePoint::SetLineColor(const QString &value)
{
lineColor = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
@ -223,7 +223,7 @@ void VToolLinePoint::SetBasePointId(const quint32 &value)
{
basePointId = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}
@ -233,7 +233,7 @@ VFormula VToolLinePoint::GetFormulaLength() const
{
VFormula fLength(formulaLength, this->getData());
fLength.setCheckZero(true);
fLength.setToolId(id);
fLength.setToolId(m_id);
fLength.setPostfix(UnitsToStr(qApp->patternUnit()));
return fLength;
@ -246,7 +246,7 @@ void VToolLinePoint::SetFormulaLength(const VFormula &value)
{
formulaLength = value.GetFormula(FormulaType::FromUser);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}

View File

@ -90,7 +90,7 @@ void VToolNormal::setDialog()
SCASSERT(not m_dialog.isNull())
QSharedPointer<DialogNormal> dialogTool = m_dialog.objectCast<DialogNormal>();
SCASSERT(not dialogTool.isNull())
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(m_id);
dialogTool->SetTypeLine(m_lineType);
dialogTool->SetFormula(formulaLength);
dialogTool->SetAngle(angle);
@ -299,7 +299,7 @@ void VToolNormal::SetSecondPointId(const quint32 &value)
{
secondPointId = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}

View File

@ -92,7 +92,7 @@ void VToolShoulderPoint::setDialog()
SCASSERT(not m_dialog.isNull())
QSharedPointer<DialogShoulderPoint> dialogTool = m_dialog.objectCast<DialogShoulderPoint>();
SCASSERT(not dialogTool.isNull())
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(m_id);
dialogTool->SetTypeLine(m_lineType);
dialogTool->SetLineColor(lineColor);
dialogTool->SetFormula(formulaLength);
@ -336,7 +336,7 @@ QString VToolShoulderPoint::MakeToolTip() const
{
const QSharedPointer<VPointF> first = VAbstractTool::data.GeometricObject<VPointF>(basePointId);
const QSharedPointer<VPointF> second = VAbstractTool::data.GeometricObject<VPointF>(p2Line);
const QSharedPointer<VPointF> current = VAbstractTool::data.GeometricObject<VPointF>(id);
const QSharedPointer<VPointF> current = VAbstractTool::data.GeometricObject<VPointF>(m_id);
const QLineF firstToCur(static_cast<QPointF>(*first), static_cast<QPointF>(*current));
const QLineF secondToCur(static_cast<QPointF>(*second), static_cast<QPointF>(*current));
@ -385,7 +385,7 @@ void VToolShoulderPoint::setPShoulder(const quint32 &value)
{
pShoulder = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}
@ -409,7 +409,7 @@ void VToolShoulderPoint::SetP2Line(const quint32 &value)
{
p2Line = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}

View File

@ -99,7 +99,7 @@ void VToolBasePoint::setDialog()
SCASSERT(not m_dialog.isNull())
QSharedPointer<DialogSinglePoint> dialogTool = m_dialog.objectCast<DialogSinglePoint>();
SCASSERT(not dialogTool.isNull())
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(m_id);
dialogTool->SetData(p->name(), static_cast<QPointF>(*p));
}
@ -153,7 +153,7 @@ void VToolBasePoint::AddToFile()
QDomElement sPoint = doc->createElement(getTagName());
// Create SPoint tag
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOptions(sPoint, obj);
//Create pattern piece structure
@ -193,7 +193,7 @@ QVariant VToolBasePoint::itemChange(QGraphicsItem::GraphicsItemChange change, co
// value - this is new position.
QPointF newPos = value.toPointF();
MoveSPoint *moveSP = new MoveSPoint(doc, newPos.x(), newPos.y(), id, this->scene());
MoveSPoint *moveSP = new MoveSPoint(doc, newPos.x(), newPos.y(), m_id, this->scene());
connect(moveSP, &MoveSPoint::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree);
qApp->getUndoStack()->push(moveSP);
const QList<QGraphicsView *> viewList = scene()->views();
@ -244,7 +244,7 @@ void VToolBasePoint::decrementReferens()
//---------------------------------------------------------------------------------------------------------------------
QPointF VToolBasePoint::GetBasePointPos() const
{
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(m_id);
QPointF pos(qApp->fromPixel(p->x()), qApp->fromPixel(p->y()));
return pos;
}
@ -252,7 +252,7 @@ QPointF VToolBasePoint::GetBasePointPos() const
//---------------------------------------------------------------------------------------------------------------------
void VToolBasePoint::SetBasePointPos(const QPointF &pos)
{
QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(m_id);
p->setX(qApp->toPixel(pos.x()));
p->setY(qApp->toPixel(pos.y()));
@ -407,7 +407,7 @@ void VToolBasePoint::ShowContextMenu(QGraphicsSceneContextMenuEvent *event, quin
*/
void VToolBasePoint::FullUpdateFromFile()
{
RefreshPointGeometry(*VAbstractTool::data.GeometricObject<VPointF>(id));
RefreshPointGeometry(*VAbstractTool::data.GeometricObject<VPointF>(m_id));
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -87,7 +87,7 @@ void VToolLineIntersect::setDialog()
SCASSERT(not m_dialog.isNull())
QSharedPointer<DialogLineIntersect> dialogTool = m_dialog.objectCast<DialogLineIntersect>();
SCASSERT(not dialogTool.isNull())
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(m_id);
dialogTool->SetP1Line1(p1Line1);
dialogTool->SetP2Line1(p2Line1);
dialogTool->SetP1Line2(p1Line2);
@ -300,7 +300,7 @@ QString VToolLineIntersect::MakeToolTip() const
const QSharedPointer<VPointF> p2L1 = VAbstractTool::data.GeometricObject<VPointF>(p2Line1);
const QSharedPointer<VPointF> p1L2 = VAbstractTool::data.GeometricObject<VPointF>(p1Line2);
const QSharedPointer<VPointF> p2L2 = VAbstractTool::data.GeometricObject<VPointF>(p2Line2);
const QSharedPointer<VPointF> current = VAbstractTool::data.GeometricObject<VPointF>(id);
const QSharedPointer<VPointF> current = VAbstractTool::data.GeometricObject<VPointF>(m_id);
const QLineF p1L1ToCur(static_cast<QPointF>(*p1L1), static_cast<QPointF>(*current));
const QLineF curToP2L1(static_cast<QPointF>(*current), static_cast<QPointF>(*p2L1));
@ -338,7 +338,7 @@ void VToolLineIntersect::SetP2Line2(const quint32 &value)
{
p2Line2 = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}
@ -376,7 +376,7 @@ void VToolLineIntersect::SetP1Line2(const quint32 &value)
{
p1Line2 = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}
@ -394,7 +394,7 @@ void VToolLineIntersect::SetP2Line1(const quint32 &value)
{
p2Line1 = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}
@ -412,7 +412,7 @@ void VToolLineIntersect::SetP1Line1(const quint32 &value)
{
p1Line1 = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}

View File

@ -70,7 +70,7 @@ void VToolPointFromArcAndTangent::setDialog()
SCASSERT(not m_dialog.isNull())
QSharedPointer<DialogPointFromArcAndTangent> dialogTool = m_dialog.objectCast<DialogPointFromArcAndTangent>();
SCASSERT(not dialogTool.isNull())
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(m_id);
dialogTool->SetArcId(arcId);
dialogTool->SetCrossCirclesPoint(crossPoint);
dialogTool->SetTangentPointId(tangentPointId);
@ -240,7 +240,7 @@ void VToolPointFromArcAndTangent::SetTangentPointId(const quint32 &value)
{
tangentPointId = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}
@ -258,7 +258,7 @@ void VToolPointFromArcAndTangent::SetArcId(const quint32 &value)
{
arcId = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}
@ -274,7 +274,7 @@ void VToolPointFromArcAndTangent::SetCrossCirclesPoint(const CrossCirclesPoint &
{
crossPoint = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}

View File

@ -73,7 +73,7 @@ void VToolPointFromCircleAndTangent::setDialog()
SCASSERT(not m_dialog.isNull())
QSharedPointer<DialogPointFromCircleAndTangent> dialogTool = m_dialog.objectCast<DialogPointFromCircleAndTangent>();
SCASSERT(not dialogTool.isNull())
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(m_id);
dialogTool->SetCircleCenterId(circleCenterId);
dialogTool->SetCircleRadius(circleRadius);
dialogTool->SetCrossCirclesPoint(crossPoint);
@ -201,7 +201,7 @@ void VToolPointFromCircleAndTangent::SetTangentPointId(const quint32 &value)
{
tangentPointId = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}
@ -219,7 +219,7 @@ void VToolPointFromCircleAndTangent::SetCircleCenterId(const quint32 &value)
{
circleCenterId = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}
@ -229,7 +229,7 @@ VFormula VToolPointFromCircleAndTangent::GetCircleRadius() const
{
VFormula radius(circleRadius, getData());
radius.setCheckZero(true);
radius.setToolId(id);
radius.setToolId(m_id);
radius.setPostfix(UnitsToStr(qApp->patternUnit()));
return radius;
}
@ -242,7 +242,7 @@ void VToolPointFromCircleAndTangent::SetCircleRadius(const VFormula &value)
if (value.getDoubleValue() > 0)// Formula don't check this, but radius can't be 0 or negative
{
circleRadius = value.GetFormula(FormulaType::FromUser);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}
@ -259,7 +259,7 @@ void VToolPointFromCircleAndTangent::SetCrossCirclesPoint(const CrossCirclesPoin
{
crossPoint = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}

View File

@ -92,7 +92,7 @@ void VToolPointOfContact::setDialog()
SCASSERT(not m_dialog.isNull())
QSharedPointer<DialogPointOfContact> dialogTool = m_dialog.objectCast<DialogPointOfContact>();
SCASSERT(not dialogTool.isNull())
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(m_id);
dialogTool->setRadius(arcRadius);
dialogTool->setCenter(center);
dialogTool->SetFirstPoint(firstPointId);
@ -343,7 +343,7 @@ QString VToolPointOfContact::MakeToolTip() const
const QSharedPointer<VPointF> p1 = VAbstractTool::data.GeometricObject<VPointF>(firstPointId);
const QSharedPointer<VPointF> p2 = VAbstractTool::data.GeometricObject<VPointF>(secondPointId);
const QSharedPointer<VPointF> centerP = VAbstractTool::data.GeometricObject<VPointF>(center);
const QSharedPointer<VPointF> current = VAbstractTool::data.GeometricObject<VPointF>(id);
const QSharedPointer<VPointF> current = VAbstractTool::data.GeometricObject<VPointF>(m_id);
const QLineF p1ToCur(static_cast<QPointF>(*p1), static_cast<QPointF>(*current));
const QLineF p2ToCur(static_cast<QPointF>(*p2), static_cast<QPointF>(*current));
@ -424,7 +424,7 @@ void VToolPointOfContact::setCenter(const quint32 &value)
{
center = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}
@ -434,7 +434,7 @@ VFormula VToolPointOfContact::getArcRadius() const
{
VFormula radius(arcRadius, this->getData());
radius.setCheckZero(true);
radius.setToolId(id);
radius.setToolId(m_id);
radius.setPostfix(UnitsToStr(qApp->patternUnit()));
return radius;
@ -447,7 +447,7 @@ void VToolPointOfContact::setArcRadius(const VFormula &value)
{
arcRadius = value.GetFormula(FormulaType::FromUser);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}

View File

@ -81,7 +81,7 @@ void VToolPointOfIntersection::setDialog()
SCASSERT(not m_dialog.isNull())
QSharedPointer<DialogPointOfIntersection> dialogTool = m_dialog.objectCast<DialogPointOfIntersection>();
SCASSERT(not dialogTool.isNull())
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(m_id);
dialogTool->SetFirstPointId(firstPointId);
dialogTool->SetSecondPointId(secondPointId);
dialogTool->SetPointName(p->name());
@ -267,7 +267,7 @@ void VToolPointOfIntersection::SetSecondPointId(const quint32 &value)
{
secondPointId = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}
@ -291,7 +291,7 @@ void VToolPointOfIntersection::SetFirstPointId(const quint32 &value)
{
firstPointId = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}

View File

@ -70,7 +70,7 @@ void VToolPointOfIntersectionArcs::setDialog()
SCASSERT(not m_dialog.isNull())
QSharedPointer<DialogPointOfIntersectionArcs> dialogTool = m_dialog.objectCast<DialogPointOfIntersectionArcs>();
SCASSERT(not dialogTool.isNull())
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(m_id);
dialogTool->SetFirstArcId(firstArcId);
dialogTool->SetSecondArcId(secondArcId);
dialogTool->SetCrossArcPoint(crossPoint);
@ -247,7 +247,7 @@ void VToolPointOfIntersectionArcs::SetFirstArcId(const quint32 &value)
{
firstArcId = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}
@ -265,7 +265,7 @@ void VToolPointOfIntersectionArcs::SetSecondArcId(const quint32 &value)
{
secondArcId = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}
@ -281,7 +281,7 @@ void VToolPointOfIntersectionArcs::SetCrossCirclesPoint(const CrossCirclesPoint
{
crossPoint = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}

View File

@ -78,7 +78,7 @@ void VToolPointOfIntersectionCircles::setDialog()
QSharedPointer<DialogPointOfIntersectionCircles> dialogTool =
m_dialog.objectCast<DialogPointOfIntersectionCircles>();
SCASSERT(not dialogTool.isNull())
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(m_id);
dialogTool->SetFirstCircleCenterId(firstCircleCenterId);
dialogTool->SetSecondCircleCenterId(secondCircleCenterId);
dialogTool->SetFirstCircleRadius(firstCircleRadius);
@ -216,7 +216,7 @@ void VToolPointOfIntersectionCircles::SetFirstCircleCenterId(const quint32 &valu
{
firstCircleCenterId = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}
@ -234,7 +234,7 @@ void VToolPointOfIntersectionCircles::SetSecondCircleCenterId(const quint32 &val
{
secondCircleCenterId = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}
@ -244,7 +244,7 @@ VFormula VToolPointOfIntersectionCircles::GetFirstCircleRadius() const
{
VFormula radius(firstCircleRadius, getData());
radius.setCheckZero(true);
radius.setToolId(id);
radius.setToolId(m_id);
radius.setPostfix(UnitsToStr(qApp->patternUnit()));
return radius;
}
@ -257,7 +257,7 @@ void VToolPointOfIntersectionCircles::SetFirstCircleRadius(const VFormula &value
if (value.getDoubleValue() > 0)// Formula don't check this, but radius can't be 0 or negative
{
firstCircleRadius = value.GetFormula(FormulaType::FromUser);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}
@ -268,7 +268,7 @@ VFormula VToolPointOfIntersectionCircles::GetSecondCircleRadius() const
{
VFormula radius(secondCircleRadius, getData());
radius.setCheckZero(true);
radius.setToolId(id);
radius.setToolId(m_id);
radius.setPostfix(UnitsToStr(qApp->patternUnit()));
return radius;
}
@ -281,7 +281,7 @@ void VToolPointOfIntersectionCircles::SetSecondCircleRadius(const VFormula &valu
if (value.getDoubleValue() > 0)// Formula don't check this, but radius can't be 0 or negative
{
secondCircleRadius = value.GetFormula(FormulaType::FromUser);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}
@ -298,7 +298,7 @@ void VToolPointOfIntersectionCircles::SetCrossCirclesPoint(const CrossCirclesPoi
{
crossPoint = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}

View File

@ -75,7 +75,7 @@ void VToolPointOfIntersectionCurves::setDialog()
SCASSERT(not m_dialog.isNull())
auto dialogTool = qobject_cast<DialogPointOfIntersectionCurves*>(m_dialog);
SCASSERT(dialogTool != nullptr)
auto p = VAbstractTool::data.GeometricObject<VPointF>(id);
auto p = VAbstractTool::data.GeometricObject<VPointF>(m_id);
dialogTool->SetFirstCurveId(firstCurveId);
dialogTool->SetSecondCurveId(secondCurveId);
dialogTool->SetVCrossPoint(vCrossPoint);
@ -287,7 +287,7 @@ void VToolPointOfIntersectionCurves::SetFirstCurveId(const quint32 &value)
{
firstCurveId = value;
auto obj = VAbstractTool::data.GetGObject(id);
auto obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}
@ -305,7 +305,7 @@ void VToolPointOfIntersectionCurves::SetSecondCurveId(const quint32 &value)
{
secondCurveId = value;
auto obj = VAbstractTool::data.GetGObject(id);
auto obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}
@ -321,7 +321,7 @@ void VToolPointOfIntersectionCurves::SetVCrossPoint(const VCrossCurvesPoint &val
{
vCrossPoint = value;
auto obj = VAbstractTool::data.GetGObject(id);
auto obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
@ -336,7 +336,7 @@ void VToolPointOfIntersectionCurves::SetHCrossPoint(const HCrossCurvesPoint &val
{
hCrossPoint = value;
auto obj = VAbstractTool::data.GetGObject(id);
auto obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}

View File

@ -91,13 +91,13 @@ VToolSinglePoint::VToolSinglePoint(VAbstractPattern *doc, VContainer *data, quin
//---------------------------------------------------------------------------------------------------------------------
QString VToolSinglePoint::name() const
{
return ObjectName<VPointF>(id);
return ObjectName<VPointF>(m_id);
}
//---------------------------------------------------------------------------------------------------------------------
void VToolSinglePoint::setName(const QString &name)
{
SetPointName(id, name);
SetPointName(m_id, name);
}
//---------------------------------------------------------------------------------------------------------------------
@ -117,7 +117,7 @@ void VToolSinglePoint::GroupVisibility(quint32 object, bool visible)
//---------------------------------------------------------------------------------------------------------------------
bool VToolSinglePoint::IsLabelVisible(quint32 id) const
{
if (this->id == id)
if (m_id == id)
{
const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(id);
return point->IsShowLabel();
@ -131,7 +131,7 @@ bool VToolSinglePoint::IsLabelVisible(quint32 id) const
//---------------------------------------------------------------------------------------------------------------------
void VToolSinglePoint::SetLabelVisible(quint32 id, bool visible)
{
if (this->id == id)
if (m_id == id)
{
const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(id);
point->SetShowLabel(visible);
@ -146,7 +146,7 @@ void VToolSinglePoint::SetLabelVisible(quint32 id, bool visible)
*/
void VToolSinglePoint::NameChangePosition(const QPointF &pos)
{
ChangePosition(this, id, pos);
ChangePosition(this, m_id, pos);
}
//---------------------------------------------------------------------------------------------------------------------
@ -203,7 +203,7 @@ void VToolSinglePoint::EnableToolMove(bool move)
//---------------------------------------------------------------------------------------------------------------------
void VToolSinglePoint::PointChoosed()
{
emit ChoosedTool(id, SceneObject::Point);
emit ChoosedTool(m_id, SceneObject::Point);
}
//---------------------------------------------------------------------------------------------------------------------
@ -219,7 +219,7 @@ void VToolSinglePoint::PointSelected(bool selected)
void VToolSinglePoint::FullUpdateFromFile()
{
ReadAttributes();
RefreshPointGeometry(*VAbstractTool::data.GeometricObject<VPointF>(id));
RefreshPointGeometry(*VAbstractTool::data.GeometricObject<VPointF>(m_id));
SetVisualization();
}
@ -261,7 +261,7 @@ QVariant VToolSinglePoint::itemChange(QGraphicsItem::GraphicsItemChange change,
m_namePoint->blockSignals(true);
m_namePoint->setSelected(value.toBool());
m_namePoint->blockSignals(false);
emit ChangedToolSelection(value.toBool(), id, id);
emit ChangedToolSelection(value.toBool(), m_id, m_id);
}
return VScenePoint::itemChange(change, value);
@ -296,7 +296,7 @@ void VToolSinglePoint::keyReleaseEvent(QKeyEvent *event)
//---------------------------------------------------------------------------------------------------------------------
void VToolSinglePoint::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
{
ShowContextMenu(event, id);
ShowContextMenu(event, m_id);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -86,7 +86,7 @@ void VToolTriangle::setDialog()
SCASSERT(not m_dialog.isNull())
QSharedPointer<DialogTriangle> dialogTool = m_dialog.objectCast<DialogTriangle>();
SCASSERT(not dialogTool.isNull())
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(m_id);
dialogTool->SetAxisP1Id(axisP1Id);
dialogTool->SetAxisP2Id(axisP2Id);
dialogTool->SetFirstPointId(firstPointId);
@ -353,7 +353,7 @@ void VToolTriangle::SetSecondPointId(const quint32 &value)
{
secondPointId = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}
@ -377,7 +377,7 @@ void VToolTriangle::SetFirstPointId(const quint32 &value)
{
firstPointId = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}
@ -395,7 +395,7 @@ void VToolTriangle::SetAxisP2Id(const quint32 &value)
{
axisP2Id = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}
@ -413,7 +413,7 @@ void VToolTriangle::SetAxisP1Id(const quint32 &value)
{
axisP1Id = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}
}

View File

@ -106,19 +106,19 @@ void VDrawTool::ChangedNameDraw(const QString &oldName, const QString &newName)
void VDrawTool::SaveDialogChange()
{
qCDebug(vTool, "Saving tool options after using dialog");
QDomElement oldDomElement = doc->elementById(id, getTagName());
QDomElement oldDomElement = doc->elementById(m_id, getTagName());
if (oldDomElement.isElement())
{
QDomElement newDomElement = oldDomElement.cloneNode().toElement();
SaveDialog(newDomElement);
SaveToolOptions *saveOptions = new SaveToolOptions(oldDomElement, newDomElement, doc, id);
SaveToolOptions *saveOptions = new SaveToolOptions(oldDomElement, newDomElement, doc, m_id);
connect(saveOptions, &SaveToolOptions::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree);
qApp->getUndoStack()->push(saveOptions);
}
else
{
qCDebug(vTool, "Can't find tool with id = %u", id);
qCDebug(vTool, "Can't find tool with id = %u", m_id);
}
}
@ -129,7 +129,7 @@ void VDrawTool::SaveDialogChange()
void VDrawTool::AddToFile()
{
QDomElement domElement = doc->createElement(getTagName());
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOptions(domElement, obj);
AddToCalculation(domElement);
}
@ -138,20 +138,20 @@ void VDrawTool::AddToFile()
void VDrawTool::SaveOption(QSharedPointer<VGObject> &obj)
{
qCDebug(vTool, "Saving tool options");
QDomElement oldDomElement = doc->elementById(id, getTagName());
QDomElement oldDomElement = doc->elementById(m_id, getTagName());
if (oldDomElement.isElement())
{
QDomElement newDomElement = oldDomElement.cloneNode().toElement();
SaveOptions(newDomElement, obj);
SaveToolOptions *saveOptions = new SaveToolOptions(oldDomElement, newDomElement, doc, id);
SaveToolOptions *saveOptions = new SaveToolOptions(oldDomElement, newDomElement, doc, m_id);
connect(saveOptions, &SaveToolOptions::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree);
qApp->getUndoStack()->push(saveOptions);
}
else
{
qCDebug(vTool, "Can't find tool with id = %u", id);
qCDebug(vTool, "Can't find tool with id = %u", m_id);
}
}
@ -160,7 +160,7 @@ void VDrawTool::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj)
{
Q_UNUSED(obj)
doc->SetAttribute(tag, VDomDocument::AttrId, id);
doc->SetAttribute(tag, VDomDocument::AttrId, m_id);
}
//---------------------------------------------------------------------------------------------------------------------
@ -185,14 +185,14 @@ bool VDrawTool::CorrectDisable(bool disable, const QString &namePP) const
//---------------------------------------------------------------------------------------------------------------------
void VDrawTool::ReadAttributes()
{
const QDomElement domElement = doc->elementById(id, getTagName());
const QDomElement domElement = doc->elementById(m_id, getTagName());
if (domElement.isElement())
{
ReadToolAttributes(domElement);
}
else
{
qCDebug(vTool, "Can't find tool with id = %u", id);
qCDebug(vTool, "Can't find tool with id = %u", m_id);
}
}
@ -240,7 +240,7 @@ void VDrawTool::SetTypeLine(const QString &value)
{
m_lineType = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
SaveOption(obj);
}

View File

@ -195,7 +195,7 @@ void VDrawTool::ContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 itemI
{
qCDebug(vTool, "Show options.");
qApp->getSceneView()->itemClicked(nullptr);
m_dialog = QSharedPointer<Dialog>(new Dialog(getData(), id, qApp->getMainWindow()));
m_dialog = QSharedPointer<Dialog>(new Dialog(getData(), m_id, qApp->getMainWindow()));
m_dialog->setModal(true);
connect(m_dialog.data(), &DialogTool::DialogClosed, this, &VDrawTool::FullUpdateFromGuiOk);
@ -228,7 +228,7 @@ template <typename Item>
void VDrawTool::ShowItem(Item *item, quint32 id, bool enable)
{
SCASSERT(item != nullptr)
if (id == item->id)
if (id == item->m_id)
{
ShowVisualization(enable);
}

View File

@ -341,7 +341,7 @@ QVariant VToolLine::itemChange(QGraphicsItem::GraphicsItemChange change, const Q
{
if (change == QGraphicsItem::ItemSelectedChange)
{
emit ChangedToolSelection(value.toBool(), id, id);
emit ChangedToolSelection(value.toBool(), m_id, m_id);
}
return QGraphicsItem::itemChange(change, value);

View File

@ -90,7 +90,7 @@ void VAbstractNode::incrementReferens()
doc->IncrementReferens(node->getIdTool());
}
ShowNode();
QDomElement domElement = doc->elementById(id, getTagName());
QDomElement domElement = doc->elementById(m_id, getTagName());
if (domElement.isElement())
{
doc->SetParametrUsage(domElement, AttrInUse, NodeUsage::InUse);
@ -117,7 +117,7 @@ void VAbstractNode::decrementReferens()
doc->DecrementReferens(node->getIdTool());
}
HideNode();
QDomElement domElement = doc->elementById(id, getTagName());
QDomElement domElement = doc->elementById(m_id, getTagName());
if (domElement.isElement())
{
doc->SetParametrUsage(domElement, AttrInUse, NodeUsage::NotInUse);

View File

@ -126,7 +126,7 @@ void VNodeArc::AddToFile()
{
QDomElement domElement = doc->createElement(getTagName());
doc->SetAttribute(domElement, VDomDocument::AttrId, id);
doc->SetAttribute(domElement, VDomDocument::AttrId, m_id);
doc->SetAttribute(domElement, AttrType, ToolType);
doc->SetAttribute(domElement, AttrIdObject, idNode);
if (idTool != NULL_ID)

View File

@ -96,7 +96,7 @@ void VNodeEllipticalArc::AddToFile()
{
QDomElement domElement = doc->createElement(getTagName());
doc->SetAttribute(domElement, VDomDocument::AttrId, id);
doc->SetAttribute(domElement, VDomDocument::AttrId, m_id);
doc->SetAttribute(domElement, AttrType, ToolType);
doc->SetAttribute(domElement, AttrIdObject, idNode);
if (idTool != NULL_ID)

View File

@ -143,7 +143,7 @@ QString VNodePoint::getTagName() const
//---------------------------------------------------------------------------------------------------------------------
void VNodePoint::PointChoosed()
{
emit ChoosedTool(id, SceneObject::Point);
emit ChoosedTool(m_id, SceneObject::Point);
}
//---------------------------------------------------------------------------------------------------------------------
@ -152,7 +152,7 @@ void VNodePoint::PointChoosed()
*/
void VNodePoint::FullUpdateFromFile()
{
RefreshPointGeometry(*VAbstractTool::data.GeometricObject<VPointF>(id));
RefreshPointGeometry(*VAbstractTool::data.GeometricObject<VPointF>(m_id));
}
//---------------------------------------------------------------------------------------------------------------------
@ -161,10 +161,10 @@ void VNodePoint::FullUpdateFromFile()
*/
void VNodePoint::AddToFile()
{
const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(id);
const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(m_id);
QDomElement domElement = doc->createElement(getTagName());
doc->SetAttribute(domElement, VDomDocument::AttrId, id);
doc->SetAttribute(domElement, VDomDocument::AttrId, m_id);
doc->SetAttribute(domElement, AttrType, ToolType);
doc->SetAttribute(domElement, AttrIdObject, idNode);
doc->SetAttribute(domElement, AttrMx, qApp->fromPixel(point->mx()));
@ -201,7 +201,7 @@ void VNodePoint::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
if (event->button() == Qt::LeftButton)
{
emit ChoosedTool(id, SceneObject::Point);
emit ChoosedTool(m_id, SceneObject::Point);
}
VScenePoint::mouseReleaseEvent(event);
}
@ -213,13 +213,13 @@ void VNodePoint::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
*/
void VNodePoint::NameChangePosition(const QPointF &pos)
{
VPointF *point = new VPointF(*VAbstractTool::data.GeometricObject<VPointF>(id));
VPointF *point = new VPointF(*VAbstractTool::data.GeometricObject<VPointF>(m_id));
QPointF p = pos - this->pos();
point->setMx(p.x());
point->setMy(p.y());
RefreshLine();
UpdateNamePosition(point->mx(), point->my());
VAbstractTool::data.UpdateGObject(id, point);
VAbstractTool::data.UpdateGObject(m_id, point);
}
//---------------------------------------------------------------------------------------------------------------------
@ -230,7 +230,7 @@ void VNodePoint::NameChangePosition(const QPointF &pos)
*/
void VNodePoint::UpdateNamePosition(qreal mx, qreal my)
{
QDomElement domElement = doc->elementById(id, getTagName());
QDomElement domElement = doc->elementById(m_id, getTagName());
if (domElement.isElement())
{
doc->SetAttribute(domElement, AttrMx, QString().setNum(qApp->fromPixel(mx)));

View File

@ -130,7 +130,7 @@ void VNodeSpline::AddToFile()
{
QDomElement domElement = doc->createElement(getTagName());
doc->SetAttribute(domElement, VDomDocument::AttrId, id);
doc->SetAttribute(domElement, VDomDocument::AttrId, m_id);
doc->SetAttribute(domElement, AttrType, ToolType);
doc->SetAttribute(domElement, AttrIdObject, idNode);
if (idTool != NULL_ID)

View File

@ -128,7 +128,7 @@ void VNodeSplinePath::AddToFile()
{
QDomElement domElement = doc->createElement(getTagName());
doc->SetAttribute(domElement, VDomDocument::AttrId, id);
doc->SetAttribute(domElement, VDomDocument::AttrId, m_id);
doc->SetAttribute(domElement, AttrType, ToolType);
doc->SetAttribute(domElement, AttrIdObject, idNode);
if (idTool != 0)

View File

@ -143,10 +143,10 @@ void VToolPiecePath::incrementReferens()
}
else
{
IncrementNodes(VAbstractTool::data.GetPiecePath(id));
IncrementNodes(VAbstractTool::data.GetPiecePath(m_id));
}
ShowNode();
QDomElement domElement = doc->elementById(id, getTagName());
QDomElement domElement = doc->elementById(m_id, getTagName());
if (domElement.isElement())
{
doc->SetParametrUsage(domElement, AttrInUse, NodeUsage::InUse);
@ -166,10 +166,10 @@ void VToolPiecePath::decrementReferens()
}
else
{
DecrementNodes(VAbstractTool::data.GetPiecePath(id));
DecrementNodes(VAbstractTool::data.GetPiecePath(m_id));
}
HideNode();
QDomElement domElement = doc->elementById(id, getTagName());
QDomElement domElement = doc->elementById(m_id, getTagName());
if (domElement.isElement())
{
doc->SetParametrUsage(domElement, AttrInUse, NodeUsage::NotInUse);
@ -215,9 +215,9 @@ void VToolPiecePath::AllowSelecting(bool enabled)
void VToolPiecePath::AddToFile()
{
QDomElement domElement = doc->createElement(getTagName());
const VPiecePath path = VAbstractTool::data.GetPiecePath(id);
const VPiecePath path = VAbstractTool::data.GetPiecePath(m_id);
AddAttributes(doc, domElement, id, path);
AddAttributes(doc, domElement, m_id, path);
if (idTool != NULL_ID)
{
@ -235,12 +235,12 @@ void VToolPiecePath::AddToFile()
if (path.GetType() == PiecePathType::InternalPath)
{
newDet.GetInternalPaths().append(id);
newDet.GetInternalPaths().append(m_id);
}
else if (path.GetType() == PiecePathType::CustomSeamAllowance)
{
CustomSARecord record;
record.path = id;
record.path = m_id;
newDet.GetCustomSARecords().append(record);
}
@ -300,7 +300,7 @@ VToolPiecePath::VToolPiecePath(VAbstractPattern *doc, VContainer *data, quint32
//---------------------------------------------------------------------------------------------------------------------
void VToolPiecePath::RefreshGeometry()
{
const VPiecePath path = VAbstractTool::data.GetPiecePath(id);
const VPiecePath path = VAbstractTool::data.GetPiecePath(m_id);
if (path.GetType() == PiecePathType::InternalPath)
{
QPainterPath p = path.PainterPath(this->getData());

View File

@ -128,7 +128,7 @@ void VToolPin::AddToFile()
{
QDomElement domElement = doc->createElement(getTagName());
doc->SetAttribute(domElement, VDomDocument::AttrId, id);
doc->SetAttribute(domElement, VDomDocument::AttrId, m_id);
doc->SetAttribute(domElement, AttrType, ToolType);
doc->SetAttribute(domElement, AttrIdObject, idNode);
if (idTool != NULL_ID)
@ -143,7 +143,7 @@ void VToolPin::AddToFile()
const VPiece oldDet = VAbstractTool::data.GetPiece(m_pieceId);
VPiece newDet = oldDet;
newDet.GetPins().append(id);
newDet.GetPins().append(m_id);
SavePieceOptions *saveCommand = new SavePieceOptions(oldDet, newDet, doc, m_pieceId);
qApp->getUndoStack()->push(saveCommand);// First push then make a connect

View File

@ -123,7 +123,7 @@ quint32 CreateNodeSplinePath(VContainer *data, quint32 id)
VAbstractTool::VAbstractTool(VAbstractPattern *doc, VContainer *data, quint32 id, QObject *parent)
:VDataTool(data, parent),
doc(doc),
id(id),
m_id(id),
vis(),
selectionType(SelectionType::ByMouseRelease)
{
@ -254,7 +254,7 @@ void VAbstractTool::DeleteTool(bool ask)
}
qCDebug(vTool, "Begin deleting.");
DelTool *delTool = new DelTool(doc, id);
DelTool *delTool = new DelTool(doc, m_id);
connect(delTool, &DelTool::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing);
qApp->getUndoStack()->push(delTool);
@ -384,7 +384,7 @@ QMap<QString, quint32> VAbstractTool::PointsList() const
QHash<quint32, QSharedPointer<VGObject> >::const_iterator i;
for (i = objs->constBegin(); i != objs->constEnd(); ++i)
{
if (i.key() != id)
if (i.key() != m_id)
{
QSharedPointer<VGObject> obj = i.value();
if (obj->getType() == GOType::Point && obj->getMode() == Draw::Calculation)

View File

@ -109,7 +109,7 @@ protected:
VAbstractPattern *doc;
/** @brief id object id. */
const quint32 id;
const quint32 m_id;
QPointer<Visualization> vis;
SelectionType selectionType;
@ -153,7 +153,7 @@ private:
*/
inline quint32 VAbstractTool::getId() const
{
return id;
return m_id;
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -483,7 +483,7 @@ void VToolSeamAllowance::AllowSelecting(bool enabled)
void VToolSeamAllowance::ResetChildren(QGraphicsItem *pItem)
{
const bool selected = isSelected();
const VPiece detail = VAbstractTool::data.GetPiece(id);
const VPiece detail = VAbstractTool::data.GetPiece(m_id);
VTextGraphicsItem* pVGI = qgraphicsitem_cast<VTextGraphicsItem*>(pItem);
if (pVGI != m_dataLabel)
{
@ -529,7 +529,7 @@ void VToolSeamAllowance::retranslateUi()
//---------------------------------------------------------------------------------------------------------------------
void VToolSeamAllowance::Highlight(quint32 id)
{
setSelected(this->id == id);
setSelected(m_id == id);
}
//---------------------------------------------------------------------------------------------------------------------
@ -538,7 +538,7 @@ void VToolSeamAllowance::Highlight(quint32 id)
*/
void VToolSeamAllowance::UpdateDetailLabel()
{
const VPiece detail = VAbstractTool::data.GetPiece(id);
const VPiece detail = VAbstractTool::data.GetPiece(m_id);
const VPieceLabelData& labelData = detail.GetPatternPieceData();
if (labelData.IsVisible() == true)
@ -564,7 +564,7 @@ void VToolSeamAllowance::UpdateDetailLabel()
*/
void VToolSeamAllowance::UpdatePatternInfo()
{
const VPiece detail = VAbstractTool::data.GetPiece(id);
const VPiece detail = VAbstractTool::data.GetPiece(m_id);
const VPatternLabelData& geom = detail.GetPatternInfo();
if (geom.IsVisible() == true)
@ -590,7 +590,7 @@ void VToolSeamAllowance::UpdatePatternInfo()
*/
void VToolSeamAllowance::UpdateGrainline()
{
const VPiece detail = VAbstractTool::data.GetPiece(id);
const VPiece detail = VAbstractTool::data.GetPiece(m_id);
const VGrainlineData& geom = detail.GetGrainlineGeometry();
if (geom.IsVisible() == true)
@ -623,11 +623,11 @@ void VToolSeamAllowance::UpdateGrainline()
*/
void VToolSeamAllowance::SaveMoveDetail(const QPointF& ptPos)
{
VPiece oldDet = VAbstractTool::data.GetPiece(id);
VPiece oldDet = VAbstractTool::data.GetPiece(m_id);
VPiece newDet = oldDet;
newDet.GetPatternPieceData().SetPos(ptPos);
SavePieceOptions* moveCommand = new SavePieceOptions(oldDet, newDet, doc, id);
SavePieceOptions* moveCommand = new SavePieceOptions(oldDet, newDet, doc, m_id);
moveCommand->setText(tr("move pattern piece label"));
connect(moveCommand, &SavePieceOptions::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree);
qApp->getUndoStack()->push(moveCommand);
@ -639,7 +639,7 @@ void VToolSeamAllowance::SaveMoveDetail(const QPointF& ptPos)
*/
void VToolSeamAllowance::SaveResizeDetail(qreal dLabelW, int iFontSize)
{
VPiece oldDet = VAbstractTool::data.GetPiece(id);
VPiece oldDet = VAbstractTool::data.GetPiece(m_id);
VPiece newDet = oldDet;
dLabelW = FromPixel(dLabelW, *VDataTool::data.GetPatternUnit());
@ -648,7 +648,7 @@ void VToolSeamAllowance::SaveResizeDetail(qreal dLabelW, int iFontSize)
newDet.GetPatternPieceData().SetLabelHeight(QString().setNum(height));
newDet.GetPatternPieceData().SetFontSize(iFontSize);
SavePieceOptions* resizeCommand = new SavePieceOptions(oldDet, newDet, doc, id);
SavePieceOptions* resizeCommand = new SavePieceOptions(oldDet, newDet, doc, m_id);
resizeCommand->setText(tr("resize pattern piece label"));
connect(resizeCommand, &SavePieceOptions::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree);
qApp->getUndoStack()->push(resizeCommand);
@ -660,7 +660,7 @@ void VToolSeamAllowance::SaveResizeDetail(qreal dLabelW, int iFontSize)
*/
void VToolSeamAllowance::SaveRotationDetail(qreal dRot)
{
VPiece oldDet = VAbstractTool::data.GetPiece(id);
VPiece oldDet = VAbstractTool::data.GetPiece(m_id);
VPiece newDet = oldDet;
newDet.GetPatternPieceData().SetPos(m_dataLabel->pos());
newDet.GetPatternPieceData().SetFontSize(m_dataLabel->GetFontSize());
@ -670,7 +670,7 @@ void VToolSeamAllowance::SaveRotationDetail(qreal dRot)
line.setAngle(-dRot);
newDet.GetPatternPieceData().SetRotationWay(QString().setNum(line.angle()));
SavePieceOptions* rotateCommand = new SavePieceOptions(oldDet, newDet, doc, id);
SavePieceOptions* rotateCommand = new SavePieceOptions(oldDet, newDet, doc, m_id);
rotateCommand->setText(tr("rotate pattern piece label"));
connect(rotateCommand, &SavePieceOptions::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree);
qApp->getUndoStack()->push(rotateCommand);
@ -683,11 +683,11 @@ void VToolSeamAllowance::SaveRotationDetail(qreal dRot)
*/
void VToolSeamAllowance::SaveMovePattern(const QPointF &ptPos)
{
VPiece oldDet = VAbstractTool::data.GetPiece(id);
VPiece oldDet = VAbstractTool::data.GetPiece(m_id);
VPiece newDet = oldDet;
newDet.GetPatternInfo().SetPos(ptPos);
SavePieceOptions* moveCommand = new SavePieceOptions(oldDet, newDet, doc, id);
SavePieceOptions* moveCommand = new SavePieceOptions(oldDet, newDet, doc, m_id);
moveCommand->setText(tr("move pattern info label"));
connect(moveCommand, &SavePieceOptions::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree);
qApp->getUndoStack()->push(moveCommand);
@ -699,7 +699,7 @@ void VToolSeamAllowance::SaveMovePattern(const QPointF &ptPos)
*/
void VToolSeamAllowance::SaveResizePattern(qreal dLabelW, int iFontSize)
{
VPiece oldDet = VAbstractTool::data.GetPiece(id);
VPiece oldDet = VAbstractTool::data.GetPiece(m_id);
VPiece newDet = oldDet;
dLabelW = FromPixel(dLabelW, *VDataTool::data.GetPatternUnit());
@ -708,7 +708,7 @@ void VToolSeamAllowance::SaveResizePattern(qreal dLabelW, int iFontSize)
newDet.GetPatternInfo().SetLabelHeight(QString().setNum(height));
newDet.GetPatternInfo().SetFontSize(iFontSize);
SavePieceOptions* resizeCommand = new SavePieceOptions(oldDet, newDet, doc, id);
SavePieceOptions* resizeCommand = new SavePieceOptions(oldDet, newDet, doc, m_id);
resizeCommand->setText(tr("resize pattern info label"));
connect(resizeCommand, &SavePieceOptions::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree);
qApp->getUndoStack()->push(resizeCommand);
@ -717,7 +717,7 @@ void VToolSeamAllowance::SaveResizePattern(qreal dLabelW, int iFontSize)
//---------------------------------------------------------------------------------------------------------------------
void VToolSeamAllowance::SaveRotationPattern(qreal dRot)
{
VPiece oldDet = VAbstractTool::data.GetPiece(id);
VPiece oldDet = VAbstractTool::data.GetPiece(m_id);
VPiece newDet = oldDet;
newDet.GetPatternInfo().SetPos(m_patternInfo->pos());
@ -728,7 +728,7 @@ void VToolSeamAllowance::SaveRotationPattern(qreal dRot)
line.setAngle(-dRot);
newDet.GetPatternInfo().SetRotation(QString().setNum(line.angle()));
SavePieceOptions* rotateCommand = new SavePieceOptions(oldDet, newDet, doc, id);
SavePieceOptions* rotateCommand = new SavePieceOptions(oldDet, newDet, doc, m_id);
rotateCommand->setText(tr("rotate pattern info label"));
connect(rotateCommand, &SavePieceOptions::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree);
qApp->getUndoStack()->push(rotateCommand);
@ -738,12 +738,12 @@ void VToolSeamAllowance::SaveRotationPattern(qreal dRot)
//---------------------------------------------------------------------------------------------------------------------
void VToolSeamAllowance::SaveMoveGrainline(const QPointF& ptPos)
{
VPiece oldDet = VAbstractTool::data.GetPiece(id);
VPiece oldDet = VAbstractTool::data.GetPiece(m_id);
VPiece newDet = oldDet;
newDet.GetGrainlineGeometry().SetPos(ptPos);
qDebug() << "******* new grainline pos" << ptPos;
SavePieceOptions* moveCommand = new SavePieceOptions(oldDet, newDet, doc, id);
SavePieceOptions* moveCommand = new SavePieceOptions(oldDet, newDet, doc, m_id);
moveCommand->setText(tr("move grainline"));
connect(moveCommand, &SavePieceOptions::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree);
qApp->getUndoStack()->push(moveCommand);
@ -752,13 +752,13 @@ void VToolSeamAllowance::SaveMoveGrainline(const QPointF& ptPos)
//---------------------------------------------------------------------------------------------------------------------
void VToolSeamAllowance::SaveResizeGrainline(qreal dLength)
{
VPiece oldDet = VAbstractTool::data.GetPiece(id);
VPiece oldDet = VAbstractTool::data.GetPiece(m_id);
VPiece newDet = oldDet;
dLength = FromPixel(dLength, *VDataTool::data.GetPatternUnit());
newDet.GetGrainlineGeometry().SetPos(m_grainLine->pos());
newDet.GetGrainlineGeometry().SetLength(QString().setNum(dLength));
SavePieceOptions* resizeCommand = new SavePieceOptions(oldDet, newDet, doc, id);
SavePieceOptions* resizeCommand = new SavePieceOptions(oldDet, newDet, doc, m_id);
resizeCommand->setText(tr("resize grainline"));
connect(resizeCommand, &SavePieceOptions::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree);
qApp->getUndoStack()->push(resizeCommand);
@ -767,12 +767,12 @@ void VToolSeamAllowance::SaveResizeGrainline(qreal dLength)
//---------------------------------------------------------------------------------------------------------------------
void VToolSeamAllowance::SaveRotateGrainline(qreal dRot, const QPointF& ptPos)
{
VPiece oldDet = VAbstractTool::data.GetPiece(id);
VPiece oldDet = VAbstractTool::data.GetPiece(m_id);
VPiece newDet = oldDet;
newDet.GetGrainlineGeometry().SetRotation(QString().setNum(qRadiansToDegrees(dRot)));
newDet.GetGrainlineGeometry().SetPos(ptPos);
SavePieceOptions* rotateCommand = new SavePieceOptions(oldDet, newDet, doc, id);
SavePieceOptions* rotateCommand = new SavePieceOptions(oldDet, newDet, doc, m_id);
rotateCommand->setText(tr("rotate grainline"));
connect(rotateCommand, &SavePieceOptions::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree);
qApp->getUndoStack()->push(rotateCommand);
@ -829,11 +829,11 @@ QPainterPath VToolSeamAllowance::shape() const
//---------------------------------------------------------------------------------------------------------------------
void VToolSeamAllowance::AddToFile()
{
const VPiece piece = VAbstractTool::data.GetPiece(id);
const VPiece piece = VAbstractTool::data.GetPiece(m_id);
QDomElement domElement = doc->createElement(getTagName());
AddAttributes(doc, domElement, id, piece);
AddAttributes(doc, domElement, m_id, piece);
AddPatternPieceData(doc, domElement, piece);
AddPatternInfo(doc, domElement, piece);
AddGrainline(doc, domElement, piece);
@ -853,7 +853,7 @@ void VToolSeamAllowance::AddToFile()
//---------------------------------------------------------------------------------------------------------------------
void VToolSeamAllowance::RefreshDataInFile()
{
QDomElement domElement = doc->elementById(id, getTagName());
QDomElement domElement = doc->elementById(m_id, getTagName());
if (domElement.isElement())
{
// Refresh only parts that we possibly need to update
@ -865,7 +865,7 @@ void VToolSeamAllowance::RefreshDataInFile()
const uint version = doc->GetParametrUInt(domElement, VToolSeamAllowance::AttrVersion, "1");
if (version == 1)
{
const VPiece piece = VAbstractTool::data.GetPiece(id);
const VPiece piece = VAbstractTool::data.GetPiece(m_id);
doc->SetAttribute(domElement, AttrVersion, QString().setNum(pieceVersion));
@ -897,7 +897,7 @@ QVariant VToolSeamAllowance::itemChange(QGraphicsItem::GraphicsItemChange change
// value - this is new position.
const QPointF newPos = value.toPointF();
MovePiece *moveDet = new MovePiece(doc, newPos.x(), newPos.y(), id, scene());
MovePiece *moveDet = new MovePiece(doc, newPos.x(), newPos.y(), m_id, scene());
connect(moveDet, &MovePiece::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree);
qApp->getUndoStack()->push(moveDet);
@ -929,10 +929,10 @@ QVariant VToolSeamAllowance::itemChange(QGraphicsItem::GraphicsItemChange change
}
}
// Don't forget to update geometry, because first change never call full parse
VPiece detail = VAbstractTool::data.GetPiece(id);
VPiece detail = VAbstractTool::data.GetPiece(m_id);
detail.SetMx(newPos.x());
detail.SetMy(newPos.y());
VAbstractTool::data.UpdatePiece(id, detail);
VAbstractTool::data.UpdatePiece(m_id, detail);
RefreshGeometry();
changeFinished = true;
@ -977,8 +977,8 @@ void VToolSeamAllowance::mousePressEvent(QGraphicsSceneMouseEvent *event)
if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick)
{
doc->SelectedDetail(id);
emit ChoosedTool(id, SceneObject::Detail);
doc->SelectedDetail(m_id);
emit ChoosedTool(m_id, SceneObject::Detail);
}
event->accept();// Special for not selectable item first need to call standard mousePressEvent then accept event
@ -1028,7 +1028,7 @@ void VToolSeamAllowance::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
QAction *inLayoutOption = menu.addAction(tr("In layout"));
inLayoutOption->setCheckable(true);
const VPiece detail = VAbstractTool::data.GetPiece(id);
const VPiece detail = VAbstractTool::data.GetPiece(m_id);
inLayoutOption->setChecked(detail.IsInLayout());
QAction *actionRemove = menu.addAction(QIcon::fromTheme("edit-delete"), tr("Delete"));
@ -1038,7 +1038,7 @@ void VToolSeamAllowance::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
if (selectedAction == actionOption)
{
QSharedPointer<DialogSeamAllowance> dialog =
QSharedPointer<DialogSeamAllowance>(new DialogSeamAllowance(getData(), id, qApp->getMainWindow()));
QSharedPointer<DialogSeamAllowance>(new DialogSeamAllowance(getData(), m_id, qApp->getMainWindow()));
dialog->EnableApply(true);
m_dialog = dialog;
m_dialog->setModal(true);
@ -1049,7 +1049,7 @@ void VToolSeamAllowance::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
}
else if (selectedAction == inLayoutOption)
{
TogglePieceInLayout *togglePrint = new TogglePieceInLayout(id, selectedAction->isChecked(),
TogglePieceInLayout *togglePrint = new TogglePieceInLayout(m_id, selectedAction->isChecked(),
&(VAbstractTool::data), doc);
connect(togglePrint, &TogglePieceInLayout::UpdateList, doc, &VAbstractPattern::CheckInLayoutList);
qApp->getUndoStack()->push(togglePrint);
@ -1098,7 +1098,7 @@ void VToolSeamAllowance::SetDialog()
SCASSERT(not m_dialog.isNull());
QSharedPointer<DialogSeamAllowance> dialogTool = m_dialog.objectCast<DialogSeamAllowance>();
SCASSERT(not dialogTool.isNull())
dialogTool->SetPiece(VAbstractTool::data.GetPiece(id));
dialogTool->SetPiece(VAbstractTool::data.GetPiece(m_id));
dialogTool->EnableApply(true);
}
@ -1165,7 +1165,7 @@ VToolSeamAllowance::VToolSeamAllowance(VAbstractPattern *doc, VContainer *data,
//---------------------------------------------------------------------------------------------------------------------
void VToolSeamAllowance::UpdateExcludeState()
{
const VPiece detail = VAbstractTool::data.GetPiece(id);
const VPiece detail = VAbstractTool::data.GetPiece(m_id);
for (int i = 0; i< detail.GetPath().CountNodes(); ++i)
{
const VPieceNode &node = detail.GetPath().at(i);
@ -1185,7 +1185,7 @@ void VToolSeamAllowance::RefreshGeometry()
{
this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, false);
const VPiece detail = VAbstractTool::data.GetPiece(id);
const VPiece detail = VAbstractTool::data.GetPiece(m_id);
QPainterPath path = detail.MainPathPath(this->getData());
if (not detail.IsHideMainPath() || not detail.IsSeamAllowance() || detail.IsSeamAllowanceBuiltIn())
@ -1237,9 +1237,9 @@ void VToolSeamAllowance::SaveDialogChange()
DialogSeamAllowance *dialogTool = qobject_cast<DialogSeamAllowance*>(m_dialog.data());
SCASSERT(dialogTool != nullptr);
const VPiece newDet = dialogTool->GetPiece();
const VPiece oldDet = VAbstractTool::data.GetPiece(id);
const VPiece oldDet = VAbstractTool::data.GetPiece(m_id);
SavePieceOptions *saveCommand = new SavePieceOptions(oldDet, newDet, doc, id);
SavePieceOptions *saveCommand = new SavePieceOptions(oldDet, newDet, doc, m_id);
connect(saveCommand, &SavePieceOptions::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree);
qApp->getUndoStack()->push(saveCommand);
UpdateDetailLabel();
@ -1514,7 +1514,7 @@ void VToolSeamAllowance::InitPins(const VPiece &detail)
//---------------------------------------------------------------------------------------------------------------------
void VToolSeamAllowance::DeleteTool(bool ask)
{
QScopedPointer<DeletePiece> delDet(new DeletePiece(doc, id, VAbstractTool::data.GetPiece(id)));
QScopedPointer<DeletePiece> delDet(new DeletePiece(doc, m_id, VAbstractTool::data.GetPiece(m_id)));
if (ask)
{
if (ConfirmDeletion() == QMessageBox::No)

View File

@ -1369,7 +1369,7 @@ void VToolUnionDetails::incrementReferens()
doc->IncrementReferens(objects.at(i));
}
QDomElement domElement = doc->elementById(id, getTagName());
QDomElement domElement = doc->elementById(m_id, getTagName());
if (domElement.isElement())
{
doc->SetParametrUsage(domElement, AttrInUse, NodeUsage::InUse);
@ -1389,7 +1389,7 @@ void VToolUnionDetails::decrementReferens()
doc->DecrementReferens(objects.at(i));
}
QDomElement domElement = doc->elementById(id, getTagName());
QDomElement domElement = doc->elementById(m_id, getTagName());
if (domElement.isElement())
{
doc->SetParametrUsage(domElement, AttrInUse, NodeUsage::NotInUse);
@ -1480,7 +1480,7 @@ void VToolUnionDetails::AddToFile()
{
QDomElement domElement = doc->createElement(getTagName());
doc->SetAttribute(domElement, VDomDocument::AttrId, id);
doc->SetAttribute(domElement, VDomDocument::AttrId, m_id);
doc->SetAttribute(domElement, AttrType, ToolType);
doc->SetAttribute(domElement, AttrIndexD1, indexD1);
doc->SetAttribute(domElement, AttrIndexD2, indexD2);
@ -1536,7 +1536,7 @@ void VToolUnionDetails::AddToModeling(const QDomElement &domElement)
QVector<quint32> VToolUnionDetails::GetReferenceObjects() const
{
QVector<quint32> list;
const QDomElement tool = doc->elementById(id, getTagName());
const QDomElement tool = doc->elementById(m_id, getTagName());
if (tool.isNull())
{
return list;