diff --git a/src/container/vcontainer.cpp b/src/container/vcontainer.cpp index 7f49d3b71..499460a9a 100644 --- a/src/container/vcontainer.cpp +++ b/src/container/vcontainer.cpp @@ -296,7 +296,7 @@ void VContainer::ClearCalculationGObjects() while (i.hasNext()) { i.next(); - if (i.value()->getMode() == Draw::Calculation) + if (i.value()->getMode() == Valentina::Calculation) { delete i.value(); gObjects.remove(i.key()); diff --git a/src/dialogs/app/dialoghistory.cpp b/src/dialogs/app/dialoghistory.cpp index 04385ea9f..366f277ed 100644 --- a/src/dialogs/app/dialoghistory.cpp +++ b/src/dialogs/app/dialoghistory.cpp @@ -177,22 +177,22 @@ QString DialogHistory::Record(const VToolRecord &tool) { switch ( tool.getTypeTool() ) { - case Tool::ArrowTool: + case Valentina::ArrowTool: Q_UNREACHABLE(); break; - case Tool::SinglePointTool: + case Valentina::SinglePointTool: { const QString name = data->GeometricObject(tool.getId())->name(); return QString(tr("%1 - Base point")).arg(name); } - case Tool::EndLineTool: + case Valentina::EndLineTool: { const quint32 basePointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrBasePoint, "0"); const QString basePointIdName = data->GeometricObject(basePointId)->name(); const QString toolIdName = data->GeometricObject(tool.getId())->name(); return QString(tr("%1_%2 - Line from point %1 to point %2")).arg(basePointIdName, toolIdName); } - case Tool::LineTool: + case Valentina::LineTool: { const quint32 firstPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0"); const quint32 secondPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0"); @@ -200,7 +200,7 @@ QString DialogHistory::Record(const VToolRecord &tool) const QString secondPointIdName = data->GeometricObject(secondPointId)->name(); return QString(tr("%1_%2 - Line from point %1 to point %2")).arg(firstPointIdName, secondPointIdName); } - case Tool::AlongLineTool: + case Valentina::AlongLineTool: { const quint32 basePointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0"); const quint32 secondPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0"); @@ -209,12 +209,12 @@ QString DialogHistory::Record(const VToolRecord &tool) const QString toolIdName = data->GeometricObject(tool.getId())->name(); return QString(tr("%3 - Point along line %1_%2")).arg(basePointIdName, secondPointIdName, toolIdName); } - case Tool::ShoulderPointTool: + case Valentina::ShoulderPointTool: { const QString name = data->GeometricObject(tool.getId())->name(); return QString(tr("%1 - Point of shoulder")).arg(name); } - case Tool::NormalTool: + case Valentina::NormalTool: { const quint32 basePointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0"); const quint32 secondPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0"); @@ -223,7 +223,7 @@ QString DialogHistory::Record(const VToolRecord &tool) const QString toolIdName = data->GeometricObject(tool.getId())->name(); return QString(tr("%3 - normal to line %1_%2")).arg(basePointIdName, secondPointIdName, toolIdName); } - case Tool::BisectorTool: + case Valentina::BisectorTool: { const quint32 firstPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0"); const quint32 secondPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0"); @@ -235,7 +235,7 @@ QString DialogHistory::Record(const VToolRecord &tool) return QString(tr("%4 - bisector of angle %1_%2_%3")).arg(firstPointIdName, secondPointIdName, thirdPointIdName, toolIdName); } - case Tool::LineIntersectTool: + case Valentina::LineIntersectTool: { const quint32 p1Line1 = doc->GetParametrUInt(domElement, VAbstractTool::AttrP1Line1, "0"); const quint32 p2Line1 = doc->GetParametrUInt(domElement, VAbstractTool::AttrP2Line1, "0"); @@ -250,7 +250,7 @@ QString DialogHistory::Record(const VToolRecord &tool) p1Line2Name, p2Line2Name, toolIdName); } - case Tool::SplineTool: + case Valentina::SplineTool: { const VSpline *spl = data->GeometricObject(tool.getId()); Q_CHECK_PTR(spl); @@ -258,14 +258,14 @@ QString DialogHistory::Record(const VToolRecord &tool) const QString splP4Name = data->GeometricObject(spl->GetP4().id())->name(); return QString(tr("Curve %1_%2")).arg(splP1Name, splP4Name); } - case Tool::ArcTool: + case Valentina::ArcTool: { const VArc *arc = data->GeometricObject(tool.getId()); Q_CHECK_PTR(arc); const QString arcCenterName = data->GeometricObject(arc->GetCenter().id())->name(); return QString(tr("Arc with center in point %1")).arg(arcCenterName); } - case Tool::SplinePathTool: + case Valentina::SplinePathTool: { const VSplinePath *splPath = data->GeometricObject(tool.getId()); Q_CHECK_PTR(splPath); @@ -288,7 +288,7 @@ QString DialogHistory::Record(const VToolRecord &tool) } return record; } - case Tool::PointOfContact: + case Valentina::PointOfContact: { const quint32 center = doc->GetParametrUInt(domElement, VAbstractTool::AttrCenter, "0"); const quint32 firstPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0"); @@ -300,7 +300,7 @@ QString DialogHistory::Record(const VToolRecord &tool) return QString(tr("%4 - point of contact of arc with the center in point %1 and line %2_%3")).arg( centerName, firstPointIdName, secondPointIdName, toolIdName); } - case Tool::Height: + case Valentina::Height: { const quint32 basePointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrBasePoint, "0"); const quint32 p1LineId = doc->GetParametrUInt(domElement, VAbstractTool::AttrP1Line, "0"); @@ -312,7 +312,7 @@ QString DialogHistory::Record(const VToolRecord &tool) p1LineIdName, p2LineIdName); } - case Tool::Triangle: + case Valentina::Triangle: { const quint32 axisP1Id = doc->GetParametrUInt(domElement, VAbstractTool::AttrAxisP1, "0"); const quint32 axisP2Id = doc->GetParametrUInt(domElement, VAbstractTool::AttrAxisP2, "0"); @@ -325,7 +325,7 @@ QString DialogHistory::Record(const VToolRecord &tool) return QString(tr("Triangle: axis %1_%2, points %3 and %4")).arg(axisP1IdName, axisP2IdName, firstPointIdName, secondPointIdName); } - case Tool::PointOfIntersection: + case Valentina::PointOfIntersection: { const quint32 firstPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0"); const quint32 secondPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0"); @@ -335,7 +335,7 @@ QString DialogHistory::Record(const VToolRecord &tool) return QString(tr("%1 - point of intersection %2 and %3")).arg(toolIdName, firstPointIdName, secondPointIdName); } - case Tool::CutArcTool: + case Valentina::CutArcTool: { const quint32 arcId = doc->GetParametrUInt(domElement, VToolCutArc::AttrArc, "0"); const VArc *arc = data->GeometricObject(arcId); @@ -344,7 +344,7 @@ QString DialogHistory::Record(const VToolRecord &tool) const QString toolIdName = data->GeometricObject(tool.getId())->name(); return QString(tr("%1 - cut arc with center %2")).arg(toolIdName, arcCenterName); } - case Tool::CutSplineTool: + case Valentina::CutSplineTool: { const quint32 splineId = doc->GetParametrUInt(domElement, VToolCutSpline::AttrSpline, "0"); const VSpline *spl = data->GeometricObject(splineId); @@ -354,7 +354,7 @@ QString DialogHistory::Record(const VToolRecord &tool) const QString splP4Name = data->GeometricObject(spl->GetP4().id())->name(); return QString(tr("%1 - cut curve %2_%3")).arg(toolIdName, splP1Name, splP4Name); } - case Tool::CutSplinePathTool: + case Valentina::CutSplinePathTool: { const quint32 splinePathId = doc->GetParametrUInt(domElement, VToolCutSplinePath::AttrSplinePath, "0"); const VSplinePath *splPath = data->GeometricObject(splinePathId); @@ -382,17 +382,17 @@ QString DialogHistory::Record(const VToolRecord &tool) } //Because "history" not only show history of pattern, but help restore current data for each pattern's //piece, we need add record about details and nodes, but don't show them. - case Tool::Detail: + case Valentina::DetailTool: break; - case Tool::UnionDetails: + case Valentina::UnionDetails: break; - case Tool::NodeArc: + case Valentina::NodeArc: break; - case Tool::NodePoint: + case Valentina::NodePoint: break; - case Tool::NodeSpline: + case Valentina::NodeSpline: break; - case Tool::NodeSplinePath: + case Valentina::NodeSplinePath: break; default: qWarning()<lineEditRadius->setText(radius); } -void DialogArc::ChoosedObject(quint32 id, const Scene::Scenes &type) +void DialogArc::ChoosedObject(quint32 id, const Valentina::Scenes &type) { - if (type == Scene::Point) + if (type == Valentina::Point) { const VPointF *point = data->GeometricObject(id); diff --git a/src/dialogs/tools/dialogarc.h b/src/dialogs/tools/dialogarc.h index 03343cc39..0611c9b94 100644 --- a/src/dialogs/tools/dialogarc.h +++ b/src/dialogs/tools/dialogarc.h @@ -96,7 +96,7 @@ public slots: * @param id id of point or detail * @param type type of object */ - virtual void ChoosedObject(quint32 id, const Scene::Scenes &type); + virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type); /** * @brief DialogAccepted save data and emit signal about closed dialog. */ diff --git a/src/dialogs/tools/dialogbisector.cpp b/src/dialogs/tools/dialogbisector.cpp index df45158b7..e0003192a 100644 --- a/src/dialogs/tools/dialogbisector.cpp +++ b/src/dialogs/tools/dialogbisector.cpp @@ -64,9 +64,9 @@ DialogBisector::~DialogBisector() delete ui; } -void DialogBisector::ChoosedObject(quint32 id, const Scene::Scenes &type) +void DialogBisector::ChoosedObject(quint32 id, const Valentina::Scenes &type) { - if (type == Scene::Point) + if (type == Valentina::Point) { const VPointF *point = data->GeometricObject(id); if (number == 0) diff --git a/src/dialogs/tools/dialogbisector.h b/src/dialogs/tools/dialogbisector.h index 5488ce972..6b928f807 100644 --- a/src/dialogs/tools/dialogbisector.h +++ b/src/dialogs/tools/dialogbisector.h @@ -119,7 +119,7 @@ public slots: * @param id id of point or detail * @param type type of object */ - virtual void ChoosedObject(quint32 id, const Scene::Scenes &type); + virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type); /** * @brief DialogAccepted save data and emit signal about closed dialog. */ diff --git a/src/dialogs/tools/dialogcutarc.cpp b/src/dialogs/tools/dialogcutarc.cpp index 6e9580f25..2206bec4d 100644 --- a/src/dialogs/tools/dialogcutarc.cpp +++ b/src/dialogs/tools/dialogcutarc.cpp @@ -59,9 +59,9 @@ DialogCutArc::~DialogCutArc() delete ui; } -void DialogCutArc::ChoosedObject(quint32 id, const Scene::Scenes &type) +void DialogCutArc::ChoosedObject(quint32 id, const Valentina::Scenes &type) { - if (type == Scene::Arc) + if (type == Valentina::Arc) { const VArc *arc = data->GeometricObject(id); ChangeCurrentText(ui->comboBoxArc, arc->name()); diff --git a/src/dialogs/tools/dialogcutarc.h b/src/dialogs/tools/dialogcutarc.h index 9b9d285c3..c2af664e9 100644 --- a/src/dialogs/tools/dialogcutarc.h +++ b/src/dialogs/tools/dialogcutarc.h @@ -87,7 +87,7 @@ public slots: * @param id id of point or detail * @param type type of object */ - virtual void ChoosedObject(quint32 id, const Scene::Scenes &type); + virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type); /** * @brief DialogAccepted save data and emit signal about closed dialog. */ diff --git a/src/dialogs/tools/dialogcutspline.cpp b/src/dialogs/tools/dialogcutspline.cpp index bc885d052..ce959b199 100644 --- a/src/dialogs/tools/dialogcutspline.cpp +++ b/src/dialogs/tools/dialogcutspline.cpp @@ -75,9 +75,9 @@ void DialogCutSpline::setSplineId(const quint32 &value, const quint32 &id) setCurrentSplineId(ui->comboBoxSpline, splineId, value, id, ComboMode::CutSpline); } -void DialogCutSpline::ChoosedObject(quint32 id, const Scene::Scenes &type) +void DialogCutSpline::ChoosedObject(quint32 id, const Valentina::Scenes &type) { - if (type == Scene::Spline) + if (type == Valentina::Spline) { const VSpline *spl = data->GeometricObject(id); ChangeCurrentText(ui->comboBoxSpline, spl->name()); diff --git a/src/dialogs/tools/dialogcutspline.h b/src/dialogs/tools/dialogcutspline.h index f5e507e2c..88d4c634b 100644 --- a/src/dialogs/tools/dialogcutspline.h +++ b/src/dialogs/tools/dialogcutspline.h @@ -87,7 +87,7 @@ public slots: * @param id id of point or detail * @param type type of object */ - virtual void ChoosedObject(quint32 id, const Scene::Scenes &type); + virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type); /** * @brief DialogAccepted save data and emit signal about closed dialog. */ diff --git a/src/dialogs/tools/dialogcutsplinepath.cpp b/src/dialogs/tools/dialogcutsplinepath.cpp index a21f01c11..003383392 100644 --- a/src/dialogs/tools/dialogcutsplinepath.cpp +++ b/src/dialogs/tools/dialogcutsplinepath.cpp @@ -76,9 +76,9 @@ void DialogCutSplinePath::setSplinePathId(const quint32 &value, const quint32 &i setCurrentSplinePathId(ui->comboBoxSplinePath, splinePathId, value, id, ComboMode::CutSpline); } -void DialogCutSplinePath::ChoosedObject(quint32 id, const Scene::Scenes &type) +void DialogCutSplinePath::ChoosedObject(quint32 id, const Valentina::Scenes &type) { - if (type == Scene::SplinePath) + if (type == Valentina::SplinePath) { const VSplinePath *splPath = data->GeometricObject(id); ChangeCurrentText(ui->comboBoxSplinePath, splPath->name()); diff --git a/src/dialogs/tools/dialogcutsplinepath.h b/src/dialogs/tools/dialogcutsplinepath.h index 0accc6d67..622d1f73d 100644 --- a/src/dialogs/tools/dialogcutsplinepath.h +++ b/src/dialogs/tools/dialogcutsplinepath.h @@ -87,7 +87,7 @@ public slots: * @param id id of point or detail * @param type type of object */ - virtual void ChoosedObject(quint32 id, const Scene::Scenes &type); + virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type); /** * @brief DialogAccepted save data and emit signal about closed dialog. */ diff --git a/src/dialogs/tools/dialogdetail.cpp b/src/dialogs/tools/dialogdetail.cpp index 2238a46ef..df0a1e044 100644 --- a/src/dialogs/tools/dialogdetail.cpp +++ b/src/dialogs/tools/dialogdetail.cpp @@ -62,23 +62,23 @@ DialogDetail::DialogDetail(const VContainer *data, QWidget *parent) connect(ui.toolButtonDelete, &QToolButton::clicked, this, &DialogDetail::DeleteItem); } -void DialogDetail::ChoosedObject(quint32 id, const Scene::Scenes &type) +void DialogDetail::ChoosedObject(quint32 id, const Valentina::Scenes &type) { - if (type != Scene::Line && type != Scene::Detail) + if (type != Valentina::Line && type != Valentina::Detail) { switch (type) { - case (Scene::Arc): - NewItem(id, Tool::NodeArc, NodeDetail::Contour); + case (Valentina::Arc): + NewItem(id, Valentina::NodeArc, NodeDetail::Contour); break; - case (Scene::Point): - NewItem(id, Tool::NodePoint, NodeDetail::Contour); + case (Valentina::Point): + NewItem(id, Valentina::NodePoint, NodeDetail::Contour); break; - case (Scene::Spline): - NewItem(id, Tool::NodeSpline, NodeDetail::Contour); + case (Valentina::Spline): + NewItem(id, Valentina::NodeSpline, NodeDetail::Contour); break; - case (Scene::SplinePath): - NewItem(id, Tool::NodeSplinePath, NodeDetail::Contour); + case (Valentina::SplinePath): + NewItem(id, Valentina::NodeSplinePath, NodeDetail::Contour); break; default: qWarning()<GeometricObject(id); name = point->name(); break; } - case (Tool::NodeArc): + case (Valentina::NodeArc): { const VArc *arc = data->GeometricObject(id); name = arc->name(); break; } - case (Tool::NodeSpline): + case (Valentina::NodeSpline): { const VSpline *spl = data->GeometricObject(id); name = spl->name(); break; } - case (Tool::NodeSplinePath): + case (Valentina::NodeSplinePath): { const VSplinePath *splPath = data->GeometricObject(id); name = splPath->name(); diff --git a/src/dialogs/tools/dialogdetail.h b/src/dialogs/tools/dialogdetail.h index bf39910b1..38dbe5a3b 100644 --- a/src/dialogs/tools/dialogdetail.h +++ b/src/dialogs/tools/dialogdetail.h @@ -61,7 +61,7 @@ public slots: * @param id id of objects (points, arcs, splines, spline paths) * @param type type of object */ - virtual void ChoosedObject(quint32 id, const Scene::Scenes &type); + virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type); /** * @brief DialogAccepted save data and emit signal about closed dialog. */ @@ -121,7 +121,7 @@ private: * @param mx offset respect to x * @param my offset respect to y */ - void NewItem(quint32 id, const Tool::Tools &typeTool, const NodeDetail::NodeDetails &typeNode, + void NewItem(quint32 id, const Valentina::Tools &typeTool, const NodeDetail::NodeDetails &typeNode, qreal mx = 0, qreal my = 0); }; diff --git a/src/dialogs/tools/dialogendline.cpp b/src/dialogs/tools/dialogendline.cpp index 4c67d7db4..806a7f43d 100644 --- a/src/dialogs/tools/dialogendline.cpp +++ b/src/dialogs/tools/dialogendline.cpp @@ -59,9 +59,9 @@ DialogEndLine::DialogEndLine(const VContainer *data, QWidget *parent) connect(ui->lineEditFormula, &QLineEdit::textChanged, this, &DialogEndLine::FormulaChanged); } -void DialogEndLine::ChoosedObject(quint32 id, const Scene::Scenes &type) +void DialogEndLine::ChoosedObject(quint32 id, const Valentina::Scenes &type) { - if (type == Scene::Point) + if (type == Valentina::Point) { const VPointF *point = data->GeometricObject(id); ChangeCurrentText(ui->comboBoxBasePoint, point->name()); diff --git a/src/dialogs/tools/dialogendline.h b/src/dialogs/tools/dialogendline.h index 05ce3c82c..97015d833 100644 --- a/src/dialogs/tools/dialogendline.h +++ b/src/dialogs/tools/dialogendline.h @@ -107,7 +107,7 @@ public slots: * @param id id of point or detail * @param type type of object */ - virtual void ChoosedObject(quint32 id, const Scene::Scenes &type); + virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type); /** * @brief DialogAccepted save data and emit signal about closed dialog. */ diff --git a/src/dialogs/tools/dialogheight.cpp b/src/dialogs/tools/dialogheight.cpp index 6b9b19f8f..249e45fa7 100644 --- a/src/dialogs/tools/dialogheight.cpp +++ b/src/dialogs/tools/dialogheight.cpp @@ -83,9 +83,9 @@ void DialogHeight::setP2LineId(const quint32 &value, const quint32 &id) setCurrentPointId(ui->comboBoxP2Line, p2LineId, value, id); } -void DialogHeight::ChoosedObject(quint32 id, const Scene::Scenes &type) +void DialogHeight::ChoosedObject(quint32 id, const Valentina::Scenes &type) { - if (type == Scene::Point) + if (type == Valentina::Point) { const VPointF *point = data->GeometricObject(id); switch (number) diff --git a/src/dialogs/tools/dialogheight.h b/src/dialogs/tools/dialogheight.h index 8fd4f9a25..79df86f24 100644 --- a/src/dialogs/tools/dialogheight.h +++ b/src/dialogs/tools/dialogheight.h @@ -109,7 +109,7 @@ public slots: * @param id id of point or detail * @param type type of object */ - virtual void ChoosedObject(quint32 id, const Scene::Scenes &type); + virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type); /** * @brief DialogAccepted save data and emit signal about closed dialog. */ diff --git a/src/dialogs/tools/dialogline.cpp b/src/dialogs/tools/dialogline.cpp index 2cb17f0cc..e5a580c88 100644 --- a/src/dialogs/tools/dialogline.cpp +++ b/src/dialogs/tools/dialogline.cpp @@ -88,9 +88,9 @@ void DialogLine::DialogAccepted() DialogClosed(QDialog::Accepted); } -void DialogLine::ChoosedObject(quint32 id, const Scene::Scenes &type) +void DialogLine::ChoosedObject(quint32 id, const Valentina::Scenes &type) { - if (type == Scene::Point) + if (type == Valentina::Point) { const VPointF *point = data->GeometricObject(id); if (number == 0) diff --git a/src/dialogs/tools/dialogline.h b/src/dialogs/tools/dialogline.h index 2df217fce..82e8c4fa1 100644 --- a/src/dialogs/tools/dialogline.h +++ b/src/dialogs/tools/dialogline.h @@ -86,7 +86,7 @@ public slots: * @param id id of point or detail * @param type type of object */ - virtual void ChoosedObject(quint32 id, const Scene::Scenes &type); + virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type); /** * @brief DialogAccepted save data and emit signal about closed dialog. */ diff --git a/src/dialogs/tools/dialoglineintersect.cpp b/src/dialogs/tools/dialoglineintersect.cpp index 185e9f830..22f7d0b05 100644 --- a/src/dialogs/tools/dialoglineintersect.cpp +++ b/src/dialogs/tools/dialoglineintersect.cpp @@ -54,9 +54,9 @@ DialogLineIntersect::~DialogLineIntersect() delete ui; } -void DialogLineIntersect::ChoosedObject(quint32 id, const Scene::Scenes &type) +void DialogLineIntersect::ChoosedObject(quint32 id, const Valentina::Scenes &type) { - if (type == Scene::Point) + if (type == Valentina::Point) { const VPointF *point = data->GeometricObject(id); if (number == 0) diff --git a/src/dialogs/tools/dialoglineintersect.h b/src/dialogs/tools/dialoglineintersect.h index 421f5d0aa..c74e0b555 100644 --- a/src/dialogs/tools/dialoglineintersect.h +++ b/src/dialogs/tools/dialoglineintersect.h @@ -106,7 +106,7 @@ public slots: * @param id id of point or detail * @param type type of object */ - virtual void ChoosedObject(quint32 id, const Scene::Scenes &type); + virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type); /** * @brief DialogAccepted save data and emit signal about closed dialog. */ diff --git a/src/dialogs/tools/dialognormal.cpp b/src/dialogs/tools/dialognormal.cpp index 0f17ddb32..298e36885 100644 --- a/src/dialogs/tools/dialognormal.cpp +++ b/src/dialogs/tools/dialognormal.cpp @@ -65,9 +65,9 @@ DialogNormal::~DialogNormal() delete ui; } -void DialogNormal::ChoosedObject(quint32 id, const Scene::Scenes &type) +void DialogNormal::ChoosedObject(quint32 id, const Valentina::Scenes &type) { - if (type == Scene::Point) + if (type == Valentina::Point) { if (number == 0) { diff --git a/src/dialogs/tools/dialognormal.h b/src/dialogs/tools/dialognormal.h index 9d747b9b9..51a2f1c20 100644 --- a/src/dialogs/tools/dialognormal.h +++ b/src/dialogs/tools/dialognormal.h @@ -118,7 +118,7 @@ public slots: * @param id id of point or detail * @param type type of object */ - virtual void ChoosedObject(quint32 id, const Scene::Scenes &type); + virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type); /** * @brief DialogAccepted save data and emit signal about closed dialog. */ diff --git a/src/dialogs/tools/dialogpointofcontact.cpp b/src/dialogs/tools/dialogpointofcontact.cpp index d8e1f8ff0..334878e2b 100644 --- a/src/dialogs/tools/dialogpointofcontact.cpp +++ b/src/dialogs/tools/dialogpointofcontact.cpp @@ -79,9 +79,9 @@ DialogPointOfContact::DialogPointOfContact(const VContainer *data, QWidget *pare connect(ui.lineEditFormula, &QLineEdit::textChanged, this, &DialogPointOfContact::FormulaChanged); } -void DialogPointOfContact::ChoosedObject(quint32 id, const Scene::Scenes &type) +void DialogPointOfContact::ChoosedObject(quint32 id, const Valentina::Scenes &type) { - if (type == Scene::Point) + if (type == Valentina::Point) { const VPointF *point = data->GeometricObject(id); if (number == 0) diff --git a/src/dialogs/tools/dialogpointofcontact.h b/src/dialogs/tools/dialogpointofcontact.h index b569cae72..9c8949ed7 100644 --- a/src/dialogs/tools/dialogpointofcontact.h +++ b/src/dialogs/tools/dialogpointofcontact.h @@ -104,7 +104,7 @@ public slots: * @param id id of point or detail * @param type type of object */ - virtual void ChoosedObject(quint32 id, const Scene::Scenes &type); + virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type); /** * @brief DialogAccepted save data and emit signal about closed dialog. */ diff --git a/src/dialogs/tools/dialogpointofintersection.cpp b/src/dialogs/tools/dialogpointofintersection.cpp index 3fa7f88aa..7a2646422 100644 --- a/src/dialogs/tools/dialogpointofintersection.cpp +++ b/src/dialogs/tools/dialogpointofintersection.cpp @@ -58,9 +58,9 @@ void DialogPointOfIntersection::setSecondPointId(const quint32 &value, const qui setCurrentPointId(ui->comboBoxSecondPoint, secondPointId, value, id); } -void DialogPointOfIntersection::ChoosedObject(quint32 id, const Scene::Scenes &type) +void DialogPointOfIntersection::ChoosedObject(quint32 id, const Valentina::Scenes &type) { - if (type == Scene::Point) + if (type == Valentina::Point) { const VPointF *point = data->GeometricObject(id); if (number == 0) diff --git a/src/dialogs/tools/dialogpointofintersection.h b/src/dialogs/tools/dialogpointofintersection.h index 2a60ca2ad..b0f41e510 100644 --- a/src/dialogs/tools/dialogpointofintersection.h +++ b/src/dialogs/tools/dialogpointofintersection.h @@ -88,7 +88,7 @@ public slots: * @param id id of point or detail * @param type type of object */ - virtual void ChoosedObject(quint32 id, const Scene::Scenes &type); + virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type); /** * @brief DialogAccepted save data and emit signal about closed dialog. */ diff --git a/src/dialogs/tools/dialogshoulderpoint.cpp b/src/dialogs/tools/dialogshoulderpoint.cpp index 723d8d699..2a679c2b4 100644 --- a/src/dialogs/tools/dialogshoulderpoint.cpp +++ b/src/dialogs/tools/dialogshoulderpoint.cpp @@ -65,9 +65,9 @@ DialogShoulderPoint::~DialogShoulderPoint() delete ui; } -void DialogShoulderPoint::ChoosedObject(quint32 id, const Scene::Scenes &type) +void DialogShoulderPoint::ChoosedObject(quint32 id, const Valentina::Scenes &type) { - if (type == Scene::Point) + if (type == Valentina::Point) { const VPointF *point = data->GeometricObject(id); if (number == 0) diff --git a/src/dialogs/tools/dialogshoulderpoint.h b/src/dialogs/tools/dialogshoulderpoint.h index 30342ee81..2fc36dcc5 100644 --- a/src/dialogs/tools/dialogshoulderpoint.h +++ b/src/dialogs/tools/dialogshoulderpoint.h @@ -119,7 +119,7 @@ public slots: * @param id id of point or detail * @param type type of object */ - virtual void ChoosedObject(quint32 id, const Scene::Scenes &type); + virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type); /** * @brief DialogAccepted save data and emit signal about closed dialog. */ diff --git a/src/dialogs/tools/dialogspline.cpp b/src/dialogs/tools/dialogspline.cpp index bfe58082d..411868d5b 100644 --- a/src/dialogs/tools/dialogspline.cpp +++ b/src/dialogs/tools/dialogspline.cpp @@ -52,9 +52,9 @@ quint32 DialogSpline::getP1() const return p1; } -void DialogSpline::ChoosedObject(quint32 id, const Scene::Scenes &type) +void DialogSpline::ChoosedObject(quint32 id, const Valentina::Scenes &type) { - if (type == Scene::Point) + if (type == Valentina::Point) { const VPointF *point = data->GeometricObject(id); if (number == 0) diff --git a/src/dialogs/tools/dialogspline.h b/src/dialogs/tools/dialogspline.h index e42cc1388..c88ec7bb8 100644 --- a/src/dialogs/tools/dialogspline.h +++ b/src/dialogs/tools/dialogspline.h @@ -126,7 +126,7 @@ public slots: * @param id id of point or detail * @param type type of object */ - virtual void ChoosedObject(quint32 id, const Scene::Scenes &type); + virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type); /** * @brief DialogAccepted save data and emit signal about closed dialog. */ diff --git a/src/dialogs/tools/dialogsplinepath.cpp b/src/dialogs/tools/dialogsplinepath.cpp index 1fedb0b69..ed7d10dbf 100644 --- a/src/dialogs/tools/dialogsplinepath.cpp +++ b/src/dialogs/tools/dialogsplinepath.cpp @@ -72,9 +72,9 @@ void DialogSplinePath::SetPath(const VSplinePath &value) } -void DialogSplinePath::ChoosedObject(quint32 id, const Scene::Scenes &type) +void DialogSplinePath::ChoosedObject(quint32 id, const Valentina::Scenes &type) { - if (type == Scene::Point) + if (type == Valentina::Point) { NewItem(id, 1, 0, 1, 180); emit ToolTip(tr("Select point of curve path")); diff --git a/src/dialogs/tools/dialogsplinepath.h b/src/dialogs/tools/dialogsplinepath.h index ad1fcb708..287d316cb 100644 --- a/src/dialogs/tools/dialogsplinepath.h +++ b/src/dialogs/tools/dialogsplinepath.h @@ -67,7 +67,7 @@ public slots: * @param id id of point or detail * @param type don't show this id in list */ - virtual void ChoosedObject(quint32 id, const Scene::Scenes &type); + virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type); /** * @brief DialogAccepted save data and emit signal about closed dialog. */ diff --git a/src/dialogs/tools/dialogtool.cpp b/src/dialogs/tools/dialogtool.cpp index f39f773d0..82ad1925f 100644 --- a/src/dialogs/tools/dialogtool.cpp +++ b/src/dialogs/tools/dialogtool.cpp @@ -83,7 +83,7 @@ void DialogTool::FillComboBoxPoints(QComboBox *box, const quint32 &id) const if (i.key() != id) { VGObject *obj = i.value(); - if (obj->getType() == GObject::Point && obj->getMode() == Draw::Calculation) + if (obj->getType() == GObject::Point && obj->getMode() == Valentina::Calculation) { const VPointF *point = data->GeometricObject(i.key()); list[point->name()] = i.key(); @@ -107,7 +107,7 @@ void DialogTool::FillComboBoxArcs(QComboBox *box, const quint32 &id, ComboMode:: if (i.key() != id + 1 && i.key() != id + 2) { VGObject *obj = i.value(); - if (obj->getType() == GObject::Arc && obj->getMode() == Draw::Calculation) + if (obj->getType() == GObject::Arc && obj->getMode() == Valentina::Calculation) { const VArc *arc = data->GeometricObject(i.key()); list[arc->name()] = i.key(); @@ -119,7 +119,7 @@ void DialogTool::FillComboBoxArcs(QComboBox *box, const quint32 &id, ComboMode:: if (i.key() != id) { VGObject *obj = i.value(); - if (obj->getType() == GObject::Arc && obj->getMode() == Draw::Calculation) + if (obj->getType() == GObject::Arc && obj->getMode() == Valentina::Calculation) { const VArc *arc = data->GeometricObject(i.key()); list[arc->name()] = i.key(); @@ -144,7 +144,7 @@ void DialogTool::FillComboBoxSplines(QComboBox *box, const quint32 &id, ComboMod if (i.key() != id + 1 && i.key() != id + 2) { VGObject *obj = i.value(); - if (obj->getType() == GObject::Spline && obj->getMode() == Draw::Calculation) + if (obj->getType() == GObject::Spline && obj->getMode() == Valentina::Calculation) { const VSpline *spl = data->GeometricObject(i.key()); list[spl->name()] = i.key(); @@ -156,7 +156,7 @@ void DialogTool::FillComboBoxSplines(QComboBox *box, const quint32 &id, ComboMod if (i.key() != id) { VGObject *obj = i.value(); - if (obj->getType() == GObject::Spline && obj->getMode() == Draw::Calculation) + if (obj->getType() == GObject::Spline && obj->getMode() == Valentina::Calculation) { const VSpline *spl = data->GeometricObject(i.key()); list[spl->name()] = i.key(); @@ -181,7 +181,7 @@ void DialogTool::FillComboBoxSplinesPath(QComboBox *box, const quint32 &id, Comb if (i.key() != id + 1 && i.key() != id + 2) { VGObject *obj = i.value(); - if (obj->getType() == GObject::SplinePath && obj->getMode() == Draw::Calculation) + if (obj->getType() == GObject::SplinePath && obj->getMode() == Valentina::Calculation) { const VSplinePath *splPath = data->GeometricObject(i.key()); list[splPath->name()] = i.key(); @@ -193,7 +193,7 @@ void DialogTool::FillComboBoxSplinesPath(QComboBox *box, const quint32 &id, Comb if (i.key() != id) { VGObject *obj = i.value(); - if (obj->getType() == GObject::SplinePath && obj->getMode() == Draw::Calculation) + if (obj->getType() == GObject::SplinePath && obj->getMode() == Valentina::Calculation) { const VSplinePath *splPath = data->GeometricObject(i.key()); list[splPath->name()] = i.key(); @@ -419,7 +419,7 @@ void DialogTool::CheckState() bOk->setEnabled(flagFormula && flagName); } -void DialogTool::ChoosedObject(quint32 id, const Scene::Scenes &type) +void DialogTool::ChoosedObject(quint32 id, const Valentina::Scenes &type) { Q_UNUSED(id); Q_UNUSED(type); diff --git a/src/dialogs/tools/dialogtool.h b/src/dialogs/tools/dialogtool.h index 2b3e0fe87..dad41b0b5 100644 --- a/src/dialogs/tools/dialogtool.h +++ b/src/dialogs/tools/dialogtool.h @@ -83,7 +83,7 @@ public slots: * @param id id of point or detail * @param type type of object */ - virtual void ChoosedObject(quint32 id, const Scene::Scenes &type); + virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type); /** * @brief NamePointChanged check name of point */ diff --git a/src/dialogs/tools/dialogtriangle.cpp b/src/dialogs/tools/dialogtriangle.cpp index 19c3c9e53..d58a3094d 100644 --- a/src/dialogs/tools/dialogtriangle.cpp +++ b/src/dialogs/tools/dialogtriangle.cpp @@ -54,9 +54,9 @@ DialogTriangle::~DialogTriangle() delete ui; } -void DialogTriangle::ChoosedObject(quint32 id, const Scene::Scenes &type) +void DialogTriangle::ChoosedObject(quint32 id, const Valentina::Scenes &type) { - if (type == Scene::Point) + if (type == Valentina::Point) { const VPointF *point = data->GeometricObject(id); switch (number) diff --git a/src/dialogs/tools/dialogtriangle.h b/src/dialogs/tools/dialogtriangle.h index cbacec9ac..d1d132857 100644 --- a/src/dialogs/tools/dialogtriangle.h +++ b/src/dialogs/tools/dialogtriangle.h @@ -110,7 +110,7 @@ public slots: * @param id id of point or detail * @param type type of object */ - virtual void ChoosedObject(quint32 id, const Scene::Scenes &type); + virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type); /** * @brief DialogAccepted save data and emit signal about closed dialog. */ diff --git a/src/dialogs/tools/dialoguniondetails.cpp b/src/dialogs/tools/dialoguniondetails.cpp index 3a015d2ff..4eb9e10ad 100644 --- a/src/dialogs/tools/dialoguniondetails.cpp +++ b/src/dialogs/tools/dialoguniondetails.cpp @@ -42,7 +42,7 @@ DialogUnionDetails::~DialogUnionDetails() delete ui; } -void DialogUnionDetails::ChoosedObject(quint32 id, const Scene::Scenes &type) +void DialogUnionDetails::ChoosedObject(quint32 id, const Valentina::Scenes &type) { if (numberD == 0) { @@ -69,12 +69,12 @@ bool DialogUnionDetails::CheckObject(const quint32 &id, const quint32 &idDetail) return det.Containes(id); } -void DialogUnionDetails::ChoosedDetail(const quint32 &id, const Scene::Scenes &type, quint32 &idDetail, +void DialogUnionDetails::ChoosedDetail(const quint32 &id, const Valentina::Scenes &type, quint32 &idDetail, ptrdiff_t &index) { if (idDetail == 0) { - if (type == Scene::Detail) + if (type == Valentina::Detail) { idDetail = id; emit ToolTip(tr("Select first point")); @@ -85,7 +85,7 @@ void DialogUnionDetails::ChoosedDetail(const quint32 &id, const Scene::Scenes &t { return; } - if (type == Scene::Point) + if (type == Valentina::Point) { if (numberP == 0) { diff --git a/src/dialogs/tools/dialoguniondetails.h b/src/dialogs/tools/dialoguniondetails.h index e972de851..5d8e4a225 100644 --- a/src/dialogs/tools/dialoguniondetails.h +++ b/src/dialogs/tools/dialoguniondetails.h @@ -76,7 +76,7 @@ public slots: * @param id id of point or detail * @param type type of object */ - void ChoosedObject(quint32 id, const Scene::Scenes &type); + void ChoosedObject(quint32 id, const Valentina::Scenes &type); /** * @brief DialogAccepted save data and emit signal about closed dialog. */ @@ -133,7 +133,7 @@ private: * @param idDetail id detail * @param index index of edge */ - void ChoosedDetail(const quint32 &id, const Scene::Scenes &type, quint32 &idDetail, ptrdiff_t &index); + void ChoosedDetail(const quint32 &id, const Valentina::Scenes &type, quint32 &idDetail, ptrdiff_t &index); }; inline quint32 DialogUnionDetails::getD1() const diff --git a/src/geometry/varc.cpp b/src/geometry/varc.cpp index 30ee685bc..ca93eef28 100644 --- a/src/geometry/varc.cpp +++ b/src/geometry/varc.cpp @@ -39,7 +39,7 @@ VArc::VArc () } VArc::VArc (VPointF center, qreal radius, QString formulaRadius, qreal f1, QString formulaF1, qreal f2, - QString formulaF2, quint32 idObject, Draw::Draws mode) + QString formulaF2, quint32 idObject, Valentina::Draws mode) : VGObject(GObject::Arc, idObject, mode), f1(f1), formulaF1(formulaF1), f2(f2), formulaF2(formulaF2), radius(radius), formulaRadius(formulaRadius), center(center) { diff --git a/src/geometry/varc.h b/src/geometry/varc.h index 3bfceac46..b2e002e9d 100644 --- a/src/geometry/varc.h +++ b/src/geometry/varc.h @@ -56,7 +56,7 @@ public: * @param f2 end angle (degree). */ VArc (VPointF center, qreal radius, QString formulaRadius, qreal f1, QString formulaF1, qreal f2, - QString formulaF2, quint32 idObject = 0, Draw::Draws mode = Draw::Calculation); + QString formulaF2, quint32 idObject = 0, Valentina::Draws mode = Valentina::Calculation); /** * @brief VArc copy constructor * @param arc arc diff --git a/src/geometry/vdetail.cpp b/src/geometry/vdetail.cpp index d92786a5c..34b72e73b 100644 --- a/src/geometry/vdetail.cpp +++ b/src/geometry/vdetail.cpp @@ -260,7 +260,7 @@ QVector VDetail::listNodePoint() const QVector list; for (ptrdiff_t i = 0; i < nodes.size(); ++i) { - if (nodes[i].getTypeTool() == Tool::NodePoint) + if (nodes[i].getTypeTool() == Valentina::NodePoint) { list.append(nodes[i]); } diff --git a/src/geometry/vequidistant.cpp b/src/geometry/vequidistant.cpp index 13c763c8d..af4106be5 100644 --- a/src/geometry/vequidistant.cpp +++ b/src/geometry/vequidistant.cpp @@ -38,7 +38,7 @@ QPainterPath VEquidistant::ContourPath(const quint32 &idDetail, const VContainer { switch (detail.at(i).getTypeTool()) { - case (Tool::NodePoint): + case (Valentina::NodePoint): { const VPointF *point = data->GeometricObject(detail.at(i).getId()); points.append(point->toQPointF()); @@ -51,7 +51,7 @@ QPainterPath VEquidistant::ContourPath(const quint32 &idDetail, const VContainer } } break; - case (Tool::NodeArc): + case (Valentina::NodeArc): { const VArc *arc = data->GeometricObject(detail.at(i).getId()); qreal len1 = GetLengthContour(points, arc->GetPoints()); @@ -75,7 +75,7 @@ QPainterPath VEquidistant::ContourPath(const quint32 &idDetail, const VContainer } } break; - case (Tool::NodeSpline): + case (Valentina::NodeSpline): { const VSpline *spline = data->GeometricObject(detail.at(i).getId()); qreal len1 = GetLengthContour(points, spline->GetPoints()); @@ -99,7 +99,7 @@ QPainterPath VEquidistant::ContourPath(const quint32 &idDetail, const VContainer } } break; - case (Tool::NodeSplinePath): + case (Valentina::NodeSplinePath): { const VSplinePath *splinePath = data->GeometricObject(detail.at(i).getId()); qreal len1 = GetLengthContour(points, splinePath->GetPathPoints()); diff --git a/src/geometry/vgobject.cpp b/src/geometry/vgobject.cpp index bbd23f03b..cd051d540 100644 --- a/src/geometry/vgobject.cpp +++ b/src/geometry/vgobject.cpp @@ -29,11 +29,11 @@ #include "vgobject.h" VGObject::VGObject() - :_id(0), type(GObject::Point), idObject(0), _name(QString()), mode(Draw::Calculation) + :_id(0), type(GObject::Point), idObject(0), _name(QString()), mode(Valentina::Calculation) { } -VGObject::VGObject(const GObject::Type &type, const quint32 &idObject, const Draw::Draws &mode) +VGObject::VGObject(const GObject::Type &type, const quint32 &idObject, const Valentina::Draws &mode) :_id(0), type(type), idObject(idObject), _name(QString()), mode(mode) { } @@ -73,12 +73,12 @@ void VGObject::setName(const QString &name) _name = name; } -Draw::Draws VGObject::getMode() const +Valentina::Draws VGObject::getMode() const { return mode; } -void VGObject::setMode(const Draw::Draws &value) +void VGObject::setMode(const Valentina::Draws &value) { mode = value; } diff --git a/src/geometry/vgobject.h b/src/geometry/vgobject.h index c06428087..773e6ce2e 100644 --- a/src/geometry/vgobject.h +++ b/src/geometry/vgobject.h @@ -61,7 +61,8 @@ public: * @param idObject id parent object. * @param mode mode creation. Used in modeling mode. */ - VGObject(const GObject::Type &type, const quint32 &idObject = 0, const Draw::Draws &mode = Draw::Calculation); + VGObject(const GObject::Type &type, const quint32 &idObject = 0, + const Valentina::Draws &mode = Valentina::Calculation); /** * @brief VGObject copy constructor. * @param obj object. @@ -98,12 +99,12 @@ public: * @brief getMode return mode creation. * @return mode. */ - Draw::Draws getMode() const; + Valentina::Draws getMode() const; /** * @brief setMode set mode creation. * @param value mode. */ - void setMode(const Draw::Draws &value); + void setMode(const Valentina::Draws &value); /** * @brief getType return object type. * @return type. @@ -139,7 +140,7 @@ protected: /** * @brief mode object created in calculation or drawing mode */ - Draw::Draws mode; + Valentina::Draws mode; }; #endif // VGOBJECT_H diff --git a/src/geometry/vnodedetail.cpp b/src/geometry/vnodedetail.cpp index 33a858f58..ca8183fad 100644 --- a/src/geometry/vnodedetail.cpp +++ b/src/geometry/vnodedetail.cpp @@ -29,9 +29,9 @@ #include "vnodedetail.h" VNodeDetail::VNodeDetail() - :id(0), typeTool(Tool::NodePoint), typeNode(NodeDetail::Contour), mx(0), my(0){} + :id(0), typeTool(Valentina::NodePoint), typeNode(NodeDetail::Contour), mx(0), my(0){} -VNodeDetail::VNodeDetail(quint32 id, Tool::Tools typeTool, NodeDetail::NodeDetails typeNode, qreal mx, qreal my) +VNodeDetail::VNodeDetail(quint32 id, Valentina::Tools typeTool, NodeDetail::NodeDetails typeNode, qreal mx, qreal my) :id(id), typeTool(typeTool), typeNode(typeNode), mx(mx), my(my){} VNodeDetail::VNodeDetail(const VNodeDetail &node) diff --git a/src/geometry/vnodedetail.h b/src/geometry/vnodedetail.h index ec7d77e38..2a16dac7d 100644 --- a/src/geometry/vnodedetail.h +++ b/src/geometry/vnodedetail.h @@ -60,7 +60,7 @@ public: * @param mx object bias x axis * @param my object bias y axis */ - VNodeDetail(quint32 id, Tool::Tools typeTool, NodeDetail::NodeDetails typeNode, qreal mx = 0, + VNodeDetail(quint32 id, Valentina::Tools typeTool, NodeDetail::NodeDetails typeNode, qreal mx = 0, qreal my = 0); /** * @brief VNodeDetail copy constructor @@ -87,12 +87,12 @@ public: * @brief getTypeTool return tool type. * @return tool type. */ - Tool::Tools getTypeTool() const; + Valentina::Tools getTypeTool() const; /** * @brief setTypeTool set tool type. * @param value tool type. */ - void setTypeTool(const Tool::Tools &value); + void setTypeTool(const Valentina::Tools &value); /** * @brief getTypeNode return node type. * @return node type. @@ -131,7 +131,7 @@ private: /** * @brief typeTool type of tool */ - Tool::Tools typeTool; + Valentina::Tools typeTool; /** * @brief typeNode node type. */ @@ -156,12 +156,12 @@ inline void VNodeDetail::setId(const quint32 &value) id = value; } -inline Tool::Tools VNodeDetail::getTypeTool() const +inline Valentina::Tools VNodeDetail::getTypeTool() const { return typeTool; } -inline void VNodeDetail::setTypeTool(const Tool::Tools &value) +inline void VNodeDetail::setTypeTool(const Valentina::Tools &value) { typeTool = value; } diff --git a/src/geometry/vpointf.cpp b/src/geometry/vpointf.cpp index 0455cfbb7..97646ca9c 100644 --- a/src/geometry/vpointf.cpp +++ b/src/geometry/vpointf.cpp @@ -28,13 +28,13 @@ #include "vpointf.h" -VPointF::VPointF(qreal x, qreal y, QString name, qreal mx, qreal my, quint32 idObject, Draw::Draws mode) +VPointF::VPointF(qreal x, qreal y, QString name, qreal mx, qreal my, quint32 idObject, Valentina::Draws mode) :VGObject(GObject::Point, idObject, mode), _mx(mx), _my(my), _x(x), _y(y) { this->_name = name; } -VPointF::VPointF() :VGObject(GObject::Point, 0, Draw::Calculation), _mx(0), _my(0), _x(0), _y(0) +VPointF::VPointF() :VGObject(GObject::Point, 0, Valentina::Calculation), _mx(0), _my(0), _x(0), _y(0) { } diff --git a/src/geometry/vpointf.h b/src/geometry/vpointf.h index 416c5e58f..a88c8c99e 100644 --- a/src/geometry/vpointf.h +++ b/src/geometry/vpointf.h @@ -58,7 +58,7 @@ public: * @param my offset name respect to y */ VPointF ( qreal x, qreal y, QString name, qreal mx, qreal my, quint32 idObject = 0, - Draw::Draws mode = Draw::Calculation); + Valentina::Draws mode = Valentina::Calculation); ~VPointF(){} /** * @brief operator = assignment operator diff --git a/src/geometry/vspline.cpp b/src/geometry/vspline.cpp index 5f3476d3d..5b731da0e 100644 --- a/src/geometry/vspline.cpp +++ b/src/geometry/vspline.cpp @@ -40,7 +40,7 @@ VSpline::VSpline ( const VSpline & spline ) kCurve(spline.GetKcurve()){} VSpline::VSpline (VPointF p1, VPointF p4, qreal angle1, qreal angle2, qreal kAsm1, qreal kAsm2, qreal kCurve, - quint32 idObject, Draw::Draws mode) + quint32 idObject, Valentina::Draws mode) :VGObject(GObject::Spline, idObject, mode), p1(p1), p2(QPointF()), p3(QPointF()), p4(p4), angle1(angle1), angle2(angle2), kAsm1(kAsm1), kAsm2(kAsm2), kCurve(kCurve) { @@ -67,7 +67,7 @@ VSpline::VSpline (VPointF p1, VPointF p4, qreal angle1, qreal angle2, qreal kAsm this->p3 = p4p3.p2(); } -VSpline::VSpline (VPointF p1, QPointF p2, QPointF p3, VPointF p4, qreal kCurve, quint32 idObject, Draw::Draws mode) +VSpline::VSpline (VPointF p1, QPointF p2, QPointF p3, VPointF p4, qreal kCurve, quint32 idObject, Valentina::Draws mode) :VGObject(GObject::Spline, idObject, mode), p1(p1), p2(p2), p3(p3), p4(p4), angle1(0), angle2(0), kAsm1(1), kAsm2(1), kCurve(1) { diff --git a/src/geometry/vspline.h b/src/geometry/vspline.h index 96211ba50..e6b1fb013 100644 --- a/src/geometry/vspline.h +++ b/src/geometry/vspline.h @@ -66,7 +66,7 @@ public: * @param kAsm2 coefficient of length second control line. */ VSpline (VPointF p1, VPointF p4, qreal angle1, qreal angle2, qreal kAsm1, qreal kAsm2, qreal kCurve, - quint32 idObject = 0, Draw::Draws mode = Draw::Calculation); + quint32 idObject = 0, Valentina::Draws mode = Valentina::Calculation); /** * @brief VSpline constructor. * @param p1 first point spline. @@ -75,7 +75,7 @@ public: * @param p4 second point spline. */ VSpline (VPointF p1, QPointF p2, QPointF p3, VPointF p4, qreal kCurve, quint32 idObject = 0, - Draw::Draws mode = Draw::Calculation); + Valentina::Draws mode = Valentina::Calculation); /** * @brief GetP1 return first spline point. * @return first point. diff --git a/src/geometry/vsplinepath.cpp b/src/geometry/vsplinepath.cpp index d91f0fc6d..0351451e2 100644 --- a/src/geometry/vsplinepath.cpp +++ b/src/geometry/vsplinepath.cpp @@ -29,7 +29,7 @@ #include "vsplinepath.h" #include "../exception/vexception.h" -VSplinePath::VSplinePath(qreal kCurve, quint32 idObject, Draw::Draws mode) +VSplinePath::VSplinePath(qreal kCurve, quint32 idObject, Valentina::Draws mode) : VGObject(GObject::SplinePath, idObject, mode), path(QVector()), kCurve(kCurve), maxCountPoints(0) { } diff --git a/src/geometry/vsplinepath.h b/src/geometry/vsplinepath.h index 127ed5b3f..1b780f42a 100644 --- a/src/geometry/vsplinepath.h +++ b/src/geometry/vsplinepath.h @@ -59,7 +59,7 @@ public: * @param idObject parent id. * @param mode mode creation spline path. */ - VSplinePath(qreal kCurve = 1, quint32 idObject = 0, Draw::Draws mode = Draw::Calculation); + VSplinePath(qreal kCurve = 1, quint32 idObject = 0, Valentina::Draws mode = Valentina::Calculation); /** * @brief VSplinePath copy constructor. * @param splPath spline path. diff --git a/src/main.cpp b/src/main.cpp index 5bb95aa51..bf6e7159e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -33,6 +33,8 @@ #include "tablewindow.h" #include "options.h" +Valentina::Units patternUnit = Valentina::Cm; + #ifdef Q_OS_WIN const QString translationsPath = QString("/translations"); #else diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index b47bf60ef..098a82c18 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -45,12 +45,11 @@ #include #include - MainWindow::MainWindow(QWidget *parent) - :QMainWindow(parent), ui(new Ui::MainWindow), pattern(nullptr), doc(nullptr), tool(Tool::ArrowTool), + :QMainWindow(parent), ui(new Ui::MainWindow), pattern(nullptr), doc(nullptr), tool(Valentina::ArrowTool), currentScene(nullptr), sceneDraw(nullptr), sceneDetails(nullptr), mouseCoordinate(nullptr), helpLabel(nullptr), view(nullptr), isInitialized(false), dialogTable(0), dialogTool(nullptr), dialogHistory(nullptr), - comboBoxDraws(nullptr), curFile(QString()), mode(Draw::Calculation), currentDrawIndex(0), currentToolBoxIndex(0), + comboBoxDraws(nullptr), curFile(QString()), mode(Valentina::Calculation), currentDrawIndex(0), currentToolBoxIndex(0), drawMode(true), recentFileActs{0, 0, 0, 0, 0}, separatorAct(nullptr), autoSaveTimer(nullptr) { CreateActions(); @@ -165,14 +164,14 @@ void MainWindow::ActionNewDraw() //Create single point const quint32 id = pattern->AddGObject(new VPointF(toPixel((10+comboBoxDraws->count()*5)), toPixel(10), "А", 5, 10)); - VToolSinglePoint *spoint = new VToolSinglePoint(doc, pattern, id, Tool::FromGui); + VToolSinglePoint *spoint = new VToolSinglePoint(doc, pattern, id, Valentina::FromGui); sceneDraw->addItem(spoint); connect(spoint, &VToolPoint::ChoosedTool, sceneDraw, &VMainGraphicsScene::ChoosedItem); connect(sceneDraw, &VMainGraphicsScene::NewFactor, spoint, &VToolSinglePoint::SetFactor); QHash* tools = doc->getTools(); Q_CHECK_PTR(tools); tools->insert(id, spoint); - VDrawTool::AddRecord(id, Tool::SinglePointTool, doc); + VDrawTool::AddRecord(id, Valentina::SinglePointTool, doc); SetEnableTool(true); SetEnableWidgets(true); @@ -205,7 +204,7 @@ void MainWindow::OptionDraw() } template -void MainWindow::SetToolButton(bool checked, Tool::Tools t, const QString &cursor, const QString &toolTip, +void MainWindow::SetToolButton(bool checked, Valentina::Tools t, const QString &cursor, const QString &toolTip, Func closeDialogSlot) { if (checked) @@ -245,7 +244,7 @@ void MainWindow::ClosedDialog(int result) void MainWindow::ToolEndLine(bool checked) { - SetToolButton(checked, Tool::EndLineTool, ":/cursor/endline_cursor.png", tr("Select point"), + SetToolButton(checked, Valentina::EndLineTool, ":/cursor/endline_cursor.png", tr("Select point"), &MainWindow::ClosedDialogEndLine); } @@ -256,7 +255,7 @@ void MainWindow::ClosedDialogEndLine(int result) void MainWindow::ToolLine(bool checked) { - SetToolButton(checked, Tool::LineTool, ":/cursor/line_cursor.png", tr("Select first point"), + SetToolButton(checked, Valentina::LineTool, ":/cursor/line_cursor.png", tr("Select first point"), &MainWindow::ClosedDialogLine); } @@ -267,7 +266,7 @@ void MainWindow::ClosedDialogLine(int result) void MainWindow::ToolAlongLine(bool checked) { - SetToolButton(checked, Tool::AlongLineTool, ":/cursor/alongline_cursor.png", tr("Select point"), + SetToolButton(checked, Valentina::AlongLineTool, ":/cursor/alongline_cursor.png", tr("Select point"), &MainWindow::ClosedDialogAlongLine); } @@ -278,7 +277,7 @@ void MainWindow::ClosedDialogAlongLine(int result) void MainWindow::ToolShoulderPoint(bool checked) { - SetToolButton(checked, Tool::ShoulderPointTool, ":/cursor/shoulder_cursor.png", + SetToolButton(checked, Valentina::ShoulderPointTool, ":/cursor/shoulder_cursor.png", tr("Select first point of line"), &MainWindow::ClosedDialogShoulderPoint); } @@ -289,7 +288,7 @@ void MainWindow::ClosedDialogShoulderPoint(int result) void MainWindow::ToolNormal(bool checked) { - SetToolButton(checked, Tool::NormalTool, ":/cursor/normal_cursor.png", + SetToolButton(checked, Valentina::NormalTool, ":/cursor/normal_cursor.png", tr("Select first point of line"), &MainWindow::ClosedDialogNormal); } @@ -300,7 +299,7 @@ void MainWindow::ClosedDialogNormal(int result) void MainWindow::ToolBisector(bool checked) { - SetToolButton(checked, Tool::BisectorTool, ":/cursor/bisector_cursor.png", + SetToolButton(checked, Valentina::BisectorTool, ":/cursor/bisector_cursor.png", tr("Select first point of angle"), &MainWindow::ClosedDialogBisector); } @@ -311,7 +310,7 @@ void MainWindow::ClosedDialogBisector(int result) void MainWindow::ToolLineIntersect(bool checked) { - SetToolButton(checked, Tool::LineIntersectTool, ":/cursor/intersect_cursor.png", + SetToolButton(checked, Valentina::LineIntersectTool, ":/cursor/intersect_cursor.png", tr("Select first point of first line"), &MainWindow::ClosedDialogLineIntersect); } @@ -322,7 +321,7 @@ void MainWindow::ClosedDialogLineIntersect(int result) void MainWindow::ToolSpline(bool checked) { - SetToolButton(checked, Tool::SplineTool, ":/cursor/spline_cursor.png", + SetToolButton(checked, Valentina::SplineTool, ":/cursor/spline_cursor.png", tr("Select first point curve"), &MainWindow::ClosedDialogSpline); } @@ -333,7 +332,7 @@ void MainWindow::ClosedDialogSpline(int result) void MainWindow::ToolCutSpline(bool checked) { - SetToolButton(checked, Tool::CutSplineTool, ":/cursor/spline_cut_point_cursor.png", + SetToolButton(checked, Valentina::CutSplineTool, ":/cursor/spline_cut_point_cursor.png", tr("Select simple curve"), &MainWindow::ClosedDialogCutSpline); } @@ -344,7 +343,7 @@ void MainWindow::ClosedDialogCutSpline(int result) void MainWindow::ToolArc(bool checked) { - SetToolButton(checked, Tool::ArcTool, ":/cursor/arc_cursor.png", + SetToolButton(checked, Valentina::ArcTool, ":/cursor/arc_cursor.png", tr("Select point of center of arc"), &MainWindow::ClosedDialogArc); } @@ -355,7 +354,7 @@ void MainWindow::ClosedDialogArc(int result) void MainWindow::ToolSplinePath(bool checked) { - SetToolButton(checked, Tool::SplinePathTool, ":/cursor/splinepath_cursor.png", + SetToolButton(checked, Valentina::SplinePathTool, ":/cursor/splinepath_cursor.png", tr("Select point of curve path"), &MainWindow::ClosedDialogSplinePath); } @@ -366,7 +365,7 @@ void MainWindow::ClosedDialogSplinePath(int result) void MainWindow::ToolCutSplinePath(bool checked) { - SetToolButton(checked, Tool::CutSplinePathTool, ":/cursor/splinepath_cut_point_cursor.png", + SetToolButton(checked, Valentina::CutSplinePathTool, ":/cursor/splinepath_cut_point_cursor.png", tr("Select curve path"), &MainWindow::ClosedDialogCutSplinePath); } @@ -377,7 +376,7 @@ void MainWindow::ClosedDialogCutSplinePath(int result) void MainWindow::ToolPointOfContact(bool checked) { - SetToolButton(checked, Tool::PointOfContact, ":/cursor/pointcontact_cursor.png", + SetToolButton(checked, Valentina::PointOfContact, ":/cursor/pointcontact_cursor.png", tr("Select first point of line"), &MainWindow::ClosedDialogPointOfContact); } @@ -388,7 +387,7 @@ void MainWindow::ClosedDialogPointOfContact(int result) void MainWindow::ToolDetail(bool checked) { - SetToolButton(checked, Tool::Detail, "://cursor/new_detail_cursor.png", + SetToolButton(checked, Valentina::DetailTool, "://cursor/new_detail_cursor.png", tr("Select points, arcs, curves clockwise."), &MainWindow::ClosedDialogDetail); } @@ -404,7 +403,7 @@ void MainWindow::ClosedDialogDetail(int result) void MainWindow::ToolHeight(bool checked) { - SetToolButton(checked, Tool::Height, ":/cursor/height_cursor.png", tr("Select base point"), + SetToolButton(checked, Valentina::Height, ":/cursor/height_cursor.png", tr("Select base point"), &MainWindow::ClosedDialogHeight); } @@ -415,7 +414,7 @@ void MainWindow::ClosedDialogHeight(int result) void MainWindow::ToolTriangle(bool checked) { - SetToolButton(checked, Tool::Triangle, ":/cursor/triangle_cursor.png", + SetToolButton(checked, Valentina::Triangle, ":/cursor/triangle_cursor.png", tr("Select first point of axis"), &MainWindow::ClosedDialogTriangle); } @@ -426,7 +425,7 @@ void MainWindow::ClosedDialogTriangle(int result) void MainWindow::ToolPointOfIntersection(bool checked) { - SetToolButton(checked, Tool::PointOfIntersection, ":/cursor/pointofintersect_cursor.png", + SetToolButton(checked, Valentina::PointOfIntersection, ":/cursor/pointofintersect_cursor.png", tr("Select point vertically"), &MainWindow::ClosedDialogPointOfIntersection); } @@ -437,7 +436,7 @@ void MainWindow::ClosedDialogPointOfIntersection(int result) void MainWindow::ToolUnionDetails(bool checked) { - SetToolButton(checked, Tool::UnionDetails, ":/cursor/union_cursor.png", tr("Select detail"), + SetToolButton(checked, Valentina::UnionDetails, ":/cursor/union_cursor.png", tr("Select detail"), &MainWindow::ClosedDialogUnionDetails); //Must disconnect this signal here. disconnect(doc, &VPattern::FullUpdateFromFile, dialogTool, &DialogTool::UpdateList); @@ -451,7 +450,7 @@ void MainWindow::ClosedDialogUnionDetails(int result) void MainWindow::ToolCutArc(bool checked) { - SetToolButton(checked, Tool::CutArcTool, ":/cursor/arc_cut_cursor.png", tr("Select arc"), + SetToolButton(checked, Valentina::CutArcTool, ":/cursor/arc_cut_cursor.png", tr("Select arc"), &MainWindow::ClosedDialogCutArc); } @@ -633,103 +632,103 @@ void MainWindow::CancelTool() dialogTool = nullptr; switch ( tool ) { - case Tool::ArrowTool: + case Valentina::ArrowTool: ui->actionArrowTool->setChecked(false); helpLabel->setText(""); break; - case Tool::SinglePointTool: + case Valentina::SinglePointTool: Q_UNREACHABLE(); //Nothing to do here because we can't create this tool from main window. break; - case Tool::EndLineTool: + case Valentina::EndLineTool: ui->toolButtonEndLine->setChecked(false); currentScene->setFocus(Qt::OtherFocusReason); currentScene->clearSelection(); break; - case Tool::LineTool: + case Valentina::LineTool: ui->toolButtonLine->setChecked(false); currentScene->setFocus(Qt::OtherFocusReason); currentScene->clearFocus(); break; - case Tool::AlongLineTool: + case Valentina::AlongLineTool: ui->toolButtonAlongLine->setChecked(false); currentScene->setFocus(Qt::OtherFocusReason); currentScene->clearSelection(); break; - case Tool::ShoulderPointTool: + case Valentina::ShoulderPointTool: ui->toolButtonShoulderPoint->setChecked(false); currentScene->setFocus(Qt::OtherFocusReason); currentScene->clearSelection(); break; - case Tool::NormalTool: + case Valentina::NormalTool: ui->toolButtonNormal->setChecked(false); currentScene->setFocus(Qt::OtherFocusReason); currentScene->clearSelection(); break; - case Tool::BisectorTool: + case Valentina::BisectorTool: ui->toolButtonBisector->setChecked(false); currentScene->setFocus(Qt::OtherFocusReason); currentScene->clearSelection(); break; - case Tool::LineIntersectTool: + case Valentina::LineIntersectTool: ui->toolButtonLineIntersect->setChecked(false); currentScene->setFocus(Qt::OtherFocusReason); currentScene->clearSelection(); break; - case Tool::SplineTool: + case Valentina::SplineTool: ui->toolButtonSpline->setChecked(false); currentScene->setFocus(Qt::OtherFocusReason); currentScene->clearSelection(); break; - case Tool::ArcTool: + case Valentina::ArcTool: ui->toolButtonArc->setChecked(false); currentScene->setFocus(Qt::OtherFocusReason); currentScene->clearSelection(); break; - case Tool::SplinePathTool: + case Valentina::SplinePathTool: ui->toolButtonSplinePath->setChecked(false); currentScene->setFocus(Qt::OtherFocusReason); currentScene->clearSelection(); break; - case Tool::PointOfContact: + case Valentina::PointOfContact: ui->toolButtonPointOfContact->setChecked(false); currentScene->setFocus(Qt::OtherFocusReason); currentScene->clearSelection(); break; - case Tool::Detail: + case Valentina::DetailTool: ui->toolButtonNewDetail->setChecked(false); break; - case Tool::Height: + case Valentina::Height: ui->toolButtonHeight->setChecked(false); currentScene->setFocus(Qt::OtherFocusReason); currentScene->clearSelection(); break; - case Tool::Triangle: + case Valentina::Triangle: ui->toolButtonTriangle->setChecked(false); currentScene->setFocus(Qt::OtherFocusReason); currentScene->clearSelection(); break; - case Tool::PointOfIntersection: + case Valentina::PointOfIntersection: ui->toolButtonPointOfIntersection->setChecked(false); currentScene->setFocus(Qt::OtherFocusReason); currentScene->clearSelection(); break; - case Tool::CutSplineTool: + case Valentina::CutSplineTool: ui->toolButtonSplineCutPoint->setChecked(false); currentScene->setFocus(Qt::OtherFocusReason); currentScene->clearSelection(); break; - case Tool::CutSplinePathTool: + case Valentina::CutSplinePathTool: ui->toolButtonSplinePathCutPoint->setChecked(false); currentScene->setFocus(Qt::OtherFocusReason); currentScene->clearSelection(); break; - case Tool::UnionDetails: + case Valentina::UnionDetails: ui->toolButtonUnionDetails->setChecked(false); currentScene->setFocus(Qt::OtherFocusReason); currentScene->clearSelection(); break; - case Tool::CutArcTool: + case Valentina::CutArcTool: ui->toolButtonArcCutPoint->setChecked(false); currentScene->setFocus(Qt::OtherFocusReason); currentScene->clearSelection(); @@ -744,7 +743,7 @@ void MainWindow::ArrowTool() { CancelTool(); ui->actionArrowTool->setChecked(true); - tool = Tool::ArrowTool; + tool = Valentina::ArrowTool; QCursor cur(Qt::ArrowCursor); view->setCursor(cur); helpLabel->setText(""); @@ -802,7 +801,7 @@ void MainWindow::ActionDraw(bool checked) connect(view, &VMainGraphicsView::NewFactor, sceneDraw, &VMainGraphicsScene::SetFactor); RestoreCurrentScene(); - mode = Draw::Calculation; + mode = Valentina::Calculation; comboBoxDraws->setEnabled(true); comboBoxDraws->setCurrentIndex(currentDrawIndex);//restore current pattern peace drawMode = true; @@ -840,7 +839,7 @@ void MainWindow::ActionDetails(bool checked) comboBoxDraws->setEnabled(false); - mode = Draw::Modeling; + mode = Valentina::Modeling; SetEnableTool(true); currentToolBoxIndex = ui->toolBox->currentIndex(); ui->toolBox->setCurrentIndex(4); @@ -1059,7 +1058,7 @@ void MainWindow::SetEnableTool(bool enable) { bool drawTools = false; bool modelingTools = false; - if (mode == Draw::Calculation) + if (mode == Valentina::Calculation) { drawTools = enable; } diff --git a/src/mainwindow.h b/src/mainwindow.h index 8d83bbd99..c5bcc046e 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -407,7 +407,7 @@ private: /** * @brief tool current tool */ - Tool::Tools tool; + Valentina::Tools tool; /** * @brief currentScene pointer to current scene. */ @@ -450,7 +450,7 @@ private: /** * @brief mode keep current draw mode. */ - Draw::Draws mode; + Valentina::Draws mode; /** * @brief currentDrawIndex save current selected pattern peace. */ @@ -510,7 +510,7 @@ private: * @param toolTip first tooltipe. * @param closeDialogSlot function what handle after close dialog. */ - void SetToolButton(bool checked, Tool::Tools t, const QString &cursor, const QString &toolTip, + void SetToolButton(bool checked, Valentina::Tools t, const QString &cursor, const QString &toolTip, Func closeDialogSlot); /** * @brief MinimumScrollBar set scroll bar to minimum. diff --git a/src/options.h b/src/options.h index 1d4176d0c..6580940f4 100644 --- a/src/options.h +++ b/src/options.h @@ -51,18 +51,14 @@ inline double toMM(double pix) extern const QString translationsPath; -namespace Scene +namespace Valentina { /** * @brief The Scene enum */ enum Scene { Point, Line, Spline, Arc, SplinePath, Detail }; Q_DECLARE_FLAGS(Scenes, Scene) -} -Q_DECLARE_OPERATORS_FOR_FLAGS( Scene::Scenes ) -namespace Tool -{ /** * @brief The Tool enum */ @@ -84,7 +80,7 @@ namespace Tool SplinePathTool, CutSplinePathTool, PointOfContact, - Detail, + DetailTool, NodePoint, NodeArc, NodeSpline, @@ -101,18 +97,25 @@ namespace Tool */ enum Source { FromGui, FromFile, FromTool }; Q_DECLARE_FLAGS(Sources, Source) -} -Q_DECLARE_OPERATORS_FOR_FLAGS( Tool::Tools ) -Q_DECLARE_OPERATORS_FOR_FLAGS( Tool::Sources ) -namespace Draw -{ /** * @brief The Draw enum */ enum Draw { Calculation, Modeling }; Q_DECLARE_FLAGS(Draws, Draw) + + /** + * @brief The Unit enum + */ + enum Unit { Mm, Cm, In }; + Q_DECLARE_FLAGS(Units, Unit) } -Q_DECLARE_OPERATORS_FOR_FLAGS(Draw::Draws) +Q_DECLARE_OPERATORS_FOR_FLAGS( Valentina::Scenes ) +Q_DECLARE_OPERATORS_FOR_FLAGS( Valentina::Tools ) +Q_DECLARE_OPERATORS_FOR_FLAGS( Valentina::Sources ) +Q_DECLARE_OPERATORS_FOR_FLAGS( Valentina::Draws ) +Q_DECLARE_OPERATORS_FOR_FLAGS( Valentina::Units ) + +extern Valentina::Units patternUnit; #endif // OPTIONS_H diff --git a/src/tools/drawTools/vtoolalongline.cpp b/src/tools/drawTools/vtoolalongline.cpp index bf6abdba3..961e2bf1b 100644 --- a/src/tools/drawTools/vtoolalongline.cpp +++ b/src/tools/drawTools/vtoolalongline.cpp @@ -34,12 +34,12 @@ const QString VToolAlongLine::ToolType = QStringLiteral("alongLine"); VToolAlongLine::VToolAlongLine(VPattern *doc, VContainer *data, quint32 id, const QString &formula, const quint32 &firstPointId, const quint32 &secondPointId, - const QString &typeLine, const Tool::Sources &typeCreation, + const QString &typeLine, const Valentina::Sources &typeCreation, QGraphicsItem *parent) :VToolLinePoint(doc, data, id, typeLine, formula, firstPointId, 0, parent), secondPointId(secondPointId) { - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { AddToFile(); } @@ -156,13 +156,13 @@ void VToolAlongLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPatt QString typeLine = dialogTool->getTypeLine(); QString pointName = dialogTool->getPointName(); Create(0, pointName, typeLine, formula, firstPointId, secondPointId, 5, 10, scene, doc, data, - Document::FullParse, Tool::FromGui); + Document::FullParse, Valentina::FromGui); } void VToolAlongLine::Create(const quint32 _id, const QString &pointName, const QString &typeLine, const QString &formula, const quint32 &firstPointId, const quint32 &secondPointId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, - VContainer *data, const Document::Documents &parse, const Tool::Sources &typeCreation) + VContainer *data, const Document::Documents &parse, const Valentina::Sources &typeCreation) { const VPointF *firstPoint = data->GeometricObject(firstPointId); const VPointF *secondPoint = data->GeometricObject(secondPointId); @@ -174,7 +174,7 @@ void VToolAlongLine::Create(const quint32 _id, const QString &pointName, const Q { line.setLength(toPixel(result)); quint32 id = _id; - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { id = data->AddGObject( new VPointF(line.p2().x(), line.p2().y(), pointName, mx, my)); data->AddLine(firstPointId, id); @@ -190,7 +190,7 @@ void VToolAlongLine::Create(const quint32 _id, const QString &pointName, const Q doc->UpdateToolData(id, data); } } - VDrawTool::AddRecord(id, Tool::AlongLineTool, doc); + VDrawTool::AddRecord(id, Valentina::AlongLineTool, doc); if (parse == Document::FullParse) { VToolAlongLine *point = new VToolAlongLine(doc, data, id, formula, firstPointId, diff --git a/src/tools/drawTools/vtoolalongline.h b/src/tools/drawTools/vtoolalongline.h index e254004c7..89924d36e 100644 --- a/src/tools/drawTools/vtoolalongline.h +++ b/src/tools/drawTools/vtoolalongline.h @@ -52,7 +52,7 @@ public: */ VToolAlongLine(VPattern *doc, VContainer *data, quint32 id, const QString &formula, const quint32 &firstPointId, const quint32 &secondPointId, const QString &typeLine, - const Tool::Sources &typeCreation, QGraphicsItem * parent = nullptr); + const Valentina::Sources &typeCreation, QGraphicsItem * parent = nullptr); /** * @brief setDialog set dialog when user want change tool option. */ @@ -84,7 +84,7 @@ public: static void Create(const quint32 _id, const QString &pointName, const QString &typeLine, const QString &formula, const quint32 &firstPointId, const quint32 &secondPointId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, - const Document::Documents &parse, const Tool::Sources &typeCreation); + const Document::Documents &parse, const Valentina::Sources &typeCreation); static const QString ToolType; public slots: /** diff --git a/src/tools/drawTools/vtoolarc.cpp b/src/tools/drawTools/vtoolarc.cpp index 04c4687cb..4ba88dcff 100644 --- a/src/tools/drawTools/vtoolarc.cpp +++ b/src/tools/drawTools/vtoolarc.cpp @@ -33,7 +33,7 @@ const QString VToolArc::TagName = QStringLiteral("arc"); const QString VToolArc::ToolType = QStringLiteral("simple"); -VToolArc::VToolArc(VPattern *doc, VContainer *data, quint32 id, const Tool::Sources &typeCreation, +VToolArc::VToolArc(VPattern *doc, VContainer *data, quint32 id, const Valentina::Sources &typeCreation, QGraphicsItem *parent) :VDrawTool(doc, data, id), QGraphicsPathItem(parent) { @@ -47,7 +47,7 @@ VToolArc::VToolArc(VPattern *doc, VContainer *data, quint32 id, const Tool::Sour this->setFlag(QGraphicsItem::ItemIsFocusable, true); this->setAcceptHoverEvents(true); - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { AddToFile(); } @@ -79,12 +79,12 @@ void VToolArc::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *d QString radius = dialogTool->GetRadius(); QString f1 = dialogTool->GetF1(); QString f2 = dialogTool->GetF2(); - Create(0, center, radius, f1, f2, scene, doc, data, Document::FullParse, Tool::FromGui); + Create(0, center, radius, f1, f2, scene, doc, data, Document::FullParse, Valentina::FromGui); } void VToolArc::Create(const quint32 _id, const quint32 ¢er, const QString &radius, const QString &f1, const QString &f2, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, - const Document::Documents &parse, const Tool::Sources &typeCreation) + const Document::Documents &parse, const Valentina::Sources &typeCreation) { qreal calcRadius = 0, calcF1 = 0, calcF2 = 0; @@ -113,7 +113,7 @@ void VToolArc::Create(const quint32 _id, const quint32 ¢er, const QString &r VPointF c = *data->GeometricObject(center); VArc *arc = new VArc(c, calcRadius, radius, calcF1, f1, calcF2, f2 ); quint32 id = _id; - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { id = data->AddGObject(arc); } @@ -126,7 +126,7 @@ void VToolArc::Create(const quint32 _id, const quint32 ¢er, const QString &r } } data->AddLengthArc(id); - VDrawTool::AddRecord(id, Tool::ArcTool, doc); + VDrawTool::AddRecord(id, Valentina::ArcTool, doc); if (parse == Document::FullParse) { VToolArc *toolArc = new VToolArc(doc, data, id, typeCreation); @@ -209,7 +209,7 @@ void VToolArc::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { if (event->button() == Qt::LeftButton) { - emit ChoosedTool(id, Scene::Arc); + emit ChoosedTool(id, Valentina::Arc); } QGraphicsItem::mouseReleaseEvent(event); } diff --git a/src/tools/drawTools/vtoolarc.h b/src/tools/drawTools/vtoolarc.h index 65dd734b7..8dd66a768 100644 --- a/src/tools/drawTools/vtoolarc.h +++ b/src/tools/drawTools/vtoolarc.h @@ -48,7 +48,7 @@ public: * @param typeCreation way we create this tool. * @param parent parent object */ - VToolArc(VPattern *doc, VContainer *data, quint32 id, const Tool::Sources &typeCreation, + VToolArc(VPattern *doc, VContainer *data, quint32 id, const Valentina::Sources &typeCreation, QGraphicsItem * parent = nullptr); /** * @brief setDialog set dialog when user want change tool option. @@ -77,7 +77,7 @@ public: */ static void Create(const quint32 _id, const quint32 ¢er, const QString &radius, const QString &f1, const QString &f2, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, - const Document::Documents &parse, const Tool::Sources &typeCreation); + const Document::Documents &parse, const Valentina::Sources &typeCreation); static const QString TagName; static const QString ToolType; public slots: diff --git a/src/tools/drawTools/vtoolbisector.cpp b/src/tools/drawTools/vtoolbisector.cpp index b2e42fa59..373f140ec 100644 --- a/src/tools/drawTools/vtoolbisector.cpp +++ b/src/tools/drawTools/vtoolbisector.cpp @@ -34,13 +34,13 @@ const QString VToolBisector::ToolType = QStringLiteral("bisector"); VToolBisector::VToolBisector(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &formula, const quint32 &firstPointId, const quint32 &secondPointId, - const quint32 &thirdPointId, const Tool::Sources &typeCreation, QGraphicsItem *parent) + const quint32 &thirdPointId, const Valentina::Sources &typeCreation, QGraphicsItem *parent) :VToolLinePoint(doc, data, id, typeLine, formula, secondPointId, 0, parent), firstPointId(0), thirdPointId(0) { this->firstPointId = firstPointId; this->thirdPointId = thirdPointId; - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { AddToFile(); } @@ -96,14 +96,14 @@ void VToolBisector::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPatte QString typeLine = dialogTool->getTypeLine(); QString pointName = dialogTool->getPointName(); Create(0, formula, firstPointId, secondPointId, thirdPointId, typeLine, pointName, 5, 10, scene, doc, data, - Document::FullParse, Tool::FromGui); + Document::FullParse, Valentina::FromGui); } void VToolBisector::Create(const quint32 _id, const QString &formula, const quint32 &firstPointId, const quint32 &secondPointId, const quint32 &thirdPointId, const QString &typeLine, const QString &pointName, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, - const Document::Documents &parse, const Tool::Sources &typeCreation) + const Document::Documents &parse, const Valentina::Sources &typeCreation) { const VPointF *firstPoint = data->GeometricObject(firstPointId); const VPointF *secondPoint = data->GeometricObject(secondPointId); @@ -117,7 +117,7 @@ void VToolBisector::Create(const quint32 _id, const QString &formula, const quin QPointF fPoint = VToolBisector::FindPoint(firstPoint->toQPointF(), secondPoint->toQPointF(), thirdPoint->toQPointF(), toPixel(result)); quint32 id = _id; - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { id = data->AddGObject(new VPointF(fPoint.x(), fPoint.y(), pointName, mx, my)); data->AddLine(firstPointId, id); @@ -131,7 +131,7 @@ void VToolBisector::Create(const quint32 _id, const QString &formula, const quin doc->UpdateToolData(id, data); } } - VDrawTool::AddRecord(id, Tool::BisectorTool, doc); + VDrawTool::AddRecord(id, Valentina::BisectorTool, doc); if (parse == Document::FullParse) { VToolBisector *point = new VToolBisector(doc, data, id, typeLine, formula, firstPointId, secondPointId, diff --git a/src/tools/drawTools/vtoolbisector.h b/src/tools/drawTools/vtoolbisector.h index 02ba4e90d..84aeac0f8 100644 --- a/src/tools/drawTools/vtoolbisector.h +++ b/src/tools/drawTools/vtoolbisector.h @@ -52,7 +52,7 @@ public: */ VToolBisector(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &formula, const quint32 &firstPointId, const quint32 &secondPointId, - const quint32 &thirdPointId, const Tool::Sources &typeCreation, + const quint32 &thirdPointId, const Valentina::Sources &typeCreation, QGraphicsItem * parent = nullptr); /** * @brief FindPoint find bisector point. @@ -97,7 +97,7 @@ public: const quint32 &secondPointId, const quint32 &thirdPointId, const QString &typeLine, const QString &pointName, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document::Documents &parse, - const Tool::Sources &typeCreation); + const Valentina::Sources &typeCreation); static const QString ToolType; public slots: /** diff --git a/src/tools/drawTools/vtoolcutarc.cpp b/src/tools/drawTools/vtoolcutarc.cpp index a16a9f87c..2c19e1be2 100644 --- a/src/tools/drawTools/vtoolcutarc.cpp +++ b/src/tools/drawTools/vtoolcutarc.cpp @@ -35,7 +35,7 @@ const QString VToolCutArc::AttrArc = QStringLiteral("arc"); VToolCutArc::VToolCutArc(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula, const quint32 &arcId, const quint32 &arc1id, const quint32 &arc2id, - const Tool::Sources &typeCreation, QGraphicsItem * parent) + const Valentina::Sources &typeCreation, QGraphicsItem * parent) :VToolPoint(doc, data, id, parent), formula(formula), arcId(arcId), firstArc(), secondArc(), arc1id(arc1id), arc2id(arc2id) { @@ -53,7 +53,7 @@ VToolCutArc::VToolCutArc(VPattern *doc, VContainer *data, const quint32 &id, con secondArc->setParentItem(this); connect(secondArc, &VSimpleArc::Choosed, this, &VToolCutArc::ArcChoosed); - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { AddToFile(); } @@ -83,12 +83,12 @@ void VToolCutArc::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern QString pointName = dialogTool->getPointName(); QString formula = dialogTool->getFormula(); quint32 arcId = dialogTool->getArcId(); - Create(0, pointName, formula, arcId, 5, 10, scene, doc, data, Document::FullParse, Tool::FromGui); + Create(0, pointName, formula, arcId, 5, 10, scene, doc, data, Document::FullParse, Valentina::FromGui); } void VToolCutArc::Create(const quint32 _id, const QString &pointName, const QString &formula, const quint32 &arcId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, - VContainer *data, const Document::Documents &parse, const Tool::Sources &typeCreation) + VContainer *data, const Document::Documents &parse, const Valentina::Sources &typeCreation) { const VArc *arc = data->GeometricObject(arcId); Calculator cal(data); @@ -103,7 +103,7 @@ void VToolCutArc::Create(const quint32 _id, const QString &pointName, const QStr quint32 id = _id; quint32 arc1id = 0; quint32 arc2id = 0; - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { VPointF *p = new VPointF(point.x(), point.y(), pointName, mx, my); id = data->AddGObject(p); @@ -136,7 +136,7 @@ void VToolCutArc::Create(const quint32 _id, const QString &pointName, const QStr data->AddLengthArc(arc1id); data->AddLengthArc(arc2id); - VDrawTool::AddRecord(id, Tool::CutArcTool, doc); + VDrawTool::AddRecord(id, Valentina::CutArcTool, doc); if (parse == Document::FullParse) { VToolCutArc *point = new VToolCutArc(doc, data, id, formula, arcId, arc1id, arc2id, typeCreation); @@ -164,7 +164,7 @@ void VToolCutArc::FullUpdateFromFile() void VToolCutArc::ArcChoosed(quint32 id) { - emit ChoosedTool(id, Scene::Arc); + emit ChoosedTool(id, Valentina::Arc); } void VToolCutArc::ChangedActivDraw(const QString &newName) diff --git a/src/tools/drawTools/vtoolcutarc.h b/src/tools/drawTools/vtoolcutarc.h index 4e845f170..5d44d47b6 100644 --- a/src/tools/drawTools/vtoolcutarc.h +++ b/src/tools/drawTools/vtoolcutarc.h @@ -53,7 +53,7 @@ public: */ VToolCutArc(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula, const quint32 &arcId, const quint32 &arc1id, const quint32 &arc2id, - const Tool::Sources &typeCreation, QGraphicsItem * parent = nullptr); + const Valentina::Sources &typeCreation, QGraphicsItem * parent = nullptr); /** * @brief setDialog set dialog when user want change tool option. */ @@ -82,7 +82,7 @@ public: */ static void Create(const quint32 _id, const QString &pointName, const QString &formula, const quint32 &arcId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, - VContainer *data, const Document::Documents &parse, const Tool::Sources &typeCreation); + VContainer *data, const Document::Documents &parse, const Valentina::Sources &typeCreation); static const QString ToolType; static const QString AttrArc; public slots: diff --git a/src/tools/drawTools/vtoolcutspline.cpp b/src/tools/drawTools/vtoolcutspline.cpp index c806746e2..6d6c5e97b 100644 --- a/src/tools/drawTools/vtoolcutspline.cpp +++ b/src/tools/drawTools/vtoolcutspline.cpp @@ -35,7 +35,7 @@ const QString VToolCutSpline::AttrSpline = QStringLiteral("spline"); VToolCutSpline::VToolCutSpline(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula, const quint32 &splineId, const quint32 &spl1id, const quint32 &spl2id, - const Tool::Sources &typeCreation, QGraphicsItem *parent) + const Valentina::Sources &typeCreation, QGraphicsItem *parent) :VToolPoint(doc, data, id, parent), formula(formula), splineId(splineId), firstSpline(), secondSpline(), spl1id(spl1id), spl2id(spl2id) { @@ -53,7 +53,7 @@ VToolCutSpline::VToolCutSpline(VPattern *doc, VContainer *data, const quint32 &i secondSpline->setParentItem(this); connect(secondSpline, &VSimpleSpline::Choosed, this, &VToolCutSpline::SplineChoosed); - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { AddToFile(); } @@ -83,13 +83,13 @@ void VToolCutSpline::Create(DialogTool *dialog, VMainGraphicsScene *scene, QString pointName = dialogTool->getPointName(); QString formula = dialogTool->getFormula(); quint32 splineId = dialogTool->getSplineId(); - Create(0, pointName, formula, splineId, 5, 10, scene, doc, data, Document::FullParse, Tool::FromGui); + Create(0, pointName, formula, splineId, 5, 10, scene, doc, data, Document::FullParse, Valentina::FromGui); } void VToolCutSpline::Create(const quint32 _id, const QString &pointName, const QString &formula, const quint32 &splineId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, - const Document::Documents &parse, const Tool::Sources &typeCreation) + const Document::Documents &parse, const Valentina::Sources &typeCreation) { const VSpline *spl = data->GeometricObject(splineId); Calculator cal(data); @@ -103,7 +103,7 @@ void VToolCutSpline::Create(const quint32 _id, const QString &pointName, quint32 id = _id; quint32 spl1id = 0; quint32 spl2id = 0; - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { VPointF *p = new VPointF(point.x(), point.y(), pointName, mx, my); id = data->AddGObject(p); @@ -137,7 +137,7 @@ void VToolCutSpline::Create(const quint32 _id, const QString &pointName, doc->UpdateToolData(id, data); } } - VDrawTool::AddRecord(id, Tool::CutSplineTool, doc); + VDrawTool::AddRecord(id, Valentina::CutSplineTool, doc); if (parse == Document::FullParse) { VToolCutSpline *point = new VToolCutSpline(doc, data, id, formula, splineId, spl1id, spl2id, typeCreation); @@ -165,7 +165,7 @@ void VToolCutSpline::FullUpdateFromFile() void VToolCutSpline::SplineChoosed(quint32 id) { - emit ChoosedTool(id, Scene::Spline); + emit ChoosedTool(id, Valentina::Spline); } void VToolCutSpline::ChangedActivDraw(const QString &newName) diff --git a/src/tools/drawTools/vtoolcutspline.h b/src/tools/drawTools/vtoolcutspline.h index 6baf52e85..5ed16027d 100644 --- a/src/tools/drawTools/vtoolcutspline.h +++ b/src/tools/drawTools/vtoolcutspline.h @@ -51,7 +51,7 @@ public: */ VToolCutSpline(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula, const quint32 &splineId, const quint32 &spl1id, const quint32 &spl2id, - const Tool::Sources &typeCreation, QGraphicsItem * parent = nullptr); + const Valentina::Sources &typeCreation, QGraphicsItem * parent = nullptr); /** * @brief setDialog set dialog when user want change tool option. */ @@ -81,7 +81,7 @@ public: static void Create(const quint32 _id, const QString &pointName, const QString &formula, const quint32 &splineId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, - const Document::Documents &parse, const Tool::Sources &typeCreation); + const Document::Documents &parse, const Valentina::Sources &typeCreation); static const QString ToolType; static const QString AttrSpline; public slots: diff --git a/src/tools/drawTools/vtoolcutsplinepath.cpp b/src/tools/drawTools/vtoolcutsplinepath.cpp index e9eaa2647..c29c921cf 100644 --- a/src/tools/drawTools/vtoolcutsplinepath.cpp +++ b/src/tools/drawTools/vtoolcutsplinepath.cpp @@ -36,7 +36,7 @@ const QString VToolCutSplinePath::AttrSplinePath = QStringLiteral("splinePath"); VToolCutSplinePath::VToolCutSplinePath(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula, const quint32 &splinePathId, const quint32 &splPath1id, const quint32 &splPath2id, - const Tool::Sources &typeCreation, QGraphicsItem *parent) + const Valentina::Sources &typeCreation, QGraphicsItem *parent) :VToolPoint(doc, data, id, parent), formula(formula), splinePathId(splinePathId), firstSpline(), secondSpline(), splPath1id (splPath1id), splPath2id(splPath2id) { @@ -54,7 +54,7 @@ VToolCutSplinePath::VToolCutSplinePath(VPattern *doc, VContainer *data, const qu secondSpline->setParentItem(this); connect(secondSpline, &VSimpleSpline::Choosed, this, &VToolCutSplinePath::SplineChoosed); - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { AddToFile(); } @@ -83,13 +83,13 @@ void VToolCutSplinePath::Create(DialogTool *dialog, VMainGraphicsScene *scene, V QString pointName = dialogTool->getPointName(); QString formula = dialogTool->getFormula(); quint32 splinePathId = dialogTool->getSplinePathId(); - Create(0, pointName, formula, splinePathId, 5, 10, scene, doc, data, Document::FullParse, Tool::FromGui); + Create(0, pointName, formula, splinePathId, 5, 10, scene, doc, data, Document::FullParse, Valentina::FromGui); } void VToolCutSplinePath::Create(const quint32 _id, const QString &pointName, const QString &formula, const quint32 &splinePathId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, - const Document::Documents &parse, const Tool::Sources &typeCreation) + const Document::Documents &parse, const Valentina::Sources &typeCreation) { const VSplinePath *splPath = data->GeometricObject(splinePathId); Q_CHECK_PTR(splPath); @@ -104,7 +104,7 @@ void VToolCutSplinePath::Create(const quint32 _id, const QString &pointName, con const QPointF point = splPath->CutSplinePath(toPixel(result), p1, p2, spl1p2, spl1p3, spl2p2, spl2p3); VPointF *p = new VPointF(point.x(), point.y(), pointName, mx, my); - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { id = data->AddGObject(p); } @@ -123,7 +123,7 @@ void VToolCutSplinePath::Create(const quint32 _id, const QString &pointName, con VSplinePath *splPath1 = new VSplinePath(); VSplinePath *splPath2 = new VSplinePath(); - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { for (qint32 i = 0; i < splPath->CountPoint(); i++) { @@ -210,7 +210,7 @@ void VToolCutSplinePath::Create(const quint32 _id, const QString &pointName, con doc->UpdateToolData(id, data); } } - VDrawTool::AddRecord(id, Tool::CutSplinePathTool, doc); + VDrawTool::AddRecord(id, Valentina::CutSplinePathTool, doc); if (parse == Document::FullParse) { VToolCutSplinePath *point = new VToolCutSplinePath(doc, data, id, formula, splinePathId, splPath1id, @@ -239,7 +239,7 @@ void VToolCutSplinePath::FullUpdateFromFile() void VToolCutSplinePath::SplineChoosed(quint32 id) { - emit ChoosedTool(id, Scene::SplinePath); + emit ChoosedTool(id, Valentina::SplinePath); } void VToolCutSplinePath::ChangedActivDraw(const QString &newName) diff --git a/src/tools/drawTools/vtoolcutsplinepath.h b/src/tools/drawTools/vtoolcutsplinepath.h index 2f9707bef..08b319439 100644 --- a/src/tools/drawTools/vtoolcutsplinepath.h +++ b/src/tools/drawTools/vtoolcutsplinepath.h @@ -54,7 +54,7 @@ public: */ VToolCutSplinePath(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula, const quint32 &splinePathId, const quint32 &splPath1id, const quint32 &splPath2id, - const Tool::Sources &typeCreation, QGraphicsItem * parent = nullptr); + const Valentina::Sources &typeCreation, QGraphicsItem * parent = nullptr); /** * @brief setDialog set dialog when user want change tool option. */ @@ -84,7 +84,7 @@ public: static void Create(const quint32 _id, const QString &pointName, const QString &formula, const quint32 &splinePathId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document::Documents &parse, - const Tool::Sources &typeCreation); + const Valentina::Sources &typeCreation); static const QString ToolType; static const QString AttrSplinePath; public slots: diff --git a/src/tools/drawTools/vtoolendline.cpp b/src/tools/drawTools/vtoolendline.cpp index 68504a32d..3448387ae 100644 --- a/src/tools/drawTools/vtoolendline.cpp +++ b/src/tools/drawTools/vtoolendline.cpp @@ -35,11 +35,11 @@ const QString VToolEndLine::ToolType = QStringLiteral("endLine"); VToolEndLine::VToolEndLine(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &formula, const qreal &angle, const quint32 &basePointId, - const Tool::Sources &typeCreation, QGraphicsItem *parent) + const Valentina::Sources &typeCreation, QGraphicsItem *parent) :VToolLinePoint(doc, data, id, typeLine, formula, basePointId, angle, parent) { - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { AddToFile(); } @@ -74,13 +74,13 @@ void VToolEndLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPatter qreal angle = dialogTool->getAngle(); quint32 basePointId = dialogTool->getBasePointId(); Create(0, pointName, typeLine, formula, angle, basePointId, 5, 10, scene, doc, data, Document::FullParse, - Tool::FromGui); + Valentina::FromGui); } void VToolEndLine::Create(const quint32 _id, const QString &pointName, const QString &typeLine, const QString &formula, const qreal &angle, const quint32 &basePointId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, - VContainer *data, const Document::Documents &parse, const Tool::Sources &typeCreation) + VContainer *data, const Document::Documents &parse, const Valentina::Sources &typeCreation) { const VPointF *basePoint = data->GeometricObject(basePointId); QLineF line = QLineF(basePoint->toQPointF(), QPointF(basePoint->x()+100, basePoint->y())); @@ -92,7 +92,7 @@ void VToolEndLine::Create(const quint32 _id, const QString &pointName, const QSt line.setLength(toPixel(result)); line.setAngle(angle); quint32 id = _id; - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { id = data->AddGObject(new VPointF(line.p2().x(), line.p2().y(), pointName, mx, my)); data->AddLine(basePointId, id); @@ -106,7 +106,7 @@ void VToolEndLine::Create(const quint32 _id, const QString &pointName, const QSt doc->UpdateToolData(id, data); } } - VDrawTool::AddRecord(id, Tool::EndLineTool, doc); + VDrawTool::AddRecord(id, Valentina::EndLineTool, doc); if (parse == Document::FullParse) { VToolEndLine *point = new VToolEndLine(doc, data, id, typeLine, formula, angle, diff --git a/src/tools/drawTools/vtoolendline.h b/src/tools/drawTools/vtoolendline.h index 98eebac48..f386e360e 100644 --- a/src/tools/drawTools/vtoolendline.h +++ b/src/tools/drawTools/vtoolendline.h @@ -52,7 +52,7 @@ public: */ VToolEndLine(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &formula, const qreal &angle, const quint32 &basePointId, - const Tool::Sources &typeCreation, QGraphicsItem * parent = nullptr); + const Valentina::Sources &typeCreation, QGraphicsItem * parent = nullptr); /** * @brief setDialog set dialog when user want change tool option. */ @@ -84,7 +84,7 @@ public: static void Create(const quint32 _id, const QString &pointName, const QString &typeLine, const QString &formula, const qreal &angle, const quint32 &basePointId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, - const Document::Documents &parse, const Tool::Sources &typeCreation); + const Document::Documents &parse, const Valentina::Sources &typeCreation); static const QString ToolType; public slots: /** diff --git a/src/tools/drawTools/vtoolheight.cpp b/src/tools/drawTools/vtoolheight.cpp index 9f3525cba..c468180a6 100644 --- a/src/tools/drawTools/vtoolheight.cpp +++ b/src/tools/drawTools/vtoolheight.cpp @@ -33,11 +33,11 @@ const QString VToolHeight::ToolType = QStringLiteral("height"); VToolHeight::VToolHeight(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const quint32 &basePointId, const quint32 &p1LineId, const quint32 &p2LineId, - const Tool::Sources &typeCreation, QGraphicsItem * parent) + const Valentina::Sources &typeCreation, QGraphicsItem * parent) :VToolLinePoint(doc, data, id, typeLine, QString(), basePointId, 0, parent), p1LineId(p1LineId), p2LineId(p2LineId) { ignoreFullUpdate = true; - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { AddToFile(); } @@ -73,13 +73,13 @@ void VToolHeight::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern quint32 p1LineId = dialogTool->getP1LineId(); quint32 p2LineId = dialogTool->getP2LineId(); Create(0, pointName, typeLine, basePointId, p1LineId, p2LineId, 5, 10, scene, doc, data, - Document::FullParse, Tool::FromGui); + Document::FullParse, Valentina::FromGui); } void VToolHeight::Create(const quint32 _id, const QString &pointName, const QString &typeLine, const quint32 &basePointId, const quint32 &p1LineId, const quint32 &p2LineId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, - VContainer *data, const Document::Documents &parse, const Tool::Sources &typeCreation) + VContainer *data, const Document::Documents &parse, const Valentina::Sources &typeCreation) { const VPointF *basePoint = data->GeometricObject(basePointId); const VPointF *p1Line = data->GeometricObject(p1LineId); @@ -87,7 +87,7 @@ void VToolHeight::Create(const quint32 _id, const QString &pointName, const QStr QPointF pHeight = FindPoint(QLineF(p1Line->toQPointF(), p2Line->toQPointF()), basePoint->toQPointF()); quint32 id = _id; - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { id = data->AddGObject(new VPointF(pHeight.x(), pHeight.y(), pointName, mx, my)); data->AddLine(basePointId, id); @@ -105,7 +105,7 @@ void VToolHeight::Create(const quint32 _id, const QString &pointName, const QStr doc->UpdateToolData(id, data); } } - VDrawTool::AddRecord(id, Tool::Height, doc); + VDrawTool::AddRecord(id, Valentina::Height, doc); if (parse == Document::FullParse) { VToolHeight *point = new VToolHeight(doc, data, id, typeLine, basePointId, p1LineId, p2LineId, diff --git a/src/tools/drawTools/vtoolheight.h b/src/tools/drawTools/vtoolheight.h index 5adb588b1..ce1105806 100644 --- a/src/tools/drawTools/vtoolheight.h +++ b/src/tools/drawTools/vtoolheight.h @@ -52,7 +52,7 @@ public: */ VToolHeight(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const quint32 &basePointId, const quint32 &p1LineId, const quint32 &p2LineId, - const Tool::Sources &typeCreation, QGraphicsItem * parent = nullptr); + const Valentina::Sources &typeCreation, QGraphicsItem * parent = nullptr); /** * @brief setDialog set dialog when user want change tool option. */ @@ -84,7 +84,7 @@ public: static void Create(const quint32 _id, const QString &pointName, const QString &typeLine, const quint32 &basePointId, const quint32 &p1LineId, const quint32 &p2LineId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, - VContainer *data, const Document::Documents &parse, const Tool::Sources &typeCreation); + VContainer *data, const Document::Documents &parse, const Valentina::Sources &typeCreation); /** * @brief FindPoint find projection base point onto line. * @param line line diff --git a/src/tools/drawTools/vtoolline.cpp b/src/tools/drawTools/vtoolline.cpp index 938855141..b1a768007 100644 --- a/src/tools/drawTools/vtoolline.cpp +++ b/src/tools/drawTools/vtoolline.cpp @@ -32,7 +32,7 @@ const QString VToolLine::TagName = QStringLiteral("line"); VToolLine::VToolLine(VPattern *doc, VContainer *data, quint32 id, quint32 firstPoint, quint32 secondPoint, - const QString &typeLine, const Tool::Sources &typeCreation, QGraphicsItem *parent) + const QString &typeLine, const Valentina::Sources &typeCreation, QGraphicsItem *parent) :VDrawTool(doc, data, id), QGraphicsLineItem(parent), firstPoint(firstPoint), secondPoint(secondPoint) { this->typeLine = typeLine; @@ -47,7 +47,7 @@ VToolLine::VToolLine(VPattern *doc, VContainer *data, quint32 id, quint32 firstP this->setAcceptHoverEvents(true); this->setPen(QPen(Qt::black, toPixel(widthHairLine)/factor, LineStyle())); - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { AddToFile(); } @@ -75,18 +75,18 @@ void VToolLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern * quint32 firstPoint = dialogTool->getFirstPoint(); quint32 secondPoint = dialogTool->getSecondPoint(); QString typeLine = dialogTool->getTypeLine(); - Create(0, firstPoint, secondPoint, typeLine, scene, doc, data, Document::FullParse, Tool::FromGui); + Create(0, firstPoint, secondPoint, typeLine, scene, doc, data, Document::FullParse, Valentina::FromGui); } void VToolLine::Create(const quint32 &_id, const quint32 &firstPoint, const quint32 &secondPoint, const QString &typeLine, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, - const Document::Documents &parse, const Tool::Sources &typeCreation) + const Document::Documents &parse, const Valentina::Sources &typeCreation) { Q_CHECK_PTR(scene); Q_CHECK_PTR(doc); Q_CHECK_PTR(data); quint32 id = _id; - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { id = data->getNextId(); data->AddLine(firstPoint, secondPoint); @@ -100,7 +100,7 @@ void VToolLine::Create(const quint32 &_id, const quint32 &firstPoint, const quin doc->UpdateToolData(id, data); } } - VDrawTool::AddRecord(id, Tool::LineTool, doc); + VDrawTool::AddRecord(id, Valentina::LineTool, doc); if (parse == Document::FullParse) { VToolLine *line = new VToolLine(doc, data, id, firstPoint, secondPoint, typeLine, typeCreation); diff --git a/src/tools/drawTools/vtoolline.h b/src/tools/drawTools/vtoolline.h index d1e8fc74d..be951fb59 100644 --- a/src/tools/drawTools/vtoolline.h +++ b/src/tools/drawTools/vtoolline.h @@ -52,7 +52,7 @@ public: * @param parent parent object. */ VToolLine(VPattern *doc, VContainer *data, quint32 id, quint32 firstPoint, - quint32 secondPoint, const QString &typeLine, const Tool::Sources &typeCreation, + quint32 secondPoint, const QString &typeLine, const Valentina::Sources &typeCreation, QGraphicsItem * parent = nullptr); /** * @brief setDialog set dialog when user want change tool option. @@ -80,7 +80,7 @@ public: */ static void Create(const quint32 &_id, const quint32 &firstPoint, const quint32 &secondPoint, const QString &typeLine, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, - const Document::Documents &parse, const Tool::Sources &typeCreation); + const Document::Documents &parse, const Valentina::Sources &typeCreation); static const QString TagName; public slots: /** diff --git a/src/tools/drawTools/vtoollineintersect.cpp b/src/tools/drawTools/vtoollineintersect.cpp index d6ec5cc8f..7688e8414 100644 --- a/src/tools/drawTools/vtoollineintersect.cpp +++ b/src/tools/drawTools/vtoollineintersect.cpp @@ -33,13 +33,13 @@ const QString VToolLineIntersect::ToolType = QStringLiteral("lineIntersect"); VToolLineIntersect::VToolLineIntersect(VPattern *doc, VContainer *data, const quint32 &id, const quint32 &p1Line1, const quint32 &p2Line1, const quint32 &p1Line2, - const quint32 &p2Line2, const Tool::Sources &typeCreation, + const quint32 &p2Line2, const Valentina::Sources &typeCreation, QGraphicsItem *parent) :VToolPoint(doc, data, id, parent), p1Line1(p1Line1), p2Line1(p2Line1), p1Line2(p1Line2), p2Line2(p2Line2) { ignoreFullUpdate = true; - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { AddToFile(); } @@ -73,14 +73,14 @@ void VToolLineIntersect::Create(DialogTool *dialog, VMainGraphicsScene *scene, V quint32 p2Line2Id = dialogTool->getP2Line2(); QString pointName = dialogTool->getPointName(); Create(0, p1Line1Id, p2Line1Id, p1Line2Id, p2Line2Id, pointName, 5, 10, scene, doc, data, - Document::FullParse, Tool::FromGui); + Document::FullParse, Valentina::FromGui); } void VToolLineIntersect::Create(const quint32 _id, const quint32 &p1Line1Id, const quint32 &p2Line1Id, const quint32 &p1Line2Id, const quint32 &p2Line2Id, const QString &pointName, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document::Documents &parse, - const Tool::Sources &typeCreation) + const Valentina::Sources &typeCreation) { const VPointF *p1Line1 = data->GeometricObject(p1Line1Id); const VPointF *p2Line1 = data->GeometricObject(p2Line1Id); @@ -94,7 +94,7 @@ void VToolLineIntersect::Create(const quint32 _id, const quint32 &p1Line1Id, con if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection) { quint32 id = _id; - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { id = data->AddGObject(new VPointF(fPoint.x(), fPoint.y(), pointName, mx, my)); data->AddLine(p1Line1Id, id); @@ -114,7 +114,7 @@ void VToolLineIntersect::Create(const quint32 _id, const quint32 &p1Line1Id, con doc->UpdateToolData(id, data); } } - VDrawTool::AddRecord(id, Tool::LineIntersectTool, doc); + VDrawTool::AddRecord(id, Valentina::LineIntersectTool, doc); if (parse == Document::FullParse) { VToolLineIntersect *point = new VToolLineIntersect(doc, data, id, p1Line1Id, p2Line1Id, p1Line2Id, diff --git a/src/tools/drawTools/vtoollineintersect.h b/src/tools/drawTools/vtoollineintersect.h index 00fb946f8..521458048 100644 --- a/src/tools/drawTools/vtoollineintersect.h +++ b/src/tools/drawTools/vtoollineintersect.h @@ -52,7 +52,7 @@ public: */ VToolLineIntersect(VPattern *doc, VContainer *data, const quint32 &id, const quint32 &p1Line1, const quint32 &p2Line1, const quint32 &p1Line2, const quint32 &p2Line2, - const Tool::Sources &typeCreation, QGraphicsItem * parent = nullptr); + const Valentina::Sources &typeCreation, QGraphicsItem * parent = nullptr); /** * @brief setDialog set dialog when user want change tool option. */ @@ -84,7 +84,7 @@ public: static void Create(const quint32 _id, const quint32 &p1Line1Id, const quint32 &p2Line1Id, const quint32 &p1Line2Id, const quint32 &p2Line2Id, const QString &pointName, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, - const Document::Documents &parse, const Tool::Sources &typeCreation); + const Document::Documents &parse, const Valentina::Sources &typeCreation); static const QString ToolType; public slots: /** diff --git a/src/tools/drawTools/vtoolnormal.cpp b/src/tools/drawTools/vtoolnormal.cpp index bcc9f0eb0..03edae31f 100644 --- a/src/tools/drawTools/vtoolnormal.cpp +++ b/src/tools/drawTools/vtoolnormal.cpp @@ -34,12 +34,12 @@ const QString VToolNormal::ToolType = QStringLiteral("normal"); VToolNormal::VToolNormal(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &formula, const qreal &angle, const quint32 &firstPointId, - const quint32 &secondPointId, const Tool::Sources &typeCreation, QGraphicsItem *parent) + const quint32 &secondPointId, const Valentina::Sources &typeCreation, QGraphicsItem *parent) :VToolLinePoint(doc, data, id, typeLine, formula, firstPointId, angle, parent), secondPointId(secondPointId) { - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { AddToFile(); } @@ -75,14 +75,14 @@ void VToolNormal::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern QString pointName = dialogTool->getPointName(); qreal angle = dialogTool->getAngle(); Create(0, formula, firstPointId, secondPointId, typeLine, pointName, angle, 5, 10, scene, doc, data, - Document::FullParse, Tool::FromGui); + Document::FullParse, Valentina::FromGui); } void VToolNormal::Create(const quint32 _id, const QString &formula, const quint32 &firstPointId, const quint32 &secondPointId, const QString &typeLine, const QString &pointName, const qreal angle, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document::Documents &parse, - const Tool::Sources &typeCreation) + const Valentina::Sources &typeCreation) { const VPointF *firstPoint = data->GeometricObject(firstPointId); const VPointF *secondPoint = data->GeometricObject(secondPointId); @@ -94,7 +94,7 @@ void VToolNormal::Create(const quint32 _id, const QString &formula, const quint3 QPointF fPoint = VToolNormal::FindPoint(firstPoint->toQPointF(), secondPoint->toQPointF(), toPixel(result), angle); quint32 id = _id; - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { id = data->AddGObject(new VPointF(fPoint.x(), fPoint.y(), pointName, mx, my)); data->AddLine(firstPointId, id); @@ -108,7 +108,7 @@ void VToolNormal::Create(const quint32 _id, const QString &formula, const quint3 doc->UpdateToolData(id, data); } } - VDrawTool::AddRecord(id, Tool::NormalTool, doc); + VDrawTool::AddRecord(id, Valentina::NormalTool, doc); if (parse == Document::FullParse) { VToolNormal *point = new VToolNormal(doc, data, id, typeLine, formula, angle, diff --git a/src/tools/drawTools/vtoolnormal.h b/src/tools/drawTools/vtoolnormal.h index dc6241e68..da1d0170b 100644 --- a/src/tools/drawTools/vtoolnormal.h +++ b/src/tools/drawTools/vtoolnormal.h @@ -53,7 +53,7 @@ public: */ VToolNormal(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &formula, const qreal &angle, const quint32 &firstPointId, - const quint32 &secondPointId, const Tool::Sources &typeCreation, + const quint32 &secondPointId, const Valentina::Sources &typeCreation, QGraphicsItem * parent = nullptr); /** * @brief setDialog set dialog when user want change tool option. @@ -88,7 +88,7 @@ public: const quint32 &secondPointId, const QString &typeLine, const QString &pointName, const qreal angle, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document::Documents &parse, - const Tool::Sources &typeCreation); + const Valentina::Sources &typeCreation); /** * @brief FindPoint return normal point. * @param firstPoint first line point. diff --git a/src/tools/drawTools/vtoolpoint.cpp b/src/tools/drawTools/vtoolpoint.cpp index 4b63db3b8..8ab589871 100644 --- a/src/tools/drawTools/vtoolpoint.cpp +++ b/src/tools/drawTools/vtoolpoint.cpp @@ -113,7 +113,7 @@ void VToolPoint::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { if (event->button() == Qt::LeftButton) { - emit ChoosedTool(id, Scene::Point); + emit ChoosedTool(id, Valentina::Point); } QGraphicsItem::mouseReleaseEvent(event); } diff --git a/src/tools/drawTools/vtoolpointofcontact.cpp b/src/tools/drawTools/vtoolpointofcontact.cpp index 0791d4dfd..d72235f0a 100644 --- a/src/tools/drawTools/vtoolpointofcontact.cpp +++ b/src/tools/drawTools/vtoolpointofcontact.cpp @@ -35,11 +35,11 @@ const QString VToolPointOfContact::ToolType = QStringLiteral("pointOfContact"); VToolPointOfContact::VToolPointOfContact(VPattern *doc, VContainer *data, const quint32 &id, const QString &radius, const quint32 ¢er, const quint32 &firstPointId, const quint32 &secondPointId, - const Tool::Sources &typeCreation, QGraphicsItem *parent) + const Valentina::Sources &typeCreation, QGraphicsItem *parent) : VToolPoint(doc, data, id, parent), arcRadius(radius), center(center), firstPointId(firstPointId), secondPointId(secondPointId) { - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { AddToFile(); } @@ -99,14 +99,14 @@ void VToolPointOfContact::Create(DialogTool *dialog, VMainGraphicsScene *scene, quint32 secondPointId = dialogTool->getSecondPoint(); QString pointName = dialogTool->getPointName(); Create(0, radius, center, firstPointId, secondPointId, pointName, 5, 10, scene, doc, data, - Document::FullParse, Tool::FromGui); + Document::FullParse, Valentina::FromGui); } void VToolPointOfContact::Create(const quint32 _id, const QString &radius, const quint32 ¢er, const quint32 &firstPointId, const quint32 &secondPointId, const QString &pointName, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, - const Document::Documents &parse, const Tool::Sources &typeCreation) + const Document::Documents &parse, const Valentina::Sources &typeCreation) { const VPointF *centerP = data->GeometricObject(center); const VPointF *firstP = data->GeometricObject(firstPointId); @@ -120,7 +120,7 @@ void VToolPointOfContact::Create(const quint32 _id, const QString &radius, const QPointF fPoint = VToolPointOfContact::FindPoint(toPixel(result), centerP->toQPointF(), firstP->toQPointF(), secondP->toQPointF()); quint32 id = _id; - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { id = data->AddGObject(new VPointF(fPoint.x(), fPoint.y(), pointName, mx, my)); data->AddLine(firstPointId, id); @@ -138,7 +138,7 @@ void VToolPointOfContact::Create(const quint32 _id, const QString &radius, const doc->UpdateToolData(id, data); } } - VDrawTool::AddRecord(id, Tool::PointOfContact, doc); + VDrawTool::AddRecord(id, Valentina::PointOfContact, doc); if (parse == Document::FullParse) { VToolPointOfContact *point = new VToolPointOfContact(doc, data, id, radius, center, diff --git a/src/tools/drawTools/vtoolpointofcontact.h b/src/tools/drawTools/vtoolpointofcontact.h index 76d0d90b7..0199dbdba 100644 --- a/src/tools/drawTools/vtoolpointofcontact.h +++ b/src/tools/drawTools/vtoolpointofcontact.h @@ -52,7 +52,7 @@ public: VToolPointOfContact(VPattern *doc, VContainer *data, const quint32 &id, const QString &arcRadius, const quint32 ¢er, const quint32 &firstPointId, const quint32 &secondPointId, - const Tool::Sources &typeCreation, QGraphicsItem * parent = nullptr); + const Valentina::Sources &typeCreation, QGraphicsItem * parent = nullptr); /** * @brief setDialog set dialog when user want change tool option. */ @@ -94,7 +94,7 @@ public: static void Create(const quint32 _id, const QString &arcRadius, const quint32 ¢er, const quint32 &firstPointId, const quint32 &secondPointId, const QString &pointName, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, - VContainer *data, const Document::Documents &parse, const Tool::Sources &typeCreation); + VContainer *data, const Document::Documents &parse, const Valentina::Sources &typeCreation); static const QString ToolType; public slots: /** diff --git a/src/tools/drawTools/vtoolpointofintersection.cpp b/src/tools/drawTools/vtoolpointofintersection.cpp index 6744f1d6f..1fe8457a5 100644 --- a/src/tools/drawTools/vtoolpointofintersection.cpp +++ b/src/tools/drawTools/vtoolpointofintersection.cpp @@ -33,11 +33,11 @@ const QString VToolPointOfIntersection::ToolType = QStringLiteral("pointOfInters VToolPointOfIntersection::VToolPointOfIntersection(VPattern *doc, VContainer *data, const quint32 &id, const quint32 &firstPointId, const quint32 &secondPointId, - const Tool::Sources &typeCreation, QGraphicsItem *parent) + const Valentina::Sources &typeCreation, QGraphicsItem *parent) :VToolPoint(doc, data, id, parent), firstPointId(firstPointId), secondPointId(secondPointId) { ignoreFullUpdate = true; - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { AddToFile(); } @@ -67,20 +67,20 @@ void VToolPointOfIntersection::Create(DialogTool *dialog, VMainGraphicsScene *sc quint32 firstPointId = dialogTool->getFirstPointId(); quint32 secondPointId = dialogTool->getSecondPointId(); QString pointName = dialogTool->getPointName(); - Create(0, pointName, firstPointId, secondPointId, 5, 10, scene, doc, data, Document::FullParse, Tool::FromGui); + Create(0, pointName, firstPointId, secondPointId, 5, 10, scene, doc, data, Document::FullParse, Valentina::FromGui); } void VToolPointOfIntersection::Create(const quint32 _id, const QString &pointName, const quint32 &firstPointId, const quint32 &secondPointId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, - const Document::Documents &parse, const Tool::Sources &typeCreation) + const Document::Documents &parse, const Valentina::Sources &typeCreation) { const VPointF *firstPoint = data->GeometricObject(firstPointId); const VPointF *secondPoint = data->GeometricObject(secondPointId); QPointF point(firstPoint->x(), secondPoint->y()); quint32 id = _id; - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { id = data->AddGObject(new VPointF(point.x(), point.y(), pointName, mx, my)); } @@ -92,7 +92,7 @@ void VToolPointOfIntersection::Create(const quint32 _id, const QString &pointNam doc->UpdateToolData(id, data); } } - VDrawTool::AddRecord(id, Tool::PointOfIntersection, doc); + VDrawTool::AddRecord(id, Valentina::PointOfIntersection, doc); if (parse == Document::FullParse) { VToolPointOfIntersection *point = new VToolPointOfIntersection(doc, data, id, firstPointId, diff --git a/src/tools/drawTools/vtoolpointofintersection.h b/src/tools/drawTools/vtoolpointofintersection.h index d6df58072..89fc26709 100644 --- a/src/tools/drawTools/vtoolpointofintersection.h +++ b/src/tools/drawTools/vtoolpointofintersection.h @@ -50,7 +50,7 @@ public: */ VToolPointOfIntersection(VPattern *doc, VContainer *data, const quint32 &id, const quint32 &firstPointId, const quint32 &secondPointId, - const Tool::Sources &typeCreation, QGraphicsItem * parent = nullptr); + const Valentina::Sources &typeCreation, QGraphicsItem * parent = nullptr); /** * @brief setDialog set dialog when user want change tool option. */ @@ -80,7 +80,7 @@ public: static void Create(const quint32 _id, const QString &pointName, const quint32 &firstPointId, const quint32 &secondPointId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document::Documents &parse, - const Tool::Sources &typeCreation); + const Valentina::Sources &typeCreation); static const QString ToolType; public slots: /** diff --git a/src/tools/drawTools/vtoolshoulderpoint.cpp b/src/tools/drawTools/vtoolshoulderpoint.cpp index 4f137473d..1c35b3d40 100644 --- a/src/tools/drawTools/vtoolshoulderpoint.cpp +++ b/src/tools/drawTools/vtoolshoulderpoint.cpp @@ -34,11 +34,11 @@ const QString VToolShoulderPoint::ToolType = QStringLiteral("shoulder"); VToolShoulderPoint::VToolShoulderPoint(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &formula, const quint32 &p1Line, const quint32 &p2Line, - const quint32 &pShoulder, const Tool::Sources &typeCreation, + const quint32 &pShoulder, const Valentina::Sources &typeCreation, QGraphicsItem * parent) :VToolLinePoint(doc, data, id, typeLine, formula, p1Line, 0, parent), p2Line(p2Line), pShoulder(pShoulder) { - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { AddToFile(); } @@ -101,14 +101,14 @@ void VToolShoulderPoint::Create(DialogTool *dialog, VMainGraphicsScene *scene, V QString typeLine = dialogTool->getTypeLine(); QString pointName = dialogTool->getPointName(); Create(0, formula, p1Line, p2Line, pShoulder, typeLine, pointName, 5, 10, scene, doc, data, - Document::FullParse, Tool::FromGui); + Document::FullParse, Valentina::FromGui); } void VToolShoulderPoint::Create(const quint32 _id, const QString &formula, const quint32 &p1Line, const quint32 &p2Line, const quint32 &pShoulder, const QString &typeLine, const QString &pointName, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, - const Document::Documents &parse, const Tool::Sources &typeCreation) + const Document::Documents &parse, const Valentina::Sources &typeCreation) { const VPointF *firstPoint = data->GeometricObject(p1Line); const VPointF *secondPoint = data->GeometricObject(p2Line); @@ -122,7 +122,7 @@ void VToolShoulderPoint::Create(const quint32 _id, const QString &formula, const QPointF fPoint = VToolShoulderPoint::FindPoint(firstPoint->toQPointF(), secondPoint->toQPointF(), shoulderPoint->toQPointF(), toPixel(result)); quint32 id = _id; - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { id = data->AddGObject(new VPointF(fPoint.x(), fPoint.y(), pointName, mx, my)); data->AddLine(p1Line, id); @@ -138,7 +138,7 @@ void VToolShoulderPoint::Create(const quint32 _id, const QString &formula, const doc->UpdateToolData(id, data); } } - VDrawTool::AddRecord(id, Tool::ShoulderPointTool, doc); + VDrawTool::AddRecord(id, Valentina::ShoulderPointTool, doc); if (parse == Document::FullParse) { VToolShoulderPoint *point = new VToolShoulderPoint(doc, data, id, typeLine, formula, diff --git a/src/tools/drawTools/vtoolshoulderpoint.h b/src/tools/drawTools/vtoolshoulderpoint.h index 2de3803be..8885dc8d6 100644 --- a/src/tools/drawTools/vtoolshoulderpoint.h +++ b/src/tools/drawTools/vtoolshoulderpoint.h @@ -53,7 +53,7 @@ public: */ VToolShoulderPoint(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &formula, const quint32 &p1Line, const quint32 &p2Line, - const quint32 &pShoulder, const Tool::Sources &typeCreation, + const quint32 &pShoulder, const Valentina::Sources &typeCreation, QGraphicsItem * parent = nullptr); /** * @brief setDialog set dialog when user want change tool option. @@ -97,7 +97,7 @@ public: static void Create(const quint32 _id, const QString &formula, const quint32 &p1Line, const quint32 &p2Line, const quint32 &pShoulder, const QString &typeLine, const QString &pointName, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, - const Document::Documents &parse, const Tool::Sources &typeCreation); + const Document::Documents &parse, const Valentina::Sources &typeCreation); static const QString ToolType; public slots: /** diff --git a/src/tools/drawTools/vtoolsinglepoint.cpp b/src/tools/drawTools/vtoolsinglepoint.cpp index a475a1f64..4447f1fa7 100644 --- a/src/tools/drawTools/vtoolsinglepoint.cpp +++ b/src/tools/drawTools/vtoolsinglepoint.cpp @@ -31,7 +31,7 @@ const QString VToolSinglePoint::ToolType = QStringLiteral("single"); -VToolSinglePoint::VToolSinglePoint (VPattern *doc, VContainer *data, quint32 id, const Tool::Sources &typeCreation, +VToolSinglePoint::VToolSinglePoint (VPattern *doc, VContainer *data, quint32 id, const Valentina::Sources &typeCreation, QGraphicsItem * parent ) :VToolPoint(doc, data, id, parent) { @@ -42,7 +42,7 @@ VToolSinglePoint::VToolSinglePoint (VPattern *doc, VContainer *data, quint32 id, this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); this->setFlag(QGraphicsItem::ItemIsFocusable, false); setColorLabel(Qt::black); - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { AddToFile(); } diff --git a/src/tools/drawTools/vtoolsinglepoint.h b/src/tools/drawTools/vtoolsinglepoint.h index c869e81f6..90fbfbd67 100644 --- a/src/tools/drawTools/vtoolsinglepoint.h +++ b/src/tools/drawTools/vtoolsinglepoint.h @@ -47,7 +47,7 @@ public: * @param typeCreation way we create this tool. * @param parent parent object. */ - VToolSinglePoint (VPattern *doc, VContainer *data, quint32 id, const Tool::Sources &typeCreation, + VToolSinglePoint (VPattern *doc, VContainer *data, quint32 id, const Valentina::Sources &typeCreation, QGraphicsItem * parent = nullptr ); /** * @brief setDialog set dialog when user want change tool option. diff --git a/src/tools/drawTools/vtoolspline.cpp b/src/tools/drawTools/vtoolspline.cpp index 09fbf4381..b3db920ea 100644 --- a/src/tools/drawTools/vtoolspline.cpp +++ b/src/tools/drawTools/vtoolspline.cpp @@ -32,7 +32,7 @@ const QString VToolSpline::ToolType = QStringLiteral("simple"); -VToolSpline::VToolSpline(VPattern *doc, VContainer *data, quint32 id, const Tool::Sources &typeCreation, +VToolSpline::VToolSpline(VPattern *doc, VContainer *data, quint32 id, const Valentina::Sources &typeCreation, QGraphicsItem *parent) :VAbstractSpline(doc, data, id, parent) { const VSpline *spl = data->GeometricObject(id); @@ -61,7 +61,7 @@ VToolSpline::VToolSpline(VPattern *doc, VContainer *data, quint32 id, const Tool connect(this, &VToolSpline::setEnabledPoint, controlPoint2, &VControlPointSpline::setEnabledPoint); controlPoints.append(controlPoint2); - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { AddToFile(); } @@ -100,19 +100,19 @@ void VToolSpline::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern qreal angle2 = dialogTool->getAngle2(); qreal kCurve = dialogTool->getKCurve(); Create(0, p1, p4, kAsm1, kAsm2, angle1, angle2, kCurve, scene, doc, data, Document::FullParse, - Tool::FromGui); + Valentina::FromGui); } void VToolSpline::Create(const quint32 _id, const quint32 &p1, const quint32 &p4, const qreal &kAsm1, const qreal kAsm2, const qreal &angle1, const qreal &angle2, const qreal &kCurve, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, - const Document::Documents &parse, const Tool::Sources &typeCreation) + const Document::Documents &parse, const Valentina::Sources &typeCreation) { VPointF point1 = *data->GeometricObject(p1); VPointF point4 = *data->GeometricObject(p4); VSpline *spline = new VSpline(point1, point4, angle1, angle2, kAsm1, kAsm2, kCurve); quint32 id = _id; - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { id = data->AddGObject(spline); data->AddLengthSpline(spline->name(), toMM(spline->GetLength())); @@ -126,7 +126,7 @@ void VToolSpline::Create(const quint32 _id, const quint32 &p1, const quint32 &p4 doc->UpdateToolData(id, data); } } - VDrawTool::AddRecord(id, Tool::SplineTool, doc); + VDrawTool::AddRecord(id, Valentina::SplineTool, doc); if (parse == Document::FullParse) { VToolSpline *spl = new VToolSpline(doc, data, id, typeCreation); @@ -209,7 +209,7 @@ void VToolSpline::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { if (event->button() == Qt::LeftButton) { - emit ChoosedTool(id, Scene::Spline); + emit ChoosedTool(id, Valentina::Spline); } QGraphicsItem::mouseReleaseEvent(event); } diff --git a/src/tools/drawTools/vtoolspline.h b/src/tools/drawTools/vtoolspline.h index ead416779..1f42f5060 100644 --- a/src/tools/drawTools/vtoolspline.h +++ b/src/tools/drawTools/vtoolspline.h @@ -47,7 +47,7 @@ public: * @param typeCreation way we create this tool. * @param parent parent object. */ - VToolSpline (VPattern *doc, VContainer *data, quint32 id, const Tool::Sources &typeCreation, + VToolSpline (VPattern *doc, VContainer *data, quint32 id, const Valentina::Sources &typeCreation, QGraphicsItem * parent = nullptr ); /** * @brief setDialog set dialog when user want change tool option. @@ -80,7 +80,7 @@ public: static void Create(const quint32 _id, const quint32 &p1, const quint32 &p4, const qreal &kAsm1, const qreal kAsm2, const qreal &angle1, const qreal &angle2, const qreal &kCurve, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, - const Document::Documents &parse, const Tool::Sources &typeCreation); + const Document::Documents &parse, const Valentina::Sources &typeCreation); static const QString ToolType; public slots: /** diff --git a/src/tools/drawTools/vtoolsplinepath.cpp b/src/tools/drawTools/vtoolsplinepath.cpp index 3f4df7ef0..b5aaf2378 100644 --- a/src/tools/drawTools/vtoolsplinepath.cpp +++ b/src/tools/drawTools/vtoolsplinepath.cpp @@ -31,7 +31,7 @@ const QString VToolSplinePath::ToolType = QStringLiteral("path"); -VToolSplinePath::VToolSplinePath(VPattern *doc, VContainer *data, quint32 id, const Tool::Sources &typeCreation, +VToolSplinePath::VToolSplinePath(VPattern *doc, VContainer *data, quint32 id, const Valentina::Sources &typeCreation, QGraphicsItem *parent) :VAbstractSpline(doc, data, id, parent) { const VSplinePath *splPath = data->GeometricObject(id); @@ -62,7 +62,7 @@ VToolSplinePath::VToolSplinePath(VPattern *doc, VContainer *data, quint32 id, co connect(this, &VToolSplinePath::setEnabledPoint, controlPoint, &VControlPointSpline::setEnabledPoint); controlPoints.append(controlPoint); } - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { AddToFile(); } @@ -91,15 +91,15 @@ void VToolSplinePath::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPat { doc->IncrementReferens((*path)[i].P().id()); } - Create(0, path, scene, doc, data, Document::FullParse, Tool::FromGui); + Create(0, path, scene, doc, data, Document::FullParse, Valentina::FromGui); } void VToolSplinePath::Create(const quint32 _id, VSplinePath *path, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document::Documents &parse, - const Tool::Sources &typeCreation) + const Valentina::Sources &typeCreation) { quint32 id = _id; - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { id = data->AddGObject(path); data->AddLengthSpline(path->name(), toMM(path->GetLength())); @@ -113,7 +113,7 @@ void VToolSplinePath::Create(const quint32 _id, VSplinePath *path, VMainGraphics doc->UpdateToolData(id, data); } } - VDrawTool::AddRecord(id, Tool::SplinePathTool, doc); + VDrawTool::AddRecord(id, Valentina::SplinePathTool, doc); if (parse == Document::FullParse) { VToolSplinePath *spl = new VToolSplinePath(doc, data, id, typeCreation); @@ -256,7 +256,7 @@ void VToolSplinePath::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { if (event->button() == Qt::LeftButton) { - emit ChoosedTool(id, Scene::SplinePath); + emit ChoosedTool(id, Valentina::SplinePath); } QGraphicsItem::mouseReleaseEvent(event); } diff --git a/src/tools/drawTools/vtoolsplinepath.h b/src/tools/drawTools/vtoolsplinepath.h index ab009fbcc..4e7ca8358 100644 --- a/src/tools/drawTools/vtoolsplinepath.h +++ b/src/tools/drawTools/vtoolsplinepath.h @@ -46,7 +46,7 @@ public: * @param typeCreation way we create this tool. * @param parent parent object. */ - VToolSplinePath(VPattern *doc, VContainer *data, quint32 id, const Tool::Sources &typeCreation, + VToolSplinePath(VPattern *doc, VContainer *data, quint32 id, const Valentina::Sources &typeCreation, QGraphicsItem * parent = nullptr); /** * @brief setDialog set dialog when user want change tool option. @@ -72,7 +72,7 @@ public: */ static void Create(const quint32 _id, VSplinePath *path, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document::Documents &parse, - const Tool::Sources &typeCreation); + const Valentina::Sources &typeCreation); static const QString ToolType; signals: /** diff --git a/src/tools/drawTools/vtooltriangle.cpp b/src/tools/drawTools/vtooltriangle.cpp index 1e86786ee..9529d0d7c 100644 --- a/src/tools/drawTools/vtooltriangle.cpp +++ b/src/tools/drawTools/vtooltriangle.cpp @@ -33,12 +33,12 @@ const QString VToolTriangle::ToolType = QStringLiteral("triangle"); VToolTriangle::VToolTriangle(VPattern *doc, VContainer *data, const quint32 &id, const quint32 &axisP1Id, const quint32 &axisP2Id, const quint32 &firstPointId, - const quint32 &secondPointId, const Tool::Sources &typeCreation, QGraphicsItem *parent) + const quint32 &secondPointId, const Valentina::Sources &typeCreation, QGraphicsItem *parent) :VToolPoint(doc, data, id, parent), axisP1Id(axisP1Id), axisP2Id(axisP2Id), firstPointId(firstPointId), secondPointId(secondPointId) { ignoreFullUpdate = true; - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { AddToFile(); } @@ -73,13 +73,13 @@ void VToolTriangle::Create(DialogTool *dialog, VMainGraphicsScene *scene, quint32 secondPointId = dialogTool->getSecondPointId(); QString pointName = dialogTool->getPointName(); Create(0, pointName, axisP1Id, axisP2Id, firstPointId, secondPointId, 5, 10, scene, doc, data, - Document::FullParse, Tool::FromGui); + Document::FullParse, Valentina::FromGui); } void VToolTriangle::Create(const quint32 _id, const QString &pointName, const quint32 &axisP1Id, const quint32 &axisP2Id, const quint32 &firstPointId, const quint32 &secondPointId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, - VContainer *data, const Document::Documents &parse, const Tool::Sources &typeCreation) + VContainer *data, const Document::Documents &parse, const Valentina::Sources &typeCreation) { const VPointF *axisP1 = data->GeometricObject(axisP1Id); const VPointF *axisP2 = data->GeometricObject(axisP2Id); @@ -89,7 +89,7 @@ void VToolTriangle::Create(const quint32 _id, const QString &pointName, const qu QPointF point = FindPoint(axisP1->toQPointF(), axisP2->toQPointF(), firstPoint->toQPointF(), secondPoint->toQPointF()); quint32 id = _id; - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { id = data->AddGObject(new VPointF(point.x(), point.y(), pointName, mx, my)); } @@ -101,7 +101,7 @@ void VToolTriangle::Create(const quint32 _id, const QString &pointName, const qu doc->UpdateToolData(id, data); } } - VDrawTool::AddRecord(id, Tool::Triangle, doc); + VDrawTool::AddRecord(id, Valentina::Triangle, doc); if (parse == Document::FullParse) { VToolTriangle *point = new VToolTriangle(doc, data, id, axisP1Id, axisP2Id, firstPointId, diff --git a/src/tools/drawTools/vtooltriangle.h b/src/tools/drawTools/vtooltriangle.h index ffdb63e30..7495e3b3c 100644 --- a/src/tools/drawTools/vtooltriangle.h +++ b/src/tools/drawTools/vtooltriangle.h @@ -52,7 +52,7 @@ public: */ VToolTriangle(VPattern *doc, VContainer *data, const quint32 &id, const quint32 &axisP1Id, const quint32 &axisP2Id, const quint32 &firstPointId, const quint32 &secondPointId, - const Tool::Sources &typeCreation, QGraphicsItem * parent = nullptr); + const Valentina::Sources &typeCreation, QGraphicsItem * parent = nullptr); /** * @brief setDialog set dialog when user want change tool option. */ @@ -84,7 +84,7 @@ public: static void Create(const quint32 _id, const QString &pointName, const quint32 &axisP1Id, const quint32 &axisP2Id, const quint32 &firstPointId, const quint32 &secondPointId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, - const Document::Documents &parse, const Tool::Sources &typeCreation); + const Document::Documents &parse, const Valentina::Sources &typeCreation); /** * @brief FindPoint find point intersection two foots right triangle. * @param axisP1 first axis point. diff --git a/src/tools/nodeDetails/vnodearc.cpp b/src/tools/nodeDetails/vnodearc.cpp index e2d55ef9f..bf3e69c78 100644 --- a/src/tools/nodeDetails/vnodearc.cpp +++ b/src/tools/nodeDetails/vnodearc.cpp @@ -33,14 +33,14 @@ const QString VNodeArc::TagName = QStringLiteral("arc"); const QString VNodeArc::ToolType = QStringLiteral("modeling"); -VNodeArc::VNodeArc(VPattern *doc, VContainer *data, quint32 id, quint32 idArc, const Tool::Sources &typeCreation, +VNodeArc::VNodeArc(VPattern *doc, VContainer *data, quint32 id, quint32 idArc, const Valentina::Sources &typeCreation, const quint32 &idTool, QObject *qoParent, QGraphicsItem *parent) :VAbstractNode(doc, data, id, idArc, idTool, qoParent), QGraphicsPathItem(parent) { RefreshGeometry(); this->setPen(QPen(baseColor, toPixel(widthHairLine))); - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { AddToFile(); } @@ -51,9 +51,9 @@ VNodeArc::VNodeArc(VPattern *doc, VContainer *data, quint32 id, quint32 idArc, c } void VNodeArc::Create(VPattern *doc, VContainer *data, quint32 id, quint32 idArc, const Document::Documents &parse, - const Tool::Sources &typeCreation, const quint32 &idTool, QObject *parent) + const Valentina::Sources &typeCreation, const quint32 &idTool, QObject *parent) { - VAbstractTool::AddRecord(id, Tool::NodeArc, doc); + VAbstractTool::AddRecord(id, Valentina::NodeArc, doc); if (parse == Document::FullParse) { VNodeArc *arc = new VNodeArc(doc, data, id, idArc, typeCreation, idTool, parent); @@ -120,7 +120,7 @@ void VNodeArc::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { if (event->button() == Qt::LeftButton) { - emit ChoosedTool(id, Scene::Arc); + emit ChoosedTool(id, Valentina::Arc); } QGraphicsItem::mouseReleaseEvent(event); } diff --git a/src/tools/nodeDetails/vnodearc.h b/src/tools/nodeDetails/vnodearc.h index 2564b429b..e548a2e5e 100644 --- a/src/tools/nodeDetails/vnodearc.h +++ b/src/tools/nodeDetails/vnodearc.h @@ -48,7 +48,7 @@ public: * @param typeCreation way we create this tool. * @param parent parent object. */ - VNodeArc(VPattern *doc, VContainer *data, quint32 id, quint32 idArc, const Tool::Sources &typeCreation, + VNodeArc(VPattern *doc, VContainer *data, quint32 id, quint32 idArc, const Valentina::Sources &typeCreation, const quint32 &idTool = 0, QObject *qoParent = nullptr, QGraphicsItem * parent = nullptr); /** * @brief Create help create tool. @@ -60,7 +60,7 @@ public: * @param typeCreation way we create this tool. */ static void Create(VPattern *doc, VContainer *data, quint32 id, quint32 idArc, const Document::Documents &parse, - const Tool::Sources &typeCreation, const quint32 &idTool = 0, QObject *parent = nullptr); + const Valentina::Sources &typeCreation, const quint32 &idTool = 0, QObject *parent = nullptr); static const QString TagName; static const QString ToolType; /** diff --git a/src/tools/nodeDetails/vnodepoint.cpp b/src/tools/nodeDetails/vnodepoint.cpp index cf21cc2e1..9928d87c9 100644 --- a/src/tools/nodeDetails/vnodepoint.cpp +++ b/src/tools/nodeDetails/vnodepoint.cpp @@ -34,7 +34,7 @@ const QString VNodePoint::TagName = QStringLiteral("point"); const QString VNodePoint::ToolType = QStringLiteral("modeling"); VNodePoint::VNodePoint(VPattern *doc, VContainer *data, quint32 id, quint32 idPoint, - const Tool::Sources &typeCreation, const quint32 &idTool, QObject *qoParent, + const Valentina::Sources &typeCreation, const quint32 &idTool, QObject *qoParent, QGraphicsItem *parent) :VAbstractNode(doc, data, id, idPoint, idTool, qoParent), QGraphicsEllipseItem(parent), radius(toPixel(1.5)), namePoint(nullptr), lineName(nullptr) @@ -48,7 +48,7 @@ VNodePoint::VNodePoint(VPattern *doc, VContainer *data, quint32 id, quint32 idPo this->setFlag(QGraphicsItem::ItemIsSelectable, true); this->setAcceptHoverEvents(true); RefreshPointGeometry(*VAbstractTool::data.GeometricObject(id)); - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { AddToFile(); } @@ -59,10 +59,10 @@ VNodePoint::VNodePoint(VPattern *doc, VContainer *data, quint32 id, quint32 idPo } void VNodePoint::Create(VPattern *doc, VContainer *data, quint32 id, quint32 idPoint, - const Document::Documents &parse, const Tool::Sources &typeCreation, const quint32 &idTool, + const Document::Documents &parse, const Valentina::Sources &typeCreation, const quint32 &idTool, QObject *parent) { - VAbstractTool::AddRecord(id, Tool::NodePoint, doc); + VAbstractTool::AddRecord(id, Valentina::NodePoint, doc); if (parse == Document::FullParse) { //TODO Need create garbage collector and remove all nodes, what we don't use. @@ -137,7 +137,7 @@ void VNodePoint::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { if (event->button() == Qt::LeftButton) { - emit ChoosedTool(id, Scene::Point); + emit ChoosedTool(id, Valentina::Point); } QGraphicsItem::mouseReleaseEvent(event); } diff --git a/src/tools/nodeDetails/vnodepoint.h b/src/tools/nodeDetails/vnodepoint.h index 951d4e0af..af513d3b5 100644 --- a/src/tools/nodeDetails/vnodepoint.h +++ b/src/tools/nodeDetails/vnodepoint.h @@ -49,7 +49,7 @@ public: * @param parent parent object. */ VNodePoint(VPattern *doc, VContainer *data, quint32 id, quint32 idPoint, - const Tool::Sources &typeCreation, const quint32 &idTool = 0, QObject *qoParent = nullptr, + const Valentina::Sources &typeCreation, const quint32 &idTool = 0, QObject *qoParent = nullptr, QGraphicsItem * parent = nullptr ); /** * @brief Create help create tool. @@ -61,7 +61,7 @@ public: * @param typeCreation way we create this tool. */ static void Create(VPattern *doc, VContainer *data, quint32 id, quint32 idPoint, - const Document::Documents &parse, const Tool::Sources &typeCreation, const quint32 &idTool = 0, + const Document::Documents &parse, const Valentina::Sources &typeCreation, const quint32 &idTool = 0, QObject *parent = nullptr); static const QString TagName; static const QString ToolType; diff --git a/src/tools/nodeDetails/vnodespline.cpp b/src/tools/nodeDetails/vnodespline.cpp index 3aff1236f..2661882c3 100644 --- a/src/tools/nodeDetails/vnodespline.cpp +++ b/src/tools/nodeDetails/vnodespline.cpp @@ -34,14 +34,14 @@ const QString VNodeSpline::TagName = QStringLiteral("spline"); const QString VNodeSpline::ToolType = QStringLiteral("modelingSpline"); VNodeSpline::VNodeSpline(VPattern *doc, VContainer *data, quint32 id, quint32 idSpline, - const Tool::Sources &typeCreation, const quint32 &idTool, QObject *qoParent, + const Valentina::Sources &typeCreation, const quint32 &idTool, QObject *qoParent, QGraphicsItem * parent) :VAbstractNode(doc, data, id, idSpline, idTool, qoParent), QGraphicsPathItem(parent) { RefreshGeometry(); this->setPen(QPen(baseColor, toPixel(widthHairLine))); - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { AddToFile(); } @@ -52,10 +52,10 @@ VNodeSpline::VNodeSpline(VPattern *doc, VContainer *data, quint32 id, quint32 id } VNodeSpline *VNodeSpline::Create(VPattern *doc, VContainer *data, quint32 id, quint32 idSpline, - const Document::Documents &parse, const Tool::Sources &typeCreation, + const Document::Documents &parse, const Valentina::Sources &typeCreation, const quint32 &idTool, QObject *parent) { - VAbstractTool::AddRecord(id, Tool::NodeSpline, doc); + VAbstractTool::AddRecord(id, Valentina::NodeSpline, doc); VNodeSpline *spl = nullptr; if (parse == Document::FullParse) { @@ -124,7 +124,7 @@ void VNodeSpline::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { if (event->button() == Qt::LeftButton) { - emit ChoosedTool(id, Scene::Spline); + emit ChoosedTool(id, Valentina::Spline); } QGraphicsItem::mouseReleaseEvent(event); } diff --git a/src/tools/nodeDetails/vnodespline.h b/src/tools/nodeDetails/vnodespline.h index 1384ea97e..b7e680e40 100644 --- a/src/tools/nodeDetails/vnodespline.h +++ b/src/tools/nodeDetails/vnodespline.h @@ -49,7 +49,7 @@ public: * @param parent parent object. */ VNodeSpline(VPattern *doc, VContainer *data, quint32 id, quint32 idSpline, - const Tool::Sources &typeCreation, const quint32 &idTool = 0, QObject *qoParent = nullptr, + const Valentina::Sources &typeCreation, const quint32 &idTool = 0, QObject *qoParent = nullptr, QGraphicsItem * parent = nullptr); /** * @brief Create help create tool. @@ -62,7 +62,7 @@ public: * @return */ static VNodeSpline *Create(VPattern *doc, VContainer *data, quint32 id, quint32 idSpline, - const Document::Documents &parse, const Tool::Sources &typeCreation, + const Document::Documents &parse, const Valentina::Sources &typeCreation, const quint32 &idTool = 0, QObject *parent = nullptr); static const QString TagName; static const QString ToolType; diff --git a/src/tools/nodeDetails/vnodesplinepath.cpp b/src/tools/nodeDetails/vnodesplinepath.cpp index 5470e1cd0..5008aa1bb 100644 --- a/src/tools/nodeDetails/vnodesplinepath.cpp +++ b/src/tools/nodeDetails/vnodesplinepath.cpp @@ -34,14 +34,14 @@ const QString VNodeSplinePath::TagName = QStringLiteral("spline"); const QString VNodeSplinePath::ToolType = QStringLiteral("modelingPath"); VNodeSplinePath::VNodeSplinePath(VPattern *doc, VContainer *data, quint32 id, quint32 idSpline, - const Tool::Sources &typeCreation, const quint32 &idTool, QObject *qoParent, + const Valentina::Sources &typeCreation, const quint32 &idTool, QObject *qoParent, QGraphicsItem * parent) :VAbstractNode(doc, data, id, idSpline, idTool, qoParent), QGraphicsPathItem(parent) { RefreshGeometry(); this->setPen(QPen(baseColor, toPixel(widthHairLine))); - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { AddToFile(); } @@ -52,10 +52,10 @@ VNodeSplinePath::VNodeSplinePath(VPattern *doc, VContainer *data, quint32 id, qu } void VNodeSplinePath::Create(VPattern *doc, VContainer *data, quint32 id, quint32 idSpline, - const Document::Documents &parse, const Tool::Sources &typeCreation, const quint32 &idTool, + const Document::Documents &parse, const Valentina::Sources &typeCreation, const quint32 &idTool, QObject *parent) { - VAbstractTool::AddRecord(id, Tool::NodeSplinePath, doc); + VAbstractTool::AddRecord(id, Valentina::NodeSplinePath, doc); if (parse == Document::FullParse) { VNodeSplinePath *splPath = new VNodeSplinePath(doc, data, id, idSpline, typeCreation, idTool, parent); @@ -127,7 +127,7 @@ void VNodeSplinePath::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { if (event->button() == Qt::LeftButton) { - emit ChoosedTool(id, Scene::SplinePath); + emit ChoosedTool(id, Valentina::SplinePath); } QGraphicsItem::mouseReleaseEvent(event); } diff --git a/src/tools/nodeDetails/vnodesplinepath.h b/src/tools/nodeDetails/vnodesplinepath.h index 3d96c306a..8c0829543 100644 --- a/src/tools/nodeDetails/vnodesplinepath.h +++ b/src/tools/nodeDetails/vnodesplinepath.h @@ -49,7 +49,7 @@ public: * @param parent parent object. */ VNodeSplinePath(VPattern *doc, VContainer *data, quint32 id, quint32 idSpline, - const Tool::Sources &typeCreation, const quint32 &idTool = 0, + const Valentina::Sources &typeCreation, const quint32 &idTool = 0, QObject *qoParent = nullptr, QGraphicsItem * parent = nullptr); /** * @brief Create help create tool. @@ -61,7 +61,7 @@ public: * @param typeCreation way we create this tool. */ static void Create(VPattern *doc, VContainer *data, quint32 id, quint32 idSpline, - const Document::Documents &parse, const Tool::Sources &typeCreation, const quint32 &idTool = 0, + const Document::Documents &parse, const Valentina::Sources &typeCreation, const quint32 &idTool = 0, QObject *parent = 0); static const QString TagName; static const QString ToolType; diff --git a/src/tools/vabstracttool.cpp b/src/tools/vabstracttool.cpp index e6453f773..81337c83d 100644 --- a/src/tools/vabstracttool.cpp +++ b/src/tools/vabstracttool.cpp @@ -304,7 +304,7 @@ const QStringList VAbstractTool::Styles() return styles; } -void VAbstractTool::AddRecord(const quint32 id, const Tool::Tools &toolType, VPattern *doc) +void VAbstractTool::AddRecord(const quint32 id, const Valentina::Tools &toolType, VPattern *doc) { quint32 cursor = doc->getCursor(); QVector *history = doc->getHistory(); diff --git a/src/tools/vabstracttool.h b/src/tools/vabstracttool.h index 48b613971..430d2d290 100644 --- a/src/tools/vabstracttool.h +++ b/src/tools/vabstracttool.h @@ -153,7 +153,7 @@ public: * @param toolType tool type * @param doc dom document container */ - static void AddRecord(const quint32 id, const Tool::Tools &toolType, VPattern *doc); + static void AddRecord(const quint32 id, const Valentina::Tools &toolType, VPattern *doc); public slots: /** * @brief FullUpdateFromFile update tool data form file. @@ -169,7 +169,7 @@ signals: * @param id object id in container. * @param type type of scene object. */ - void ChoosedTool(quint32 id, Scene::Scenes type); + void ChoosedTool(quint32 id, Valentina::Scenes type); /** * @brief FullUpdateTree emit if need reparse pattern file. */ diff --git a/src/tools/vtooldetail.cpp b/src/tools/vtooldetail.cpp index 5ad9740b4..60504c451 100644 --- a/src/tools/vtooldetail.cpp +++ b/src/tools/vtooldetail.cpp @@ -47,7 +47,7 @@ const QString VToolDetail::NodePoint = QStringLiteral("NodePoint"); const QString VToolDetail::NodeSpline = QStringLiteral("NodeSpline"); const QString VToolDetail::NodeSplinePath = QStringLiteral("NodeSplinePath"); -VToolDetail::VToolDetail(VPattern *doc, VContainer *data, const quint32 &id, const Tool::Sources &typeCreation, +VToolDetail::VToolDetail(VPattern *doc, VContainer *data, const quint32 &id, const Valentina::Sources &typeCreation, VMainGraphicsScene *scene, QGraphicsItem *parent) :VAbstractTool(doc, data, id), QGraphicsPathItem(parent), dialog(nullptr), sceneDetails(scene) { @@ -56,16 +56,16 @@ VToolDetail::VToolDetail(VPattern *doc, VContainer *data, const quint32 &id, con { switch (detail[i].getTypeTool()) { - case (Tool::NodePoint): + case (Valentina::NodePoint): InitTool(scene, detail[i]); break; - case (Tool::NodeArc): + case (Valentina::NodeArc): InitTool(scene, detail[i]); break; - case (Tool::NodeSpline): + case (Valentina::NodeSpline): InitTool(scene, detail[i]); break; - case (Tool::NodeSplinePath): + case (Valentina::NodeSplinePath): InitTool(scene, detail[i]); break; default: @@ -80,7 +80,7 @@ VToolDetail::VToolDetail(VPattern *doc, VContainer *data, const quint32 &id, con this->setPos(detail.getMx(), detail.getMy()); this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); this->setFlag(QGraphicsItem::ItemIsFocusable, true); - if (typeCreation == Tool::FromGui || typeCreation == Tool::FromTool) + if (typeCreation == Valentina::FromGui || typeCreation == Valentina::FromTool) { AddToFile(); } @@ -112,28 +112,28 @@ void VToolDetail::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern quint32 id = 0; switch (detail[i].getTypeTool()) { - case (Tool::NodePoint): + case (Valentina::NodePoint): { id = CreateNode(data, detail[i].getId()); - VNodePoint::Create(doc, data, id, detail[i].getId(), Document::FullParse, Tool::FromGui); + VNodePoint::Create(doc, data, id, detail[i].getId(), Document::FullParse, Valentina::FromGui); } break; - case (Tool::NodeArc): + case (Valentina::NodeArc): { id = CreateNode(data, detail[i].getId()); - VNodeArc::Create(doc, data, id, detail[i].getId(), Document::FullParse, Tool::FromGui); + VNodeArc::Create(doc, data, id, detail[i].getId(), Document::FullParse, Valentina::FromGui); } break; - case (Tool::NodeSpline): + case (Valentina::NodeSpline): { id = CreateNode(data, detail[i].getId()); - VNodeSpline::Create(doc, data, id, detail[i].getId(), Document::FullParse, Tool::FromGui); + VNodeSpline::Create(doc, data, id, detail[i].getId(), Document::FullParse, Valentina::FromGui); } break; - case (Tool::NodeSplinePath): + case (Valentina::NodeSplinePath): { id = CreateNode(data, detail[i].getId()); - VNodeSplinePath::Create(doc, data, id, detail[i].getId(), Document::FullParse, Tool::FromGui); + VNodeSplinePath::Create(doc, data, id, detail[i].getId(), Document::FullParse, Valentina::FromGui); } break; default: @@ -144,14 +144,14 @@ void VToolDetail::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern det.append(node); } det.setName(detail.getName()); - Create(0, det, scene, doc, data, Document::FullParse, Tool::FromGui); + Create(0, det, scene, doc, data, Document::FullParse, Valentina::FromGui); } void VToolDetail::Create(const quint32 &_id, const VDetail &newDetail, VMainGraphicsScene *scene, VPattern *doc, - VContainer *data, const Document::Documents &parse, const Tool::Sources &typeCreation) + VContainer *data, const Document::Documents &parse, const Valentina::Sources &typeCreation) { quint32 id = _id; - if (typeCreation == Tool::FromGui || typeCreation == Tool::FromTool) + if (typeCreation == Valentina::FromGui || typeCreation == Valentina::FromTool) { id = data->AddDetail(newDetail); } @@ -163,7 +163,7 @@ void VToolDetail::Create(const quint32 &_id, const VDetail &newDetail, VMainGrap doc->UpdateToolData(id, data); } } - VAbstractTool::AddRecord(id, Tool::Detail, doc); + VAbstractTool::AddRecord(id, Valentina::DetailTool, doc); if (parse == Document::FullParse) { VToolDetail *detail = new VToolDetail(doc, data, id, typeCreation, scene); @@ -320,7 +320,7 @@ void VToolDetail::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { if (event->button() == Qt::LeftButton) { - emit ChoosedTool(id, Scene::Detail); + emit ChoosedTool(id, Valentina::Detail); } QGraphicsItem::mouseReleaseEvent(event); } @@ -382,16 +382,16 @@ void VToolDetail::AddNode(QDomElement &domElement, const VNodeDetail &node) } switch (node.getTypeTool()) { - case (Tool::NodeArc): + case (Valentina::NodeArc): doc->SetAttribute(nod, AttrType, NodeArc); break; - case (Tool::NodePoint): + case (Valentina::NodePoint): doc->SetAttribute(nod, AttrType, NodePoint); break; - case (Tool::NodeSpline): + case (Valentina::NodeSpline): doc->SetAttribute(nod, AttrType, NodeSpline); break; - case (Tool::NodeSplinePath): + case (Valentina::NodeSplinePath): doc->SetAttribute(nod, AttrType, NodeSplinePath); break; default: diff --git a/src/tools/vtooldetail.h b/src/tools/vtooldetail.h index 21f84bb48..2a6b44b14 100644 --- a/src/tools/vtooldetail.h +++ b/src/tools/vtooldetail.h @@ -49,7 +49,7 @@ public: * @param scene pointer to scene. * @param parent parent object */ - VToolDetail(VPattern *doc, VContainer *data, const quint32 &id, const Tool::Sources &typeCreation, + VToolDetail(VPattern *doc, VContainer *data, const quint32 &id, const Valentina::Sources &typeCreation, VMainGraphicsScene *scene, QGraphicsItem * parent = nullptr); ~VToolDetail(); /** @@ -67,7 +67,7 @@ public: { //We can't use exist object. Need create new. T *node = new T(*data->GeometricObject(id)); - node->setMode(Draw::Modeling); + node->setMode(Valentina::Modeling); return data->AddGObject(node); } @@ -91,7 +91,7 @@ public: */ static void Create(const quint32 &_id, const VDetail &newDetail, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document::Documents &parse, - const Tool::Sources &typeCreation); + const Valentina::Sources &typeCreation); static const QString TagName; static const QString TagNode; static const QString AttrSupplement; diff --git a/src/tools/vtooluniondetails.cpp b/src/tools/vtooluniondetails.cpp index 31c68715c..2c0c44e0b 100644 --- a/src/tools/vtooluniondetails.cpp +++ b/src/tools/vtooluniondetails.cpp @@ -43,10 +43,10 @@ const QString VToolUnionDetails::NodeTypeModeling = QStringLiteral("Modeling"); VToolUnionDetails::VToolUnionDetails(VPattern *doc, VContainer *data, const quint32 &id, const VDetail &d1, const VDetail &d2, const quint32 &indexD1, const quint32 &indexD2, - const Tool::Sources &typeCreation, QObject *parent) + const Valentina::Sources &typeCreation, QObject *parent) :VAbstractTool(doc, data, id, parent), d1(d1), d2(d2), indexD1(indexD1), indexD2(indexD2) { - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { AddToFile(); } @@ -63,7 +63,7 @@ void VToolUnionDetails::AddToNewDetail(QObject *tool, VPattern *doc, VContainer quint32 id = 0, idObject = 0; switch (det.at(i).getTypeTool()) { - case (Tool::NodePoint): + case (Valentina::NodePoint): { if ( qFuzzyCompare(dx+1, 1) && qFuzzyCompare(dy+1, 1) && (pRotate == 0)) { @@ -72,18 +72,18 @@ void VToolUnionDetails::AddToNewDetail(QObject *tool, VPattern *doc, VContainer else { VPointF *point = new VPointF(*data->GeometricObject(det.at(i).getId())); - point->setMode(Draw::Modeling); + point->setMode(Valentina::Modeling); BiasRotatePoint(point, dx, dy, data->GeometricObject(pRotate)->toQPointF(), angle); idObject = data->AddGObject(point); VPointF *point1 = new VPointF(*point); - point1->setMode(Draw::Modeling); + point1->setMode(Valentina::Modeling); id = data->AddGObject(point1); - VNodePoint::Create(doc, data, id, idObject, Document::FullParse, Tool::FromGui, idTool, tool); + VNodePoint::Create(doc, data, id, idObject, Document::FullParse, Valentina::FromGui, idTool, tool); } } break; - case (Tool::NodeArc): + case (Valentina::NodeArc): { if (qFuzzyCompare(dx+1, 1) && qFuzzyCompare(dy+1, 1) && pRotate == 0) { @@ -102,24 +102,24 @@ void VToolUnionDetails::AddToNewDetail(QObject *tool, VPattern *doc, VContainer QLineF l1(center->toQPointF(), p1.toQPointF()); QLineF l2(center->toQPointF(), p2.toQPointF()); - center->setMode(Draw::Modeling); + center->setMode(Valentina::Modeling); quint32 idCenter = data->AddGObject(center); Q_UNUSED(idCenter); VArc *arc1 = new VArc(*center, arc->GetRadius(), arc->GetFormulaRadius(), l1.angle(), QString().setNum(l1.angle()), l2.angle(), QString().setNum(l2.angle())); - arc1->setMode(Draw::Modeling); + arc1->setMode(Valentina::Modeling); idObject = data->AddGObject(arc1); VArc *arc2 = new VArc(*arc1); - arc2->setMode(Draw::Modeling); + arc2->setMode(Valentina::Modeling); id = data->AddGObject(arc2); - VNodeArc::Create(doc, data, id, idObject, Document::FullParse, Tool::FromGui, idTool, tool); + VNodeArc::Create(doc, data, id, idObject, Document::FullParse, Valentina::FromGui, idTool, tool); } } break; - case (Tool::NodeSpline): + case (Valentina::NodeSpline): { if (qFuzzyCompare(dx+1, 1) && qFuzzyCompare(dy+1, 1) && pRotate == 0) { @@ -144,17 +144,17 @@ void VToolUnionDetails::AddToNewDetail(QObject *tool, VPattern *doc, VContainer quint32 idP4 = data->AddGObject(p4); VSpline *spl = new VSpline(*p1, p2.toQPointF(), p3.toQPointF(), *p4, spline->GetKcurve(), 0, - Draw::Modeling); + Valentina::Modeling); idObject = data->AddGObject(spl); VSpline *spl1 = new VSpline(*spl); - spl1->setMode(Draw::Modeling); + spl1->setMode(Valentina::Modeling); id = data->AddGObject(spl1); - VNodeSpline::Create(doc, data, id, idObject, Document::FullParse, Tool::FromGui, idTool, tool); + VNodeSpline::Create(doc, data, id, idObject, Document::FullParse, Valentina::FromGui, idTool, tool); } } break; - case (Tool::NodeSplinePath): + case (Valentina::NodeSplinePath): { if (qFuzzyCompare(dx+1, 1) && qFuzzyCompare(dy+1, 1) && pRotate == 0) { @@ -163,7 +163,7 @@ void VToolUnionDetails::AddToNewDetail(QObject *tool, VPattern *doc, VContainer else { VSplinePath *path = new VSplinePath(); - path->setMode(Draw::Modeling); + path->setMode(Valentina::Modeling); const VSplinePath *splinePath = data->GeometricObject(det.at(i).getId()); qint32 k = splinePath->getMaxCountPoints(); for (qint32 i = 1; i <= splinePath->Count(); ++i) @@ -209,9 +209,9 @@ void VToolUnionDetails::AddToNewDetail(QObject *tool, VPattern *doc, VContainer idObject = data->AddGObject(path); VSplinePath *path1 = new VSplinePath(*path); - path1->setMode(Draw::Modeling); + path1->setMode(Valentina::Modeling); id = data->AddGObject(path1); - VNodeSplinePath::Create(doc, data, id, idObject, Document::FullParse, Tool::FromGui, idTool, tool); + VNodeSplinePath::Create(doc, data, id, idObject, Document::FullParse, Valentina::FromGui, idTool, tool); } } break; @@ -228,12 +228,12 @@ void VToolUnionDetails::UpdatePoints(const quint32 &idDetail, VContainer *data, { switch (det.at(i).getTypeTool()) { - case (Tool::NodePoint): + case (Valentina::NodePoint): { if (qFuzzyCompare(dx+1, 1) == false || qFuzzyCompare(dy+1, 1) == false || pRotate != 0) { VPointF *point = new VPointF(*data->GeometricObject(det.at(i).getId())); - point->setMode(Draw::Modeling); + point->setMode(Valentina::Modeling); BiasRotatePoint(point, dx, dy, data->GeometricObject(pRotate)->toQPointF(), angle); ++idCount; data->UpdateGObject(idDetail+idCount, point); @@ -242,7 +242,7 @@ void VToolUnionDetails::UpdatePoints(const quint32 &idDetail, VContainer *data, } } break; - case (Tool::NodeArc): + case (Valentina::NodeArc): { if (qFuzzyCompare(dx+1, 1) == false || qFuzzyCompare(dy+1, 1) == false || pRotate != 0) { @@ -258,11 +258,11 @@ void VToolUnionDetails::UpdatePoints(const quint32 &idDetail, VContainer *data, QLineF l1(center->toQPointF(), p1.toQPointF()); QLineF l2(center->toQPointF(), p2.toQPointF()); ++idCount; - center->setMode(Draw::Modeling); + center->setMode(Valentina::Modeling); data->UpdateGObject(idDetail+idCount, center); VArc *arc1 = new VArc(*center, arc->GetRadius(), arc->GetFormulaRadius(), l1.angle(), QString().setNum(l1.angle()), l2.angle(), QString().setNum(l2.angle())); - arc1->setMode(Draw::Modeling); + arc1->setMode(Valentina::Modeling); ++idCount; data->UpdateGObject(idDetail+idCount, arc1); @@ -270,7 +270,7 @@ void VToolUnionDetails::UpdatePoints(const quint32 &idDetail, VContainer *data, } } break; - case (Tool::NodeSpline): + case (Valentina::NodeSpline): { if (qFuzzyCompare(dx+1, 1) == false || qFuzzyCompare(dy+1, 1) == false || pRotate != 0) { @@ -293,7 +293,7 @@ void VToolUnionDetails::UpdatePoints(const quint32 &idDetail, VContainer *data, data->UpdateGObject(idDetail+idCount, p4); VSpline *spl = new VSpline(*p1, p2.toQPointF(), p3.toQPointF(), *p4, spline->GetKcurve(), 0, - Draw::Modeling); + Valentina::Modeling); ++idCount; data->UpdateGObject(idDetail+idCount, spl); @@ -302,12 +302,12 @@ void VToolUnionDetails::UpdatePoints(const quint32 &idDetail, VContainer *data, } } break; - case (Tool::NodeSplinePath): + case (Valentina::NodeSplinePath): { if (qFuzzyCompare(dx+1, 1) == false || qFuzzyCompare(dy+1, 1) == false || pRotate != 0) { VSplinePath *path = new VSplinePath(); - path->setMode(Draw::Modeling); + path->setMode(Valentina::Modeling); const VSplinePath *splinePath = data->GeometricObject(det.at(i).getId()); Q_CHECK_PTR(splinePath); qint32 k = splinePath->getMaxCountPoints(); @@ -390,17 +390,17 @@ void VToolUnionDetails::Create(DialogTool *dialog, VMainGraphicsScene *scene, VP ptrdiff_t indexD1 = dialogTool->getIndexD1(); ptrdiff_t indexD2 = dialogTool->getIndexD2(); Create(0, d1, d2, dialogTool->getD1(), dialogTool->getD2(), indexD1, indexD2, scene, doc, data, Document::FullParse, - Tool::FromGui); + Valentina::FromGui); } void VToolUnionDetails::Create(const quint32 _id, const VDetail &d1, const VDetail &d2, const quint32 &d1id, const quint32 &d2id, const quint32 &indexD1, const quint32 &indexD2, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, - const Document::Documents &parse, const Tool::Sources &typeCreation) + const Document::Documents &parse, const Valentina::Sources &typeCreation) { VToolUnionDetails *unionDetails = 0; quint32 id = _id; - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { id = data->getNextId(); } @@ -411,7 +411,7 @@ void VToolUnionDetails::Create(const quint32 _id, const VDetail &d1, const VDeta doc->UpdateToolData(id, data); } } - VAbstractTool::AddRecord(id, Tool::UnionDetails, doc); + VAbstractTool::AddRecord(id, Valentina::UnionDetails, doc); if (parse == Document::FullParse) { //Scene doesn't show this tool, so doc will destroy this object. @@ -454,7 +454,7 @@ void VToolUnionDetails::Create(const quint32 _id, const VDetail &d1, const VDeta point2.toQPointF())); qint32 pointsD2 = 0; //Keeps count points second detail, what we already add. - if (typeCreation == Tool::FromGui) + if (typeCreation == Valentina::FromGui) { qint32 j = 0, i = 0; VDetail newDetail; @@ -484,7 +484,7 @@ void VToolUnionDetails::Create(const quint32 _id, const VDetail &d1, const VDeta } while(i < d1.RemoveEdge(indexD1).CountNode()); newDetail.setName("Detail"); - VToolDetail::Create(0, newDetail, scene, doc, data, parse, Tool::FromTool); + VToolDetail::Create(0, newDetail, scene, doc, data, parse, Valentina::FromTool); QHash* tools = doc->getTools(); Q_CHECK_PTR(tools); @@ -581,24 +581,24 @@ QVector VToolUnionDetails::GetDetailFromFile(VPattern *doc, const QDomE quint32 id = doc->GetParametrUInt(element, VToolDetail::AttrIdObject, "0"); qreal mx = toPixel(doc->GetParametrDouble(element, VAbstractTool::AttrMx, "0.0")); qreal my = toPixel(doc->GetParametrDouble(element, VAbstractTool::AttrMy, "0.0")); - Tool::Tools tool; + Valentina::Tools tool; NodeDetail::NodeDetails nodeType = NodeDetail::Contour; QString t = doc->GetParametrString(element, "type", "NodePoint"); if (t == "NodePoint") { - tool = Tool::NodePoint; + tool = Valentina::NodePoint; } else if (t == "NodeArc") { - tool = Tool::NodeArc; + tool = Valentina::NodeArc; } else if (t == "NodeSpline") { - tool = Tool::NodeSpline; + tool = Valentina::NodeSpline; } else if (t == "NodeSplinePath") { - tool = Tool::NodeSplinePath; + tool = Valentina::NodeSplinePath; } d.append(VNodeDetail(id, tool, nodeType, mx, my)); } @@ -669,16 +669,16 @@ void VToolUnionDetails::AddNode(QDomElement &domElement, const VNodeDetail &node } switch (node.getTypeTool()) { - case (Tool::NodeArc): + case (Valentina::NodeArc): doc->SetAttribute(nod, AttrType, QStringLiteral("NodeArc")); break; - case (Tool::NodePoint): + case (Valentina::NodePoint): doc->SetAttribute(nod, AttrType, QStringLiteral("NodePoint")); break; - case (Tool::NodeSpline): + case (Valentina::NodeSpline): doc->SetAttribute(nod, AttrType, QStringLiteral("NodeSpline")); break; - case (Tool::NodeSplinePath): + case (Valentina::NodeSplinePath): doc->SetAttribute(nod, AttrType, QStringLiteral("NodeSplinePath")); break; default: diff --git a/src/tools/vtooluniondetails.h b/src/tools/vtooluniondetails.h index 85fdaa978..43e3dd014 100644 --- a/src/tools/vtooluniondetails.h +++ b/src/tools/vtooluniondetails.h @@ -52,7 +52,7 @@ public: * @param parent parent object. */ VToolUnionDetails(VPattern *doc, VContainer *data, const quint32 &id, const VDetail &d1, const VDetail &d2, - const quint32 &indexD1, const quint32 &indexD2, const Tool::Sources &typeCreation, + const quint32 &indexD1, const quint32 &indexD2, const Valentina::Sources &typeCreation, QObject *parent = nullptr); /** * @brief setDialog set dialog when user want change tool option. @@ -83,7 +83,7 @@ public: static void Create(const quint32 _id, const VDetail &d1, const VDetail &d2, const quint32 &d1id, const quint32 &d2id, const quint32 &indexD1, const quint32 &indexD2, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document::Documents &parse, - const Tool::Sources &typeCreation); + const Valentina::Sources &typeCreation); static void PointsOnEdge(const VDetail &d, const qint32 &index, VPointF &p1, VPointF &p2, VContainer *data); static void FindJ(const qint32 &pointsD2, const VDetail &d2, const qint32 &indexD2, qint32 &j); /** diff --git a/src/widgets/vmaingraphicsscene.cpp b/src/widgets/vmaingraphicsscene.cpp index 7b1b9320d..047f86e16 100644 --- a/src/widgets/vmaingraphicsscene.cpp +++ b/src/widgets/vmaingraphicsscene.cpp @@ -62,7 +62,7 @@ void VMainGraphicsScene::setTransform(const QTransform &transform) _transform = transform; } -void VMainGraphicsScene::ChoosedItem(quint32 id, const Scene::Scenes &type) +void VMainGraphicsScene::ChoosedItem(quint32 id, const Valentina::Scenes &type) { emit ChoosedObject(id, type); } diff --git a/src/widgets/vmaingraphicsscene.h b/src/widgets/vmaingraphicsscene.h index 3b3f6afa4..87620d695 100644 --- a/src/widgets/vmaingraphicsscene.h +++ b/src/widgets/vmaingraphicsscene.h @@ -85,7 +85,7 @@ public slots: * @param id object id. * @param type object scene type. */ - void ChoosedItem(quint32 id, const Scene::Scenes &type); + void ChoosedItem(quint32 id, const Valentina::Scenes &type); /** * @brief SetFactor set current scale factor of scene. * @param factor scene scale factor. scene scale factor. @@ -118,7 +118,7 @@ signals: * @param id object id. * @param type object scene type. */ - void ChoosedObject(quint32 id, Scene::Scenes type); + void ChoosedObject(quint32 id, Valentina::Scenes type); /** * @brief NewFactor send new scale factor. * @param factor scene scale factor. diff --git a/src/widgets/vsimplesplinepath.cpp b/src/widgets/vsimplesplinepath.cpp index 906c41808..18393dd0f 100644 --- a/src/widgets/vsimplesplinepath.cpp +++ b/src/widgets/vsimplesplinepath.cpp @@ -37,7 +37,7 @@ void VSimpleSplinePath::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { if (event->button() == Qt::LeftButton) { - emit ChoosedTool(id, Scene::SplinePath); + emit ChoosedTool(id, Valentina::SplinePath); } QGraphicsItem::mouseReleaseEvent(event); } diff --git a/src/xml/vpattern.cpp b/src/xml/vpattern.cpp index f3a8b64e2..5131e3aa2 100644 --- a/src/xml/vpattern.cpp +++ b/src/xml/vpattern.cpp @@ -62,7 +62,7 @@ const QString VPattern::IncrementKsize = QStringLiteral("ksize"); const QString VPattern::IncrementKgrowth = QStringLiteral("kgrowth"); const QString VPattern::IncrementDescription = QStringLiteral("description"); -VPattern::VPattern(VContainer *data, QComboBox *comboBoxDraws, Draw::Draws *mode, QObject *parent) +VPattern::VPattern(VContainer *data, QComboBox *comboBoxDraws, Valentina::Draws *mode, QObject *parent) : QObject(parent), VDomDocument(data), nameActivDraw(QString()), tools(QHash()), history(QVector()), cursor(0), comboBoxDraws(comboBoxDraws), mode(mode), patternModified(false) { @@ -250,7 +250,7 @@ void VPattern::setCursor(const quint32 &value) void VPattern::setCurrentData() { - if (*mode == Draw::Calculation) + if (*mode == Valentina::Calculation) { const QString nameDraw = comboBoxDraws->itemText(comboBoxDraws->currentIndex()); if (nameActivDraw != nameDraw) @@ -458,10 +458,10 @@ void VPattern::ParseDrawElement(VMainGraphicsScene *sceneDraw, VMainGraphicsScen { case 0: // TagCalculation data->ClearCalculationGObjects(); - ParseDrawMode(sceneDraw, sceneDetail, domElement, parse, Draw::Calculation); + ParseDrawMode(sceneDraw, sceneDetail, domElement, parse, Valentina::Calculation); break; case 1: // TagModeling - ParseDrawMode(sceneDraw, sceneDetail, domElement, parse, Draw::Modeling); + ParseDrawMode(sceneDraw, sceneDetail, domElement, parse, Valentina::Modeling); break; case 2: // TagDetails ParseDetails(sceneDetail, domElement, parse); @@ -477,12 +477,12 @@ void VPattern::ParseDrawElement(VMainGraphicsScene *sceneDraw, VMainGraphicsScen } void VPattern::ParseDrawMode(VMainGraphicsScene *sceneDraw, VMainGraphicsScene *sceneDetail, const QDomNode &node, - const Document::Documents &parse, const Draw::Draws &mode) + const Document::Documents &parse, const Valentina::Draws &mode) { Q_CHECK_PTR(sceneDraw); Q_CHECK_PTR(sceneDetail); VMainGraphicsScene *scene = nullptr; - if (mode == Draw::Calculation) + if (mode == Valentina::Calculation) { scene = sceneDraw; } @@ -555,23 +555,23 @@ void VPattern::ParseDetailElement(VMainGraphicsScene *sceneDetail, const QDomEle const NodeDetail::NodeDetails nodeType = NodeDetail::Contour; const QString t = GetParametrString(element, AttrType, "NodePoint"); - Tool::Tools tool; + Valentina::Tools tool; QStringList types; types << VToolDetail::NodePoint << VToolDetail::NodeArc << VToolDetail::NodeSpline << VToolDetail::NodeSplinePath; switch (types.indexOf(t)) { case 0: // VToolDetail::NodePoint - tool = Tool::NodePoint; + tool = Valentina::NodePoint; break; case 1: // VToolDetail::NodeArc - tool = Tool::NodeArc; + tool = Valentina::NodeArc; break; case 2: // VToolDetail::NodeSpline - tool = Tool::NodeSpline; + tool = Valentina::NodeSpline; break; case 3: // VToolDetail::NodeSplinePath - tool = Tool::NodeSplinePath; + tool = Valentina::NodeSplinePath; break; default: qWarning()<<"Wrong node type."<UpdateGObject(id, new VPointF(x, y, name, mx, my)); - VDrawTool::AddRecord(id, Tool::SinglePointTool, this); + VDrawTool::AddRecord(id, Valentina::SinglePointTool, this); if (parse != Document::FullParse) { UpdateToolData(id, data); } if (parse == Document::FullParse) { - spoint = new VToolSinglePoint(this, data, id, Tool::FromFile); + spoint = new VToolSinglePoint(this, data, id, Valentina::FromFile); scene->addItem(spoint); connect(spoint, &VToolSinglePoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, spoint, &VToolSinglePoint::SetFactor); @@ -681,7 +681,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d const qreal angle = GetParametrDouble(domElement, VAbstractTool::AttrAngle, "0.0"); VToolEndLine::Create(id, name, typeLine, formula, angle, basePointId, - mx, my, scene, this, data, parse, Tool::FromFile); + mx, my, scene, this, data, parse, Valentina::FromFile); } catch (const VExceptionBadId &e) { @@ -704,7 +704,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d const quint32 secondPointId = GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0"); VToolAlongLine::Create(id, name, typeLine, formula, firstPointId, secondPointId, mx, my, scene, this, - data, parse, Tool::FromFile); + data, parse, Valentina::FromFile); } catch (const VExceptionBadId &e) { @@ -728,7 +728,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d const quint32 pShoulder = GetParametrUInt(domElement, VAbstractTool::AttrPShoulder, "0"); VToolShoulderPoint::Create(id, formula, p1Line, p2Line, pShoulder, typeLine, name, mx, my, scene, this, - data, parse, Tool::FromFile); + data, parse, Valentina::FromFile); } catch (const VExceptionBadId &e) { @@ -752,7 +752,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d const qreal angle = GetParametrDouble(domElement, VAbstractTool::AttrAngle, "0.0"); VToolNormal::Create(id, formula, firstPointId, secondPointId, typeLine, name, angle, mx, my, scene, - this, data, parse, Tool::FromFile); + this, data, parse, Valentina::FromFile); } catch (const VExceptionBadId &e) { @@ -776,7 +776,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d const quint32 thirdPointId = GetParametrUInt(domElement, VAbstractTool::AttrThirdPoint, "0"); VToolBisector::Create(id, formula, firstPointId, secondPointId, thirdPointId, - typeLine, name, mx, my, scene, this, data, parse, Tool::FromFile); + typeLine, name, mx, my, scene, this, data, parse, Valentina::FromFile); } catch (const VExceptionBadId &e) { @@ -798,7 +798,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d const quint32 p2Line2Id = GetParametrUInt(domElement, VAbstractTool::AttrP2Line2, "0"); VToolLineIntersect::Create(id, p1Line1Id, p2Line1Id, p1Line2Id, p2Line2Id, name, - mx, my, scene, this, data, parse, Tool::FromFile); + mx, my, scene, this, data, parse, Valentina::FromFile); } catch (const VExceptionBadId &e) { @@ -820,7 +820,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d const quint32 secondPointId = GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0"); VToolPointOfContact::Create(id, radius, center, firstPointId, secondPointId, name, mx, my, scene, this, - data, parse, Tool::FromFile); + data, parse, Valentina::FromFile); } catch (const VExceptionBadId &e) { @@ -839,8 +839,8 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d const qreal mx = toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMx, "10.0")); const qreal my = toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMy, "15.0")); data->UpdateGObject(id, new VPointF(point->x(), point->y(), point->name(), mx, my, idObject, - Draw::Modeling)); - VNodePoint::Create(this, data, id, idObject, parse, Tool::FromFile, idTool); + Valentina::Modeling)); + VNodePoint::Create(this, data, id, idObject, parse, Valentina::FromFile, idTool); } catch (const VExceptionBadId &e) { @@ -863,7 +863,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d const quint32 p2LineId = GetParametrUInt(domElement, VAbstractTool::AttrP2Line, "0"); VToolHeight::Create(id, name, typeLine, basePointId, p1LineId, p2LineId, - mx, my, scene, this, data, parse, Tool::FromFile); + mx, my, scene, this, data, parse, Valentina::FromFile); } catch (const VExceptionBadId &e) { @@ -885,7 +885,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d const quint32 secondPointId = GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0"); VToolTriangle::Create(id, name, axisP1Id, axisP2Id, firstPointId, secondPointId, mx, my, scene, this, - data, parse, Tool::FromFile); + data, parse, Valentina::FromFile); } catch (const VExceptionBadId &e) { @@ -905,7 +905,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d const quint32 secondPointId = GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0"); VToolPointOfIntersection::Create(id, name, firstPointId, secondPointId, mx, my, scene, this, data, - parse, Tool::FromFile); + parse, Valentina::FromFile); } catch (const VExceptionBadId &e) { @@ -924,7 +924,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "0"); const quint32 splineId = GetParametrUInt(domElement, VToolCutSpline::AttrSpline, "0"); - VToolCutSpline::Create(id, name, formula, splineId, mx, my, scene, this, data, parse, Tool::FromFile); + VToolCutSpline::Create(id, name, formula, splineId, mx, my, scene, this, data, parse, Valentina::FromFile); } catch (const VExceptionBadId &e) { @@ -944,7 +944,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d const quint32 splinePathId = GetParametrUInt(domElement, VToolCutSplinePath::AttrSplinePath, "0"); VToolCutSplinePath::Create(id, name, formula, splinePathId, mx, my, - scene, this, data, parse, Tool::FromFile); + scene, this, data, parse, Valentina::FromFile); } catch (const VExceptionBadId &e) { @@ -963,7 +963,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "0"); const quint32 arcId = GetParametrUInt(domElement, VToolCutArc::AttrArc, "0"); - VToolCutArc::Create(id, name, formula, arcId, mx, my, scene, this, data, parse, Tool::FromFile); + VToolCutArc::Create(id, name, formula, arcId, mx, my, scene, this, data, parse, Valentina::FromFile); } catch (const VExceptionBadId &e) { @@ -991,7 +991,7 @@ void VPattern::ParseLineElement(VMainGraphicsScene *scene, const QDomElement &do const QString typeLine = GetParametrString(domElement, VAbstractTool::AttrTypeLine, VAbstractTool::TypeLineLine); - VToolLine::Create(id, firstPoint, secondPoint, typeLine, scene, this, data, parse, Tool::FromFile); + VToolLine::Create(id, firstPoint, secondPoint, typeLine, scene, this, data, parse, Valentina::FromFile); } catch (const VExceptionBadId &e) { @@ -1025,7 +1025,7 @@ void VPattern::ParseSplineElement(VMainGraphicsScene *scene, const QDomElement & const qreal kCurve = GetParametrDouble(domElement, VAbstractTool::AttrKCurve, "1.0"); VToolSpline::Create(id, point1, point4, kAsm1, kAsm2, angle1, angle2, kCurve, scene, this, data, parse, - Tool::FromFile); + Valentina::FromFile); } catch (const VExceptionBadId &e) { @@ -1069,7 +1069,7 @@ void VPattern::ParseSplineElement(VMainGraphicsScene *scene, const QDomElement & } } - VToolSplinePath::Create(id, path, scene, this, data, parse, Tool::FromFile); + VToolSplinePath::Create(id, path, scene, this, data, parse, Valentina::FromFile); } catch (const VExceptionBadId &e) { @@ -1086,9 +1086,9 @@ void VPattern::ParseSplineElement(VMainGraphicsScene *scene, const QDomElement & const quint32 idTool = GetParametrUInt(domElement, VAbstractNode::AttrIdTool, "0"); VSpline *spl = new VSpline(*data->GeometricObject(idObject)); spl->setIdObject(idObject); - spl->setMode(Draw::Modeling); + spl->setMode(Valentina::Modeling); data->UpdateGObject(id, spl); - VNodeSpline::Create(this, data, id, idObject, parse, Tool::FromFile, idTool); + VNodeSpline::Create(this, data, id, idObject, parse, Valentina::FromFile, idTool); } catch (const VExceptionBadId &e) { @@ -1105,9 +1105,9 @@ void VPattern::ParseSplineElement(VMainGraphicsScene *scene, const QDomElement & const quint32 idTool = GetParametrUInt(domElement, VAbstractNode::AttrIdTool, "0"); VSplinePath *path = new VSplinePath(*data->GeometricObject(idObject)); path->setIdObject(idObject); - path->setMode(Draw::Modeling); + path->setMode(Valentina::Modeling); data->UpdateGObject(id, path); - VNodeSplinePath::Create(this, data, id, idObject, parse, Tool::FromFile, idTool); + VNodeSplinePath::Create(this, data, id, idObject, parse, Valentina::FromFile, idTool); } catch (const VExceptionBadId &e) { @@ -1143,7 +1143,7 @@ void VPattern::ParseArcElement(VMainGraphicsScene *scene, const QDomElement &dom const QString f1 = GetParametrString(domElement, VAbstractTool::AttrAngle1, "180"); const QString f2 = GetParametrString(domElement, VAbstractTool::AttrAngle2, "270"); - VToolArc::Create(id, center, radius, f1, f2, scene, this, data, parse, Tool::FromFile); + VToolArc::Create(id, center, radius, f1, f2, scene, this, data, parse, Valentina::FromFile); } catch (const VExceptionBadId &e) { @@ -1160,9 +1160,9 @@ void VPattern::ParseArcElement(VMainGraphicsScene *scene, const QDomElement &dom const quint32 idTool = GetParametrUInt(domElement, VAbstractNode::AttrIdTool, "0"); VArc *arc = new VArc(*data->GeometricObject(idObject)); arc->setIdObject(idObject); - arc->setMode(Draw::Modeling); + arc->setMode(Valentina::Modeling); data->UpdateGObject(id, arc); - VNodeArc::Create(this, data, id, idObject, parse, Tool::FromFile, idTool); + VNodeArc::Create(this, data, id, idObject, parse, Valentina::FromFile, idTool); } catch (const VExceptionBadId &e) { @@ -1199,7 +1199,7 @@ void VPattern::ParseToolsElement(VMainGraphicsScene *scene, const QDomElement &d const QVector vector = VToolUnionDetails::GetDetailFromFile(this, domElement); VToolUnionDetails::Create(id, vector[0], vector[1], 0, 0, indexD1, indexD2, scene, this, data, parse, - Tool::FromFile); + Valentina::FromFile); } catch (const VExceptionBadId &e) { diff --git a/src/xml/vpattern.h b/src/xml/vpattern.h index 67298f618..d748f693a 100644 --- a/src/xml/vpattern.h +++ b/src/xml/vpattern.h @@ -52,7 +52,7 @@ class VPattern : public QObject, public VDomDocument { Q_OBJECT public: - VPattern(VContainer *data, QComboBox *comboBoxDraws, Draw::Draws *mode, QObject *parent = nullptr); + VPattern(VContainer *data, QComboBox *comboBoxDraws, Valentina::Draws *mode, QObject *parent = nullptr); /** * @brief CreateEmptyFile create minimal empty file. */ @@ -256,7 +256,7 @@ private: /** * @brief mode current draw mode. */ - Draw::Draws *mode; + Valentina::Draws *mode; /** * @brief fileModified true if exist change in file. */ @@ -291,7 +291,7 @@ private: * @param mode draw mode. */ void ParseDrawMode(VMainGraphicsScene *sceneDraw, VMainGraphicsScene *sceneDetail, - const QDomNode& node, const Document::Documents &parse, const Draw::Draws &mode); + const QDomNode& node, const Document::Documents &parse, const Valentina::Draws &mode); /** * @brief ParseDetailElement parse detail tag. * @param sceneDetail detail scene. diff --git a/src/xml/vtoolrecord.cpp b/src/xml/vtoolrecord.cpp index 110a9c9c2..ed6f0e756 100644 --- a/src/xml/vtoolrecord.cpp +++ b/src/xml/vtoolrecord.cpp @@ -29,7 +29,7 @@ #include "vtoolrecord.h" VToolRecord::VToolRecord() - :id(0), typeTool(Tool::ArrowTool), nameDraw(QString()){} + :id(0), typeTool(Valentina::ArrowTool), nameDraw(QString()){} -VToolRecord::VToolRecord(const quint32 &id, const Tool::Tools &typeTool, const QString &nameDraw) +VToolRecord::VToolRecord(const quint32 &id, const Valentina::Tools &typeTool, const QString &nameDraw) :id(id), typeTool(typeTool), nameDraw(nameDraw){} diff --git a/src/xml/vtoolrecord.h b/src/xml/vtoolrecord.h index 3530d1c5e..edbe2aae6 100644 --- a/src/xml/vtoolrecord.h +++ b/src/xml/vtoolrecord.h @@ -49,7 +49,7 @@ public: * @param typeTool tool type. * @param nameDraw pattern peace name. */ - VToolRecord(const quint32 &id, const Tool::Tools &typeTool, const QString &nameDraw); + VToolRecord(const quint32 &id, const Valentina::Tools &typeTool, const QString &nameDraw); /** * @brief getId return tool id. * @return id. @@ -64,12 +64,12 @@ public: * @brief getTypeTool return tool type. * @return tool type. */ - Tool::Tools getTypeTool() const; + Valentina::Tools getTypeTool() const; /** * @brief setTypeTool set tool type. * @param value tool type. */ - void setTypeTool(const Tool::Tools &value); + void setTypeTool(const Valentina::Tools &value); /** * @brief getNameDraw return pattern peace name. * @return pattern peace name. @@ -88,7 +88,7 @@ private: /** * @brief typeTool tool type. */ - Tool::Tools typeTool; + Valentina::Tools typeTool; /** * @brief nameDraw pattern peace name. */ @@ -105,12 +105,12 @@ inline void VToolRecord::setId(const quint32 &value) id = value; } -inline Tool::Tools VToolRecord::getTypeTool() const +inline Valentina::Tools VToolRecord::getTypeTool() const { return typeTool; } -inline void VToolRecord::setTypeTool(const Tool::Tools &value) +inline void VToolRecord::setTypeTool(const Valentina::Tools &value) { typeTool = value; }