From 70441f48edc4b3137ad03a2730ee89211d7de178 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 15 Jun 2015 10:40:23 +0300 Subject: [PATCH 01/22] Refactoring. Preparetion for creation VWidgets static library. --HG-- branch : feature --- src/app/mainwindow.cpp | 12 +++---- src/app/options.h | 3 -- src/app/tools/vabstracttool.cpp | 37 ------------------- src/app/tools/vabstracttool.h | 1 - src/app/undocommands/addtocalc.cpp | 4 +-- src/app/undocommands/movedetail.cpp | 4 +-- src/app/undocommands/movelabel.cpp | 2 +- src/app/undocommands/movespline.cpp | 2 +- src/app/undocommands/movesplinepath.cpp | 2 +- src/app/undocommands/movespoint.cpp | 2 +- src/app/undocommands/savedetailoptions.cpp | 4 +-- src/app/widgets/doubledelegate.cpp | 2 +- src/app/widgets/textdelegate.cpp | 1 - src/app/widgets/vmaingraphicsscene.h | 2 +- src/app/widgets/vmaingraphicsview.cpp | 41 +++++++++++++++++++--- src/app/widgets/vmaingraphicsview.h | 2 ++ src/app/xml/vpattern.cpp | 4 +-- src/utils/def.h | 1 + 18 files changed, 60 insertions(+), 66 deletions(-) diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index 39ac9fe8b..5d9f7f15c 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -2035,8 +2035,8 @@ void MainWindow::New() } //Set scene size to size scene view - VAbstractTool::NewSceneRect(sceneDraw, ui->view); - VAbstractTool::NewSceneRect(sceneDetails, ui->view); + VMainGraphicsView::NewSceneRect(sceneDraw, ui->view); + VMainGraphicsView::NewSceneRect(sceneDetails, ui->view); ToolBarOption(); AddPP(patternPieceName, path); @@ -2782,8 +2782,8 @@ void MainWindow::LoadPattern(const QString &fileName) #endif //QT_VERSION >= QT_VERSION_CHECK(5, 1, 0) // On this stage scene empty. Fit scene size to view size - VAbstractTool::NewSceneRect(sceneDraw, ui->view); - VAbstractTool::NewSceneRect(sceneDetails, ui->view); + VMainGraphicsView::NewSceneRect(sceneDraw, ui->view); + VMainGraphicsView::NewSceneRect(sceneDetails, ui->view); #ifdef Q_OS_WIN32 qt_ntfs_permission_lookup++; // turn checking on @@ -3102,8 +3102,8 @@ void MainWindow::ZoomFirstShow() ActionDraw(true); ui->view->ZoomFitBest(); - VAbstractTool::NewSceneRect(sceneDraw, ui->view); - VAbstractTool::NewSceneRect(sceneDetails, ui->view); + VMainGraphicsView::NewSceneRect(sceneDraw, ui->view); + VMainGraphicsView::NewSceneRect(sceneDetails, ui->view); ActionDetails(true); ui->view->ZoomFitBest(); diff --git a/src/app/options.h b/src/app/options.h index a008c89d9..b51c193fb 100644 --- a/src/app/options.h +++ b/src/app/options.h @@ -55,9 +55,6 @@ extern const QString degreeSymbol; extern const QString cursorArrowOpenHand; extern const QString cursorArrowCloseHand; -enum class SceneObject : char { Point, Line, Spline, Arc, SplinePath, Detail, Unknown }; - - enum class Source : char { FromGui, FromFile, FromTool }; enum class Contour : char { OpenContour, CloseContour }; diff --git a/src/app/tools/vabstracttool.cpp b/src/app/tools/vabstracttool.cpp index e0f63e15d..7bd1d356b 100644 --- a/src/app/tools/vabstracttool.cpp +++ b/src/app/tools/vabstracttool.cpp @@ -124,43 +124,6 @@ VAbstractTool::VAbstractTool(VPattern *doc, VContainer *data, quint32 id, QObjec VAbstractTool::~VAbstractTool() {} -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief NewSceneRect calculate scene rect what contains all items and doesn't less that size of scene view. - * @param sc scene. - * @param view view. - */ -void VAbstractTool::NewSceneRect(QGraphicsScene *sc, QGraphicsView *view) -{ - SCASSERT(sc != nullptr); - SCASSERT(view != nullptr); - - QRectF rect = sc->itemsBoundingRect(); - - QRect rec0 = view->rect(); - rec0 = QRect(0, 0, rec0.width()-2, rec0.height()-2); - - QTransform t = view->transform(); - - QRectF rec1; - if (t.m11() < 1) - { - qreal width = rec0.width()/t.m11(); - qreal height = rec0.height()/t.m22(); - rec1 = QRect(0, 0, static_cast(width), static_cast(height)); - - rec1.translate(rec0.center().x()-rec1.center().x(), rec0.center().y()-rec1.center().y()); - QPolygonF polygone = view->mapToScene(rec1.toRect()); - rec1 = polygone.boundingRect(); - } - else - { - rec1 = rec0; - } - rec1 = rec1.united(rect.toRect()); - sc->setSceneRect(rec1); -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief DeleteTool full delete object form scene and file. diff --git a/src/app/tools/vabstracttool.h b/src/app/tools/vabstracttool.h index 0ccb20ea2..0d02d5a4d 100644 --- a/src/app/tools/vabstracttool.h +++ b/src/app/tools/vabstracttool.h @@ -53,7 +53,6 @@ class VAbstractTool: public VDataTool public: VAbstractTool(VPattern *doc, VContainer *data, quint32 id, QObject *parent = nullptr); virtual ~VAbstractTool(); - static void NewSceneRect(QGraphicsScene *sc, QGraphicsView *view); quint32 getId() const; static const QString AttrType; static const QString AttrMx; diff --git a/src/app/undocommands/addtocalc.cpp b/src/app/undocommands/addtocalc.cpp index 276973914..5f1d5a35c 100644 --- a/src/app/undocommands/addtocalc.cpp +++ b/src/app/undocommands/addtocalc.cpp @@ -81,7 +81,7 @@ void AddToCalc::undo() doc->setCursor(0); } emit NeedFullParsing(); - VAbstractTool::NewSceneRect(qApp->getCurrentScene(), qApp->getSceneView()); + VMainGraphicsView::NewSceneRect(qApp->getCurrentScene(), qApp->getSceneView()); doc->SetCurrentPP(nameActivDraw);//Return current pattern piece after undo } @@ -121,7 +121,7 @@ void AddToCalc::redo() return; } RedoFullParsing(); - VAbstractTool::NewSceneRect(qApp->getCurrentScene(), qApp->getSceneView()); + VMainGraphicsView::NewSceneRect(qApp->getCurrentScene(), qApp->getSceneView()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/undocommands/movedetail.cpp b/src/app/undocommands/movedetail.cpp index 5de78f1a1..a05dc8817 100644 --- a/src/app/undocommands/movedetail.cpp +++ b/src/app/undocommands/movedetail.cpp @@ -72,7 +72,7 @@ void MoveDetail::undo() emit NeedLiteParsing(Document::LiteParse); QList list = scene->views(); - VAbstractTool::NewSceneRect(scene, list[0]); + VMainGraphicsView::NewSceneRect(scene, list[0]); } else { @@ -98,7 +98,7 @@ void MoveDetail::redo() redoFlag = true; QList list = scene->views(); - VAbstractTool::NewSceneRect(scene, list[0]); + VMainGraphicsView::NewSceneRect(scene, list[0]); } else { diff --git a/src/app/undocommands/movelabel.cpp b/src/app/undocommands/movelabel.cpp index cd5fe506a..4443975a2 100644 --- a/src/app/undocommands/movelabel.cpp +++ b/src/app/undocommands/movelabel.cpp @@ -123,7 +123,7 @@ void MoveLabel::Do(double mx, double my) emit NeedLiteParsing(Document::LitePPParse); QList list = scene->views(); - VAbstractTool::NewSceneRect(scene, list[0]); + VMainGraphicsView::NewSceneRect(scene, list[0]); } else { diff --git a/src/app/undocommands/movespline.cpp b/src/app/undocommands/movespline.cpp index 68731ff11..ca50e7226 100644 --- a/src/app/undocommands/movespline.cpp +++ b/src/app/undocommands/movespline.cpp @@ -100,7 +100,7 @@ void MoveSpline::Do(const VSpline &spl) emit NeedLiteParsing(Document::LiteParse); QList list = scene->views(); - VAbstractTool::NewSceneRect(scene, list[0]); + VMainGraphicsView::NewSceneRect(scene, list[0]); } else { diff --git a/src/app/undocommands/movesplinepath.cpp b/src/app/undocommands/movesplinepath.cpp index ba7526fa9..2520c3530 100644 --- a/src/app/undocommands/movesplinepath.cpp +++ b/src/app/undocommands/movesplinepath.cpp @@ -95,7 +95,7 @@ void MoveSplinePath::Do(const VSplinePath &splPath) emit NeedLiteParsing(Document::LiteParse); QList list = scene->views(); - VAbstractTool::NewSceneRect(scene, list[0]); + VMainGraphicsView::NewSceneRect(scene, list[0]); } else { diff --git a/src/app/undocommands/movespoint.cpp b/src/app/undocommands/movespoint.cpp index 1ea27044b..9a21d871f 100644 --- a/src/app/undocommands/movespoint.cpp +++ b/src/app/undocommands/movespoint.cpp @@ -125,7 +125,7 @@ void MoveSPoint::Do(double x, double y) emit NeedLiteParsing(Document::LitePPParse); QList list = scene->views(); - VAbstractTool::NewSceneRect(scene, list[0]); + VMainGraphicsView::NewSceneRect(scene, list[0]); } else { diff --git a/src/app/undocommands/savedetailoptions.cpp b/src/app/undocommands/savedetailoptions.cpp index 475a38a69..179bdc9f2 100644 --- a/src/app/undocommands/savedetailoptions.cpp +++ b/src/app/undocommands/savedetailoptions.cpp @@ -71,7 +71,7 @@ void SaveDetailOptions::undo() emit NeedLiteParsing(Document::LiteParse); QList list = scene->views(); - VAbstractTool::NewSceneRect(scene, list[0]); + VMainGraphicsView::NewSceneRect(scene, list[0]); } else { @@ -108,7 +108,7 @@ void SaveDetailOptions::redo() emit NeedLiteParsing(Document::LiteParse); QList listV = scene->views(); - VAbstractTool::NewSceneRect(scene, listV[0]); + VMainGraphicsView::NewSceneRect(scene, listV[0]); } else { diff --git a/src/app/widgets/doubledelegate.cpp b/src/app/widgets/doubledelegate.cpp index 46feb8e09..c883dfeb3 100644 --- a/src/app/widgets/doubledelegate.cpp +++ b/src/app/widgets/doubledelegate.cpp @@ -28,7 +28,7 @@ #include "doubledelegate.h" #include -#include "../options.h" +#include "../../utils/def.h" //--------------------------------------------------------------------------------------------------------------------- /** diff --git a/src/app/widgets/textdelegate.cpp b/src/app/widgets/textdelegate.cpp index 6be5f6b69..e33822289 100644 --- a/src/app/widgets/textdelegate.cpp +++ b/src/app/widgets/textdelegate.cpp @@ -28,7 +28,6 @@ #include "textdelegate.h" #include -#include "../options.h" #include "../libs/vpatterndb/vcontainer.h" //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/widgets/vmaingraphicsscene.h b/src/app/widgets/vmaingraphicsscene.h index 111e88755..dec5e3523 100644 --- a/src/app/widgets/vmaingraphicsscene.h +++ b/src/app/widgets/vmaingraphicsscene.h @@ -30,7 +30,7 @@ #define VMAINGRAPHICSSCENE_H #include -#include "../options.h" +#include "../../utils/def.h" /** * @brief The VMainGraphicsScene class main scene. diff --git a/src/app/widgets/vmaingraphicsview.cpp b/src/app/widgets/vmaingraphicsview.cpp index b38f99249..41e55d811 100644 --- a/src/app/widgets/vmaingraphicsview.cpp +++ b/src/app/widgets/vmaingraphicsview.cpp @@ -32,7 +32,6 @@ #include #include #include -#include "../tools/vabstracttool.h" #include "../visualization/vsimplecurve.h" #include @@ -193,7 +192,7 @@ VMainGraphicsView::VMainGraphicsView(QWidget *parent) void VMainGraphicsView::ZoomIn() { scale(1.1, 1.1); - VAbstractTool::NewSceneRect(this->scene(), this); + VMainGraphicsView::NewSceneRect(this->scene(), this); emit NewFactor(1.1); } @@ -201,7 +200,7 @@ void VMainGraphicsView::ZoomIn() void VMainGraphicsView::ZoomOut() { scale(1.0/1.1, 1.0/1.1); - VAbstractTool::NewSceneRect(this->scene(), this); + VMainGraphicsView::NewSceneRect(this->scene(), this); emit NewFactor(1.0/1.1); } @@ -254,7 +253,7 @@ void VMainGraphicsView::mousePressEvent(QMouseEvent *mousePress) } for (int i = 0; i < list.size(); ++i) { - if (qApp->getCurrentScene()->items().contains(list.at(i))) + if (this->scene()->items().contains(list.at(i))) { if (list.at(i)->type() <= VSimpleCurve::Type && list.at(i)->type() > QGraphicsItem::UserType) @@ -297,3 +296,37 @@ void VMainGraphicsView::setShowToolOptions(bool value) { showToolOptions = value; } + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief NewSceneRect calculate scene rect what contains all items and doesn't less that size of scene view. + * @param sc scene. + * @param view view. + */ +void VMainGraphicsView::NewSceneRect(QGraphicsScene *sc, QGraphicsView *view) +{ + SCASSERT(sc != nullptr); + SCASSERT(view != nullptr); + + const QRectF rect = sc->itemsBoundingRect(); + const QRect rec0 = QRect(0, 0, view->rect().width()-2, view->rect().height()-2); + const QTransform t = view->transform(); + + QRectF rec1; + if (t.m11() < 1) + { + const qreal width = rec0.width()/t.m11(); + const qreal height = rec0.height()/t.m22(); + rec1 = QRect(0, 0, static_cast(width), static_cast(height)); + + rec1.translate(rec0.center().x()-rec1.center().x(), rec0.center().y()-rec1.center().y()); + const QPolygonF polygone = view->mapToScene(rec1.toRect()); + rec1 = polygone.boundingRect(); + } + else + { + rec1 = rec0; + } + rec1 = rec1.united(rect.toRect()); + sc->setSceneRect(rec1); +} diff --git a/src/app/widgets/vmaingraphicsview.h b/src/app/widgets/vmaingraphicsview.h index cb0a488fa..a10007e71 100644 --- a/src/app/widgets/vmaingraphicsview.h +++ b/src/app/widgets/vmaingraphicsview.h @@ -104,6 +104,8 @@ public: explicit VMainGraphicsView(QWidget *parent = nullptr); void setShowToolOptions(bool value); + static void NewSceneRect(QGraphicsScene *sc, QGraphicsView *view); + signals: /** * @brief NewFactor send new scale factor. diff --git a/src/app/xml/vpattern.cpp b/src/app/xml/vpattern.cpp index 6fd90b777..70f39d9a0 100644 --- a/src/app/xml/vpattern.cpp +++ b/src/app/xml/vpattern.cpp @@ -842,8 +842,8 @@ void VPattern::LiteParseTree(const Document &parse) setCurrentData(); emit FullUpdateFromFile(); // Recalculate scene rect - VAbstractTool::NewSceneRect(sceneDraw, qApp->getSceneView()); - VAbstractTool::NewSceneRect(sceneDetail, qApp->getSceneView()); + VMainGraphicsView::NewSceneRect(sceneDraw, qApp->getSceneView()); + VMainGraphicsView::NewSceneRect(sceneDetail, qApp->getSceneView()); qCDebug(vXML, "Scene size updated."); } diff --git a/src/utils/def.h b/src/utils/def.h index 0e9668877..19d66def4 100644 --- a/src/utils/def.h +++ b/src/utils/def.h @@ -34,6 +34,7 @@ #include enum class NodeDetail : char { Contour, Modeling }; +enum class SceneObject : char { Point, Line, Spline, Arc, SplinePath, Detail, Unknown }; enum class Tool : unsigned char { From 4e4deeb2e5ae3b71bc59b3199545723fae09e725 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 15 Jun 2015 12:32:27 +0300 Subject: [PATCH 02/22] Refactoring. More independent class VSimpleCurve. --HG-- branch : feature --- src/app/core/vapplication.cpp | 29 ++---------------- src/app/core/vapplication.h | 16 ---------- src/app/mainwindowsnogui.cpp | 22 +++++++------- src/app/tools/drawTools/vabstractspline.cpp | 15 ++++++---- src/app/tools/drawTools/vtoolarc.cpp | 5 ++-- .../tools/drawTools/vtoolarcwithlength.cpp | 5 ++-- src/app/tools/drawTools/vtoolcut.cpp | 6 ++-- src/app/tools/drawTools/vtoolline.cpp | 12 +++++--- src/app/tools/drawTools/vtoollinepoint.cpp | 9 ++++-- src/app/tools/drawTools/vtoolpoint.cpp | 16 ++++++---- src/app/tools/drawTools/vtoolsinglepoint.cpp | 4 +-- src/app/tools/drawTools/vtoolspline.cpp | 11 ++++--- src/app/tools/drawTools/vtoolsplinepath.cpp | 10 ++++--- src/app/tools/nodeDetails/vnodearc.cpp | 6 ++-- src/app/tools/nodeDetails/vnodepoint.cpp | 6 ++-- src/app/tools/nodeDetails/vnodespline.cpp | 6 ++-- src/app/tools/nodeDetails/vnodesplinepath.cpp | 6 ++-- src/app/visualization/vcontrolpointspline.cpp | 17 ++++++----- src/app/visualization/vcontrolpointspline.h | 4 ++- src/app/visualization/visline.cpp | 3 +- src/app/visualization/vispath.cpp | 3 +- src/app/visualization/vistoolline.cpp | 2 +- src/app/visualization/vistooltriangle.cpp | 2 +- src/app/visualization/visualization.cpp | 9 +++--- src/app/visualization/visualization.h | 5 ++-- src/app/visualization/vsimplecurve.cpp | 21 +++++++------ src/app/visualization/vsimplecurve.h | 6 ++-- src/libs/ifc/ifcdef.cpp | 30 +++++++++++++++++++ src/libs/ifc/ifcdef.h | 3 ++ 29 files changed, 156 insertions(+), 133 deletions(-) diff --git a/src/app/core/vapplication.cpp b/src/app/core/vapplication.cpp index ccbbeb309..e88a8e4cd 100644 --- a/src/app/core/vapplication.cpp +++ b/src/app/core/vapplication.cpp @@ -157,9 +157,8 @@ const QString VApplication::GistFileName = QStringLiteral("gist.json"); */ VApplication::VApplication(int &argc, char **argv) : QApplication(argc, argv), _patternUnit(Unit::Cm), _patternType(MeasurementsType::Individual), - _widthMainLine(DefWidth), _widthHairLine(DefWidth/3.0), trVars(nullptr), - undoStack(nullptr), sceneView(nullptr), currentScene(nullptr), autoSaveTimer(nullptr), mainWindow(nullptr), - openingPattern(false), settings(nullptr), doc(nullptr), log(nullptr), + trVars(nullptr), undoStack(nullptr), sceneView(nullptr), currentScene(nullptr), autoSaveTimer(nullptr), + mainWindow(nullptr), openingPattern(false), settings(nullptr), doc(nullptr), log(nullptr), #if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0) out(nullptr), logLock(nullptr) #else @@ -167,8 +166,6 @@ VApplication::VApplication(int &argc, char **argv) #endif { undoStack = new QUndoStack(this); - - InitLineWidth(); } //--------------------------------------------------------------------------------------------------------------------- @@ -349,27 +346,6 @@ QString VApplication::translationsPath() const #endif } -//--------------------------------------------------------------------------------------------------------------------- -void VApplication::InitLineWidth() -{ - switch (_patternUnit) - { - case Unit::Mm: - _widthMainLine = DefWidth; - break; - case Unit::Cm: - _widthMainLine = DefWidth/10.0; - break; - case Unit::Inch: - _widthMainLine = DefWidth/25.4; - break; - default: - _widthMainLine = DefWidth; - break; - } - _widthHairLine = _widthMainLine/3.0; -} - //--------------------------------------------------------------------------------------------------------------------- QString VApplication::LogDirPath() const { @@ -493,7 +469,6 @@ void VApplication::ClearOldLogs() const void VApplication::setPatternUnit(const Unit &patternUnit) { _patternUnit = patternUnit; - InitLineWidth(); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/core/vapplication.h b/src/app/core/vapplication.h index 98ff39415..e3086722b 100644 --- a/src/app/core/vapplication.h +++ b/src/app/core/vapplication.h @@ -77,8 +77,6 @@ public: #endif //QT_VERSION >= QT_VERSION_CHECK(5, 1, 0) QString translationsPath() const; - qreal widthMainLine() const; - qreal widthHairLine() const; template QString LocaleToString(const T &value) @@ -133,8 +131,6 @@ private: Q_DISABLE_COPY(VApplication) Unit _patternUnit; MeasurementsType _patternType; - qreal _widthMainLine; - qreal _widthHairLine; VTranslateVars *trVars; QUndoStack *undoStack; VMainGraphicsView *sceneView; @@ -204,18 +200,6 @@ inline void VApplication::setPatternType(const MeasurementsType &patternType) _patternType = patternType; } -//--------------------------------------------------------------------------------------------------------------------- -inline qreal VApplication::widthMainLine() const -{ - return _widthMainLine; -} - -//--------------------------------------------------------------------------------------------------------------------- -inline qreal VApplication::widthHairLine() const -{ - return _widthHairLine; -} - //--------------------------------------------------------------------------------------------------------------------- inline QUndoStack *VApplication::getUndoStack() const { diff --git a/src/app/mainwindowsnogui.cpp b/src/app/mainwindowsnogui.cpp index cc97757b1..55b3f5721 100644 --- a/src/app/mainwindowsnogui.cpp +++ b/src/app/mainwindowsnogui.cpp @@ -400,8 +400,8 @@ QIcon MainWindowsNoGUI::ScenePreview(int i) const QPainter painter(&image); painter.setFont( QFont( "Arial", 8, QFont::Normal ) ); painter.setRenderHint(QPainter::Antialiasing, true); - painter.setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()), Qt::SolidLine, Qt::RoundCap, - Qt::RoundJoin)); + painter.setPen(QPen(Qt::black, qApp->toPixel(WidthMainLine(*pattern->GetPatternUnit())), Qt::SolidLine, + Qt::RoundCap, Qt::RoundJoin)); painter.setBrush ( QBrush ( Qt::NoBrush ) ); scenes.at(i)->render(&painter); painter.end(); @@ -508,8 +508,8 @@ void MainWindowsNoGUI::SvgFile(const QString &name, int i) const painter.begin(&generator); painter.setFont( QFont( "Arial", 8, QFont::Normal ) ); painter.setRenderHint(QPainter::Antialiasing, true); - painter.setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine()), Qt::SolidLine, Qt::RoundCap, - Qt::RoundJoin)); + painter.setPen(QPen(Qt::black, qApp->toPixel(WidthHairLine(*pattern->GetPatternUnit())), Qt::SolidLine, + Qt::RoundCap, Qt::RoundJoin)); painter.setBrush ( QBrush ( Qt::NoBrush ) ); scenes.at(i)->render(&painter, paper->rect(), paper->rect(), Qt::IgnoreAspectRatio); painter.end(); @@ -533,8 +533,8 @@ void MainWindowsNoGUI::PngFile(const QString &name, int i) const QPainter painter(&image); painter.setFont( QFont( "Arial", 8, QFont::Normal ) ); painter.setRenderHint(QPainter::Antialiasing, true); - painter.setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()), Qt::SolidLine, Qt::RoundCap, - Qt::RoundJoin)); + painter.setPen(QPen(Qt::black, qApp->toPixel(WidthMainLine(*pattern->GetPatternUnit())), Qt::SolidLine, + Qt::RoundCap, Qt::RoundJoin)); painter.setBrush ( QBrush ( Qt::NoBrush ) ); scenes.at(i)->render(&painter, r, r, Qt::IgnoreAspectRatio); image.save(name); @@ -577,8 +577,8 @@ void MainWindowsNoGUI::PdfFile(const QString &name, int i) const } painter.setFont( QFont( "Arial", 8, QFont::Normal ) ); painter.setRenderHint(QPainter::Antialiasing, true); - painter.setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()), Qt::SolidLine, Qt::RoundCap, - Qt::RoundJoin)); + painter.setPen(QPen(Qt::black, qApp->toPixel(WidthMainLine(*pattern->GetPatternUnit())), Qt::SolidLine, + Qt::RoundCap, Qt::RoundJoin)); painter.setBrush ( QBrush ( Qt::NoBrush ) ); scenes.at(i)->render(&painter, r, r, Qt::IgnoreAspectRatio); painter.end(); @@ -685,15 +685,15 @@ QVector MainWindowsNoGUI::AllSheets() QPainter painter(&image); painter.setFont( QFont( "Arial", 8, QFont::Normal ) ); painter.setRenderHint(QPainter::Antialiasing, true); - painter.setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()), Qt::SolidLine, Qt::RoundCap, - Qt::RoundJoin)); + painter.setPen(QPen(Qt::black, qApp->toPixel(WidthMainLine(*pattern->GetPatternUnit())), Qt::SolidLine, + Qt::RoundCap, Qt::RoundJoin)); painter.setBrush ( QBrush ( Qt::NoBrush ) ); scenes.at(i)->render(&painter); painter.end(); images.append(image); // Resore - paper->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()))); + paper->setPen(QPen(Qt::black, qApp->toPixel(WidthMainLine(*pattern->GetPatternUnit())))); brush->setColor( QColor( Qt::gray ) ); brush->setStyle( Qt::SolidPattern ); scenes[i]->setBackgroundBrush( *brush ); diff --git a/src/app/tools/drawTools/vabstractspline.cpp b/src/app/tools/drawTools/vabstractspline.cpp index b62894c23..8d5840880 100644 --- a/src/app/tools/drawTools/vabstractspline.cpp +++ b/src/app/tools/drawTools/vabstractspline.cpp @@ -75,7 +75,8 @@ void VAbstractSpline::Disable(bool disable, const QString &namePP) { enabled = !CorrectDisable(disable, namePP); this->setEnabled(enabled); - this->setPen(QPen(CorrectColor(lineColor), qApp->toPixel(qApp->widthHairLine())/factor, Qt::SolidLine, + this->setPen(QPen(CorrectColor(lineColor), + qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor, Qt::SolidLine, Qt::RoundCap)); emit setEnabledPoint(enabled); } @@ -119,7 +120,8 @@ void VAbstractSpline::SetFactor(qreal factor) void VAbstractSpline::hoverEnterEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); - this->setPen(QPen(CorrectColor(lineColor), qApp->toPixel(qApp->widthMainLine())/factor, Qt::SolidLine, + this->setPen(QPen(CorrectColor(lineColor), + qApp->toPixel(WidthMainLine(*VAbstractTool::data.GetPatternUnit()))/factor, Qt::SolidLine, Qt::RoundCap)); this->setPath(ToolPath(PathDirection::Show)); isHovered = true; @@ -135,7 +137,8 @@ void VAbstractSpline::hoverEnterEvent(QGraphicsSceneHoverEvent *event) void VAbstractSpline::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); - this->setPen(QPen(CorrectColor(lineColor), qApp->toPixel(qApp->widthHairLine())/factor)); + this->setPen(QPen(CorrectColor(lineColor), + qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor)); if (detailsMode) { this->setPath(ToolPath(PathDirection::Show)); @@ -244,10 +247,12 @@ void VAbstractSpline::setEnabled(bool enabled) QGraphicsPathItem::setEnabled(enabled); if (enabled) { - setPen(QPen(QColor(lineColor), qApp->toPixel(qApp->widthHairLine())/factor)); + setPen(QPen(QColor(lineColor), + qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor)); } else { - setPen(QPen(Qt::gray, qApp->toPixel(qApp->widthHairLine())/factor)); + setPen(QPen(Qt::gray, + qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor)); } } diff --git a/src/app/tools/drawTools/vtoolarc.cpp b/src/app/tools/drawTools/vtoolarc.cpp index b4c77d517..3bcc3c0ab 100644 --- a/src/app/tools/drawTools/vtoolarc.cpp +++ b/src/app/tools/drawTools/vtoolarc.cpp @@ -55,7 +55,7 @@ VToolArc::VToolArc(VPattern *doc, VContainer *data, quint32 id, const QString &c lineColor = color; this->setPath(ToolPath()); - this->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine())/factor)); + this->setPen(QPen(Qt::black, qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor)); this->setFlag(QGraphicsItem::ItemIsSelectable, true); this->setFlag(QGraphicsItem::ItemIsFocusable, true); this->setAcceptHoverEvents(true); @@ -358,7 +358,8 @@ void VToolArc::SetVisualization() */ void VToolArc::RefreshGeometry() { - this->setPen(QPen(CorrectColor(lineColor), qApp->toPixel(qApp->widthHairLine())/factor)); + this->setPen(QPen(CorrectColor(lineColor), + qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor)); this->setPath(ToolPath()); SetVisualization(); diff --git a/src/app/tools/drawTools/vtoolarcwithlength.cpp b/src/app/tools/drawTools/vtoolarcwithlength.cpp index af2a1ed3c..17e03582f 100644 --- a/src/app/tools/drawTools/vtoolarcwithlength.cpp +++ b/src/app/tools/drawTools/vtoolarcwithlength.cpp @@ -47,7 +47,7 @@ VToolArcWithLength::VToolArcWithLength(VPattern *doc, VContainer *data, quint32 lineColor = color; this->setPath(ToolPath()); - this->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine())/factor)); + this->setPen(QPen(Qt::black, qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor)); this->setFlag(QGraphicsItem::ItemIsSelectable, true); this->setFlag(QGraphicsItem::ItemIsFocusable, true); this->setAcceptHoverEvents(true); @@ -312,7 +312,8 @@ void VToolArcWithLength::SetVisualization() //--------------------------------------------------------------------------------------------------------------------- void VToolArcWithLength::RefreshGeometry() { - this->setPen(QPen(CorrectColor(lineColor), qApp->toPixel(qApp->widthHairLine())/factor)); + this->setPen(QPen(CorrectColor(lineColor), + qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor)); this->setPath(ToolPath()); SetVisualization(); diff --git a/src/app/tools/drawTools/vtoolcut.cpp b/src/app/tools/drawTools/vtoolcut.cpp index 746533674..e6a2fce65 100644 --- a/src/app/tools/drawTools/vtoolcut.cpp +++ b/src/app/tools/drawTools/vtoolcut.cpp @@ -43,14 +43,16 @@ VToolCut::VToolCut(VPattern *doc, VContainer *data, const quint32 &id, const QSt lineColor = color; - firstCurve = new VSimpleCurve(curve1id, QColor(lineColor), SimpleCurvePoint::ForthPoint, &factor); + firstCurve = new VSimpleCurve(curve1id, QColor(lineColor), SimpleCurvePoint::ForthPoint, *data->GetPatternUnit(), + &factor); firstCurve->setParentItem(this); connect(firstCurve, &VSimpleCurve::Choosed, this, &VToolCut::CurveChoosed); connect(firstCurve, &VSimpleCurve::HoverPath, this, &VToolCut::HoverPath); // TODO: Now we only hide simple curves, but in future need totally delete them all. firstCurve->setVisible(false); - secondCurve = new VSimpleCurve(curve2id, QColor(lineColor), SimpleCurvePoint::FirstPoint, &factor); + secondCurve = new VSimpleCurve(curve2id, QColor(lineColor), SimpleCurvePoint::FirstPoint, *data->GetPatternUnit(), + &factor); secondCurve->setParentItem(this); connect(secondCurve, &VSimpleCurve::Choosed, this, &VToolCut::CurveChoosed); connect(secondCurve, &VSimpleCurve::HoverPath, this, &VToolCut::HoverPath); diff --git a/src/app/tools/drawTools/vtoolline.cpp b/src/app/tools/drawTools/vtoolline.cpp index d8de28978..0ef1cbfe7 100644 --- a/src/app/tools/drawTools/vtoolline.cpp +++ b/src/app/tools/drawTools/vtoolline.cpp @@ -62,7 +62,8 @@ VToolLine::VToolLine(VPattern *doc, VContainer *data, quint32 id, quint32 firstP this->setFlag(QGraphicsItem::ItemIsSelectable, true); this->setFlag(QGraphicsItem::ItemIsFocusable, true); this->setAcceptHoverEvents(true); - this->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine())/factor, LineStyleToPenStyle(typeLine))); + this->setPen(QPen(Qt::black, qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor, + LineStyleToPenStyle(typeLine))); ToolCreation(typeCreation); } @@ -218,7 +219,8 @@ void VToolLine::Disable(bool disable, const QString &namePP) { enabled = !CorrectDisable(disable, namePP); this->setEnabled(enabled); - this->setPen(QPen(CorrectColor(baseColor), qApp->toPixel(qApp->widthHairLine())/factor, + this->setPen(QPen(CorrectColor(baseColor), + qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor, LineStyleToPenStyle(typeLine))); } @@ -270,7 +272,8 @@ void VToolLine::RefreshDataInFile() void VToolLine::hoverEnterEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); - this->setPen(QPen(CorrectColor(lineColor), qApp->toPixel(qApp->widthMainLine())/factor, + this->setPen(QPen(CorrectColor(lineColor), + qApp->toPixel(WidthMainLine(*VAbstractTool::data.GetPatternUnit()))/factor, LineStyleToPenStyle(typeLine))); } @@ -284,7 +287,8 @@ void VToolLine::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) Q_UNUSED(event); if (vis == nullptr) { - this->setPen(QPen(CorrectColor(lineColor), qApp->toPixel(qApp->widthHairLine())/factor, + this->setPen(QPen(CorrectColor(lineColor), + qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor, LineStyleToPenStyle(typeLine))); } } diff --git a/src/app/tools/drawTools/vtoollinepoint.cpp b/src/app/tools/drawTools/vtoollinepoint.cpp index 698bfcb85..2a13dbc0b 100644 --- a/src/app/tools/drawTools/vtoollinepoint.cpp +++ b/src/app/tools/drawTools/vtoollinepoint.cpp @@ -54,7 +54,8 @@ VToolLinePoint::VToolLinePoint(VPattern *doc, VContainer *data, const quint32 &i QPointF point1 = data->GeometricObject(basePointId)->toQPointF(); QPointF point2 = data->GeometricObject(id)->toQPointF(); mainLine = new QGraphicsLineItem(QLineF(point1 - point2, QPointF()), this); - mainLine->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine())/factor, LineStyleToPenStyle(typeLine))); + mainLine->setPen(QPen(Qt::black, qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor, + LineStyleToPenStyle(typeLine))); mainLine->setFlag(QGraphicsItem::ItemStacksBehindParent, true); } @@ -70,7 +71,8 @@ VToolLinePoint::~VToolLinePoint() */ void VToolLinePoint::RefreshGeometry() { - mainLine->setPen(QPen(CorrectColor(QColor(lineColor)), qApp->toPixel(qApp->widthHairLine())/factor, + mainLine->setPen(QPen(CorrectColor(QColor(lineColor)), + qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor, LineStyleToPenStyle(typeLine))); VToolPoint::RefreshPointGeometry(*VDrawTool::data.GeometricObject(id)); QPointF point = VDrawTool::data.GeometricObject(id)->toQPointF(); @@ -111,7 +113,8 @@ void VToolLinePoint::SetFactor(qreal factor) void VToolLinePoint::Disable(bool disable, const QString &namePP) { VToolPoint::Disable(disable, namePP); - mainLine->setPen(QPen(CorrectColor(lineColor), qApp->toPixel(qApp->widthHairLine())/factor, + mainLine->setPen(QPen(CorrectColor(lineColor), + qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor, LineStyleToPenStyle(typeLine))); mainLine->setEnabled(enabled); } diff --git a/src/app/tools/drawTools/vtoolpoint.cpp b/src/app/tools/drawTools/vtoolpoint.cpp index 33a9fac30..d25bb9f07 100644 --- a/src/app/tools/drawTools/vtoolpoint.cpp +++ b/src/app/tools/drawTools/vtoolpoint.cpp @@ -221,7 +221,8 @@ void VToolPoint::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) void VToolPoint::hoverEnterEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); - this->setPen(QPen(CorrectColor(baseColor), qApp->toPixel(qApp->widthMainLine())/factor)); + this->setPen(QPen(CorrectColor(baseColor), + qApp->toPixel(WidthMainLine(*VAbstractTool::data.GetPatternUnit()))/factor)); QGraphicsEllipseItem::hoverEnterEvent(event); } @@ -233,7 +234,8 @@ void VToolPoint::hoverEnterEvent(QGraphicsSceneHoverEvent *event) void VToolPoint::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); - this->setPen(QPen(CorrectColor(baseColor), qApp->toPixel(qApp->widthHairLine())/factor)); + this->setPen(QPen(CorrectColor(baseColor), + qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor)); QGraphicsEllipseItem::hoverLeaveEvent(event); } @@ -245,7 +247,8 @@ void VToolPoint::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) void VToolPoint::RefreshPointGeometry(const VPointF &point) { this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, false); - this->setPen(QPen(CorrectColor(baseColor), qApp->toPixel(qApp->widthHairLine())/factor)); + this->setPen(QPen(CorrectColor(baseColor), + qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor)); QRectF rec = QRectF(0, 0, radius*2, radius*2); rec.translate(-rec.center().x(), -rec.center().y()); this->setRect(rec); @@ -277,7 +280,8 @@ void VToolPoint::RefreshLine() VGObject::LineIntersectCircle(QPointF(), radius, QLineF(QPointF(), nameRec.center() - scenePos()), p1, p2); QPointF pRec = VGObject::LineIntersectRect(nameRec, QLineF(scenePos(), nameRec.center())); lineName->setLine(QLineF(p1, pRec - scenePos())); - lineName->setPen(QPen(CorrectColor(Qt::black), qApp->toPixel(qApp->widthHairLine())/factor)); + lineName->setPen(QPen(CorrectColor(Qt::black), + qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor)); if (QLineF(p1, pRec - scenePos()).length() <= ToPixel(4, Unit::Mm)) { @@ -362,10 +366,10 @@ void VToolPoint::setEnabled(bool enabled) QGraphicsEllipseItem::setEnabled(enabled); if (enabled) { - setPen(QPen(QColor(baseColor), qApp->toPixel(qApp->widthHairLine())/factor)); + setPen(QPen(QColor(baseColor), qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor)); } else { - setPen(QPen(Qt::gray, qApp->toPixel(qApp->widthHairLine())/factor)); + setPen(QPen(Qt::gray, qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor)); } } diff --git a/src/app/tools/drawTools/vtoolsinglepoint.cpp b/src/app/tools/drawTools/vtoolsinglepoint.cpp index 5c025facc..7e5ec1a34 100644 --- a/src/app/tools/drawTools/vtoolsinglepoint.cpp +++ b/src/app/tools/drawTools/vtoolsinglepoint.cpp @@ -53,7 +53,7 @@ VToolSinglePoint::VToolSinglePoint (VPattern *doc, VContainer *data, quint32 id, :VToolPoint(doc, data, id, parent), namePP(namePP), mPath(mPath) { baseColor = Qt::red; - this->setPen(QPen(baseColor, qApp->toPixel(qApp->widthHairLine())/factor)); + this->setPen(QPen(baseColor, qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor)); this->setFlag(QGraphicsItem::ItemIsMovable, true); this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); this->setFlag(QGraphicsItem::ItemIsFocusable, false); @@ -258,7 +258,7 @@ void VToolSinglePoint::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) void VToolSinglePoint::SetColorLabel(const Qt::GlobalColor &color) { namePoint->setBrush(color); - lineName->setPen(QPen(color, qApp->toPixel(qApp->widthHairLine())/factor)); + lineName->setPen(QPen(color, qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor)); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/tools/drawTools/vtoolspline.cpp b/src/app/tools/drawTools/vtoolspline.cpp index d87d5d2bb..5ab843269 100644 --- a/src/app/tools/drawTools/vtoolspline.cpp +++ b/src/app/tools/drawTools/vtoolspline.cpp @@ -57,7 +57,7 @@ VToolSpline::VToolSpline(VPattern *doc, VContainer *data, quint32 id, const QStr sceneType = SceneObject::Spline; lineColor = color; - this->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine())/factor)); + this->setPen(QPen(Qt::black, qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor)); this->setFlag(QGraphicsItem::ItemIsSelectable, true); this->setFlag(QGraphicsItem::ItemIsFocusable, true); this->setFlag(QGraphicsItem::ItemIsMovable, true); @@ -66,7 +66,8 @@ VToolSpline::VToolSpline(VPattern *doc, VContainer *data, quint32 id, const QStr const QSharedPointer spl = VAbstractTool::data.GeometricObject(id); VControlPointSpline *controlPoint1 = new VControlPointSpline(1, SplinePointPosition::FirstPoint, spl->GetP2(), - spl->GetP1().toQPointF(), this); + spl->GetP1().toQPointF(), *data->GetPatternUnit(), + this); connect(controlPoint1, &VControlPointSpline::ControlPointChangePosition, this, &VToolSpline::ControlPointChangePosition); connect(this, &VToolSpline::RefreshLine, controlPoint1, &VControlPointSpline::RefreshLine); @@ -75,7 +76,8 @@ VToolSpline::VToolSpline(VPattern *doc, VContainer *data, quint32 id, const QStr controlPoints.append(controlPoint1); VControlPointSpline *controlPoint2 = new VControlPointSpline(1, SplinePointPosition::LastPoint, spl->GetP3(), - spl->GetP4().toQPointF(), this); + spl->GetP4().toQPointF(), *data->GetPatternUnit(), + this); connect(controlPoint2, &VControlPointSpline::ControlPointChangePosition, this, &VToolSpline::ControlPointChangePosition); connect(this, &VToolSpline::RefreshLine, controlPoint2, &VControlPointSpline::RefreshLine); @@ -467,7 +469,8 @@ void VToolSpline::SetVisualization() */ void VToolSpline::RefreshGeometry() { - this->setPen(QPen(CorrectColor(lineColor), qApp->toPixel(qApp->widthHairLine())/factor)); + this->setPen(QPen(CorrectColor(lineColor), + qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor)); if (isHovered || detailsMode) { this->setPath(ToolPath(PathDirection::Show)); diff --git a/src/app/tools/drawTools/vtoolsplinepath.cpp b/src/app/tools/drawTools/vtoolsplinepath.cpp index 6e6915041..45c0a6fa1 100644 --- a/src/app/tools/drawTools/vtoolsplinepath.cpp +++ b/src/app/tools/drawTools/vtoolsplinepath.cpp @@ -56,7 +56,7 @@ VToolSplinePath::VToolSplinePath(VPattern *doc, VContainer *data, quint32 id, co lineColor = color; this->setPath(ToolPath()); - this->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine())/factor)); + this->setPen(QPen(Qt::black, qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor)); this->setFlag(QGraphicsItem::ItemIsSelectable, true); this->setFlag(QGraphicsItem::ItemIsFocusable, true); this->setFlag(QGraphicsItem::ItemIsMovable, true); @@ -67,7 +67,8 @@ VToolSplinePath::VToolSplinePath(VPattern *doc, VContainer *data, quint32 id, co { VSpline spl = splPath->GetSpline(i); VControlPointSpline *controlPoint = new VControlPointSpline(i, SplinePointPosition::FirstPoint, spl.GetP2(), - spl.GetP1().toQPointF(), this); + spl.GetP1().toQPointF(), *data->GetPatternUnit(), + this); connect(controlPoint, &VControlPointSpline::ControlPointChangePosition, this, &VToolSplinePath::ControlPointChangePosition); connect(this, &VToolSplinePath::RefreshLine, controlPoint, &VControlPointSpline::RefreshLine); @@ -76,7 +77,7 @@ VToolSplinePath::VToolSplinePath(VPattern *doc, VContainer *data, quint32 id, co controlPoints.append(controlPoint); controlPoint = new VControlPointSpline(i, SplinePointPosition::LastPoint, spl.GetP3(), spl.GetP4().toQPointF(), - this); + *data->GetPatternUnit(), this); connect(controlPoint, &VControlPointSpline::ControlPointChangePosition, this, &VToolSplinePath::ControlPointChangePosition); connect(this, &VToolSplinePath::RefreshLine, controlPoint, &VControlPointSpline::RefreshLine); @@ -548,7 +549,8 @@ void VToolSplinePath::RefreshGeometry() { this->setPath(ToolPath()); } - this->setPen(QPen(CorrectColor(lineColor), qApp->toPixel(qApp->widthHairLine())/factor)); + this->setPen(QPen(CorrectColor(lineColor), + qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor)); const QSharedPointer splPath = VAbstractTool::data.GeometricObject(id); for (qint32 i = 1; i<=splPath->Count(); ++i) { diff --git a/src/app/tools/nodeDetails/vnodearc.cpp b/src/app/tools/nodeDetails/vnodearc.cpp index 23158b6da..0c760a23a 100644 --- a/src/app/tools/nodeDetails/vnodearc.cpp +++ b/src/app/tools/nodeDetails/vnodearc.cpp @@ -53,7 +53,7 @@ VNodeArc::VNodeArc(VPattern *doc, VContainer *data, quint32 id, quint32 idArc, c :VAbstractNode(doc, data, id, idArc, idTool, qoParent), QGraphicsPathItem(parent) { RefreshGeometry(); - this->setPen(QPen(baseColor, qApp->toPixel(qApp->widthHairLine()))); + this->setPen(QPen(baseColor, qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit())))); ToolCreation(typeCreation); } @@ -191,7 +191,7 @@ void VNodeArc::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) void VNodeArc::hoverMoveEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthMainLine()))); + this->setPen(QPen(currentColor, qApp->toPixel(WidthMainLine(*VAbstractTool::data.GetPatternUnit())))); } //--------------------------------------------------------------------------------------------------------------------- @@ -202,7 +202,7 @@ void VNodeArc::hoverMoveEvent(QGraphicsSceneHoverEvent *event) void VNodeArc::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine()))); + this->setPen(QPen(currentColor, qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit())))); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/tools/nodeDetails/vnodepoint.cpp b/src/app/tools/nodeDetails/vnodepoint.cpp index 3318a0e63..93a521acf 100644 --- a/src/app/tools/nodeDetails/vnodepoint.cpp +++ b/src/app/tools/nodeDetails/vnodepoint.cpp @@ -60,7 +60,7 @@ VNodePoint::VNodePoint(VPattern *doc, VContainer *data, quint32 id, quint32 idPo lineName = new QGraphicsLineItem(this); connect(namePoint, &VGraphicsSimpleTextItem::NameChangePosition, this, &VNodePoint::NameChangePosition); - this->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine()))); + this->setPen(QPen(Qt::black, qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit())))); this->setBrush(QBrush(Qt::NoBrush)); this->setFlag(QGraphicsItem::ItemIsSelectable, true); this->setAcceptHoverEvents(true); @@ -208,7 +208,7 @@ void VNodePoint::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) void VNodePoint::hoverMoveEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthMainLine()))); + this->setPen(QPen(currentColor, qApp->toPixel(WidthMainLine(*VAbstractTool::data.GetPatternUnit())))); } //--------------------------------------------------------------------------------------------------------------------- @@ -219,7 +219,7 @@ void VNodePoint::hoverMoveEvent(QGraphicsSceneHoverEvent *event) void VNodePoint::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine()))); + this->setPen(QPen(currentColor, qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit())))); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/tools/nodeDetails/vnodespline.cpp b/src/app/tools/nodeDetails/vnodespline.cpp index ce231ed51..8d2e52b59 100644 --- a/src/app/tools/nodeDetails/vnodespline.cpp +++ b/src/app/tools/nodeDetails/vnodespline.cpp @@ -54,7 +54,7 @@ VNodeSpline::VNodeSpline(VPattern *doc, VContainer *data, quint32 id, quint32 id :VAbstractNode(doc, data, id, idSpline, idTool, qoParent), QGraphicsPathItem(parent) { RefreshGeometry(); - this->setPen(QPen(baseColor, qApp->toPixel(qApp->widthHairLine()))); + this->setPen(QPen(baseColor, qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit())))); ToolCreation(typeCreation); } @@ -193,7 +193,7 @@ void VNodeSpline::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) void VNodeSpline::hoverMoveEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthMainLine()))); + this->setPen(QPen(currentColor, qApp->toPixel(WidthMainLine(*VAbstractTool::data.GetPatternUnit())))); } //--------------------------------------------------------------------------------------------------------------------- @@ -204,7 +204,7 @@ void VNodeSpline::hoverMoveEvent(QGraphicsSceneHoverEvent *event) void VNodeSpline::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine()))); + this->setPen(QPen(currentColor, qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit())))); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/tools/nodeDetails/vnodesplinepath.cpp b/src/app/tools/nodeDetails/vnodesplinepath.cpp index c3aac3c0c..6614c09a0 100644 --- a/src/app/tools/nodeDetails/vnodesplinepath.cpp +++ b/src/app/tools/nodeDetails/vnodesplinepath.cpp @@ -54,7 +54,7 @@ VNodeSplinePath::VNodeSplinePath(VPattern *doc, VContainer *data, quint32 id, qu :VAbstractNode(doc, data, id, idSpline, idTool, qoParent), QGraphicsPathItem(parent) { RefreshGeometry(); - this->setPen(QPen(baseColor, qApp->toPixel(qApp->widthHairLine()))); + this->setPen(QPen(baseColor, qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit())))); ToolCreation(typeCreation); } @@ -196,7 +196,7 @@ void VNodeSplinePath::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) void VNodeSplinePath::hoverMoveEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthMainLine()))); + this->setPen(QPen(currentColor, qApp->toPixel(WidthMainLine(*VAbstractTool::data.GetPatternUnit())))); } //--------------------------------------------------------------------------------------------------------------------- @@ -207,7 +207,7 @@ void VNodeSplinePath::hoverMoveEvent(QGraphicsSceneHoverEvent *event) void VNodeSplinePath::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine()))); + this->setPen(QPen(currentColor, qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit())))); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/visualization/vcontrolpointspline.cpp b/src/app/visualization/vcontrolpointspline.cpp index 5b1a91d48..469f9328d 100644 --- a/src/app/visualization/vcontrolpointspline.cpp +++ b/src/app/visualization/vcontrolpointspline.cpp @@ -44,16 +44,17 @@ * @param parent parent object. */ VControlPointSpline::VControlPointSpline(const qint32 &indexSpline, SplinePointPosition position, - const QPointF &controlPoint, const QPointF &splinePoint, + const QPointF &controlPoint, const QPointF &splinePoint, Unit patternUnit, QGraphicsItem *parent) - :QGraphicsEllipseItem(parent), radius(0), controlLine(nullptr), indexSpline(indexSpline), position(position) + :QGraphicsEllipseItem(parent), radius(0), controlLine(nullptr), indexSpline(indexSpline), position(position), + patternUnit(patternUnit) { //create circle radius = (1.5/*mm*/ / 25.4) * PrintDPI; QRectF rec = QRectF(0, 0, radius*2, radius*2); rec.translate(-rec.center().x(), -rec.center().y()); this->setRect(rec); - this->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine()))); + this->setPen(QPen(Qt::black, qApp->toPixel(WidthHairLine(patternUnit)))); this->setBrush(QBrush(Qt::NoBrush)); this->setFlag(QGraphicsItem::ItemIsSelectable, true); this->setFlag(QGraphicsItem::ItemIsMovable, true); @@ -65,7 +66,7 @@ VControlPointSpline::VControlPointSpline(const qint32 &indexSpline, SplinePointP QPointF p1, p2; VGObject::LineIntersectCircle(QPointF(), radius, QLineF( QPointF(), splinePoint-controlPoint), p1, p2); controlLine = new QGraphicsLineItem(QLineF(splinePoint-controlPoint, p1), this); - controlLine->setPen(QPen(Qt::red, qApp->toPixel(qApp->widthHairLine()))); + controlLine->setPen(QPen(Qt::red, qApp->toPixel(WidthHairLine(patternUnit)))); controlLine->setFlag(QGraphicsItem::ItemStacksBehindParent, true); } @@ -96,7 +97,7 @@ void VControlPointSpline::paint(QPainter *painter, const QStyleOptionGraphicsIte */ void VControlPointSpline::hoverEnterEvent(QGraphicsSceneHoverEvent *event) { - this->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()))); + this->setPen(QPen(Qt::black, qApp->toPixel(WidthMainLine(patternUnit)))); VApplication::setOverrideCursor(cursorArrowOpenHand, 1, 1); QGraphicsEllipseItem::hoverEnterEvent(event); } @@ -104,7 +105,7 @@ void VControlPointSpline::hoverEnterEvent(QGraphicsSceneHoverEvent *event) //--------------------------------------------------------------------------------------------------------------------- void VControlPointSpline::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { - this->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine()))); + this->setPen(QPen(Qt::black, qApp->toPixel(WidthHairLine(patternUnit)))); //Disable cursor-arrow-openhand VApplication::restoreOverrideCursor(cursorArrowOpenHand); QGraphicsEllipseItem::hoverLeaveEvent(event); @@ -183,14 +184,14 @@ void VControlPointSpline::setEnabledPoint(bool enable) { if (enable == true) { - this->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine()))); + this->setPen(QPen(Qt::black, qApp->toPixel(WidthHairLine(patternUnit)))); this->setFlag(QGraphicsItem::ItemIsSelectable, true); this->setFlag(QGraphicsItem::ItemIsMovable, true); this->setAcceptHoverEvents(true); } else { - this->setPen(QPen(Qt::gray, qApp->toPixel(qApp->widthHairLine()))); + this->setPen(QPen(Qt::gray, qApp->toPixel(WidthHairLine(patternUnit)))); this->setFlag(QGraphicsItem::ItemIsSelectable, false); this->setFlag(QGraphicsItem::ItemIsMovable, false); this->setAcceptHoverEvents(false); diff --git a/src/app/visualization/vcontrolpointspline.h b/src/app/visualization/vcontrolpointspline.h index 1b5c99ded..f4416a6c2 100644 --- a/src/app/visualization/vcontrolpointspline.h +++ b/src/app/visualization/vcontrolpointspline.h @@ -42,7 +42,7 @@ class VControlPointSpline : public QObject, public QGraphicsEllipseItem Q_OBJECT public: VControlPointSpline(const qint32 &indexSpline, SplinePointPosition position, const QPointF &controlPoint, - const QPointF &splinePoint, QGraphicsItem * parent = nullptr); + const QPointF &splinePoint, Unit patternUnit, QGraphicsItem * parent = nullptr); virtual ~VControlPointSpline(); virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0); virtual int type() const {return Type;} @@ -85,6 +85,8 @@ private: /** @brief position position point in spline. */ SplinePointPosition position; + + Unit patternUnit; }; #endif // VCONTROLPOINTSPLINE_H diff --git a/src/app/visualization/visline.cpp b/src/app/visualization/visline.cpp index 82009a6e4..c87778efc 100644 --- a/src/app/visualization/visline.cpp +++ b/src/app/visualization/visline.cpp @@ -120,7 +120,8 @@ QLineF VisLine::Axis(const QPointF &p1, const QPointF &p2) const //--------------------------------------------------------------------------------------------------------------------- void VisLine::InitPen() { - this->setPen(QPen(mainColor, qApp->toPixel(qApp->widthHairLine())/factor, lineStyle)); + this->setPen(QPen(mainColor, qApp->toPixel(WidthHairLine(*Visualization::data->GetPatternUnit()))/factor, + lineStyle)); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/visualization/vispath.cpp b/src/app/visualization/vispath.cpp index b93549394..5fd99a48c 100644 --- a/src/app/visualization/vispath.cpp +++ b/src/app/visualization/vispath.cpp @@ -43,7 +43,8 @@ VisPath::~VisPath() //--------------------------------------------------------------------------------------------------------------------- void VisPath::InitPen() { - this->setPen(QPen(mainColor, qApp->toPixel(qApp->widthHairLine())/factor, lineStyle)); + this->setPen(QPen(mainColor, qApp->toPixel(WidthHairLine(*Visualization::data->GetPatternUnit()))/factor, + lineStyle)); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/visualization/vistoolline.cpp b/src/app/visualization/vistoolline.cpp index 3f41397aa..2d5ffa637 100644 --- a/src/app/visualization/vistoolline.cpp +++ b/src/app/visualization/vistoolline.cpp @@ -70,6 +70,6 @@ void VisToolLine::DrawLine(QGraphicsLineItem *lineItem, const QLineF &line, cons { SCASSERT (lineItem != nullptr); - lineItem->setPen(QPen(color, qApp->toPixel(qApp->widthMainLine())/factor, style)); + lineItem->setPen(QPen(color, qApp->toPixel(WidthMainLine(*Visualization::data->GetPatternUnit()))/factor, style)); lineItem->setLine(line); } diff --git a/src/app/visualization/vistooltriangle.cpp b/src/app/visualization/vistooltriangle.cpp index db490e095..5177aabe9 100644 --- a/src/app/visualization/vistooltriangle.cpp +++ b/src/app/visualization/vistooltriangle.cpp @@ -135,7 +135,7 @@ void VisToolTriangle::DrawAimedAxis(QGraphicsPathItem *item, const QLineF &line, { SCASSERT (item != nullptr); - item->setPen(QPen(color, qApp->toPixel(qApp->widthHairLine())/factor, style)); + item->setPen(QPen(color, qApp->toPixel(WidthHairLine(*Visualization::data->GetPatternUnit()))/factor, style)); QPainterPath path; path.moveTo(line.p1()); diff --git a/src/app/visualization/visualization.cpp b/src/app/visualization/visualization.cpp index 90cc7797f..8b78e2d08 100644 --- a/src/app/visualization/visualization.cpp +++ b/src/app/visualization/visualization.cpp @@ -109,7 +109,7 @@ QGraphicsEllipseItem *Visualization::InitPoint(const QColor &color, QGraphicsIte QGraphicsEllipseItem *point = new QGraphicsEllipseItem(parent); point->setZValue(1); point->setBrush(QBrush(Qt::NoBrush)); - point->setPen(QPen(color, qApp->toPixel(qApp->widthMainLine())/factor)); + point->setPen(QPen(color, qApp->toPixel(WidthMainLine(*Visualization::data->GetPatternUnit()))/factor)); point->setRect(PointRect(ToPixel(DefPointRadius/*mm*/, Unit::Mm))); point->setFlags(QGraphicsItem::ItemStacksBehindParent); point->setVisible(false); @@ -169,7 +169,7 @@ void Visualization::DrawPoint(QGraphicsEllipseItem *point, const QPointF &pos, c SCASSERT (point != nullptr); point->setPos(pos); - point->setPen(QPen(color, qApp->toPixel(qApp->widthMainLine())/factor, style)); + point->setPen(QPen(color, qApp->toPixel(WidthMainLine(*Visualization::data->GetPatternUnit()))/factor, style)); point->setVisible(true); } @@ -178,7 +178,7 @@ void Visualization::DrawLine(QGraphicsLineItem *lineItem, const QLineF &line, co { SCASSERT (lineItem != nullptr); - lineItem->setPen(QPen(color, qApp->toPixel(qApp->widthHairLine())/factor, style)); + lineItem->setPen(QPen(color, qApp->toPixel(WidthHairLine(*Visualization::data->GetPatternUnit()))/factor, style)); lineItem->setLine(line); lineItem->setVisible(true); } @@ -189,7 +189,8 @@ void Visualization::DrawPath(QGraphicsPathItem *pathItem, const QPainterPath &pa { SCASSERT (pathItem != nullptr); - pathItem->setPen(QPen(color, qApp->toPixel(qApp->widthMainLine())/factor, style, cap)); + pathItem->setPen(QPen(color, qApp->toPixel(WidthMainLine(*Visualization::data->GetPatternUnit()))/factor, style, + cap)); pathItem->setPath(path); pathItem->setVisible(true); } diff --git a/src/app/visualization/visualization.h b/src/app/visualization/visualization.h index 5596084db..3f9a414b9 100644 --- a/src/app/visualization/visualization.h +++ b/src/app/visualization/visualization.h @@ -35,11 +35,10 @@ #include "../core/vapplication.h" #include "../widgets/vmaingraphicsscene.h" #include "../../utils/logging.h" +#include "../../libs/vpatterndb/vcontainer.h" Q_DECLARE_LOGGING_CATEGORY(vVis) -class VContainer; - class Visualization : public QObject { Q_OBJECT @@ -99,7 +98,7 @@ protected: Item *InitItem(const QColor &color, QGraphicsItem *parent) { Item *item = new Item(parent); - item->setPen(QPen(color, qApp->toPixel(qApp->widthHairLine())/factor)); + item->setPen(QPen(color, qApp->toPixel(WidthHairLine(*data->GetPatternUnit()))/factor)); item->setZValue(1); item->setFlags(QGraphicsItem::ItemStacksBehindParent); item->setVisible(false); diff --git a/src/app/visualization/vsimplecurve.cpp b/src/app/visualization/vsimplecurve.cpp index 729539d1d..aecd703c5 100644 --- a/src/app/visualization/vsimplecurve.cpp +++ b/src/app/visualization/vsimplecurve.cpp @@ -27,7 +27,6 @@ *************************************************************************/ #include "vsimplecurve.h" -#include "../core/vapplication.h" #include #include #include @@ -40,18 +39,18 @@ * @param currentColor current color. * @param parent parent object. */ -VSimpleCurve::VSimpleCurve(quint32 id, QColor currentColor, SimpleCurvePoint pointPosition, qreal *factor, - QObject *parent) +VSimpleCurve::VSimpleCurve(quint32 id, QColor currentColor, SimpleCurvePoint pointPosition, Unit patternUnit, + qreal *factor, QObject *parent) :QObject(parent), QGraphicsPathItem(), id (id), factor(factor), currentColor(currentColor), - curvePosition(pointPosition), enabled(true) + curvePosition(pointPosition), enabled(true), patternUnit(patternUnit) { if (factor == nullptr) { - setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine()))); + setPen(QPen(currentColor, ToPixel(WidthHairLine(patternUnit), patternUnit))); } else { - setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/ *factor)); + setPen(QPen(currentColor, ToPixel(WidthHairLine(patternUnit), patternUnit)/ *factor)); } setFlag(QGraphicsItem::ItemIsSelectable, true); setAcceptHoverEvents(true); @@ -62,7 +61,7 @@ void VSimpleCurve::ChangedActivDraw(const bool &flag) { enabled = flag; setEnabled(enabled); - setPen(QPen(CorrectColor(currentColor), qApp->toPixel(qApp->widthHairLine())/ *factor)); + setPen(QPen(CorrectColor(currentColor), ToPixel(WidthHairLine(patternUnit), patternUnit)/ *factor)); } //--------------------------------------------------------------------------------------------------------------------- @@ -102,11 +101,11 @@ void VSimpleCurve::hoverMoveEvent(QGraphicsSceneHoverEvent *event) Q_UNUSED(event); if (factor == nullptr) { - this->setPen(QPen(CorrectColor(currentColor), qApp->toPixel(qApp->widthMainLine()))); + this->setPen(QPen(CorrectColor(currentColor), ToPixel(WidthMainLine(patternUnit), patternUnit))); } else { - this->setPen(QPen(CorrectColor(currentColor), qApp->toPixel(qApp->widthMainLine())/ *factor)); + this->setPen(QPen(CorrectColor(currentColor), ToPixel(WidthMainLine(patternUnit), patternUnit)/ *factor)); } emit HoverPath(id, curvePosition, PathDirection::Show); } @@ -121,11 +120,11 @@ void VSimpleCurve::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) Q_UNUSED(event); if (factor == nullptr) { - this->setPen(QPen(CorrectColor(currentColor), qApp->toPixel(qApp->widthHairLine()))); + this->setPen(QPen(CorrectColor(currentColor), ToPixel(WidthHairLine(patternUnit), patternUnit))); } else { - this->setPen(QPen(CorrectColor(currentColor), qApp->toPixel(qApp->widthHairLine())/ *factor)); + this->setPen(QPen(CorrectColor(currentColor), ToPixel(WidthHairLine(patternUnit), patternUnit)/ *factor)); } emit HoverPath(id, curvePosition, PathDirection::Hide); diff --git a/src/app/visualization/vsimplecurve.h b/src/app/visualization/vsimplecurve.h index 78279336c..4c2b6ff80 100644 --- a/src/app/visualization/vsimplecurve.h +++ b/src/app/visualization/vsimplecurve.h @@ -31,7 +31,7 @@ #include #include "../libs/vgeometry/vabstractcurve.h" -#include "../options.h" +#include "../../utils/def.h" enum class SimpleCurvePoint : char { FirstPoint, ForthPoint }; @@ -42,7 +42,7 @@ class VSimpleCurve : public QObject, public QGraphicsPathItem { Q_OBJECT public: - VSimpleCurve(quint32 id, QColor currentColor, SimpleCurvePoint curvePosition, + VSimpleCurve(quint32 id, QColor currentColor, SimpleCurvePoint curvePosition, Unit patternUnit, qreal *factor = nullptr, QObject *parent = 0); void ChangedActivDraw(const bool &flag); virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0); @@ -80,6 +80,8 @@ private: bool enabled; + Unit patternUnit; + QColor CorrectColor(const QColor &color) const; }; diff --git a/src/libs/ifc/ifcdef.cpp b/src/libs/ifc/ifcdef.cpp index 75410d596..5ed716df4 100644 --- a/src/libs/ifc/ifcdef.cpp +++ b/src/libs/ifc/ifcdef.cpp @@ -29,3 +29,33 @@ #include "ifcdef.h" const qreal PrintDPI = 96.0; + +#define DefWidth 1.2//mm + +//--------------------------------------------------------------------------------------------------------------------- +qreal WidthMainLine(Unit patternUnit) +{ + qreal _widthMainLine = DefWidth; + switch (patternUnit) + { + case Unit::Mm: + _widthMainLine = DefWidth; + break; + case Unit::Cm: + _widthMainLine = DefWidth/10.0; + break; + case Unit::Inch: + _widthMainLine = DefWidth/25.4; + break; + default: + _widthMainLine = DefWidth; + break; + } + return _widthMainLine; +} + +//--------------------------------------------------------------------------------------------------------------------- +qreal WidthHairLine(Unit patternUnit) +{ + return WidthMainLine(patternUnit)/3.0; +} diff --git a/src/libs/ifc/ifcdef.h b/src/libs/ifc/ifcdef.h index 7777bd572..adac8e6d2 100644 --- a/src/libs/ifc/ifcdef.h +++ b/src/libs/ifc/ifcdef.h @@ -61,6 +61,9 @@ static const quint32 null_id = 0; extern const qreal PrintDPI; +qreal WidthMainLine(Unit patternUnit); +qreal WidthHairLine(Unit patternUnit); + //--------------------------------------------------------------------------------------------------------------------- inline double ToPixel(double val, const Unit &unit) { From 95f141d7374fe99d3bf6f96299f5c5109ea058a4 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 15 Jun 2015 12:37:18 +0300 Subject: [PATCH 03/22] Move realization to cpp. --HG-- branch : feature --- src/libs/ifc/ifcdef.cpp | 109 +++++++++++++++++++++++++++++++++++++++ src/libs/ifc/ifcdef.h | 110 ++-------------------------------------- 2 files changed, 112 insertions(+), 107 deletions(-) diff --git a/src/libs/ifc/ifcdef.cpp b/src/libs/ifc/ifcdef.cpp index 5ed716df4..8bfc8d93c 100644 --- a/src/libs/ifc/ifcdef.cpp +++ b/src/libs/ifc/ifcdef.cpp @@ -59,3 +59,112 @@ qreal WidthHairLine(Unit patternUnit) { return WidthMainLine(patternUnit)/3.0; } + +//--------------------------------------------------------------------------------------------------------------------- +double ToPixel(double val, const Unit &unit) +{ + switch (unit) + { + case Unit::Mm: + return (val / 25.4) * PrintDPI; + case Unit::Cm: + return ((val * 10.0) / 25.4) * PrintDPI; + case Unit::Inch: + return val * PrintDPI; + case Unit::Px: + return val; + default: + break; + } + return 0; +} + +//--------------------------------------------------------------------------------------------------------------------- +double FromPixel(double pix, const Unit &unit) +{ + switch (unit) + { + case Unit::Mm: + return (pix / PrintDPI) * 25.4; + case Unit::Cm: + return ((pix / PrintDPI) * 25.4) / 10.0; + case Unit::Inch: + return pix / PrintDPI; + case Unit::Px: + return pix; + default: + break; + } + return 0; +} + +//--------------------------------------------------------------------------------------------------------------------- +qreal UnitConvertor(qreal value, const Unit &from, const Unit &to) +{ + switch (from) + { + case Unit::Mm: + switch (to) + { + case Unit::Mm: + return value; + case Unit::Cm: + return value / 10.0; + case Unit::Inch: + return value / 25.4; + case Unit::Px: + return (value / 25.4) * PrintDPI; + default: + break; + } + break; + case Unit::Cm: + switch (to) + { + case Unit::Mm: + return value * 10.0; + case Unit::Cm: + return value; + case Unit::Inch: + return value / 2.54; + case Unit::Px: + return ((value * 10.0) / 25.4) * PrintDPI; + default: + break; + } + break; + case Unit::Inch: + switch (to) + { + case Unit::Mm: + return value * 25.4; + case Unit::Cm: + return value * 2.54; + case Unit::Inch: + return value; + case Unit::Px: + return value * PrintDPI; + default: + break; + } + break; + case Unit::Px: + switch (to) + { + case Unit::Mm: + return (value / PrintDPI) * 25.4; + case Unit::Cm: + return ((value / PrintDPI) * 25.4) / 10.0; + case Unit::Inch: + return value / PrintDPI; + case Unit::Px: + return value; + default: + break; + } + break; + default: + break; + } + return 0; +} diff --git a/src/libs/ifc/ifcdef.h b/src/libs/ifc/ifcdef.h index adac8e6d2..e61a27a06 100644 --- a/src/libs/ifc/ifcdef.h +++ b/src/libs/ifc/ifcdef.h @@ -64,113 +64,9 @@ extern const qreal PrintDPI; qreal WidthMainLine(Unit patternUnit); qreal WidthHairLine(Unit patternUnit); -//--------------------------------------------------------------------------------------------------------------------- -inline double ToPixel(double val, const Unit &unit) -{ - switch (unit) - { - case Unit::Mm: - return (val / 25.4) * PrintDPI; - case Unit::Cm: - return ((val * 10.0) / 25.4) * PrintDPI; - case Unit::Inch: - return val * PrintDPI; - case Unit::Px: - return val; - default: - break; - } - return 0; -} +double ToPixel(double val, const Unit &unit); +double FromPixel(double pix, const Unit &unit); -//--------------------------------------------------------------------------------------------------------------------- -inline double FromPixel(double pix, const Unit &unit) -{ - switch (unit) - { - case Unit::Mm: - return (pix / PrintDPI) * 25.4; - case Unit::Cm: - return ((pix / PrintDPI) * 25.4) / 10.0; - case Unit::Inch: - return pix / PrintDPI; - case Unit::Px: - return pix; - default: - break; - } - return 0; -} - -//--------------------------------------------------------------------------------------------------------------------- -inline qreal UnitConvertor(qreal value, const Unit &from, const Unit &to) -{ - switch (from) - { - case Unit::Mm: - switch (to) - { - case Unit::Mm: - return value; - case Unit::Cm: - return value / 10.0; - case Unit::Inch: - return value / 25.4; - case Unit::Px: - return (value / 25.4) * PrintDPI; - default: - break; - } - break; - case Unit::Cm: - switch (to) - { - case Unit::Mm: - return value * 10.0; - case Unit::Cm: - return value; - case Unit::Inch: - return value / 2.54; - case Unit::Px: - return ((value * 10.0) / 25.4) * PrintDPI; - default: - break; - } - break; - case Unit::Inch: - switch (to) - { - case Unit::Mm: - return value * 25.4; - case Unit::Cm: - return value * 2.54; - case Unit::Inch: - return value; - case Unit::Px: - return value * PrintDPI; - default: - break; - } - break; - case Unit::Px: - switch (to) - { - case Unit::Mm: - return (value / PrintDPI) * 25.4; - case Unit::Cm: - return ((value / PrintDPI) * 25.4) / 10.0; - case Unit::Inch: - return value / PrintDPI; - case Unit::Px: - return value; - default: - break; - } - break; - default: - break; - } - return 0; -} +qreal UnitConvertor(qreal value, const Unit &from, const Unit &to); #endif // IFCDEF_H From a67cd0b855c1c50cbe196a7255c9054b516f8e10 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 15 Jun 2015 13:03:24 +0300 Subject: [PATCH 04/22] Remove CONFIG += ordered. --HG-- branch : feature --- src/test/test.pro | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/test.pro b/src/test/test.pro index 2d7250662..c6011dc86 100644 --- a/src/test/test.pro +++ b/src/test/test.pro @@ -1,4 +1,4 @@ TEMPLATE = subdirs -CONFIG += ordered -SUBDIRS = ParserTest \ +SUBDIRS = \ + ParserTest \ ValentinaTest From cababbfc378df3d6883d13eba49568c434f8d6f1 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 15 Jun 2015 14:43:41 +0300 Subject: [PATCH 05/22] New static library VMisc. --HG-- branch : feature --- share/translations.pro | 3 +- src/app/app.pro | 12 ++- src/app/core/vapplication.cpp | 2 +- .../app/dialogstandardmeasurements.cpp | 2 +- src/app/dialogs/tools/dialogtool.h | 2 +- src/app/mainwindow.cpp | 2 +- src/app/options.h | 2 +- src/app/tools/drawTools/vtoolpoint.cpp | 2 +- src/app/tools/vdatatool.h | 2 +- src/app/undocommands/vundocommand.h | 2 +- src/app/visualization/visualization.h | 2 +- src/app/visualization/vsimplecurve.h | 2 +- src/app/widgets/doubledelegate.cpp | 2 +- src/app/widgets/vmaingraphicsscene.h | 2 +- src/app/xml/vstandardmeasurements.cpp | 1 + src/libs/ifc/exception/vexception.cpp | 4 +- src/libs/ifc/ifc.pro | 1 - src/libs/ifc/xml/vdomdocument.h | 2 +- src/libs/ifc/xml/vtoolrecord.h | 2 +- src/libs/libs.pro | 3 +- src/libs/vgeometry/vgeometry.pro | 1 - src/libs/vlayout/vlayout.pro | 1 - src/libs/vlayout/vposition.cpp | 2 +- src/libs/vlayout/vposter.cpp | 2 +- src/{utils => libs/vmisc}/def.cpp | 0 src/{utils => libs/vmisc}/def.h | 0 src/{utils => libs/vmisc}/logging.h | 0 src/libs/vmisc/stable.cpp | 30 ++++++ src/libs/vmisc/stable.h | 52 +++++++++ src/{utils => libs/vmisc}/vmath.h | 0 src/libs/vmisc/vmisc.pri | 12 +++ src/libs/vmisc/vmisc.pro | 101 ++++++++++++++++++ src/libs/vobj/vobj.pro | 1 - .../vpatterndb/variables/vinternalvariable.h | 2 +- src/libs/vpatterndb/vcontainer.cpp | 2 +- src/libs/vpatterndb/vnodedetail.h | 2 +- src/libs/vpatterndb/vpatterndb.pro | 1 - src/libs/vpatterndb/vtranslatevars.cpp | 2 +- src/utils/utils.pri | 7 -- 39 files changed, 232 insertions(+), 38 deletions(-) rename src/{utils => libs/vmisc}/def.cpp (100%) rename src/{utils => libs/vmisc}/def.h (100%) rename src/{utils => libs/vmisc}/logging.h (100%) create mode 100644 src/libs/vmisc/stable.cpp create mode 100644 src/libs/vmisc/stable.h rename src/{utils => libs/vmisc}/vmath.h (100%) create mode 100644 src/libs/vmisc/vmisc.pri create mode 100644 src/libs/vmisc/vmisc.pro delete mode 100644 src/utils/utils.pri diff --git a/share/translations.pro b/share/translations.pro index 45cdae4fe..7ea6a416b 100644 --- a/share/translations.pro +++ b/share/translations.pro @@ -15,7 +15,8 @@ DEPENDPATH += \ ../src/libs/vobj \ ../src/libs/vlayout \ ../src/libs/vgeometry \ - ../src/libs/vpatterndb + ../src/libs/vpatterndb \ + ../src/libs/vmisc include(../src/app/app.pri) include(../src/libs/qmuparser/qmuparser.pri) diff --git a/src/app/app.pro b/src/app/app.pro index 193aa596f..50d1eeab9 100644 --- a/src/app/app.pro +++ b/src/app/app.pro @@ -46,7 +46,6 @@ UI_DIR = uic # Suport subdirectories. Just better project code tree. include(app.pri) -include(../utils/utils.pri) # This include path help promoute VMainGraphicsView on main window. Without it compiler can't find path to custom view INCLUDEPATH += "$${PWD}/widgets" @@ -600,7 +599,7 @@ DEPENDPATH += $$PWD/../libs/vgeometry win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vgeometry/$${DESTDIR}/vgeometry.lib else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vgeometry/$${DESTDIR}/libvgeometry.a -#VPatternDB staic library +#VPatternDB static library unix|win32: LIBS += -L$$OUT_PWD/../libs/vpatterndb/$${DESTDIR}/ -lvpatterndb INCLUDEPATH += $$PWD/../libs/vpatterndb @@ -609,6 +608,15 @@ DEPENDPATH += $$PWD/../libs/vpatterndb win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vpatterndb/$${DESTDIR}/vpatterndb.lib else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vpatterndb/$${DESTDIR}/libvpatterndb.a +#VMisc static library +unix|win32: LIBS += -L$$OUT_PWD/../libs/vmisc/$${DESTDIR}/ -lvmisc + +INCLUDEPATH += $$PWD/../libs/vmisc +DEPENDPATH += $$PWD/../libs/vmisc + +win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vmisc/$${DESTDIR}/vmisc.lib +else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vmisc/$${DESTDIR}/libvmisc.a + noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols # do nothing } else { diff --git a/src/app/core/vapplication.cpp b/src/app/core/vapplication.cpp index e88a8e4cd..a404b9a55 100644 --- a/src/app/core/vapplication.cpp +++ b/src/app/core/vapplication.cpp @@ -34,7 +34,7 @@ #include "../libs/ifc/exception/vexceptionwrongid.h" #include "vmaingraphicsview.h" #include "../version.h" -#include "../../utils/logging.h" +#include "../vmisc/logging.h" #include #include diff --git a/src/app/dialogs/app/dialogstandardmeasurements.cpp b/src/app/dialogs/app/dialogstandardmeasurements.cpp index 2cd149854..cb8793ba7 100644 --- a/src/app/dialogs/app/dialogstandardmeasurements.cpp +++ b/src/app/dialogs/app/dialogstandardmeasurements.cpp @@ -32,7 +32,7 @@ #include "../../core/vapplication.h" #include "../../core/vsettings.h" #include "../../libs/vpatterndb/vcontainer.h" -#include "../../utils/logging.h" +#include "../vmisc/logging.h" #include #include diff --git a/src/app/dialogs/tools/dialogtool.h b/src/app/dialogs/tools/dialogtool.h index c7e703eb7..a39adb095 100644 --- a/src/app/dialogs/tools/dialogtool.h +++ b/src/app/dialogs/tools/dialogtool.h @@ -30,7 +30,7 @@ #define DIALOGTOOL_H #include "../../core/vapplication.h" -#include "../../utils/logging.h" +#include "../vmisc/logging.h" #include "../../widgets/vmaingraphicsscene.h" #include "../../visualization/visualization.h" #include "../../xml/vpattern.h" diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index 5d9f7f15c..385ff8712 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -44,7 +44,7 @@ #include "vtooloptionspropertybrowser.h" #include "options.h" #include "../libs/ifc/xml/vpatternconverter.h" -#include "../../utils/logging.h" +#include "../vmisc/logging.h" #include #include diff --git a/src/app/options.h b/src/app/options.h index b51c193fb..41e50a80d 100644 --- a/src/app/options.h +++ b/src/app/options.h @@ -32,7 +32,7 @@ #include "../libs/ifc/ifcdef.h" #include "../libs/vgeometry/vgeometrydef.h" #include "../libs/qmuparser/qmudef.h" -#include "../../utils/def.h" +#include "../vmisc/def.h" #ifdef Q_OS_WIN32 # if defined( Q_CC_MSVC ) // MSVC USED diff --git a/src/app/tools/drawTools/vtoolpoint.cpp b/src/app/tools/drawTools/vtoolpoint.cpp index d25bb9f07..5e8c522c2 100644 --- a/src/app/tools/drawTools/vtoolpoint.cpp +++ b/src/app/tools/drawTools/vtoolpoint.cpp @@ -27,7 +27,7 @@ *************************************************************************/ #include "vtoolpoint.h" -#include "../../utils/logging.h" +#include "../vmisc/logging.h" #include "../../libs/vgeometry/vpointf.h" #include "../../visualization/vgraphicssimpletextitem.h" #include "../../undocommands/movelabel.h" diff --git a/src/app/tools/vdatatool.h b/src/app/tools/vdatatool.h index 645f9be4f..de97a8ee6 100644 --- a/src/app/tools/vdatatool.h +++ b/src/app/tools/vdatatool.h @@ -30,7 +30,7 @@ #define VDATATOOL_H #include "../libs/vpatterndb/vcontainer.h" -#include "../../utils/logging.h" +#include "../vmisc/logging.h" Q_DECLARE_LOGGING_CATEGORY(vTool) diff --git a/src/app/undocommands/vundocommand.h b/src/app/undocommands/vundocommand.h index 562ede74d..dc86281f8 100644 --- a/src/app/undocommands/vundocommand.h +++ b/src/app/undocommands/vundocommand.h @@ -32,7 +32,7 @@ #include #include -#include "../../utils/logging.h" +#include "../vmisc/logging.h" #include "../xml/vpattern.h" Q_DECLARE_LOGGING_CATEGORY(vUndo) diff --git a/src/app/visualization/visualization.h b/src/app/visualization/visualization.h index 3f9a414b9..56b141fa6 100644 --- a/src/app/visualization/visualization.h +++ b/src/app/visualization/visualization.h @@ -34,7 +34,7 @@ #include "../core/vapplication.h" #include "../widgets/vmaingraphicsscene.h" -#include "../../utils/logging.h" +#include "../vmisc/logging.h" #include "../../libs/vpatterndb/vcontainer.h" Q_DECLARE_LOGGING_CATEGORY(vVis) diff --git a/src/app/visualization/vsimplecurve.h b/src/app/visualization/vsimplecurve.h index 4c2b6ff80..c098e3660 100644 --- a/src/app/visualization/vsimplecurve.h +++ b/src/app/visualization/vsimplecurve.h @@ -31,7 +31,7 @@ #include #include "../libs/vgeometry/vabstractcurve.h" -#include "../../utils/def.h" +#include "../vmisc/def.h" enum class SimpleCurvePoint : char { FirstPoint, ForthPoint }; diff --git a/src/app/widgets/doubledelegate.cpp b/src/app/widgets/doubledelegate.cpp index c883dfeb3..be1927642 100644 --- a/src/app/widgets/doubledelegate.cpp +++ b/src/app/widgets/doubledelegate.cpp @@ -28,7 +28,7 @@ #include "doubledelegate.h" #include -#include "../../utils/def.h" +#include "../vmisc/def.h" //--------------------------------------------------------------------------------------------------------------------- /** diff --git a/src/app/widgets/vmaingraphicsscene.h b/src/app/widgets/vmaingraphicsscene.h index dec5e3523..4e2a441ce 100644 --- a/src/app/widgets/vmaingraphicsscene.h +++ b/src/app/widgets/vmaingraphicsscene.h @@ -30,7 +30,7 @@ #define VMAINGRAPHICSSCENE_H #include -#include "../../utils/def.h" +#include "../vmisc/def.h" /** * @brief The VMainGraphicsScene class main scene. diff --git a/src/app/xml/vstandardmeasurements.cpp b/src/app/xml/vstandardmeasurements.cpp index 5cf706ac0..41193656a 100644 --- a/src/app/xml/vstandardmeasurements.cpp +++ b/src/app/xml/vstandardmeasurements.cpp @@ -29,6 +29,7 @@ #include "vstandardmeasurements.h" #include #include "../core/vapplication.h" +#include "../../libs/vmisc/def.h" const QString VStandardMeasurements::TagDescription = QStringLiteral("description"); const QString VStandardMeasurements::TagId = QStringLiteral("id"); diff --git a/src/libs/ifc/exception/vexception.cpp b/src/libs/ifc/exception/vexception.cpp index 837ac6c47..1c621b2c5 100644 --- a/src/libs/ifc/exception/vexception.cpp +++ b/src/libs/ifc/exception/vexception.cpp @@ -27,8 +27,8 @@ *************************************************************************/ #include "vexception.h" -#include "../../../utils/logging.h" -#include "../../../utils/def.h" +#include "../vmisc/logging.h" +#include "../vmisc/def.h" #include #include diff --git a/src/libs/ifc/ifc.pro b/src/libs/ifc/ifc.pro index 10ed6b39f..b0adbb445 100644 --- a/src/libs/ifc/ifc.pro +++ b/src/libs/ifc/ifc.pro @@ -31,7 +31,6 @@ CONFIG -= debug_and_release debug_and_release_target DEFINES += QT_MESSAGELOGCONTEXT include(ifc.pri) -include(../../utils/utils.pri) # This is static library so no need in "make install" diff --git a/src/libs/ifc/xml/vdomdocument.h b/src/libs/ifc/xml/vdomdocument.h index f23214dae..20d78c8eb 100644 --- a/src/libs/ifc/xml/vdomdocument.h +++ b/src/libs/ifc/xml/vdomdocument.h @@ -34,7 +34,7 @@ #include #include "ifcdef.h" -#include "../../../utils/logging.h" +#include "../vmisc/logging.h" Q_DECLARE_LOGGING_CATEGORY(vXML) diff --git a/src/libs/ifc/xml/vtoolrecord.h b/src/libs/ifc/xml/vtoolrecord.h index dd927a999..f1823fc3f 100644 --- a/src/libs/ifc/xml/vtoolrecord.h +++ b/src/libs/ifc/xml/vtoolrecord.h @@ -29,7 +29,7 @@ #ifndef VTOOLRECORD_H #define VTOOLRECORD_H -#include "../../utils/def.h" +#include "../vmisc/def.h" #include diff --git a/src/libs/libs.pro b/src/libs/libs.pro index 92bfad3c8..4d31c3064 100644 --- a/src/libs/libs.pro +++ b/src/libs/libs.pro @@ -6,6 +6,7 @@ SUBDIRS = \ vobj \ vlayout \ vgeometry \ - vpatterndb + vpatterndb \ + vmisc vgeometry.depends = ifc diff --git a/src/libs/vgeometry/vgeometry.pro b/src/libs/vgeometry/vgeometry.pro index 4c8e26eb0..43e050a5a 100644 --- a/src/libs/vgeometry/vgeometry.pro +++ b/src/libs/vgeometry/vgeometry.pro @@ -25,7 +25,6 @@ CONFIG -= debug_and_release debug_and_release_target DEFINES += QT_MESSAGELOGCONTEXT include(vgeometry.pri) -include(../../utils/utils.pri) # This is static library so no need in "make install" diff --git a/src/libs/vlayout/vlayout.pro b/src/libs/vlayout/vlayout.pro index d152d8b08..2d45800a7 100644 --- a/src/libs/vlayout/vlayout.pro +++ b/src/libs/vlayout/vlayout.pro @@ -27,7 +27,6 @@ CONFIG -= debug_and_release debug_and_release_target DEFINES += QT_MESSAGELOGCONTEXT include(vlayout.pri) -include(../../utils/utils.pri) # This is static library so no need in "make install" diff --git a/src/libs/vlayout/vposition.cpp b/src/libs/vlayout/vposition.cpp index f100965bf..80a06df4e 100644 --- a/src/libs/vlayout/vposition.cpp +++ b/src/libs/vlayout/vposition.cpp @@ -27,7 +27,7 @@ *************************************************************************/ #include "vposition.h" -#include "../../utils/def.h" +#include "../vmisc/def.h" #include #include diff --git a/src/libs/vlayout/vposter.cpp b/src/libs/vlayout/vposter.cpp index 461fb59f3..212e5dd1c 100644 --- a/src/libs/vlayout/vposter.cpp +++ b/src/libs/vlayout/vposter.cpp @@ -35,7 +35,7 @@ # include #endif -#include "../../utils/def.h" +#include "../vmisc/def.h" //--------------------------------------------------------------------------------------------------------------------- VPoster::VPoster(const QPrinter *printer) diff --git a/src/utils/def.cpp b/src/libs/vmisc/def.cpp similarity index 100% rename from src/utils/def.cpp rename to src/libs/vmisc/def.cpp diff --git a/src/utils/def.h b/src/libs/vmisc/def.h similarity index 100% rename from src/utils/def.h rename to src/libs/vmisc/def.h diff --git a/src/utils/logging.h b/src/libs/vmisc/logging.h similarity index 100% rename from src/utils/logging.h rename to src/libs/vmisc/logging.h diff --git a/src/libs/vmisc/stable.cpp b/src/libs/vmisc/stable.cpp new file mode 100644 index 000000000..a42d3fd7c --- /dev/null +++ b/src/libs/vmisc/stable.cpp @@ -0,0 +1,30 @@ +/************************************************************************ + ** + ** @file stable.cpp + ** @author Roman Telezhynskyi + ** @date 10 12, 2014 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2013-2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +// Build the precompiled headers. +#include "stable.h" diff --git a/src/libs/vmisc/stable.h b/src/libs/vmisc/stable.h new file mode 100644 index 000000000..495de51b1 --- /dev/null +++ b/src/libs/vmisc/stable.h @@ -0,0 +1,52 @@ +/************************************************************************ + ** + ** @file stable.h + ** @author Roman Telezhynskyi + ** @date 10 12, 2014 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2013-2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef STABLE_H +#define STABLE_H + +/* I like to include this pragma too, so the build log indicates if pre-compiled headers were in use. */ +#ifndef __clang__ +#pragma message("Compiling precompiled headers for VMisc library.\n") +#endif + +/* Add C includes here */ + +#if defined __cplusplus +/* Add C++ includes here */ + +#ifdef QT_CORE_LIB +#include +#endif + +#ifdef QT_GUI_LIB +# include +#endif + +#endif/*__cplusplus*/ + +#endif // STABLE_H diff --git a/src/utils/vmath.h b/src/libs/vmisc/vmath.h similarity index 100% rename from src/utils/vmath.h rename to src/libs/vmisc/vmath.h diff --git a/src/libs/vmisc/vmisc.pri b/src/libs/vmisc/vmisc.pri new file mode 100644 index 000000000..b098d9842 --- /dev/null +++ b/src/libs/vmisc/vmisc.pri @@ -0,0 +1,12 @@ +# ADD TO EACH PATH $$PWD VARIABLE!!!!!! +# This need for corect working file translations.pro + +SOURCES += \ + $$PWD/stable.cpp \ + $$PWD/def.cpp + +HEADERS += \ + $$PWD/stable.h \ + $$PWD/def.h \ + $$PWD/logging.h \ + $$PWD/vmath.h diff --git a/src/libs/vmisc/vmisc.pro b/src/libs/vmisc/vmisc.pro new file mode 100644 index 000000000..b3f21da35 --- /dev/null +++ b/src/libs/vmisc/vmisc.pro @@ -0,0 +1,101 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2015-06-15T14:07:14 +# +#------------------------------------------------- + +# File with common stuff for whole project +include(../../../Valentina.pri) + +# Name of library +TARGET = vmisc + +# We want to create a library +TEMPLATE = lib + +CONFIG += \ + staticlib \# Making static library + c++11 # We use C++11 standard + +# Use out-of-source builds (shadow builds) +CONFIG -= debug_and_release debug_and_release_target + +# Since Qt 5.4.0 the source code location is recorded only in debug builds. +# We need this information also in release builds. For this need define QT_MESSAGELOGCONTEXT. +DEFINES += QT_MESSAGELOGCONTEXT + +include(vmisc.pri) + +# This is static library so no need in "make install" + +# directory for executable file +DESTDIR = bin + +# files created moc +MOC_DIR = moc + +# objecs files +OBJECTS_DIR = obj + +# Set using ccache. Function enable_ccache() defined in Valentina.pri. +$$enable_ccache() + +# Set precompiled headers. Function set_PCH() defined in Valentina.pri. +$$set_PCH() + +CONFIG(debug, debug|release){ + # Debug mode + unix { + #Turn on compilers warnings. + *-g++{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$GCC_DEBUG_CXXFLAGS # See Valentina.pri for more details. + + noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer + # do nothing + } else { + #gcc’s 4.8.0 Address Sanitizer + #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ + QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_LFLAGS += -fsanitize=address + } + } + clang*{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$CLANG_DEBUG_CXXFLAGS # See Valentina.pri for more details. + + # -isystem key works only for headers. In some cases it's not enough. But we can't delete these warnings and + # want them in global list. Compromise decision delete them from local list. + QMAKE_CXXFLAGS -= \ + -Wmissing-prototypes + } + } else { + *-g++{ + QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See Valentina.pri for more details. + } + } + +}else{ + # Release mode + DEFINES += V_NO_ASSERT + !unix:*-g++{ + QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll + } + + noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols + # do nothing + } else { + !macx:!win32-msvc*{ + # Turn on debug symbols in release mode on Unix systems. + # On Mac OS X temporarily disabled. TODO: find way how to strip binary file. + QMAKE_CXXFLAGS_RELEASE += -g -gdwarf-3 + QMAKE_CFLAGS_RELEASE += -g -gdwarf-3 + QMAKE_LFLAGS_RELEASE = + } + } +} diff --git a/src/libs/vobj/vobj.pro b/src/libs/vobj/vobj.pro index 2ba59ae2c..f23693def 100644 --- a/src/libs/vobj/vobj.pro +++ b/src/libs/vobj/vobj.pro @@ -25,7 +25,6 @@ CONFIG -= debug_and_release debug_and_release_target DEFINES += QT_MESSAGELOGCONTEXT include(vobj.pri) -include(../../utils/utils.pri) # This is static library so no need in "make install" diff --git a/src/libs/vpatterndb/variables/vinternalvariable.h b/src/libs/vpatterndb/variables/vinternalvariable.h index 9c8e61c50..1eb8d3fc3 100644 --- a/src/libs/vpatterndb/variables/vinternalvariable.h +++ b/src/libs/vpatterndb/variables/vinternalvariable.h @@ -31,7 +31,7 @@ #include #include -#include "../../utils/def.h" +#include "../vmisc/def.h" class VInternalVariableData; diff --git a/src/libs/vpatterndb/vcontainer.cpp b/src/libs/vpatterndb/vcontainer.cpp index cfb5194f7..eb9d4e3d8 100644 --- a/src/libs/vpatterndb/vcontainer.cpp +++ b/src/libs/vpatterndb/vcontainer.cpp @@ -29,7 +29,7 @@ #include "vcontainer.h" #include "../vgeometry/varc.h" #include "../vgeometry/vsplinepath.h" -#include "../../utils/logging.h" +#include "../vmisc/logging.h" #include "vtranslatevars.h" #include diff --git a/src/libs/vpatterndb/vnodedetail.h b/src/libs/vpatterndb/vnodedetail.h index 14bef930c..a229440f3 100644 --- a/src/libs/vpatterndb/vnodedetail.h +++ b/src/libs/vpatterndb/vnodedetail.h @@ -32,7 +32,7 @@ #include #include -#include "../../utils/def.h" +#include "../vmisc/def.h" class VNodeDetailData; diff --git a/src/libs/vpatterndb/vpatterndb.pro b/src/libs/vpatterndb/vpatterndb.pro index 82cb7256e..8ab08defb 100644 --- a/src/libs/vpatterndb/vpatterndb.pro +++ b/src/libs/vpatterndb/vpatterndb.pro @@ -25,7 +25,6 @@ CONFIG -= debug_and_release debug_and_release_target DEFINES += QT_MESSAGELOGCONTEXT include(vpatterndb.pri) -include(../../utils/utils.pri) # This is static library so no need in "make install" diff --git a/src/libs/vpatterndb/vtranslatevars.cpp b/src/libs/vpatterndb/vtranslatevars.cpp index 4f10fe0f1..8e934bf5e 100644 --- a/src/libs/vpatterndb/vtranslatevars.cpp +++ b/src/libs/vpatterndb/vtranslatevars.cpp @@ -28,7 +28,7 @@ #include "vtranslatevars.h" #include "calculator.h" -#include "../../utils/def.h" +#include "../vmisc/def.h" #include "../vgeometry/vgeometrydef.h" using namespace qmu; diff --git a/src/utils/utils.pri b/src/utils/utils.pri deleted file mode 100644 index 6cb4394d2..000000000 --- a/src/utils/utils.pri +++ /dev/null @@ -1,7 +0,0 @@ -HEADERS += \ - $$PWD/logging.h \ - $$PWD/vmath.h \ - $$PWD/def.h - -SOURCES += \ - $$PWD/def.cpp From 8faded8de26ea1ed58dc190314c9d5af5691c42c Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 15 Jun 2015 15:02:42 +0300 Subject: [PATCH 06/22] Move classes to VMisc. --HG-- branch : feature --- src/app/core/core.pri | 6 ------ src/app/core/vsettings.cpp | 2 +- src/app/dialogs/app/dialoglayoutsettings.cpp | 2 +- src/app/main.cpp | 2 +- src/app/mainwindow.cpp | 2 +- src/app/tools/drawTools/vtoolspline.cpp | 2 +- src/app/tools/drawTools/vtoolsplinepath.cpp | 2 +- src/app/xml/vpattern.cpp | 2 +- src/libs/vgeometry/vsplinepath.cpp | 2 +- src/libs/vlayout/vcontour.cpp | 2 +- src/libs/vlayout/vlayoutdetail.cpp | 2 +- src/libs/vlayout/vposition.cpp | 2 +- src/libs/vlayout/vposter.cpp | 2 +- .../vmisc}/backport/qcommandlineoption.cpp | 0 .../core => libs/vmisc}/backport/qcommandlineoption.h | 0 .../vmisc}/backport/qcommandlineparser.cpp | 0 .../core => libs/vmisc}/backport/qcommandlineparser.h | 0 src/{app/core => libs/vmisc}/undoevent.cpp | 0 src/{app/core => libs/vmisc}/undoevent.h | 0 src/libs/vmisc/vmisc.pri | 10 ++++++++-- src/libs/vobj/vobjengine.cpp | 2 +- 21 files changed, 21 insertions(+), 21 deletions(-) rename src/{app/core => libs/vmisc}/backport/qcommandlineoption.cpp (100%) rename src/{app/core => libs/vmisc}/backport/qcommandlineoption.h (100%) rename src/{app/core => libs/vmisc}/backport/qcommandlineparser.cpp (100%) rename src/{app/core => libs/vmisc}/backport/qcommandlineparser.h (100%) rename src/{app/core => libs/vmisc}/undoevent.cpp (100%) rename src/{app/core => libs/vmisc}/undoevent.h (100%) diff --git a/src/app/core/core.pri b/src/app/core/core.pri index 5b7e0e14d..e977232d8 100644 --- a/src/app/core/core.pri +++ b/src/app/core/core.pri @@ -3,16 +3,10 @@ HEADERS += \ $$PWD/vapplication.h \ - $$PWD/undoevent.h \ $$PWD/vsettings.h \ - $$PWD/backport/qcommandlineoption.h \ - $$PWD/backport/qcommandlineparser.h \ $$PWD/vformula.h SOURCES += \ $$PWD/vapplication.cpp \ - $$PWD/undoevent.cpp \ $$PWD/vsettings.cpp \ - $$PWD/backport/qcommandlineoption.cpp \ - $$PWD/backport/qcommandlineparser.cpp \ $$PWD/vformula.cpp diff --git a/src/app/core/vsettings.cpp b/src/app/core/vsettings.cpp index 02033aef4..0feb75525 100644 --- a/src/app/core/vsettings.cpp +++ b/src/app/core/vsettings.cpp @@ -36,7 +36,7 @@ #include "../xml/vabstractmeasurements.h" #if QT_VERSION < QT_VERSION_CHECK(5, 1, 0) -# include "../../utils/vmath.h" +# include "../../libs/vmisc/vmath.h" #else # include #endif diff --git a/src/app/dialogs/app/dialoglayoutsettings.cpp b/src/app/dialogs/app/dialoglayoutsettings.cpp index ab6ae314b..c72b7f2ca 100644 --- a/src/app/dialogs/app/dialoglayoutsettings.cpp +++ b/src/app/dialogs/app/dialoglayoutsettings.cpp @@ -34,7 +34,7 @@ #include "../../libs/vlayout/vlayoutgenerator.h" #if QT_VERSION < QT_VERSION_CHECK(5, 1, 0) -# include "../../../utils/vmath.h" +# include "../../libs/vmisc/vmath.h" #else # include #endif diff --git a/src/app/main.cpp b/src/app/main.cpp index 6a35142bf..51dd03a98 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -30,7 +30,7 @@ #include "core/vapplication.h" #if QT_VERSION < QT_VERSION_CHECK(5, 2, 0) -# include "../core/backport/qcommandlineparser.h" +# include "../libs/vmisc/backport/qcommandlineparser.h" #else # include #endif diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index 385ff8712..1d04256f7 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -38,7 +38,7 @@ #include "xml/vstandardmeasurements.h" #include "xml/vindividualmeasurements.h" #include "core/vapplication.h" -#include "core/undoevent.h" +#include "../libs/vmisc/undoevent.h" #include "core/vsettings.h" #include "undocommands/renamepp.h" #include "vtooloptionspropertybrowser.h" diff --git a/src/app/tools/drawTools/vtoolspline.cpp b/src/app/tools/drawTools/vtoolspline.cpp index 5ab843269..26aa02006 100644 --- a/src/app/tools/drawTools/vtoolspline.cpp +++ b/src/app/tools/drawTools/vtoolspline.cpp @@ -34,7 +34,7 @@ #include "../../options.h" #if QT_VERSION < QT_VERSION_CHECK(5, 1, 0) -# include "../../../utils/vmath.h" +# include "../../libs/vmisc/vmath.h" #else # include #endif diff --git a/src/app/tools/drawTools/vtoolsplinepath.cpp b/src/app/tools/drawTools/vtoolsplinepath.cpp index 45c0a6fa1..68b6eb81f 100644 --- a/src/app/tools/drawTools/vtoolsplinepath.cpp +++ b/src/app/tools/drawTools/vtoolsplinepath.cpp @@ -32,7 +32,7 @@ #include "../../visualization/vistoolsplinepath.h" #if QT_VERSION < QT_VERSION_CHECK(5, 1, 0) -# include "../../../utils/vmath.h" +# include "../../libs/vmisc/vmath.h" #else # include #endif diff --git a/src/app/xml/vpattern.cpp b/src/app/xml/vpattern.cpp index 70f39d9a0..b0333bdd4 100644 --- a/src/app/xml/vpattern.cpp +++ b/src/app/xml/vpattern.cpp @@ -38,7 +38,7 @@ #include "../libs/ifc/exception/vexceptionemptyparameter.h" #include "../libs/ifc/exception/vexceptionundo.h" #include "../libs/ifc/xml/vpatternconverter.h" -#include "../core/undoevent.h" +#include "../libs/vmisc/undoevent.h" #include "../core/vsettings.h" #include "vstandardmeasurements.h" #include "vindividualmeasurements.h" diff --git a/src/libs/vgeometry/vsplinepath.cpp b/src/libs/vgeometry/vsplinepath.cpp index 4c16e0d46..437f177af 100644 --- a/src/libs/vgeometry/vsplinepath.cpp +++ b/src/libs/vgeometry/vsplinepath.cpp @@ -31,7 +31,7 @@ #include "../ifc/exception/vexception.h" #if QT_VERSION < QT_VERSION_CHECK(5, 1, 0) -# include "../../utils/vmath.h" +# include "../libs/vmisc/vmath.h" #else # include #endif diff --git a/src/libs/vlayout/vcontour.cpp b/src/libs/vlayout/vcontour.cpp index c2069e723..bf223b767 100644 --- a/src/libs/vlayout/vcontour.cpp +++ b/src/libs/vlayout/vcontour.cpp @@ -33,7 +33,7 @@ #include #include #if QT_VERSION < QT_VERSION_CHECK(5, 1, 0) -# include "../../utils/vmath.h" +# include "../libs/vmisc/vmath.h" #else # include #endif diff --git a/src/libs/vlayout/vlayoutdetail.cpp b/src/libs/vlayout/vlayoutdetail.cpp index 09e921aa2..e6730fb61 100644 --- a/src/libs/vlayout/vlayoutdetail.cpp +++ b/src/libs/vlayout/vlayoutdetail.cpp @@ -32,7 +32,7 @@ #include #include #if QT_VERSION < QT_VERSION_CHECK(5, 1, 0) -# include "../../utils/vmath.h" +# include "../libs/vmisc/vmath.h" #else # include #endif diff --git a/src/libs/vlayout/vposition.cpp b/src/libs/vlayout/vposition.cpp index 80a06df4e..a98ba64ef 100644 --- a/src/libs/vlayout/vposition.cpp +++ b/src/libs/vlayout/vposition.cpp @@ -40,7 +40,7 @@ #include #include #if QT_VERSION < QT_VERSION_CHECK(5, 1, 0) -# include "../../utils/vmath.h" +# include "../libs/vmisc/vmath.h" #else # include #endif diff --git a/src/libs/vlayout/vposter.cpp b/src/libs/vlayout/vposter.cpp index 212e5dd1c..f7f1f4b43 100644 --- a/src/libs/vlayout/vposter.cpp +++ b/src/libs/vlayout/vposter.cpp @@ -30,7 +30,7 @@ #include #include #if QT_VERSION < QT_VERSION_CHECK(5, 1, 0) -# include "../../utils/vmath.h" +# include "../libs/vmisc/vmath.h" #else # include #endif diff --git a/src/app/core/backport/qcommandlineoption.cpp b/src/libs/vmisc/backport/qcommandlineoption.cpp similarity index 100% rename from src/app/core/backport/qcommandlineoption.cpp rename to src/libs/vmisc/backport/qcommandlineoption.cpp diff --git a/src/app/core/backport/qcommandlineoption.h b/src/libs/vmisc/backport/qcommandlineoption.h similarity index 100% rename from src/app/core/backport/qcommandlineoption.h rename to src/libs/vmisc/backport/qcommandlineoption.h diff --git a/src/app/core/backport/qcommandlineparser.cpp b/src/libs/vmisc/backport/qcommandlineparser.cpp similarity index 100% rename from src/app/core/backport/qcommandlineparser.cpp rename to src/libs/vmisc/backport/qcommandlineparser.cpp diff --git a/src/app/core/backport/qcommandlineparser.h b/src/libs/vmisc/backport/qcommandlineparser.h similarity index 100% rename from src/app/core/backport/qcommandlineparser.h rename to src/libs/vmisc/backport/qcommandlineparser.h diff --git a/src/app/core/undoevent.cpp b/src/libs/vmisc/undoevent.cpp similarity index 100% rename from src/app/core/undoevent.cpp rename to src/libs/vmisc/undoevent.cpp diff --git a/src/app/core/undoevent.h b/src/libs/vmisc/undoevent.h similarity index 100% rename from src/app/core/undoevent.h rename to src/libs/vmisc/undoevent.h diff --git a/src/libs/vmisc/vmisc.pri b/src/libs/vmisc/vmisc.pri index b098d9842..f75d3197a 100644 --- a/src/libs/vmisc/vmisc.pri +++ b/src/libs/vmisc/vmisc.pri @@ -3,10 +3,16 @@ SOURCES += \ $$PWD/stable.cpp \ - $$PWD/def.cpp + $$PWD/def.cpp \ + $$PWD/undoevent.cpp \ + $$PWD/backport/qcommandlineoption.cpp \ + $$PWD/backport/qcommandlineparser.cpp HEADERS += \ $$PWD/stable.h \ $$PWD/def.h \ $$PWD/logging.h \ - $$PWD/vmath.h + $$PWD/vmath.h \ + $$PWD/undoevent.h \ + $$PWD/backport/qcommandlineoption.h \ + $$PWD/backport/qcommandlineparser.h diff --git a/src/libs/vobj/vobjengine.cpp b/src/libs/vobj/vobjengine.cpp index bd02afe0a..e979de63a 100644 --- a/src/libs/vobj/vobjengine.cpp +++ b/src/libs/vobj/vobjengine.cpp @@ -31,7 +31,7 @@ #include #include #if QT_VERSION < QT_VERSION_CHECK(5, 1, 0) -# include "../../utils/vmath.h" +# include "../libs/vmisc/vmath.h" #else # include #endif From 6132153338613549be977297b3aa429f6ffcb141 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 15 Jun 2015 15:50:59 +0300 Subject: [PATCH 07/22] Move classes to VWidgets. --HG-- branch : feature --- src/app/app.pro | 9 ++ src/app/core/vapplication.h | 2 +- .../dialogs/app/configpages/patternpage.cpp | 2 +- src/app/dialogs/app/dialogincrements.cpp | 6 +- src/app/dialogs/tools/dialogalongline.cpp | 2 +- src/app/dialogs/tools/dialogbisector.cpp | 2 +- .../tools/dialogcurveintersectaxis.cpp | 2 +- src/app/dialogs/tools/dialogcutarc.cpp | 2 +- src/app/dialogs/tools/dialogendline.cpp | 2 +- src/app/dialogs/tools/dialogheight.cpp | 2 +- src/app/dialogs/tools/dialogline.cpp | 2 +- src/app/dialogs/tools/dialoglineintersect.cpp | 2 +- .../dialogs/tools/dialoglineintersectaxis.cpp | 2 +- src/app/dialogs/tools/dialognormal.cpp | 2 +- .../tools/dialogpointfromarcandtangent.cpp | 2 +- .../tools/dialogpointfromcircleandtangent.cpp | 2 +- .../dialogs/tools/dialogpointofcontact.cpp | 2 +- .../tools/dialogpointofintersection.cpp | 2 +- .../tools/dialogpointofintersectionarcs.cpp | 2 +- .../dialogpointofintersectioncircles.cpp | 2 +- src/app/dialogs/tools/dialogshoulderpoint.cpp | 2 +- src/app/dialogs/tools/dialogtool.h | 4 +- src/app/dialogs/tools/dialogtriangle.cpp | 2 +- src/app/mainwindow.h | 2 +- src/app/tools/drawTools/vdrawtool.h | 2 +- .../drawTools/vtoolcurveintersectaxis.cpp | 2 +- src/app/tools/drawTools/vtoolcut.h | 2 +- src/app/tools/drawTools/vtoolendline.cpp | 2 +- .../drawTools/vtoollineintersectaxis.cpp | 2 +- src/app/tools/vabstracttool.cpp | 2 +- src/app/tools/vabstracttool.h | 2 +- src/app/tools/vtooldetail.cpp | 2 +- src/app/undocommands/addtocalc.cpp | 4 +- src/app/visualization/visualization.h | 2 +- src/app/visualization/visualization.pri | 2 - src/app/widgets/widgets.pri | 14 +-- src/libs/libs.pro | 3 +- .../vwidgets}/doubledelegate.cpp | 0 .../vwidgets}/doubledelegate.h | 0 src/libs/vwidgets/stable.cpp | 30 ++++++ src/libs/vwidgets/stable.h | 52 ++++++++++ .../vwidgets}/textdelegate.cpp | 2 +- .../widgets => libs/vwidgets}/textdelegate.h | 0 .../vwidgets}/vmaingraphicsscene.cpp | 0 .../vwidgets}/vmaingraphicsscene.h | 0 .../vwidgets}/vmaingraphicsview.cpp | 2 +- .../vwidgets}/vmaingraphicsview.h | 0 .../vwidgets}/vsimplecurve.cpp | 0 .../vwidgets}/vsimplecurve.h | 2 +- .../vwidgets}/vwidgetpopup.cpp | 0 .../widgets => libs/vwidgets}/vwidgetpopup.h | 0 src/libs/vwidgets/vwidgets.pri | 20 ++++ src/libs/vwidgets/vwidgets.pro | 96 +++++++++++++++++++ 53 files changed, 251 insertions(+), 55 deletions(-) rename src/{app/widgets => libs/vwidgets}/doubledelegate.cpp (100%) rename src/{app/widgets => libs/vwidgets}/doubledelegate.h (100%) create mode 100644 src/libs/vwidgets/stable.cpp create mode 100644 src/libs/vwidgets/stable.h rename src/{app/widgets => libs/vwidgets}/textdelegate.cpp (99%) rename src/{app/widgets => libs/vwidgets}/textdelegate.h (100%) rename src/{app/widgets => libs/vwidgets}/vmaingraphicsscene.cpp (100%) rename src/{app/widgets => libs/vwidgets}/vmaingraphicsscene.h (100%) rename src/{app/widgets => libs/vwidgets}/vmaingraphicsview.cpp (99%) rename src/{app/widgets => libs/vwidgets}/vmaingraphicsview.h (100%) rename src/{app/visualization => libs/vwidgets}/vsimplecurve.cpp (100%) rename src/{app/visualization => libs/vwidgets}/vsimplecurve.h (98%) rename src/{app/widgets => libs/vwidgets}/vwidgetpopup.cpp (100%) rename src/{app/widgets => libs/vwidgets}/vwidgetpopup.h (100%) create mode 100644 src/libs/vwidgets/vwidgets.pri create mode 100644 src/libs/vwidgets/vwidgets.pro diff --git a/src/app/app.pro b/src/app/app.pro index 50d1eeab9..a806c91f0 100644 --- a/src/app/app.pro +++ b/src/app/app.pro @@ -617,6 +617,15 @@ DEPENDPATH += $$PWD/../libs/vmisc win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vmisc/$${DESTDIR}/vmisc.lib else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vmisc/$${DESTDIR}/libvmisc.a +#VWidgets static library +unix|win32: LIBS += -L$$OUT_PWD/../libs/vwidgets/$${DESTDIR}/ -lvwidgets + +INCLUDEPATH += $$PWD/../libs/vwidgets +DEPENDPATH += $$PWD/../libs/vwidgets + +win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vwidgets/$${DESTDIR}/vwidgets.lib +else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vwidgets/$${DESTDIR}/libvwidgets.a + noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols # do nothing } else { diff --git a/src/app/core/vapplication.h b/src/app/core/vapplication.h index e3086722b..8ccdcca44 100644 --- a/src/app/core/vapplication.h +++ b/src/app/core/vapplication.h @@ -31,7 +31,7 @@ #include #include "../options.h" -#include "../widgets/vmaingraphicsview.h" +#include "../libs/vwidgets/vmaingraphicsview.h" #include "../libs/vpatterndb/vtranslatevars.h" #include "vsettings.h" diff --git a/src/app/dialogs/app/configpages/patternpage.cpp b/src/app/dialogs/app/configpages/patternpage.cpp index e911bcd28..32e01b72d 100644 --- a/src/app/dialogs/app/configpages/patternpage.cpp +++ b/src/app/dialogs/app/configpages/patternpage.cpp @@ -30,7 +30,7 @@ #include "../../../options.h" #include "../../../core/vapplication.h" #include "../../../core/vsettings.h" -#include "../../../widgets/vmaingraphicsview.h" +#include "../../../../libs/vwidgets/vmaingraphicsview.h" #include #include #include diff --git a/src/app/dialogs/app/dialogincrements.cpp b/src/app/dialogs/app/dialogincrements.cpp index 3aa3d0bac..90ee3e4a0 100644 --- a/src/app/dialogs/app/dialogincrements.cpp +++ b/src/app/dialogs/app/dialogincrements.cpp @@ -28,9 +28,9 @@ #include "dialogincrements.h" #include "ui_dialogincrements.h" -#include "../../widgets/doubledelegate.h" -#include "../../widgets/textdelegate.h" -#include "../../widgets/vwidgetpopup.h" +#include "../../libs/vwidgets/doubledelegate.h" +#include "../../libs/vwidgets/textdelegate.h" +#include "../../libs/vwidgets/vwidgetpopup.h" #include "../../xml/vstandardmeasurements.h" #include "../../xml/vindividualmeasurements.h" #include "../../core/vsettings.h" diff --git a/src/app/dialogs/tools/dialogalongline.cpp b/src/app/dialogs/tools/dialogalongline.cpp index bbcd01fd8..0f81da4ee 100644 --- a/src/app/dialogs/tools/dialogalongline.cpp +++ b/src/app/dialogs/tools/dialogalongline.cpp @@ -30,7 +30,7 @@ #include "ui_dialogalongline.h" #include "../../visualization/vistoolalongline.h" #include "../../tools/vabstracttool.h" -#include "../../widgets/vmaingraphicsscene.h" +#include "../../libs/vwidgets/vmaingraphicsscene.h" #include "dialogeditwrongformula.h" #include diff --git a/src/app/dialogs/tools/dialogbisector.cpp b/src/app/dialogs/tools/dialogbisector.cpp index de3cb782f..e8c7d95c6 100644 --- a/src/app/dialogs/tools/dialogbisector.cpp +++ b/src/app/dialogs/tools/dialogbisector.cpp @@ -32,7 +32,7 @@ #include "../../libs/vgeometry/vpointf.h" #include "../../libs/vpatterndb/vcontainer.h" #include "../../visualization/vistoolbisector.h" -#include "../../widgets/vmaingraphicsscene.h" +#include "../../libs/vwidgets/vmaingraphicsscene.h" #include "../../tools/vabstracttool.h" #include "dialogeditwrongformula.h" diff --git a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp b/src/app/dialogs/tools/dialogcurveintersectaxis.cpp index 93ca299b7..fd0dd5bc7 100644 --- a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp +++ b/src/app/dialogs/tools/dialogcurveintersectaxis.cpp @@ -32,7 +32,7 @@ #include "../../libs/vgeometry/vpointf.h" #include "../../libs/vpatterndb/vcontainer.h" #include "../../visualization/vistoolcurveintersectaxis.h" -#include "../../widgets/vmaingraphicsscene.h" +#include "../../libs/vwidgets/vmaingraphicsscene.h" #include "../../tools/vabstracttool.h" #include "dialogeditwrongformula.h" diff --git a/src/app/dialogs/tools/dialogcutarc.cpp b/src/app/dialogs/tools/dialogcutarc.cpp index 2e0c08544..5c96add17 100644 --- a/src/app/dialogs/tools/dialogcutarc.cpp +++ b/src/app/dialogs/tools/dialogcutarc.cpp @@ -32,7 +32,7 @@ #include "../../libs/vgeometry/varc.h" #include "../../libs/vpatterndb/vcontainer.h" #include "../../visualization/vistoolcutarc.h" -#include "../../widgets/vmaingraphicsscene.h" +#include "../../libs/vwidgets/vmaingraphicsscene.h" #include "../../xml/vpattern.h" #include "dialogeditwrongformula.h" diff --git a/src/app/dialogs/tools/dialogendline.cpp b/src/app/dialogs/tools/dialogendline.cpp index 71f80a40b..6f6e429d1 100644 --- a/src/app/dialogs/tools/dialogendline.cpp +++ b/src/app/dialogs/tools/dialogendline.cpp @@ -32,7 +32,7 @@ #include "../../libs/vgeometry/vpointf.h" #include "../../libs/vpatterndb/vcontainer.h" #include "../../visualization/vistoolendline.h" -#include "../../widgets/vmaingraphicsscene.h" +#include "../../libs/vwidgets/vmaingraphicsscene.h" #include "../../tools/vabstracttool.h" #include "dialogeditwrongformula.h" #include diff --git a/src/app/dialogs/tools/dialogheight.cpp b/src/app/dialogs/tools/dialogheight.cpp index fb0f69cdd..145866c32 100644 --- a/src/app/dialogs/tools/dialogheight.cpp +++ b/src/app/dialogs/tools/dialogheight.cpp @@ -33,7 +33,7 @@ #include "../../libs/vpatterndb/vcontainer.h" #include "../../tools/vabstracttool.h" #include "../visualization/vistoolheight.h" -#include "../widgets/vmaingraphicsscene.h" +#include "../../libs/vwidgets/vmaingraphicsscene.h" //--------------------------------------------------------------------------------------------------------------------- /** diff --git a/src/app/dialogs/tools/dialogline.cpp b/src/app/dialogs/tools/dialogline.cpp index 18f69fcaa..d3badadb5 100644 --- a/src/app/dialogs/tools/dialogline.cpp +++ b/src/app/dialogs/tools/dialogline.cpp @@ -33,7 +33,7 @@ #include "../../libs/vpatterndb/vcontainer.h" #include "../../visualization/vistoolline.h" #include "../../core/vapplication.h" -#include "../../widgets/vmaingraphicsscene.h" +#include "../../libs/vwidgets/vmaingraphicsscene.h" #include "../../tools/vabstracttool.h" //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialoglineintersect.cpp b/src/app/dialogs/tools/dialoglineintersect.cpp index 1ec708225..adb003cf5 100644 --- a/src/app/dialogs/tools/dialoglineintersect.cpp +++ b/src/app/dialogs/tools/dialoglineintersect.cpp @@ -32,7 +32,7 @@ #include "../../libs/vgeometry/vpointf.h" #include "../../libs/vpatterndb/vcontainer.h" #include "../../visualization/vistoollineintersect.h" -#include "../../widgets/vmaingraphicsscene.h" +#include "../../libs/vwidgets/vmaingraphicsscene.h" #include "../../xml/vpattern.h" //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.cpp b/src/app/dialogs/tools/dialoglineintersectaxis.cpp index 20f0500ef..0402769b4 100644 --- a/src/app/dialogs/tools/dialoglineintersectaxis.cpp +++ b/src/app/dialogs/tools/dialoglineintersectaxis.cpp @@ -32,7 +32,7 @@ #include "../../libs/vgeometry/vpointf.h" #include "../../libs/vpatterndb/vcontainer.h" #include "../../visualization/vistoollineintersectaxis.h" -#include "../../widgets/vmaingraphicsscene.h" +#include "../../libs/vwidgets/vmaingraphicsscene.h" #include "../../tools/vabstracttool.h" #include "dialogeditwrongformula.h" diff --git a/src/app/dialogs/tools/dialognormal.cpp b/src/app/dialogs/tools/dialognormal.cpp index 00061f9da..c67f1f673 100644 --- a/src/app/dialogs/tools/dialognormal.cpp +++ b/src/app/dialogs/tools/dialognormal.cpp @@ -29,7 +29,7 @@ #include "dialognormal.h" #include "ui_dialognormal.h" #include "../visualization/vistoolnormal.h" -#include "../widgets/vmaingraphicsscene.h" +#include "../../../libs/vwidgets/vmaingraphicsscene.h" #include "../../tools/vabstracttool.h" #include "dialogeditwrongformula.h" diff --git a/src/app/dialogs/tools/dialogpointfromarcandtangent.cpp b/src/app/dialogs/tools/dialogpointfromarcandtangent.cpp index b4d0285b1..86d047129 100644 --- a/src/app/dialogs/tools/dialogpointfromarcandtangent.cpp +++ b/src/app/dialogs/tools/dialogpointfromarcandtangent.cpp @@ -32,7 +32,7 @@ #include "../../libs/vgeometry/vpointf.h" #include "../../libs/vpatterndb/vcontainer.h" #include "../../visualization/vistoolpointfromarcandtangent.h" -#include "../../widgets/vmaingraphicsscene.h" +#include "../../libs/vwidgets/vmaingraphicsscene.h" //--------------------------------------------------------------------------------------------------------------------- DialogPointFromArcAndTangent::DialogPointFromArcAndTangent(const VContainer *data, const quint32 &toolId, diff --git a/src/app/dialogs/tools/dialogpointfromcircleandtangent.cpp b/src/app/dialogs/tools/dialogpointfromcircleandtangent.cpp index 167f163f0..9608b2344 100644 --- a/src/app/dialogs/tools/dialogpointfromcircleandtangent.cpp +++ b/src/app/dialogs/tools/dialogpointfromcircleandtangent.cpp @@ -32,7 +32,7 @@ #include "../../libs/vgeometry/vpointf.h" #include "../../libs/vpatterndb/vcontainer.h" #include "../../visualization/vistoolpointfromcircleandtangent.h" -#include "../../widgets/vmaingraphicsscene.h" +#include "../../libs/vwidgets/vmaingraphicsscene.h" #include "dialogeditwrongformula.h" //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogpointofcontact.cpp b/src/app/dialogs/tools/dialogpointofcontact.cpp index dc65404ff..08c17c0e3 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.cpp +++ b/src/app/dialogs/tools/dialogpointofcontact.cpp @@ -31,7 +31,7 @@ #include "../../libs/vgeometry/vpointf.h" #include "../../libs/vpatterndb/vcontainer.h" #include "../../visualization/vistoolpointofcontact.h" -#include "../../widgets/vmaingraphicsscene.h" +#include "../libs/vwidgets/vmaingraphicsscene.h" #include "../../xml/vpattern.h" #include "dialogeditwrongformula.h" diff --git a/src/app/dialogs/tools/dialogpointofintersection.cpp b/src/app/dialogs/tools/dialogpointofintersection.cpp index 186df7882..510154b4b 100644 --- a/src/app/dialogs/tools/dialogpointofintersection.cpp +++ b/src/app/dialogs/tools/dialogpointofintersection.cpp @@ -32,7 +32,7 @@ #include "../../libs/vgeometry/vpointf.h" #include "../../libs/vpatterndb/vcontainer.h" #include "../../visualization/vistoolpointofintersection.h" -#include "../../widgets/vmaingraphicsscene.h" +#include "../../libs/vwidgets/vmaingraphicsscene.h" #include "../../xml/vpattern.h" //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogpointofintersectionarcs.cpp b/src/app/dialogs/tools/dialogpointofintersectionarcs.cpp index bdeee9cd0..640b04f4d 100644 --- a/src/app/dialogs/tools/dialogpointofintersectionarcs.cpp +++ b/src/app/dialogs/tools/dialogpointofintersectionarcs.cpp @@ -32,7 +32,7 @@ #include "../../libs/vgeometry/vpointf.h" #include "../../libs/vpatterndb/vcontainer.h" #include "../../visualization/vistoolpointofintersectionarcs.h" -#include "../../widgets/vmaingraphicsscene.h" +#include "../../libs/vwidgets/vmaingraphicsscene.h" //--------------------------------------------------------------------------------------------------------------------- DialogPointOfIntersectionArcs::DialogPointOfIntersectionArcs(const VContainer *data, const quint32 &toolId, diff --git a/src/app/dialogs/tools/dialogpointofintersectioncircles.cpp b/src/app/dialogs/tools/dialogpointofintersectioncircles.cpp index ad957656b..a8c0779a3 100644 --- a/src/app/dialogs/tools/dialogpointofintersectioncircles.cpp +++ b/src/app/dialogs/tools/dialogpointofintersectioncircles.cpp @@ -32,7 +32,7 @@ #include "../../libs/vgeometry/vpointf.h" #include "../../libs/vpatterndb/vcontainer.h" #include "../../visualization/vistoolpointofintersectioncircles.h" -#include "../../widgets/vmaingraphicsscene.h" +#include "../../libs/vwidgets/vmaingraphicsscene.h" #include "dialogeditwrongformula.h" //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogshoulderpoint.cpp b/src/app/dialogs/tools/dialogshoulderpoint.cpp index 12fcfa1cc..b1c3ae863 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.cpp +++ b/src/app/dialogs/tools/dialogshoulderpoint.cpp @@ -32,7 +32,7 @@ #include "../../libs/vgeometry/vpointf.h" #include "../../libs/vpatterndb/vcontainer.h" #include "../../visualization/vistoolshoulderpoint.h" -#include "../../widgets/vmaingraphicsscene.h" +#include "../libs/vwidgets/vmaingraphicsscene.h" #include "../../tools/vabstracttool.h" #include "dialogeditwrongformula.h" diff --git a/src/app/dialogs/tools/dialogtool.h b/src/app/dialogs/tools/dialogtool.h index a39adb095..f3f04e449 100644 --- a/src/app/dialogs/tools/dialogtool.h +++ b/src/app/dialogs/tools/dialogtool.h @@ -30,8 +30,8 @@ #define DIALOGTOOL_H #include "../../core/vapplication.h" -#include "../vmisc/logging.h" -#include "../../widgets/vmaingraphicsscene.h" +#include "../libs/vmisc/logging.h" +#include "../libs/vwidgets/vmaingraphicsscene.h" #include "../../visualization/visualization.h" #include "../../xml/vpattern.h" diff --git a/src/app/dialogs/tools/dialogtriangle.cpp b/src/app/dialogs/tools/dialogtriangle.cpp index fdee8a144..97bfbee1b 100644 --- a/src/app/dialogs/tools/dialogtriangle.cpp +++ b/src/app/dialogs/tools/dialogtriangle.cpp @@ -31,7 +31,7 @@ #include "../../libs/vgeometry/vpointf.h" #include "../../libs/vpatterndb/vcontainer.h" #include "../../visualization/vistooltriangle.h" -#include "../../widgets/vmaingraphicsscene.h" +#include "../libs/vwidgets/vmaingraphicsscene.h" #include "../../xml/vpattern.h" //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/mainwindow.h b/src/app/mainwindow.h index d43b58855..9751d35e7 100644 --- a/src/app/mainwindow.h +++ b/src/app/mainwindow.h @@ -30,7 +30,7 @@ #define MAINWINDOW_H #include "mainwindowsnogui.h" -#include "widgets/vmaingraphicsview.h" +#include "../libs/vwidgets/vmaingraphicsview.h" #include "dialogs/dialogs.h" #include "tools/vtooldetail.h" #include "tools/vtooluniondetails.h" diff --git a/src/app/tools/drawTools/vdrawtool.h b/src/app/tools/drawTools/vdrawtool.h index bae635ed5..9e968dc46 100644 --- a/src/app/tools/drawTools/vdrawtool.h +++ b/src/app/tools/drawTools/vdrawtool.h @@ -34,7 +34,7 @@ #include #include #include "../../dialogs/tools/dialogtool.h" -#include "../../widgets/vmaingraphicsscene.h" +#include "../../libs/vwidgets/vmaingraphicsscene.h" #include "../../xml/vpattern.h" /** diff --git a/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp b/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp index 26c90c11b..b335d2fc8 100644 --- a/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp +++ b/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp @@ -27,7 +27,7 @@ *************************************************************************/ #include "vtoolcurveintersectaxis.h" -#include "../../widgets/vmaingraphicsscene.h" +#include "../../libs/vwidgets/vmaingraphicsscene.h" #include "../../libs/vpatterndb/calculator.h" #include "../../dialogs/tools/dialogcurveintersectaxis.h" #include "../../dialogs/tools/dialogeditwrongformula.h" diff --git a/src/app/tools/drawTools/vtoolcut.h b/src/app/tools/drawTools/vtoolcut.h index 1c78202d9..eb71ac1d7 100644 --- a/src/app/tools/drawTools/vtoolcut.h +++ b/src/app/tools/drawTools/vtoolcut.h @@ -30,7 +30,7 @@ #define VTOOLCUT_H #include "vtoolpoint.h" -#include "../../visualization/vsimplecurve.h" +#include "../../libs/vwidgets/vsimplecurve.h" #include "vabstractspline.h" class VFormula; diff --git a/src/app/tools/drawTools/vtoolendline.cpp b/src/app/tools/drawTools/vtoolendline.cpp index 25b8ad8f9..b95bd79bb 100644 --- a/src/app/tools/drawTools/vtoolendline.cpp +++ b/src/app/tools/drawTools/vtoolendline.cpp @@ -27,7 +27,7 @@ *************************************************************************/ #include "vtoolendline.h" -#include "../../widgets/vmaingraphicsscene.h" +#include "../../libs/vwidgets/vmaingraphicsscene.h" #include "../../libs/vpatterndb/calculator.h" #include "../../dialogs/tools/dialogendline.h" #include "../../dialogs/tools/dialogeditwrongformula.h" diff --git a/src/app/tools/drawTools/vtoollineintersectaxis.cpp b/src/app/tools/drawTools/vtoollineintersectaxis.cpp index e6adc40b9..d40cfe561 100644 --- a/src/app/tools/drawTools/vtoollineintersectaxis.cpp +++ b/src/app/tools/drawTools/vtoollineintersectaxis.cpp @@ -27,7 +27,7 @@ *************************************************************************/ #include "vtoollineintersectaxis.h" -#include "../../widgets/vmaingraphicsscene.h" +#include "../../libs/vwidgets/vmaingraphicsscene.h" #include "../../libs/vpatterndb/calculator.h" #include "../../dialogs/tools/dialoglineintersectaxis.h" #include "../../dialogs/tools/dialogeditwrongformula.h" diff --git a/src/app/tools/vabstracttool.cpp b/src/app/tools/vabstracttool.cpp index 7bd1d356b..2611126c1 100644 --- a/src/app/tools/vabstracttool.cpp +++ b/src/app/tools/vabstracttool.cpp @@ -37,7 +37,7 @@ #include "../core/vapplication.h" #include "../libs/vgeometry/vpointf.h" #include "../undocommands/savetooloptions.h" -#include "../widgets/vmaingraphicsview.h" +#include "../libs/vwidgets/vmaingraphicsview.h" #include "../core/vsettings.h" const QString VAbstractTool::AttrType = QStringLiteral("type"); diff --git a/src/app/tools/vabstracttool.h b/src/app/tools/vabstracttool.h index 0d02d5a4d..92510807b 100644 --- a/src/app/tools/vabstracttool.h +++ b/src/app/tools/vabstracttool.h @@ -32,7 +32,7 @@ #include "vdatatool.h" #include "../xml/vpattern.h" #include "../core/vapplication.h" -#include "../widgets/vmaingraphicsscene.h" +#include "../libs/vwidgets/vmaingraphicsscene.h" #include "../visualization/visualization.h" class QDomElement; diff --git a/src/app/tools/vtooldetail.cpp b/src/app/tools/vtooldetail.cpp index a732c38ba..2412bac8c 100644 --- a/src/app/tools/vtooldetail.cpp +++ b/src/app/tools/vtooldetail.cpp @@ -30,7 +30,7 @@ #include "nodeDetails/nodedetails.h" #include "../libs/vgeometry/varc.h" #include "../libs/vgeometry/vsplinepath.h" -#include "../widgets/vmaingraphicsscene.h" +#include "../libs/vwidgets/vmaingraphicsscene.h" #include "../dialogs/tools/dialogtool.h" #include "../dialogs/tools/dialogdetail.h" #include diff --git a/src/app/undocommands/addtocalc.cpp b/src/app/undocommands/addtocalc.cpp index 5f1d5a35c..bab94b40a 100644 --- a/src/app/undocommands/addtocalc.cpp +++ b/src/app/undocommands/addtocalc.cpp @@ -30,8 +30,8 @@ #include "../xml/vpattern.h" #include "../tools/vabstracttool.h" #include "../core/vapplication.h" -#include "../widgets/vmaingraphicsscene.h" -#include "../widgets/vmaingraphicsview.h" +#include "../libs/vwidgets/vmaingraphicsscene.h" +#include "../libs/vwidgets/vmaingraphicsview.h" //--------------------------------------------------------------------------------------------------------------------- AddToCalc::AddToCalc(const QDomElement &xml, VPattern *doc, QUndoCommand *parent) diff --git a/src/app/visualization/visualization.h b/src/app/visualization/visualization.h index 56b141fa6..4f03b4262 100644 --- a/src/app/visualization/visualization.h +++ b/src/app/visualization/visualization.h @@ -33,7 +33,7 @@ #include #include "../core/vapplication.h" -#include "../widgets/vmaingraphicsscene.h" +#include "../libs/vwidgets/vmaingraphicsscene.h" #include "../vmisc/logging.h" #include "../../libs/vpatterndb/vcontainer.h" diff --git a/src/app/visualization/visualization.pri b/src/app/visualization/visualization.pri index 22b859b49..cca79ad52 100644 --- a/src/app/visualization/visualization.pri +++ b/src/app/visualization/visualization.pri @@ -4,7 +4,6 @@ HEADERS += \ $$PWD/vgraphicssimpletextitem.h \ $$PWD/vcontrolpointspline.h \ - $$PWD/vsimplecurve.h \ $$PWD/visline.h \ $$PWD/vistoolline.h \ $$PWD/vistoolendline.h \ @@ -36,7 +35,6 @@ HEADERS += \ SOURCES += \ $$PWD/vgraphicssimpletextitem.cpp \ $$PWD/vcontrolpointspline.cpp \ - $$PWD/vsimplecurve.cpp \ $$PWD/visline.cpp \ $$PWD/vistoolline.cpp \ $$PWD/vistoolendline.cpp \ diff --git a/src/app/widgets/widgets.pri b/src/app/widgets/widgets.pri index e82137562..9e67bb64b 100644 --- a/src/app/widgets/widgets.pri +++ b/src/app/widgets/widgets.pri @@ -2,21 +2,11 @@ # This need for corect working file translations.pro HEADERS += \ - $$PWD/vmaingraphicsview.h \ - $$PWD/vmaingraphicsscene.h \ - $$PWD/doubledelegate.h \ - $$PWD/textdelegate.h \ $$PWD/vtooloptionspropertybrowser.h \ $$PWD/vformulapropertyeditor.h \ - $$PWD/vformulaproperty.h \ - $$PWD/vwidgetpopup.h + $$PWD/vformulaproperty.h SOURCES += \ - $$PWD/vmaingraphicsview.cpp \ - $$PWD/vmaingraphicsscene.cpp \ - $$PWD/doubledelegate.cpp \ - $$PWD/textdelegate.cpp \ $$PWD/vtooloptionspropertybrowser.cpp \ $$PWD/vformulapropertyeditor.cpp \ - $$PWD/vformulaproperty.cpp \ - $$PWD/vwidgetpopup.cpp + $$PWD/vformulaproperty.cpp diff --git a/src/libs/libs.pro b/src/libs/libs.pro index 4d31c3064..83421d31b 100644 --- a/src/libs/libs.pro +++ b/src/libs/libs.pro @@ -7,6 +7,7 @@ SUBDIRS = \ vlayout \ vgeometry \ vpatterndb \ - vmisc + vmisc \ + vwidgets vgeometry.depends = ifc diff --git a/src/app/widgets/doubledelegate.cpp b/src/libs/vwidgets/doubledelegate.cpp similarity index 100% rename from src/app/widgets/doubledelegate.cpp rename to src/libs/vwidgets/doubledelegate.cpp diff --git a/src/app/widgets/doubledelegate.h b/src/libs/vwidgets/doubledelegate.h similarity index 100% rename from src/app/widgets/doubledelegate.h rename to src/libs/vwidgets/doubledelegate.h diff --git a/src/libs/vwidgets/stable.cpp b/src/libs/vwidgets/stable.cpp new file mode 100644 index 000000000..a42d3fd7c --- /dev/null +++ b/src/libs/vwidgets/stable.cpp @@ -0,0 +1,30 @@ +/************************************************************************ + ** + ** @file stable.cpp + ** @author Roman Telezhynskyi + ** @date 10 12, 2014 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2013-2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +// Build the precompiled headers. +#include "stable.h" diff --git a/src/libs/vwidgets/stable.h b/src/libs/vwidgets/stable.h new file mode 100644 index 000000000..e19a85cee --- /dev/null +++ b/src/libs/vwidgets/stable.h @@ -0,0 +1,52 @@ +/************************************************************************ + ** + ** @file stable.h + ** @author Roman Telezhynskyi + ** @date 10 12, 2014 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2013-2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef STABLE_H +#define STABLE_H + +/* I like to include this pragma too, so the build log indicates if pre-compiled headers were in use. */ +#ifndef __clang__ +#pragma message("Compiling precompiled headers for VPatternDB library.\n") +#endif + +/* Add C includes here */ + +#if defined __cplusplus +/* Add C++ includes here */ + +#ifdef QT_CORE_LIB +#include +#endif + +#ifdef QT_GUI_LIB +# include +#endif + +#endif/*__cplusplus*/ + +#endif // STABLE_H diff --git a/src/app/widgets/textdelegate.cpp b/src/libs/vwidgets/textdelegate.cpp similarity index 99% rename from src/app/widgets/textdelegate.cpp rename to src/libs/vwidgets/textdelegate.cpp index e33822289..1a9768454 100644 --- a/src/app/widgets/textdelegate.cpp +++ b/src/libs/vwidgets/textdelegate.cpp @@ -28,7 +28,7 @@ #include "textdelegate.h" #include -#include "../libs/vpatterndb/vcontainer.h" +#include "../vpatterndb/vcontainer.h" //--------------------------------------------------------------------------------------------------------------------- /** diff --git a/src/app/widgets/textdelegate.h b/src/libs/vwidgets/textdelegate.h similarity index 100% rename from src/app/widgets/textdelegate.h rename to src/libs/vwidgets/textdelegate.h diff --git a/src/app/widgets/vmaingraphicsscene.cpp b/src/libs/vwidgets/vmaingraphicsscene.cpp similarity index 100% rename from src/app/widgets/vmaingraphicsscene.cpp rename to src/libs/vwidgets/vmaingraphicsscene.cpp diff --git a/src/app/widgets/vmaingraphicsscene.h b/src/libs/vwidgets/vmaingraphicsscene.h similarity index 100% rename from src/app/widgets/vmaingraphicsscene.h rename to src/libs/vwidgets/vmaingraphicsscene.h diff --git a/src/app/widgets/vmaingraphicsview.cpp b/src/libs/vwidgets/vmaingraphicsview.cpp similarity index 99% rename from src/app/widgets/vmaingraphicsview.cpp rename to src/libs/vwidgets/vmaingraphicsview.cpp index 41e55d811..7c87b8516 100644 --- a/src/app/widgets/vmaingraphicsview.cpp +++ b/src/libs/vwidgets/vmaingraphicsview.cpp @@ -32,7 +32,7 @@ #include #include #include -#include "../visualization/vsimplecurve.h" +#include "vsimplecurve.h" #include #include diff --git a/src/app/widgets/vmaingraphicsview.h b/src/libs/vwidgets/vmaingraphicsview.h similarity index 100% rename from src/app/widgets/vmaingraphicsview.h rename to src/libs/vwidgets/vmaingraphicsview.h diff --git a/src/app/visualization/vsimplecurve.cpp b/src/libs/vwidgets/vsimplecurve.cpp similarity index 100% rename from src/app/visualization/vsimplecurve.cpp rename to src/libs/vwidgets/vsimplecurve.cpp diff --git a/src/app/visualization/vsimplecurve.h b/src/libs/vwidgets/vsimplecurve.h similarity index 98% rename from src/app/visualization/vsimplecurve.h rename to src/libs/vwidgets/vsimplecurve.h index c098e3660..4f31eba73 100644 --- a/src/app/visualization/vsimplecurve.h +++ b/src/libs/vwidgets/vsimplecurve.h @@ -30,7 +30,7 @@ #define VSIMPLECURVE_H #include -#include "../libs/vgeometry/vabstractcurve.h" +#include "../vgeometry/vabstractcurve.h" #include "../vmisc/def.h" enum class SimpleCurvePoint : char { FirstPoint, ForthPoint }; diff --git a/src/app/widgets/vwidgetpopup.cpp b/src/libs/vwidgets/vwidgetpopup.cpp similarity index 100% rename from src/app/widgets/vwidgetpopup.cpp rename to src/libs/vwidgets/vwidgetpopup.cpp diff --git a/src/app/widgets/vwidgetpopup.h b/src/libs/vwidgets/vwidgetpopup.h similarity index 100% rename from src/app/widgets/vwidgetpopup.h rename to src/libs/vwidgets/vwidgetpopup.h diff --git a/src/libs/vwidgets/vwidgets.pri b/src/libs/vwidgets/vwidgets.pri new file mode 100644 index 000000000..0ddb4e7cc --- /dev/null +++ b/src/libs/vwidgets/vwidgets.pri @@ -0,0 +1,20 @@ +# ADD TO EACH PATH $$PWD VARIABLE!!!!!! +# This need for corect working file translations.pro + +SOURCES += \ + $$PWD/stable.cpp \ + $$PWD/doubledelegate.cpp \ + $$PWD/textdelegate.cpp \ + $$PWD/vmaingraphicsscene.cpp \ + $$PWD/vmaingraphicsview.cpp \ + $$PWD/vsimplecurve.cpp \ + $$PWD/vwidgetpopup.cpp + +HEADERS += \ + $$PWD/stable.h \ + $$PWD/doubledelegate.h \ + $$PWD/textdelegate.h \ + $$PWD/vmaingraphicsscene.h \ + $$PWD/vmaingraphicsview.h \ + $$PWD/vsimplecurve.h \ + $$PWD/vwidgetpopup.h diff --git a/src/libs/vwidgets/vwidgets.pro b/src/libs/vwidgets/vwidgets.pro new file mode 100644 index 000000000..28b9e641f --- /dev/null +++ b/src/libs/vwidgets/vwidgets.pro @@ -0,0 +1,96 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2015-06-15T15:24:19 +# +#------------------------------------------------- + +# File with common stuff for whole project +include(../../../Valentina.pri) + +# Name of the library +TARGET = vwidgets + +# We want create a library +TEMPLATE = lib + +CONFIG += \ + staticlib \# Making static library + c++11 # We use C++11 standard + +# Use out-of-source builds (shadow builds) +CONFIG -= debug_and_release debug_and_release_target + +# Since Qt 5.4.0 the source code location is recorded only in debug builds. +# We need this information also in release builds. For this need define QT_MESSAGELOGCONTEXT. +DEFINES += QT_MESSAGELOGCONTEXT + +include(vwidgets.pri) + +# This is static library so no need in "make install" + +# directory for executable file +DESTDIR = bin + +# files created moc +MOC_DIR = moc + +# objecs files +OBJECTS_DIR = obj + +# Set using ccache. Function enable_ccache() defined in Valentina.pri. +$$enable_ccache() + +# Set precompiled headers. Function set_PCH() defined in Valentina.pri. +$$set_PCH() + +CONFIG(debug, debug|release){ + # Debug mode + unix { + #Turn on compilers warnings. + *-g++{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$GCC_DEBUG_CXXFLAGS # See Valentina.pri for more details. + + noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer + # do nothing + } else { + #gcc’s 4.8.0 Address Sanitizer + #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ + QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_LFLAGS += -fsanitize=address + } + } + clang*{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$CLANG_DEBUG_CXXFLAGS # See Valentina.pri for more details. + } + } else { + *-g++{ + QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See Valentina.pri for more details. + } + } + +}else{ + # Release mode + + !unix:*-g++{ + QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll + } + + noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols + # do nothing + } else { + !macx:!win32-msvc*{ + # Turn on debug symbols in release mode on Unix systems. + # On Mac OS X temporarily disabled. TODO: find way how to strip binary file. + QMAKE_CXXFLAGS_RELEASE += -g -gdwarf-3 + QMAKE_CFLAGS_RELEASE += -g -gdwarf-3 + QMAKE_LFLAGS_RELEASE = + } + } +} From 63d500189922ae5355475b184d080be7df78afc3 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 15 Jun 2015 16:10:55 +0300 Subject: [PATCH 08/22] Unite "core" and "widgets" folders. --HG-- branch : feature --- src/app/app.pri | 1 - src/app/core/core.pri | 10 ++++++++-- src/app/{widgets => core}/vformulaproperty.cpp | 0 src/app/{widgets => core}/vformulaproperty.h | 0 src/app/{widgets => core}/vformulapropertyeditor.cpp | 0 src/app/{widgets => core}/vformulapropertyeditor.h | 0 .../vtooloptionspropertybrowser.cpp | 0 .../{widgets => core}/vtooloptionspropertybrowser.h | 0 src/app/dialogs/app/configdialog.cpp | 2 +- src/app/dialogs/app/dialogaboutapp.cpp | 2 +- src/app/dialogs/app/dialoglayoutprogress.cpp | 4 ++-- src/app/dialogs/app/dialogmeasurements.cpp | 2 +- src/app/dialogs/app/dialogpatternxmledit.cpp | 2 +- src/app/dialogs/app/dialogsavelayout.cpp | 2 +- src/app/dialogs/tools/dialogheight.cpp | 2 +- src/app/dialogs/tools/dialognormal.cpp | 2 +- src/app/mainwindow.cpp | 2 +- src/app/mainwindowsnogui.cpp | 8 ++++---- src/app/tools/drawTools/vdrawtool.cpp | 4 ++-- src/app/tools/drawTools/vtoolarc.cpp | 2 +- src/app/tools/drawTools/vtoolarcwithlength.cpp | 2 +- src/app/tools/drawTools/vtoolcurveintersectaxis.cpp | 2 +- src/app/tools/drawTools/vtoolendline.cpp | 2 +- src/app/tools/drawTools/vtoollineintersectaxis.cpp | 2 +- src/app/tools/drawTools/vtoollinepoint.h | 2 +- .../drawTools/vtoolpointfromcircleandtangent.cpp | 2 +- .../drawTools/vtoolpointofintersectioncircles.cpp | 2 +- src/app/widgets/widgets.pri | 12 ------------ 28 files changed, 32 insertions(+), 39 deletions(-) rename src/app/{widgets => core}/vformulaproperty.cpp (100%) rename src/app/{widgets => core}/vformulaproperty.h (100%) rename src/app/{widgets => core}/vformulapropertyeditor.cpp (100%) rename src/app/{widgets => core}/vformulapropertyeditor.h (100%) rename src/app/{widgets => core}/vtooloptionspropertybrowser.cpp (100%) rename src/app/{widgets => core}/vtooloptionspropertybrowser.h (100%) delete mode 100644 src/app/widgets/widgets.pri diff --git a/src/app/app.pri b/src/app/app.pri index 7f5d8d065..807bc2eae 100644 --- a/src/app/app.pri +++ b/src/app/app.pri @@ -1,7 +1,6 @@ # Suport subdirectories. Just better project code tree. include(dialogs/dialogs.pri) include(tools/tools.pri) -include(widgets/widgets.pri) include(xml/xml.pri) include(undocommands/undocommands.pri) include(visualization/visualization.pri) diff --git a/src/app/core/core.pri b/src/app/core/core.pri index e977232d8..ffccc7e44 100644 --- a/src/app/core/core.pri +++ b/src/app/core/core.pri @@ -4,9 +4,15 @@ HEADERS += \ $$PWD/vapplication.h \ $$PWD/vsettings.h \ - $$PWD/vformula.h + $$PWD/vformula.h \ + $$PWD/vformulaproperty.h \ + $$PWD/vformulapropertyeditor.h \ + $$PWD/vtooloptionspropertybrowser.h SOURCES += \ $$PWD/vapplication.cpp \ $$PWD/vsettings.cpp \ - $$PWD/vformula.cpp + $$PWD/vformula.cpp \ + $$PWD/vformulaproperty.cpp \ + $$PWD/vformulapropertyeditor.cpp \ + $$PWD/vtooloptionspropertybrowser.cpp diff --git a/src/app/widgets/vformulaproperty.cpp b/src/app/core/vformulaproperty.cpp similarity index 100% rename from src/app/widgets/vformulaproperty.cpp rename to src/app/core/vformulaproperty.cpp diff --git a/src/app/widgets/vformulaproperty.h b/src/app/core/vformulaproperty.h similarity index 100% rename from src/app/widgets/vformulaproperty.h rename to src/app/core/vformulaproperty.h diff --git a/src/app/widgets/vformulapropertyeditor.cpp b/src/app/core/vformulapropertyeditor.cpp similarity index 100% rename from src/app/widgets/vformulapropertyeditor.cpp rename to src/app/core/vformulapropertyeditor.cpp diff --git a/src/app/widgets/vformulapropertyeditor.h b/src/app/core/vformulapropertyeditor.h similarity index 100% rename from src/app/widgets/vformulapropertyeditor.h rename to src/app/core/vformulapropertyeditor.h diff --git a/src/app/widgets/vtooloptionspropertybrowser.cpp b/src/app/core/vtooloptionspropertybrowser.cpp similarity index 100% rename from src/app/widgets/vtooloptionspropertybrowser.cpp rename to src/app/core/vtooloptionspropertybrowser.cpp diff --git a/src/app/widgets/vtooloptionspropertybrowser.h b/src/app/core/vtooloptionspropertybrowser.h similarity index 100% rename from src/app/widgets/vtooloptionspropertybrowser.h rename to src/app/core/vtooloptionspropertybrowser.h diff --git a/src/app/dialogs/app/configdialog.cpp b/src/app/dialogs/app/configdialog.cpp index e36471a83..fe3d0bc87 100644 --- a/src/app/dialogs/app/configdialog.cpp +++ b/src/app/dialogs/app/configdialog.cpp @@ -33,7 +33,7 @@ #include #include #include -#include "../core/vapplication.h" +#include "../../core/vapplication.h" //--------------------------------------------------------------------------------------------------------------------- ConfigDialog::ConfigDialog(QWidget *parent) : diff --git a/src/app/dialogs/app/dialogaboutapp.cpp b/src/app/dialogs/app/dialogaboutapp.cpp index 17dce5b12..c27706168 100644 --- a/src/app/dialogs/app/dialogaboutapp.cpp +++ b/src/app/dialogs/app/dialogaboutapp.cpp @@ -33,7 +33,7 @@ #include #include #include "../../options.h" -#include "../core/vapplication.h" +#include "../../core/vapplication.h" //--------------------------------------------------------------------------------------------------------------------- DialogAboutApp::DialogAboutApp(QWidget *parent) : diff --git a/src/app/dialogs/app/dialoglayoutprogress.cpp b/src/app/dialogs/app/dialoglayoutprogress.cpp index f15268cfe..ed326f51d 100644 --- a/src/app/dialogs/app/dialoglayoutprogress.cpp +++ b/src/app/dialogs/app/dialoglayoutprogress.cpp @@ -28,8 +28,8 @@ #include "dialoglayoutprogress.h" #include "ui_dialoglayoutprogress.h" -#include "../options.h" -#include "../core/vapplication.h" +#include "../../options.h" +#include "../../core/vapplication.h" #include #include diff --git a/src/app/dialogs/app/dialogmeasurements.cpp b/src/app/dialogs/app/dialogmeasurements.cpp index cfa386f55..c9d49c8fa 100644 --- a/src/app/dialogs/app/dialogmeasurements.cpp +++ b/src/app/dialogs/app/dialogmeasurements.cpp @@ -28,7 +28,7 @@ #include "dialogmeasurements.h" #include "ui_dialogmeasurements.h" -#include "../core/vapplication.h" +#include "../../core/vapplication.h" //--------------------------------------------------------------------------------------------------------------------- DialogMeasurements::DialogMeasurements(QWidget *parent) : diff --git a/src/app/dialogs/app/dialogpatternxmledit.cpp b/src/app/dialogs/app/dialogpatternxmledit.cpp index b1782f23f..55c45f6fe 100644 --- a/src/app/dialogs/app/dialogpatternxmledit.cpp +++ b/src/app/dialogs/app/dialogpatternxmledit.cpp @@ -28,7 +28,7 @@ #include "dialogpatternxmledit.h" #include "ui_dialogpatternxmledit.h" -#include "../core/vapplication.h" +#include "../../core/vapplication.h" #include #include diff --git a/src/app/dialogs/app/dialogsavelayout.cpp b/src/app/dialogs/app/dialogsavelayout.cpp index 3a37bba72..a26a7e1d2 100644 --- a/src/app/dialogs/app/dialogsavelayout.cpp +++ b/src/app/dialogs/app/dialogsavelayout.cpp @@ -28,7 +28,7 @@ #include "dialogsavelayout.h" #include "ui_dialogsavelayout.h" -#include "../options.h" +#include "../../options.h" #include "../../core/vapplication.h" #include "../../core/vsettings.h" diff --git a/src/app/dialogs/tools/dialogheight.cpp b/src/app/dialogs/tools/dialogheight.cpp index 145866c32..54f3ef57a 100644 --- a/src/app/dialogs/tools/dialogheight.cpp +++ b/src/app/dialogs/tools/dialogheight.cpp @@ -32,7 +32,7 @@ #include "../../libs/vgeometry/vpointf.h" #include "../../libs/vpatterndb/vcontainer.h" #include "../../tools/vabstracttool.h" -#include "../visualization/vistoolheight.h" +#include "../../visualization/vistoolheight.h" #include "../../libs/vwidgets/vmaingraphicsscene.h" //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialognormal.cpp b/src/app/dialogs/tools/dialognormal.cpp index c67f1f673..8285bd333 100644 --- a/src/app/dialogs/tools/dialognormal.cpp +++ b/src/app/dialogs/tools/dialognormal.cpp @@ -28,7 +28,7 @@ #include "dialognormal.h" #include "ui_dialognormal.h" -#include "../visualization/vistoolnormal.h" +#include "../../visualization/vistoolnormal.h" #include "../../../libs/vwidgets/vmaingraphicsscene.h" #include "../../tools/vabstracttool.h" #include "dialogeditwrongformula.h" diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index 1d04256f7..201e1a3f0 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -41,7 +41,7 @@ #include "../libs/vmisc/undoevent.h" #include "core/vsettings.h" #include "undocommands/renamepp.h" -#include "vtooloptionspropertybrowser.h" +#include "core/vtooloptionspropertybrowser.h" #include "options.h" #include "../libs/ifc/xml/vpatternconverter.h" #include "../vmisc/logging.h" diff --git a/src/app/mainwindowsnogui.cpp b/src/app/mainwindowsnogui.cpp index 55b3f5721..8ab38c3c4 100644 --- a/src/app/mainwindowsnogui.cpp +++ b/src/app/mainwindowsnogui.cpp @@ -27,13 +27,13 @@ *************************************************************************/ #include "mainwindowsnogui.h" -#include "../core/vapplication.h" +#include "core/vapplication.h" #include "../libs/vpatterndb/vcontainer.h" #include "../libs/vobj/vobjpaintdevice.h" -#include "../dialogs/app/dialoglayoutsettings.h" +#include "dialogs/app/dialoglayoutsettings.h" #include "../libs/vlayout/vlayoutgenerator.h" -#include "../dialogs/app/dialoglayoutprogress.h" -#include "../dialogs/app/dialogsavelayout.h" +#include "dialogs/app/dialoglayoutprogress.h" +#include "dialogs/app/dialogsavelayout.h" #include "../libs/vlayout/vposter.h" #include diff --git a/src/app/tools/drawTools/vdrawtool.cpp b/src/app/tools/drawTools/vdrawtool.cpp index 8f6980310..eeabe8c91 100644 --- a/src/app/tools/drawTools/vdrawtool.cpp +++ b/src/app/tools/drawTools/vdrawtool.cpp @@ -29,8 +29,8 @@ #include "vdrawtool.h" #include -#include "../dialogs/tools/dialogeditwrongformula.h" -#include "../dialogs/app/dialogundo.h" +#include "../../dialogs/tools/dialogeditwrongformula.h" +#include "../../dialogs/app/dialogundo.h" #include "../libs/vpatterndb/calculator.h" #include "../../undocommands/addtocalc.h" #include "../../undocommands/savetooloptions.h" diff --git a/src/app/tools/drawTools/vtoolarc.cpp b/src/app/tools/drawTools/vtoolarc.cpp index 3bcc3c0ab..5c98e36ef 100644 --- a/src/app/tools/drawTools/vtoolarc.cpp +++ b/src/app/tools/drawTools/vtoolarc.cpp @@ -30,7 +30,7 @@ #include "../../libs/vpatterndb/calculator.h" #include "../../dialogs/tools/dialogarc.h" #include "../../libs/vgeometry/varc.h" -#include "../core/vformula.h" +#include "../../core/vformula.h" #include "../../visualization/vistoolarc.h" #include diff --git a/src/app/tools/drawTools/vtoolarcwithlength.cpp b/src/app/tools/drawTools/vtoolarcwithlength.cpp index 17e03582f..ae65670b5 100644 --- a/src/app/tools/drawTools/vtoolarcwithlength.cpp +++ b/src/app/tools/drawTools/vtoolarcwithlength.cpp @@ -30,7 +30,7 @@ #include "../../libs/vpatterndb/calculator.h" #include "../../dialogs/tools/dialogarcwithlength.h" #include "../../libs/vgeometry/varc.h" -#include "../core/vformula.h" +#include "../../core/vformula.h" #include "../../visualization/vistoolarcwithlength.h" #include diff --git a/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp b/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp index b335d2fc8..2520c1e1b 100644 --- a/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp +++ b/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp @@ -32,7 +32,7 @@ #include "../../dialogs/tools/dialogcurveintersectaxis.h" #include "../../dialogs/tools/dialogeditwrongformula.h" #include "../../libs/vgeometry/vpointf.h" -#include "./../visualization/vistoolcurveintersectaxis.h" +#include "../../visualization/vistoolcurveintersectaxis.h" const QString VToolCurveIntersectAxis::ToolType = QStringLiteral("curveIntersectAxis"); diff --git a/src/app/tools/drawTools/vtoolendline.cpp b/src/app/tools/drawTools/vtoolendline.cpp index b95bd79bb..c44d267a7 100644 --- a/src/app/tools/drawTools/vtoolendline.cpp +++ b/src/app/tools/drawTools/vtoolendline.cpp @@ -32,7 +32,7 @@ #include "../../dialogs/tools/dialogendline.h" #include "../../dialogs/tools/dialogeditwrongformula.h" #include "../../libs/vgeometry/vpointf.h" -#include "./../visualization/vistoolendline.h" +#include "../../visualization/vistoolendline.h" const QString VToolEndLine::ToolType = QStringLiteral("endLine"); diff --git a/src/app/tools/drawTools/vtoollineintersectaxis.cpp b/src/app/tools/drawTools/vtoollineintersectaxis.cpp index d40cfe561..4dbc92919 100644 --- a/src/app/tools/drawTools/vtoollineintersectaxis.cpp +++ b/src/app/tools/drawTools/vtoollineintersectaxis.cpp @@ -32,7 +32,7 @@ #include "../../dialogs/tools/dialoglineintersectaxis.h" #include "../../dialogs/tools/dialogeditwrongformula.h" #include "../../libs/vgeometry/vpointf.h" -#include "./../visualization/vistoollineintersectaxis.h" +#include "../../visualization/vistoollineintersectaxis.h" const QString VToolLineIntersectAxis::ToolType = QStringLiteral("lineIntersectAxis"); diff --git a/src/app/tools/drawTools/vtoollinepoint.h b/src/app/tools/drawTools/vtoollinepoint.h index 6b840ce4b..93d020c68 100644 --- a/src/app/tools/drawTools/vtoollinepoint.h +++ b/src/app/tools/drawTools/vtoollinepoint.h @@ -30,7 +30,7 @@ #define VTOOLLINEPOINT_H #include "vtoolpoint.h" -#include "../core/vformula.h" +#include "../../core/vformula.h" /** * @brief The VToolLinePoint class parent for all tools what create point with line. diff --git a/src/app/tools/drawTools/vtoolpointfromcircleandtangent.cpp b/src/app/tools/drawTools/vtoolpointfromcircleandtangent.cpp index 2a9b08f25..6156d55a5 100644 --- a/src/app/tools/drawTools/vtoolpointfromcircleandtangent.cpp +++ b/src/app/tools/drawTools/vtoolpointfromcircleandtangent.cpp @@ -31,7 +31,7 @@ #include "../../libs/vgeometry/vpointf.h" #include "../../libs/vgeometry/varc.h" #include "../../visualization/vistoolpointfromcircleandtangent.h" -#include "../core/vformula.h" +#include "../../core/vformula.h" const QString VToolPointFromCircleAndTangent::ToolType = QStringLiteral("pointFromCircleAndTangent"); diff --git a/src/app/tools/drawTools/vtoolpointofintersectioncircles.cpp b/src/app/tools/drawTools/vtoolpointofintersectioncircles.cpp index f9adc78fa..b5f7e5823 100644 --- a/src/app/tools/drawTools/vtoolpointofintersectioncircles.cpp +++ b/src/app/tools/drawTools/vtoolpointofintersectioncircles.cpp @@ -31,7 +31,7 @@ #include "../../libs/vgeometry/vpointf.h" #include "../../libs/vgeometry/varc.h" #include "../../visualization/vistoolpointofintersectioncircles.h" -#include "../core/vformula.h" +#include "../../core/vformula.h" const QString VToolPointOfIntersectionCircles::ToolType = QStringLiteral("pointOfIntersectionCircles"); diff --git a/src/app/widgets/widgets.pri b/src/app/widgets/widgets.pri deleted file mode 100644 index 9e67bb64b..000000000 --- a/src/app/widgets/widgets.pri +++ /dev/null @@ -1,12 +0,0 @@ -# ADD TO EACH PATH $$PWD VARIABLE!!!!!! -# This need for corect working file translations.pro - -HEADERS += \ - $$PWD/vtooloptionspropertybrowser.h \ - $$PWD/vformulapropertyeditor.h \ - $$PWD/vformulaproperty.h - -SOURCES += \ - $$PWD/vtooloptionspropertybrowser.cpp \ - $$PWD/vformulapropertyeditor.cpp \ - $$PWD/vformulaproperty.cpp From 224241adde38b71fec92d242a119df012c9c3cc0 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 15 Jun 2015 16:14:10 +0300 Subject: [PATCH 09/22] More independent class VSettings. --HG-- branch : feature --- src/app/core/vsettings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/core/vsettings.cpp b/src/app/core/vsettings.cpp index 0feb75525..7531d3dc8 100644 --- a/src/app/core/vsettings.cpp +++ b/src/app/core/vsettings.cpp @@ -33,7 +33,7 @@ #include #include -#include "../xml/vabstractmeasurements.h" +#include "../../libs/ifc/ifcdef.h" #if QT_VERSION < QT_VERSION_CHECK(5, 1, 0) # include "../../libs/vmisc/vmath.h" From 78dbb63c1be92458c433b47d8623a922745480c2 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 15 Jun 2015 16:24:57 +0300 Subject: [PATCH 10/22] Move class VSettings to library VMisc. --HG-- branch : feature --- src/app/core/core.pri | 2 -- src/app/core/vformula.cpp | 2 +- src/app/dialogs/app/configpages/communitypage.cpp | 2 +- src/app/dialogs/app/configpages/configurationpage.cpp | 2 +- src/app/dialogs/app/configpages/pathpage.cpp | 2 +- src/app/dialogs/app/configpages/patternpage.cpp | 2 +- src/app/dialogs/app/dialogincrements.cpp | 2 +- src/app/dialogs/app/dialogindividualmeasurements.cpp | 2 +- src/app/dialogs/app/dialoglayoutsettings.cpp | 2 +- src/app/dialogs/app/dialogsavelayout.cpp | 2 +- src/app/dialogs/app/dialogstandardmeasurements.cpp | 2 +- src/app/mainwindow.cpp | 2 +- src/app/tools/vabstracttool.cpp | 2 +- src/app/xml/vpattern.cpp | 2 +- src/libs/vmisc/vmisc.pri | 6 ++++-- src/{app/core => libs/vmisc}/vsettings.cpp | 0 src/{app/core => libs/vmisc}/vsettings.h | 0 17 files changed, 17 insertions(+), 17 deletions(-) rename src/{app/core => libs/vmisc}/vsettings.cpp (100%) rename src/{app/core => libs/vmisc}/vsettings.h (100%) diff --git a/src/app/core/core.pri b/src/app/core/core.pri index ffccc7e44..401024d03 100644 --- a/src/app/core/core.pri +++ b/src/app/core/core.pri @@ -3,7 +3,6 @@ HEADERS += \ $$PWD/vapplication.h \ - $$PWD/vsettings.h \ $$PWD/vformula.h \ $$PWD/vformulaproperty.h \ $$PWD/vformulapropertyeditor.h \ @@ -11,7 +10,6 @@ HEADERS += \ SOURCES += \ $$PWD/vapplication.cpp \ - $$PWD/vsettings.cpp \ $$PWD/vformula.cpp \ $$PWD/vformulaproperty.cpp \ $$PWD/vformulapropertyeditor.cpp \ diff --git a/src/app/core/vformula.cpp b/src/app/core/vformula.cpp index 5f1185cbd..3cdca81f7 100644 --- a/src/app/core/vformula.cpp +++ b/src/app/core/vformula.cpp @@ -30,7 +30,7 @@ #include "../libs/vpatterndb/calculator.h" #include "../libs/vpatterndb/vcontainer.h" #include "../core/vapplication.h" -#include "../core/vsettings.h" +#include "../libs/vmisc/vsettings.h" #include //VFormula diff --git a/src/app/dialogs/app/configpages/communitypage.cpp b/src/app/dialogs/app/configpages/communitypage.cpp index ac27f05e5..f770e9ff9 100644 --- a/src/app/dialogs/app/configpages/communitypage.cpp +++ b/src/app/dialogs/app/configpages/communitypage.cpp @@ -29,7 +29,7 @@ #include "communitypage.h" #include "../../../options.h" #include "../../../core/vapplication.h" -#include "../../../core/vsettings.h" +#include "../../../../libs/vmisc/vsettings.h" #include #include #include diff --git a/src/app/dialogs/app/configpages/configurationpage.cpp b/src/app/dialogs/app/configpages/configurationpage.cpp index 3ed823254..b394ab1d1 100644 --- a/src/app/dialogs/app/configpages/configurationpage.cpp +++ b/src/app/dialogs/app/configpages/configurationpage.cpp @@ -29,7 +29,7 @@ #include "configurationpage.h" #include "../../../options.h" #include "../../../core/vapplication.h" -#include "../../../core/vsettings.h" +#include "../../../../libs/vmisc/vsettings.h" #include #include #include diff --git a/src/app/dialogs/app/configpages/pathpage.cpp b/src/app/dialogs/app/configpages/pathpage.cpp index cad72ef13..4ffe3cd6a 100644 --- a/src/app/dialogs/app/configpages/pathpage.cpp +++ b/src/app/dialogs/app/configpages/pathpage.cpp @@ -29,7 +29,7 @@ #include "pathpage.h" #include "../../../options.h" #include "../../../core/vapplication.h" -#include "../../../core/vsettings.h" +#include "../../../../libs/vmisc/vsettings.h" #include #include #include diff --git a/src/app/dialogs/app/configpages/patternpage.cpp b/src/app/dialogs/app/configpages/patternpage.cpp index 32e01b72d..a5a522bbc 100644 --- a/src/app/dialogs/app/configpages/patternpage.cpp +++ b/src/app/dialogs/app/configpages/patternpage.cpp @@ -29,7 +29,7 @@ #include "patternpage.h" #include "../../../options.h" #include "../../../core/vapplication.h" -#include "../../../core/vsettings.h" +#include "../../../../libs/vmisc/vsettings.h" #include "../../../../libs/vwidgets/vmaingraphicsview.h" #include #include diff --git a/src/app/dialogs/app/dialogincrements.cpp b/src/app/dialogs/app/dialogincrements.cpp index 90ee3e4a0..4841a4705 100644 --- a/src/app/dialogs/app/dialogincrements.cpp +++ b/src/app/dialogs/app/dialogincrements.cpp @@ -33,7 +33,7 @@ #include "../../libs/vwidgets/vwidgetpopup.h" #include "../../xml/vstandardmeasurements.h" #include "../../xml/vindividualmeasurements.h" -#include "../../core/vsettings.h" +#include "../../libs/vmisc/vsettings.h" #include #include diff --git a/src/app/dialogs/app/dialogindividualmeasurements.cpp b/src/app/dialogs/app/dialogindividualmeasurements.cpp index 3fcc132f7..7ee0ba41a 100644 --- a/src/app/dialogs/app/dialogindividualmeasurements.cpp +++ b/src/app/dialogs/app/dialogindividualmeasurements.cpp @@ -30,7 +30,7 @@ #include "ui_dialogindividualmeasurements.h" #include "../../xml/vindividualmeasurements.h" #include "../../core/vapplication.h" -#include "../../core/vsettings.h" +#include "../../libs/vmisc/vsettings.h" #include "../../libs/vpatterndb/vcontainer.h" #include diff --git a/src/app/dialogs/app/dialoglayoutsettings.cpp b/src/app/dialogs/app/dialoglayoutsettings.cpp index c72b7f2ca..7f8cb65f8 100644 --- a/src/app/dialogs/app/dialoglayoutsettings.cpp +++ b/src/app/dialogs/app/dialoglayoutsettings.cpp @@ -30,7 +30,7 @@ #include "ui_dialoglayoutsettings.h" #include "../../core/vapplication.h" #include "../../libs/ifc/xml/vdomdocument.h" -#include "../../core/vsettings.h" +#include "../../libs/vmisc/vsettings.h" #include "../../libs/vlayout/vlayoutgenerator.h" #if QT_VERSION < QT_VERSION_CHECK(5, 1, 0) diff --git a/src/app/dialogs/app/dialogsavelayout.cpp b/src/app/dialogs/app/dialogsavelayout.cpp index a26a7e1d2..c0cc09bc3 100644 --- a/src/app/dialogs/app/dialogsavelayout.cpp +++ b/src/app/dialogs/app/dialogsavelayout.cpp @@ -30,7 +30,7 @@ #include "ui_dialogsavelayout.h" #include "../../options.h" #include "../../core/vapplication.h" -#include "../../core/vsettings.h" +#include "../../libs/vmisc/vsettings.h" #include #include diff --git a/src/app/dialogs/app/dialogstandardmeasurements.cpp b/src/app/dialogs/app/dialogstandardmeasurements.cpp index cb8793ba7..bc76284ab 100644 --- a/src/app/dialogs/app/dialogstandardmeasurements.cpp +++ b/src/app/dialogs/app/dialogstandardmeasurements.cpp @@ -30,7 +30,7 @@ #include "ui_dialogstandardmeasurements.h" #include "../../xml/vstandardmeasurements.h" #include "../../core/vapplication.h" -#include "../../core/vsettings.h" +#include "../../libs/vmisc/vsettings.h" #include "../../libs/vpatterndb/vcontainer.h" #include "../vmisc/logging.h" diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index 201e1a3f0..7adae9c6a 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -39,7 +39,7 @@ #include "xml/vindividualmeasurements.h" #include "core/vapplication.h" #include "../libs/vmisc/undoevent.h" -#include "core/vsettings.h" +#include "../libs/vmisc/vsettings.h" #include "undocommands/renamepp.h" #include "core/vtooloptionspropertybrowser.h" #include "options.h" diff --git a/src/app/tools/vabstracttool.cpp b/src/app/tools/vabstracttool.cpp index 2611126c1..f85c369f9 100644 --- a/src/app/tools/vabstracttool.cpp +++ b/src/app/tools/vabstracttool.cpp @@ -38,7 +38,7 @@ #include "../libs/vgeometry/vpointf.h" #include "../undocommands/savetooloptions.h" #include "../libs/vwidgets/vmaingraphicsview.h" -#include "../core/vsettings.h" +#include "../libs/vmisc/vsettings.h" const QString VAbstractTool::AttrType = QStringLiteral("type"); const QString VAbstractTool::AttrMx = QStringLiteral("mx"); diff --git a/src/app/xml/vpattern.cpp b/src/app/xml/vpattern.cpp index b0333bdd4..1ec85ab58 100644 --- a/src/app/xml/vpattern.cpp +++ b/src/app/xml/vpattern.cpp @@ -39,7 +39,7 @@ #include "../libs/ifc/exception/vexceptionundo.h" #include "../libs/ifc/xml/vpatternconverter.h" #include "../libs/vmisc/undoevent.h" -#include "../core/vsettings.h" +#include "../libs/vmisc/vsettings.h" #include "vstandardmeasurements.h" #include "vindividualmeasurements.h" #include "../../libs/qmuparser/qmuparsererror.h" diff --git a/src/libs/vmisc/vmisc.pri b/src/libs/vmisc/vmisc.pri index f75d3197a..658e0d301 100644 --- a/src/libs/vmisc/vmisc.pri +++ b/src/libs/vmisc/vmisc.pri @@ -6,7 +6,8 @@ SOURCES += \ $$PWD/def.cpp \ $$PWD/undoevent.cpp \ $$PWD/backport/qcommandlineoption.cpp \ - $$PWD/backport/qcommandlineparser.cpp + $$PWD/backport/qcommandlineparser.cpp \ + $$PWD/vsettings.cpp HEADERS += \ $$PWD/stable.h \ @@ -15,4 +16,5 @@ HEADERS += \ $$PWD/vmath.h \ $$PWD/undoevent.h \ $$PWD/backport/qcommandlineoption.h \ - $$PWD/backport/qcommandlineparser.h + $$PWD/backport/qcommandlineparser.h \ + $$PWD/vsettings.h diff --git a/src/app/core/vsettings.cpp b/src/libs/vmisc/vsettings.cpp similarity index 100% rename from src/app/core/vsettings.cpp rename to src/libs/vmisc/vsettings.cpp diff --git a/src/app/core/vsettings.h b/src/libs/vmisc/vsettings.h similarity index 100% rename from src/app/core/vsettings.h rename to src/libs/vmisc/vsettings.h From fe704484c548cf87e42f3b7ba9fdc15833fa9035 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 15 Jun 2015 16:47:44 +0300 Subject: [PATCH 11/22] Class VControlPointSpline more independent. --HG-- branch : feature --- src/app/core/vapplication.cpp | 42 ----------------- src/app/core/vapplication.h | 3 -- src/app/options.cpp | 3 -- src/app/options.h | 3 -- src/app/tools/drawTools/vtoolsinglepoint.cpp | 10 ++-- src/app/tools/drawTools/vtoolspline.cpp | 10 ++-- src/app/tools/drawTools/vtoolsplinepath.cpp | 10 ++-- src/app/visualization/vcontrolpointspline.cpp | 24 +++++----- src/app/visualization/vcontrolpointspline.h | 2 +- .../visualization/vgraphicssimpletextitem.cpp | 10 ++-- src/libs/vmisc/def.cpp | 47 +++++++++++++++++++ src/libs/vmisc/def.h | 6 +++ src/libs/vmisc/vmisc.pro | 2 + 13 files changed, 87 insertions(+), 85 deletions(-) diff --git a/src/app/core/vapplication.cpp b/src/app/core/vapplication.cpp index a404b9a55..e461fc1da 100644 --- a/src/app/core/vapplication.cpp +++ b/src/app/core/vapplication.cpp @@ -608,48 +608,6 @@ void VApplication::setCurrentScene(QGraphicsScene *value) currentScene = value; } -//--------------------------------------------------------------------------------------------------------------------- -void VApplication::setOverrideCursor(const QString &pixmapPath, int hotX, int hotY) -{ -#ifndef QT_NO_CURSOR - QPixmap oldPixmap; - if (QCursor *oldCursor = QGuiApplication::overrideCursor()) - { - oldPixmap = oldCursor->pixmap(); - } - QPixmap newPixmap(pixmapPath); - - QImage oldImage = oldPixmap.toImage(); - QImage newImage = newPixmap.toImage(); - - if (oldImage != newImage ) - { - QApplication::setOverrideCursor(QCursor(newPixmap, hotX, hotY)); - } -#endif -} - -//--------------------------------------------------------------------------------------------------------------------- -void VApplication::restoreOverrideCursor(const QString &pixmapPath) -{ -#ifndef QT_NO_CURSOR - QPixmap oldPixmap; - if (QCursor *oldCursor = QGuiApplication::overrideCursor()) - { - oldPixmap = oldCursor->pixmap(); - } - QPixmap newPixmap(pixmapPath); - - QImage oldImage = oldPixmap.toImage(); - QImage newImage = newPixmap.toImage(); - - if (oldImage == newImage ) - { - QApplication::restoreOverrideCursor(); - } -#endif -} - //--------------------------------------------------------------------------------------------------------------------- QStringList VApplication::LabelLanguages() { diff --git a/src/app/core/vapplication.h b/src/app/core/vapplication.h index 8ccdcca44..1427e57f8 100644 --- a/src/app/core/vapplication.h +++ b/src/app/core/vapplication.h @@ -105,9 +105,6 @@ public: void setCurrentDocument(VPattern *doc); VPattern *getCurrentDocument()const; - static void setOverrideCursor(const QString & pixmapPath, int hotX = -1, int hotY = -1); - static void restoreOverrideCursor(const QString & pixmapPath); - static QStringList LabelLanguages(); void StartLogging(); diff --git a/src/app/options.cpp b/src/app/options.cpp index 22f45df26..2cc70763b 100644 --- a/src/app/options.cpp +++ b/src/app/options.cpp @@ -32,6 +32,3 @@ // From documantation: If you use QStringLiteral you should avoid declaring the same literal in multiple places: This // furthermore blows up the binary sizes. const QString degreeSymbol = QStringLiteral("°"); - -const QString cursorArrowOpenHand = QStringLiteral("://cursor/cursor-arrow-openhand.png"); -const QString cursorArrowCloseHand = QStringLiteral("://cursor/cursor-arrow-closehand.png"); diff --git a/src/app/options.h b/src/app/options.h index 41e50a80d..f98ddce0c 100644 --- a/src/app/options.h +++ b/src/app/options.h @@ -52,9 +52,6 @@ class QStringList; extern const QString degreeSymbol; -extern const QString cursorArrowOpenHand; -extern const QString cursorArrowCloseHand; - enum class Source : char { FromGui, FromFile, FromTool }; enum class Contour : char { OpenContour, CloseContour }; diff --git a/src/app/tools/drawTools/vtoolsinglepoint.cpp b/src/app/tools/drawTools/vtoolsinglepoint.cpp index 7e5ec1a34..c763fa9dd 100644 --- a/src/app/tools/drawTools/vtoolsinglepoint.cpp +++ b/src/app/tools/drawTools/vtoolsinglepoint.cpp @@ -65,7 +65,7 @@ VToolSinglePoint::VToolSinglePoint (VPattern *doc, VContainer *data, quint32 id, VToolSinglePoint::~VToolSinglePoint() { //Disable cursor-arrow-openhand - VApplication::restoreOverrideCursor(cursorArrowOpenHand); + RestoreOverrideCursor(cursorArrowOpenHand); } //--------------------------------------------------------------------------------------------------------------------- @@ -207,7 +207,7 @@ void VToolSinglePoint::hoverEnterEvent(QGraphicsSceneHoverEvent *event) if (flags() & QGraphicsItem::ItemIsMovable) { - VApplication::setOverrideCursor(cursorArrowOpenHand, 1, 1); + SetOverrideCursor(cursorArrowOpenHand, 1, 1); } } @@ -219,7 +219,7 @@ void VToolSinglePoint::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) if (flags() & QGraphicsItem::ItemIsMovable) { //Disable cursor-arrow-openhand - VApplication::restoreOverrideCursor(cursorArrowOpenHand); + RestoreOverrideCursor(cursorArrowOpenHand); } } @@ -230,7 +230,7 @@ void VToolSinglePoint::mousePressEvent(QGraphicsSceneMouseEvent *event) { if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) { - VApplication::setOverrideCursor(cursorArrowCloseHand, 1, 1); + SetOverrideCursor(cursorArrowCloseHand, 1, 1); } } VToolPoint::mousePressEvent(event); @@ -244,7 +244,7 @@ void VToolSinglePoint::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) { //Disable cursor-arrow-closehand - VApplication::restoreOverrideCursor(cursorArrowCloseHand); + RestoreOverrideCursor(cursorArrowCloseHand); } } VToolPoint::mouseReleaseEvent(event); diff --git a/src/app/tools/drawTools/vtoolspline.cpp b/src/app/tools/drawTools/vtoolspline.cpp index 26aa02006..0985f93c1 100644 --- a/src/app/tools/drawTools/vtoolspline.cpp +++ b/src/app/tools/drawTools/vtoolspline.cpp @@ -94,7 +94,7 @@ VToolSpline::VToolSpline(VPattern *doc, VContainer *data, quint32 id, const QStr VToolSpline::~VToolSpline() { //Disable cursor-arrow-openhand - VApplication::restoreOverrideCursor(cursorArrowOpenHand); + RestoreOverrideCursor(cursorArrowOpenHand); } //--------------------------------------------------------------------------------------------------------------------- @@ -345,7 +345,7 @@ void VToolSpline::mousePressEvent(QGraphicsSceneMouseEvent *event) { if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) { - VApplication::setOverrideCursor(cursorArrowCloseHand, 1, 1); + SetOverrideCursor(cursorArrowCloseHand, 1, 1); oldPosition = event->scenePos(); event->accept(); } @@ -361,7 +361,7 @@ void VToolSpline::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) { //Disable cursor-arrow-closehand - VApplication::restoreOverrideCursor(cursorArrowCloseHand); + RestoreOverrideCursor(cursorArrowCloseHand); } } VAbstractSpline::mouseReleaseEvent(event); @@ -425,7 +425,7 @@ void VToolSpline::hoverEnterEvent(QGraphicsSceneHoverEvent *event) { if (flags() & QGraphicsItem::ItemIsMovable) { - VApplication::setOverrideCursor(cursorArrowOpenHand, 1, 1); + SetOverrideCursor(cursorArrowOpenHand, 1, 1); } VAbstractSpline::hoverEnterEvent(event); @@ -437,7 +437,7 @@ void VToolSpline::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) if (flags() & QGraphicsItem::ItemIsMovable) { //Disable cursor-arrow-openhand - VApplication::restoreOverrideCursor(cursorArrowOpenHand); + RestoreOverrideCursor(cursorArrowOpenHand); } VAbstractSpline::hoverLeaveEvent(event); diff --git a/src/app/tools/drawTools/vtoolsplinepath.cpp b/src/app/tools/drawTools/vtoolsplinepath.cpp index 68b6eb81f..6d0498938 100644 --- a/src/app/tools/drawTools/vtoolsplinepath.cpp +++ b/src/app/tools/drawTools/vtoolsplinepath.cpp @@ -95,7 +95,7 @@ VToolSplinePath::VToolSplinePath(VPattern *doc, VContainer *data, quint32 id, co VToolSplinePath::~VToolSplinePath() { //Disable cursor-arrow-openhand - VApplication::restoreOverrideCursor(cursorArrowOpenHand); + RestoreOverrideCursor(cursorArrowOpenHand); } //--------------------------------------------------------------------------------------------------------------------- @@ -412,7 +412,7 @@ void VToolSplinePath::mousePressEvent(QGraphicsSceneMouseEvent *event) { if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) { - VApplication::setOverrideCursor(cursorArrowCloseHand, 1, 1); + SetOverrideCursor(cursorArrowCloseHand, 1, 1); oldPosition = event->scenePos(); event->accept(); } @@ -428,7 +428,7 @@ void VToolSplinePath::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) { //Disable cursor-arrow-closehand - VApplication::restoreOverrideCursor(cursorArrowCloseHand); + RestoreOverrideCursor(cursorArrowCloseHand); } } VAbstractSpline::mouseReleaseEvent(event); @@ -502,7 +502,7 @@ void VToolSplinePath::hoverEnterEvent(QGraphicsSceneHoverEvent *event) { if (flags() & QGraphicsItem::ItemIsMovable) { - VApplication::setOverrideCursor(cursorArrowOpenHand, 1, 1); + SetOverrideCursor(cursorArrowOpenHand, 1, 1); } VAbstractSpline::hoverEnterEvent(event); @@ -514,7 +514,7 @@ void VToolSplinePath::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) if (flags() & QGraphicsItem::ItemIsMovable) { //Disable cursor-arrow-openhand - VApplication::restoreOverrideCursor(cursorArrowOpenHand); + RestoreOverrideCursor(cursorArrowOpenHand); } VAbstractSpline::hoverLeaveEvent(event); diff --git a/src/app/visualization/vcontrolpointspline.cpp b/src/app/visualization/vcontrolpointspline.cpp index 469f9328d..49f504573 100644 --- a/src/app/visualization/vcontrolpointspline.cpp +++ b/src/app/visualization/vcontrolpointspline.cpp @@ -27,12 +27,10 @@ *************************************************************************/ #include "vcontrolpointspline.h" -#include "../tools/vabstracttool.h" #include #include #include -#include "../core/vapplication.h" //--------------------------------------------------------------------------------------------------------------------- /** @@ -54,7 +52,7 @@ VControlPointSpline::VControlPointSpline(const qint32 &indexSpline, SplinePointP QRectF rec = QRectF(0, 0, radius*2, radius*2); rec.translate(-rec.center().x(), -rec.center().y()); this->setRect(rec); - this->setPen(QPen(Qt::black, qApp->toPixel(WidthHairLine(patternUnit)))); + this->setPen(QPen(Qt::black, ToPixel(WidthHairLine(patternUnit), patternUnit))); this->setBrush(QBrush(Qt::NoBrush)); this->setFlag(QGraphicsItem::ItemIsSelectable, true); this->setFlag(QGraphicsItem::ItemIsMovable, true); @@ -66,7 +64,7 @@ VControlPointSpline::VControlPointSpline(const qint32 &indexSpline, SplinePointP QPointF p1, p2; VGObject::LineIntersectCircle(QPointF(), radius, QLineF( QPointF(), splinePoint-controlPoint), p1, p2); controlLine = new QGraphicsLineItem(QLineF(splinePoint-controlPoint, p1), this); - controlLine->setPen(QPen(Qt::red, qApp->toPixel(WidthHairLine(patternUnit)))); + controlLine->setPen(QPen(Qt::red, ToPixel(WidthHairLine(patternUnit), patternUnit))); controlLine->setFlag(QGraphicsItem::ItemStacksBehindParent, true); } @@ -74,7 +72,7 @@ VControlPointSpline::VControlPointSpline(const qint32 &indexSpline, SplinePointP VControlPointSpline::~VControlPointSpline() { //Disable cursor-arrow-openhand - VApplication::restoreOverrideCursor(cursorArrowOpenHand); + RestoreOverrideCursor(cursorArrowOpenHand); } //--------------------------------------------------------------------------------------------------------------------- @@ -97,17 +95,17 @@ void VControlPointSpline::paint(QPainter *painter, const QStyleOptionGraphicsIte */ void VControlPointSpline::hoverEnterEvent(QGraphicsSceneHoverEvent *event) { - this->setPen(QPen(Qt::black, qApp->toPixel(WidthMainLine(patternUnit)))); - VApplication::setOverrideCursor(cursorArrowOpenHand, 1, 1); + this->setPen(QPen(Qt::black, ToPixel(WidthMainLine(patternUnit), patternUnit))); + SetOverrideCursor(cursorArrowOpenHand, 1, 1); QGraphicsEllipseItem::hoverEnterEvent(event); } //--------------------------------------------------------------------------------------------------------------------- void VControlPointSpline::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { - this->setPen(QPen(Qt::black, qApp->toPixel(WidthHairLine(patternUnit)))); + this->setPen(QPen(Qt::black, ToPixel(WidthHairLine(patternUnit), patternUnit))); //Disable cursor-arrow-openhand - VApplication::restoreOverrideCursor(cursorArrowOpenHand); + RestoreOverrideCursor(cursorArrowOpenHand); QGraphicsEllipseItem::hoverLeaveEvent(event); } @@ -134,7 +132,7 @@ void VControlPointSpline::mousePressEvent(QGraphicsSceneMouseEvent *event) { if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) { - VApplication::setOverrideCursor(cursorArrowCloseHand, 1, 1); + SetOverrideCursor(cursorArrowCloseHand, 1, 1); } QGraphicsEllipseItem::mousePressEvent(event); } @@ -145,7 +143,7 @@ void VControlPointSpline::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) { //Disable cursor-arrow-closehand - VApplication::restoreOverrideCursor(cursorArrowCloseHand); + RestoreOverrideCursor(cursorArrowCloseHand); } QGraphicsEllipseItem::mouseReleaseEvent(event); } @@ -184,14 +182,14 @@ void VControlPointSpline::setEnabledPoint(bool enable) { if (enable == true) { - this->setPen(QPen(Qt::black, qApp->toPixel(WidthHairLine(patternUnit)))); + this->setPen(QPen(Qt::black, ToPixel(WidthHairLine(patternUnit), patternUnit))); this->setFlag(QGraphicsItem::ItemIsSelectable, true); this->setFlag(QGraphicsItem::ItemIsMovable, true); this->setAcceptHoverEvents(true); } else { - this->setPen(QPen(Qt::gray, qApp->toPixel(WidthHairLine(patternUnit)))); + this->setPen(QPen(Qt::gray, ToPixel(WidthHairLine(patternUnit), patternUnit))); this->setFlag(QGraphicsItem::ItemIsSelectable, false); this->setFlag(QGraphicsItem::ItemIsMovable, false); this->setAcceptHoverEvents(false); diff --git a/src/app/visualization/vcontrolpointspline.h b/src/app/visualization/vcontrolpointspline.h index f4416a6c2..9b3f8ac17 100644 --- a/src/app/visualization/vcontrolpointspline.h +++ b/src/app/visualization/vcontrolpointspline.h @@ -32,7 +32,7 @@ #include #include #include "../libs/vgeometry/vsplinepath.h" -#include "../options.h" +#include "../libs/vmisc/def.h" /** * @brief The VControlPointSpline class control spline point. diff --git a/src/app/visualization/vgraphicssimpletextitem.cpp b/src/app/visualization/vgraphicssimpletextitem.cpp index a34a0610a..f201d79d4 100644 --- a/src/app/visualization/vgraphicssimpletextitem.cpp +++ b/src/app/visualization/vgraphicssimpletextitem.cpp @@ -74,7 +74,7 @@ VGraphicsSimpleTextItem::VGraphicsSimpleTextItem( const QString & text, QGraphic VGraphicsSimpleTextItem::~VGraphicsSimpleTextItem() { //Disable cursor-arrow-openhand - VApplication::restoreOverrideCursor(cursorArrowOpenHand); + RestoreOverrideCursor(cursorArrowOpenHand); } //--------------------------------------------------------------------------------------------------------------------- @@ -133,7 +133,7 @@ void VGraphicsSimpleTextItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event) { this->setBrush(Qt::green); - VApplication::setOverrideCursor(cursorArrowOpenHand, 1, 1); + SetOverrideCursor(cursorArrowOpenHand, 1, 1); } QGraphicsSimpleTextItem::hoverEnterEvent(event); } @@ -151,7 +151,7 @@ void VGraphicsSimpleTextItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) this->setBrush(Qt::black); //Disable cursor-arrow-openhand - VApplication::restoreOverrideCursor(cursorArrowOpenHand); + RestoreOverrideCursor(cursorArrowOpenHand); } QGraphicsSimpleTextItem::hoverLeaveEvent(event); } @@ -173,7 +173,7 @@ void VGraphicsSimpleTextItem::mousePressEvent(QGraphicsSceneMouseEvent *event) { if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) { - VApplication::setOverrideCursor(cursorArrowCloseHand, 1, 1); + SetOverrideCursor(cursorArrowCloseHand, 1, 1); } } QGraphicsSimpleTextItem::mousePressEvent(event); @@ -187,7 +187,7 @@ void VGraphicsSimpleTextItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) { //Disable cursor-arrow-closehand - VApplication::restoreOverrideCursor(cursorArrowCloseHand); + RestoreOverrideCursor(cursorArrowCloseHand); } } else diff --git a/src/libs/vmisc/def.cpp b/src/libs/vmisc/def.cpp index ac7f45c7f..ed9826849 100644 --- a/src/libs/vmisc/def.cpp +++ b/src/libs/vmisc/def.cpp @@ -28,6 +28,8 @@ #include "def.h" +#include + // Keep synchronize all names with initialization in VApllication class!!!!! //measurements //head and neck @@ -216,3 +218,48 @@ const QStringList builInFunctions = QStringList() << sin_F << cos_F << tan_F const QString cm_Oprt = QStringLiteral("cm"); const QString mm_Oprt = QStringLiteral("mm"); const QString in_Oprt = QStringLiteral("in"); + +const QString cursorArrowOpenHand = QStringLiteral("://cursor/cursor-arrow-openhand.png"); +const QString cursorArrowCloseHand = QStringLiteral("://cursor/cursor-arrow-closehand.png"); + +//--------------------------------------------------------------------------------------------------------------------- +void SetOverrideCursor(const QString &pixmapPath, int hotX, int hotY) +{ +#ifndef QT_NO_CURSOR + QPixmap oldPixmap; + if (QCursor *oldCursor = QGuiApplication::overrideCursor()) + { + oldPixmap = oldCursor->pixmap(); + } + QPixmap newPixmap(pixmapPath); + + QImage oldImage = oldPixmap.toImage(); + QImage newImage = newPixmap.toImage(); + + if (oldImage != newImage ) + { + QApplication::setOverrideCursor(QCursor(newPixmap, hotX, hotY)); + } +#endif +} + +//--------------------------------------------------------------------------------------------------------------------- +void RestoreOverrideCursor(const QString &pixmapPath) +{ +#ifndef QT_NO_CURSOR + QPixmap oldPixmap; + if (QCursor *oldCursor = QGuiApplication::overrideCursor()) + { + oldPixmap = oldCursor->pixmap(); + } + QPixmap newPixmap(pixmapPath); + + QImage oldImage = oldPixmap.toImage(); + QImage newImage = newPixmap.toImage(); + + if (oldImage == newImage ) + { + QApplication::restoreOverrideCursor(); + } +#endif +} diff --git a/src/libs/vmisc/def.h b/src/libs/vmisc/def.h index 19d66def4..0bab8864f 100644 --- a/src/libs/vmisc/def.h +++ b/src/libs/vmisc/def.h @@ -368,4 +368,10 @@ extern const QString cm_Oprt; extern const QString mm_Oprt; extern const QString in_Oprt; +extern const QString cursorArrowOpenHand; +extern const QString cursorArrowCloseHand; + +void SetOverrideCursor(const QString & pixmapPath, int hotX = -1, int hotY = -1); +void RestoreOverrideCursor(const QString & pixmapPath); + #endif // DEF_H diff --git a/src/libs/vmisc/vmisc.pro b/src/libs/vmisc/vmisc.pro index b3f21da35..6a51731ce 100644 --- a/src/libs/vmisc/vmisc.pro +++ b/src/libs/vmisc/vmisc.pro @@ -7,6 +7,8 @@ # File with common stuff for whole project include(../../../Valentina.pri) +QT += widgets + # Name of library TARGET = vmisc From 2c49348495adc27940cb812c1f3ed4c7f25e0ba9 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 15 Jun 2015 16:49:34 +0300 Subject: [PATCH 12/22] Class VGraphicsSimpleTextItem more independent. --HG-- branch : feature --- src/app/visualization/vgraphicssimpletextitem.cpp | 2 -- src/app/visualization/vgraphicssimpletextitem.h | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/app/visualization/vgraphicssimpletextitem.cpp b/src/app/visualization/vgraphicssimpletextitem.cpp index f201d79d4..330281502 100644 --- a/src/app/visualization/vgraphicssimpletextitem.cpp +++ b/src/app/visualization/vgraphicssimpletextitem.cpp @@ -34,8 +34,6 @@ #include #include -#include "../core/vapplication.h" - //--------------------------------------------------------------------------------------------------------------------- /** * @brief VGraphicsSimpleTextItem default constructor. diff --git a/src/app/visualization/vgraphicssimpletextitem.h b/src/app/visualization/vgraphicssimpletextitem.h index 607413d08..65a268b70 100644 --- a/src/app/visualization/vgraphicssimpletextitem.h +++ b/src/app/visualization/vgraphicssimpletextitem.h @@ -31,7 +31,7 @@ #include #include -#include "../options.h" +#include "../libs/vmisc/def.h" /** * @brief The VGraphicsSimpleTextItem class pointer label. From f4aeff48cdc3e1cb9578b338696401ebcb1376d5 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 15 Jun 2015 16:59:19 +0300 Subject: [PATCH 13/22] Move classes VGraphicsSimpleTextItem and VControlPointSpline to library VWidgets. --HG-- branch : feature --- src/app/visualization/visualization.pri | 4 ---- .../vwidgets}/vcontrolpointspline.cpp | 0 .../visualization => libs/vwidgets}/vcontrolpointspline.h | 4 ++-- .../vwidgets}/vgraphicssimpletextitem.cpp | 1 + .../vwidgets}/vgraphicssimpletextitem.h | 2 +- src/libs/vwidgets/vwidgets.pri | 8 ++++++-- src/libs/vwidgets/vwidgets.pro | 2 ++ 7 files changed, 12 insertions(+), 9 deletions(-) rename src/{app/visualization => libs/vwidgets}/vcontrolpointspline.cpp (100%) rename src/{app/visualization => libs/vwidgets}/vcontrolpointspline.h (98%) rename src/{app/visualization => libs/vwidgets}/vgraphicssimpletextitem.cpp (99%) rename src/{app/visualization => libs/vwidgets}/vgraphicssimpletextitem.h (99%) diff --git a/src/app/visualization/visualization.pri b/src/app/visualization/visualization.pri index cca79ad52..fd25ef5d7 100644 --- a/src/app/visualization/visualization.pri +++ b/src/app/visualization/visualization.pri @@ -2,8 +2,6 @@ # This need for corect working file translations.pro HEADERS += \ - $$PWD/vgraphicssimpletextitem.h \ - $$PWD/vcontrolpointspline.h \ $$PWD/visline.h \ $$PWD/vistoolline.h \ $$PWD/vistoolendline.h \ @@ -33,8 +31,6 @@ HEADERS += \ $$PWD/vistoolarcwithlength.h SOURCES += \ - $$PWD/vgraphicssimpletextitem.cpp \ - $$PWD/vcontrolpointspline.cpp \ $$PWD/visline.cpp \ $$PWD/vistoolline.cpp \ $$PWD/vistoolendline.cpp \ diff --git a/src/app/visualization/vcontrolpointspline.cpp b/src/libs/vwidgets/vcontrolpointspline.cpp similarity index 100% rename from src/app/visualization/vcontrolpointspline.cpp rename to src/libs/vwidgets/vcontrolpointspline.cpp diff --git a/src/app/visualization/vcontrolpointspline.h b/src/libs/vwidgets/vcontrolpointspline.h similarity index 98% rename from src/app/visualization/vcontrolpointspline.h rename to src/libs/vwidgets/vcontrolpointspline.h index 9b3f8ac17..0b0a73134 100644 --- a/src/app/visualization/vcontrolpointspline.h +++ b/src/libs/vwidgets/vcontrolpointspline.h @@ -31,8 +31,8 @@ #include #include -#include "../libs/vgeometry/vsplinepath.h" -#include "../libs/vmisc/def.h" +#include "../vgeometry/vsplinepath.h" +#include "../vmisc/def.h" /** * @brief The VControlPointSpline class control spline point. diff --git a/src/app/visualization/vgraphicssimpletextitem.cpp b/src/libs/vwidgets/vgraphicssimpletextitem.cpp similarity index 99% rename from src/app/visualization/vgraphicssimpletextitem.cpp rename to src/libs/vwidgets/vgraphicssimpletextitem.cpp index 330281502..a87aa40cd 100644 --- a/src/app/visualization/vgraphicssimpletextitem.cpp +++ b/src/libs/vwidgets/vgraphicssimpletextitem.cpp @@ -33,6 +33,7 @@ #include #include #include +#include //--------------------------------------------------------------------------------------------------------------------- /** diff --git a/src/app/visualization/vgraphicssimpletextitem.h b/src/libs/vwidgets/vgraphicssimpletextitem.h similarity index 99% rename from src/app/visualization/vgraphicssimpletextitem.h rename to src/libs/vwidgets/vgraphicssimpletextitem.h index 65a268b70..7df21d074 100644 --- a/src/app/visualization/vgraphicssimpletextitem.h +++ b/src/libs/vwidgets/vgraphicssimpletextitem.h @@ -31,7 +31,7 @@ #include #include -#include "../libs/vmisc/def.h" +#include "../vmisc/def.h" /** * @brief The VGraphicsSimpleTextItem class pointer label. diff --git a/src/libs/vwidgets/vwidgets.pri b/src/libs/vwidgets/vwidgets.pri index 0ddb4e7cc..d750ea70f 100644 --- a/src/libs/vwidgets/vwidgets.pri +++ b/src/libs/vwidgets/vwidgets.pri @@ -8,7 +8,9 @@ SOURCES += \ $$PWD/vmaingraphicsscene.cpp \ $$PWD/vmaingraphicsview.cpp \ $$PWD/vsimplecurve.cpp \ - $$PWD/vwidgetpopup.cpp + $$PWD/vwidgetpopup.cpp \ + $$PWD/vcontrolpointspline.cpp \ + $$PWD/vgraphicssimpletextitem.cpp HEADERS += \ $$PWD/stable.h \ @@ -17,4 +19,6 @@ HEADERS += \ $$PWD/vmaingraphicsscene.h \ $$PWD/vmaingraphicsview.h \ $$PWD/vsimplecurve.h \ - $$PWD/vwidgetpopup.h + $$PWD/vwidgetpopup.h \ + $$PWD/vcontrolpointspline.h \ + $$PWD/vgraphicssimpletextitem.h diff --git a/src/libs/vwidgets/vwidgets.pro b/src/libs/vwidgets/vwidgets.pro index 28b9e641f..ad7a64b08 100644 --- a/src/libs/vwidgets/vwidgets.pro +++ b/src/libs/vwidgets/vwidgets.pro @@ -7,6 +7,8 @@ # File with common stuff for whole project include(../../../Valentina.pri) +QT += widgets + # Name of the library TARGET = vwidgets From 3bf2e056c0934049839aa46f35aaa467f1525a3b Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 15 Jun 2015 17:06:37 +0300 Subject: [PATCH 14/22] Precompiled headers for Valentina tests. --HG-- branch : feature --- src/test/ValentinaTest/ValentinaTest.pro | 12 +++- src/test/ValentinaTest/stable.cpp | 30 +++++++++ src/test/ValentinaTest/stable.h | 82 ++++++++++++++++++++++++ 3 files changed, 122 insertions(+), 2 deletions(-) create mode 100644 src/test/ValentinaTest/stable.cpp create mode 100644 src/test/ValentinaTest/stable.h diff --git a/src/test/ValentinaTest/ValentinaTest.pro b/src/test/ValentinaTest/ValentinaTest.pro index 7a560610c..a8d6a301b 100644 --- a/src/test/ValentinaTest/ValentinaTest.pro +++ b/src/test/ValentinaTest/ValentinaTest.pro @@ -41,7 +41,8 @@ SOURCES += \ abstracttest.cpp \ tst_nameregexp.cpp \ tst_vlayoutdetail.cpp \ - tst_varc.cpp + tst_varc.cpp \ + stable.cpp HEADERS += \ tst_vposter.h \ @@ -50,7 +51,14 @@ HEADERS += \ abstracttest.h \ tst_nameregexp.h \ tst_vlayoutdetail.h \ - tst_varc.h + tst_varc.h \ + stable.h + +# Set using ccache. Function enable_ccache() defined in Valentina.pri. +$$enable_ccache() + +# Set precompiled headers. Function set_PCH() defined in Valentina.pri. +$$set_PCH() CONFIG(debug, debug|release){ # Debug mode diff --git a/src/test/ValentinaTest/stable.cpp b/src/test/ValentinaTest/stable.cpp new file mode 100644 index 000000000..e291c2801 --- /dev/null +++ b/src/test/ValentinaTest/stable.cpp @@ -0,0 +1,30 @@ +/************************************************************************ + ** + ** @file stable.cpp + ** @author Roman Telezhynskyi + ** @date November 15, 2013 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2013-2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +// Build the precompiled headers. +#include "stable.h" diff --git a/src/test/ValentinaTest/stable.h b/src/test/ValentinaTest/stable.h new file mode 100644 index 000000000..d08eea301 --- /dev/null +++ b/src/test/ValentinaTest/stable.h @@ -0,0 +1,82 @@ +/************************************************************************ + ** + ** @file stable.h + ** @author Roman Telezhynskyi + ** @date November 15, 2013 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2013-2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef STABLE_H +#define STABLE_H + +/* I like to include this pragma too, so the build log indicates if pre-compiled headers were in use. */ +#ifndef __clang__ +#pragma message("Compiling precompiled headers for Valentina tests.\n") +#endif + +/* Add C includes here */ + +#if defined __cplusplus +/* Add C++ includes here */ +#include + +/*In all cases we need include core header for getting defined values*/ +#ifdef QT_CORE_LIB +# include +#endif + +#ifdef QT_GUI_LIB +# include +#endif + +#ifdef QT_XML_LIB +# include +#endif + +//In Windows you can't use same header in all modes. +#if !defined(Q_OS_WIN) +# ifdef QT_WIDGETS_LIB +# include +# endif + +# ifdef QT_SVG_LIB +# include +# endif + +# ifdef QT_PRINTSUPPORT_LIB +# include +# endif + + //Build doesn't work, if include this headers on Windows. +# ifdef QT_XMLPATTERNS_LIB +# include +# endif + +# ifdef QT_NETWORK_LIB +# include +# endif +#endif/*Q_OS_WIN*/ + +#endif /*__cplusplus*/ + +#endif // STABLE_H From f166f2521baafeb0c6267e308e02480fc6426415 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 16 Jun 2015 11:30:25 +0300 Subject: [PATCH 15/22] Refactoring UndoCommands. --HG-- branch : feature --- src/app/core/vtooloptionspropertybrowser.cpp | 4 +- src/app/tools/drawTools/vabstractspline.h | 2 +- src/app/tools/drawTools/vtoolpoint.cpp | 2 +- src/app/tools/drawTools/vtoolsinglepoint.cpp | 2 +- src/app/tools/drawTools/vtoolsplinepath.cpp | 4 +- src/app/tools/drawTools/vtoolsplinepath.h | 4 +- src/app/tools/nodeDetails/vnodepoint.cpp | 2 +- src/app/tools/vtooldetail.cpp | 2 +- src/app/tools/vtooldetail.h | 2 +- src/app/undocommands/adddet.cpp | 11 +- src/app/undocommands/adddet.h | 4 +- src/app/undocommands/adddetnode.cpp | 11 +- src/app/undocommands/adddetnode.h | 2 +- src/app/undocommands/addpatternpiece.cpp | 5 +- src/app/undocommands/addpatternpiece.h | 2 +- src/app/undocommands/addtocalc.cpp | 3 +- src/app/undocommands/addtocalc.h | 2 +- src/app/undocommands/adduniondetails.cpp | 11 +- src/app/undocommands/adduniondetails.h | 2 +- src/app/undocommands/deletedetail.cpp | 3 +- src/app/undocommands/deletedetail.h | 2 +- src/app/undocommands/deletepatternpiece.cpp | 5 +- src/app/undocommands/deletepatternpiece.h | 2 +- src/app/undocommands/deltool.cpp | 3 +- src/app/undocommands/deltool.h | 2 +- src/app/undocommands/movedetail.cpp | 5 +- src/app/undocommands/movedetail.h | 2 +- src/app/undocommands/movelabel.cpp | 3 +- src/app/undocommands/movelabel.h | 2 +- src/app/undocommands/movespline.cpp | 3 +- src/app/undocommands/movespline.h | 4 +- src/app/undocommands/movesplinepath.cpp | 2 +- src/app/undocommands/movesplinepath.h | 4 +- src/app/undocommands/movespoint.cpp | 5 +- src/app/undocommands/movespoint.h | 2 +- src/app/undocommands/renamepp.cpp | 3 +- src/app/undocommands/renamepp.h | 2 +- src/app/undocommands/savedetailoptions.cpp | 4 +- src/app/undocommands/savedetailoptions.h | 2 +- src/app/undocommands/savetooloptions.cpp | 5 +- src/app/undocommands/savetooloptions.h | 2 +- src/app/undocommands/vundocommand.cpp | 4 +- src/app/undocommands/vundocommand.h | 6 +- src/app/xml/vpattern.cpp | 548 +----------------- src/app/xml/vpattern.h | 196 +------ src/libs/ifc/xml/vabstractpattern.cpp | 560 +++++++++++++++++++ src/libs/ifc/xml/vabstractpattern.h | 221 ++++++++ src/libs/ifc/xml/xml.pri | 6 +- 48 files changed, 883 insertions(+), 802 deletions(-) create mode 100644 src/libs/ifc/xml/vabstractpattern.cpp create mode 100644 src/libs/ifc/xml/vabstractpattern.h diff --git a/src/app/core/vtooloptionspropertybrowser.cpp b/src/app/core/vtooloptionspropertybrowser.cpp index 0ef4f58e9..7e47f60cf 100644 --- a/src/app/core/vtooloptionspropertybrowser.cpp +++ b/src/app/core/vtooloptionspropertybrowser.cpp @@ -30,8 +30,8 @@ #include "../tools/drawTools/drawtools.h" #include "../core/vapplication.h" #include "vmaingraphicsview.h" -#include "../visualization/vgraphicssimpletextitem.h" -#include "../visualization/vcontrolpointspline.h" +#include "../../libs/vwidgets/vgraphicssimpletextitem.h" +#include "../../libs/vwidgets/vcontrolpointspline.h" #include "../../libs/vpropertyexplorer/vproperties.h" #include "vformulaproperty.h" #include "../core/vformula.h" diff --git a/src/app/tools/drawTools/vabstractspline.h b/src/app/tools/drawTools/vabstractspline.h index 6dfe08709..48f90295c 100644 --- a/src/app/tools/drawTools/vabstractspline.h +++ b/src/app/tools/drawTools/vabstractspline.h @@ -31,7 +31,7 @@ #include "vdrawtool.h" #include -#include "../../visualization/vcontrolpointspline.h" +#include "../libs/vwidgets/vcontrolpointspline.h" class VAbstractSpline:public VDrawTool, public QGraphicsPathItem { diff --git a/src/app/tools/drawTools/vtoolpoint.cpp b/src/app/tools/drawTools/vtoolpoint.cpp index 5e8c522c2..91d2ddf01 100644 --- a/src/app/tools/drawTools/vtoolpoint.cpp +++ b/src/app/tools/drawTools/vtoolpoint.cpp @@ -29,7 +29,7 @@ #include "vtoolpoint.h" #include "../vmisc/logging.h" #include "../../libs/vgeometry/vpointf.h" -#include "../../visualization/vgraphicssimpletextitem.h" +#include "../../libs/vwidgets/vgraphicssimpletextitem.h" #include "../../undocommands/movelabel.h" #include diff --git a/src/app/tools/drawTools/vtoolsinglepoint.cpp b/src/app/tools/drawTools/vtoolsinglepoint.cpp index c763fa9dd..f8b8c521c 100644 --- a/src/app/tools/drawTools/vtoolsinglepoint.cpp +++ b/src/app/tools/drawTools/vtoolsinglepoint.cpp @@ -28,7 +28,7 @@ #include "vtoolsinglepoint.h" #include "../../dialogs/tools/dialogsinglepoint.h" -#include "../../visualization/vgraphicssimpletextitem.h" +#include "../../libs/vwidgets/vgraphicssimpletextitem.h" #include "../../undocommands/movespoint.h" #include "../../undocommands/addpatternpiece.h" #include "../../undocommands/deletepatternpiece.h" diff --git a/src/app/tools/drawTools/vtoolsplinepath.cpp b/src/app/tools/drawTools/vtoolsplinepath.cpp index 6d0498938..0b176cfa1 100644 --- a/src/app/tools/drawTools/vtoolsplinepath.cpp +++ b/src/app/tools/drawTools/vtoolsplinepath.cpp @@ -271,7 +271,7 @@ void VToolSplinePath::RefreshSplinePath(VSplinePath &splPath) * @param node tag in file. * @param path spline path. */ -void VToolSplinePath::UpdatePathPoint(VPattern *doc, QDomNode& node, const VSplinePath &path) +void VToolSplinePath::UpdatePathPoint(VAbstractPattern *doc, QDomNode& node, const VSplinePath &path) { SCASSERT(doc != nullptr); QDomElement element = node.toElement(); @@ -344,7 +344,7 @@ void VToolSplinePath::RefreshDataInFile() * @param domElement dom element. * @param splPoint spline path point. */ -void VToolSplinePath::AddPathPoint(VPattern *doc, QDomElement &domElement, const VSplinePoint &splPoint) +void VToolSplinePath::AddPathPoint(VAbstractPattern *doc, QDomElement &domElement, const VSplinePoint &splPoint) { SCASSERT(doc != nullptr); QDomElement pathPoint = doc->createElement(AttrPathPoint); diff --git a/src/app/tools/drawTools/vtoolsplinepath.h b/src/app/tools/drawTools/vtoolsplinepath.h index 0cddec8f3..feb1bbf82 100644 --- a/src/app/tools/drawTools/vtoolsplinepath.h +++ b/src/app/tools/drawTools/vtoolsplinepath.h @@ -47,7 +47,7 @@ public: VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation); static const QString ToolType; - static void UpdatePathPoint(VPattern *doc, QDomNode& node, const VSplinePath &path); + static void UpdatePathPoint(VAbstractPattern *doc, QDomNode& node, const VSplinePath &path); virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::SplinePath)}; @@ -91,7 +91,7 @@ private: QPointF oldPosition; void RefreshGeometry(); - static void AddPathPoint(VPattern *doc, QDomElement &domElement, const VSplinePoint &splPoint); + static void AddPathPoint(VAbstractPattern *doc, QDomElement &domElement, const VSplinePoint &splPoint); void UpdateControlPoints(const VSpline &spl, VSplinePath &splPath, const qint32 &indexSpline) const; void RefreshSplinePath(VSplinePath &splPath); }; diff --git a/src/app/tools/nodeDetails/vnodepoint.cpp b/src/app/tools/nodeDetails/vnodepoint.cpp index 93a521acf..b019f370d 100644 --- a/src/app/tools/nodeDetails/vnodepoint.cpp +++ b/src/app/tools/nodeDetails/vnodepoint.cpp @@ -30,7 +30,7 @@ #include "../../core/vapplication.h" #include "../../libs/vgeometry/vpointf.h" -#include "../../visualization/vgraphicssimpletextitem.h" +#include "../../libs/vwidgets/vgraphicssimpletextitem.h" #include #include #include diff --git a/src/app/tools/vtooldetail.cpp b/src/app/tools/vtooldetail.cpp index 2412bac8c..6303b5284 100644 --- a/src/app/tools/vtooldetail.cpp +++ b/src/app/tools/vtooldetail.cpp @@ -442,7 +442,7 @@ void VToolDetail::RemoveReferens() * @param domElement tag in xml tree. * @param node node of detail. */ -void VToolDetail::AddNode(VPattern *doc, QDomElement &domElement, const VNodeDetail &node) +void VToolDetail::AddNode(VAbstractPattern *doc, QDomElement &domElement, const VNodeDetail &node) { QDomElement nod = doc->createElement(TagNode); diff --git a/src/app/tools/vtooldetail.h b/src/app/tools/vtooldetail.h index 17ee686f8..4105efd4f 100644 --- a/src/app/tools/vtooldetail.h +++ b/src/app/tools/vtooldetail.h @@ -82,7 +82,7 @@ public: static const QString NodeSpline; static const QString NodeSplinePath; void Remove(bool ask); - static void AddNode(VPattern *doc, QDomElement &domElement, const VNodeDetail &node); + static void AddNode(VAbstractPattern *doc, QDomElement &domElement, const VNodeDetail &node); virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::Detail)}; virtual QString getTagName() const; diff --git a/src/app/undocommands/adddet.cpp b/src/app/undocommands/adddet.cpp index d522598f8..197404b5a 100644 --- a/src/app/undocommands/adddet.cpp +++ b/src/app/undocommands/adddet.cpp @@ -27,10 +27,9 @@ *************************************************************************/ #include "adddet.h" -#include "../xml/vpattern.h" //--------------------------------------------------------------------------------------------------------------------- -AddDet::AddDet(const QDomElement &xml, VPattern *doc, QUndoCommand *parent) +AddDet::AddDet(const QDomElement &xml, VAbstractPattern *doc, QUndoCommand *parent) : VUndoCommand(xml, doc, parent) { setText(tr("Add detail")); @@ -48,7 +47,7 @@ void AddDet::undo() qCDebug(vUndo, "Undo."); QDomElement element; - if (doc->GetActivNodeElement(VPattern::TagDetails, element)) + if (doc->GetActivNodeElement(VAbstractPattern::TagDetails, element)) { QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) @@ -67,7 +66,7 @@ void AddDet::undo() } else { - qCDebug(vUndo, "Can't find tag %s.", VPattern::TagDetails.toUtf8().constData()); + qCDebug(vUndo, "Can't find tag %s.", VAbstractPattern::TagDetails.toUtf8().constData()); return; } emit NeedFullParsing(); @@ -80,13 +79,13 @@ void AddDet::redo() qCDebug(vUndo, "Redo."); QDomElement element; - if (doc->GetActivNodeElement(VPattern::TagDetails, element)) + if (doc->GetActivNodeElement(VAbstractPattern::TagDetails, element)) { element.appendChild(xml); } else { - qCDebug(vUndo, "Can't find tag %s.", VPattern::TagDetails.toUtf8().constData()); + qCDebug(vUndo, "Can't find tag %s.", VAbstractPattern::TagDetails.toUtf8().constData()); return; } RedoFullParsing(); diff --git a/src/app/undocommands/adddet.h b/src/app/undocommands/adddet.h index 230c216e7..53e05fb39 100644 --- a/src/app/undocommands/adddet.h +++ b/src/app/undocommands/adddet.h @@ -31,13 +31,11 @@ #include "vundocommand.h" -class VPattern; - class AddDet : public VUndoCommand { Q_OBJECT public: - AddDet(const QDomElement &xml, VPattern *doc, QUndoCommand *parent = 0); + AddDet(const QDomElement &xml, VAbstractPattern *doc, QUndoCommand *parent = 0); virtual ~AddDet(); // cppcheck-suppress unusedFunction virtual void undo(); diff --git a/src/app/undocommands/adddetnode.cpp b/src/app/undocommands/adddetnode.cpp index c46c0d86d..de1b5b64b 100644 --- a/src/app/undocommands/adddetnode.cpp +++ b/src/app/undocommands/adddetnode.cpp @@ -27,10 +27,9 @@ *************************************************************************/ #include "adddetnode.h" -#include "../xml/vpattern.h" //--------------------------------------------------------------------------------------------------------------------- -AddDetNode::AddDetNode(const QDomElement &xml, VPattern *doc, QUndoCommand *parent) +AddDetNode::AddDetNode(const QDomElement &xml, VAbstractPattern *doc, QUndoCommand *parent) : VUndoCommand(xml, doc, parent) { setText(QObject::tr("Add node")); @@ -47,7 +46,7 @@ void AddDetNode::undo() qCDebug(vUndo, "Undo."); QDomElement modelingElement; - if (doc->GetActivNodeElement(VPattern::TagModeling, modelingElement)) + if (doc->GetActivNodeElement(VAbstractPattern::TagModeling, modelingElement)) { QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) @@ -66,7 +65,7 @@ void AddDetNode::undo() } else { - qCDebug(vUndo, "Can't find tag %s.", VPattern::TagModeling.toUtf8().constData()); + qCDebug(vUndo, "Can't find tag %s.", VAbstractPattern::TagModeling.toUtf8().constData()); return; } } @@ -77,13 +76,13 @@ void AddDetNode::redo() qCDebug(vUndo, "Redo."); QDomElement modelingElement; - if (doc->GetActivNodeElement(VPattern::TagModeling, modelingElement)) + if (doc->GetActivNodeElement(VAbstractPattern::TagModeling, modelingElement)) { modelingElement.appendChild(xml); } else { - qCDebug(vUndo, "Can't find tag %s.", VPattern::TagModeling.toUtf8().constData()); + qCDebug(vUndo, "Can't find tag %s.", VAbstractPattern::TagModeling.toUtf8().constData()); return; } } diff --git a/src/app/undocommands/adddetnode.h b/src/app/undocommands/adddetnode.h index d58b255dc..8db44930d 100644 --- a/src/app/undocommands/adddetnode.h +++ b/src/app/undocommands/adddetnode.h @@ -35,7 +35,7 @@ class AddDetNode : public VUndoCommand { Q_OBJECT public: - AddDetNode(const QDomElement &xml, VPattern *doc, QUndoCommand *parent = 0); + AddDetNode(const QDomElement &xml, VAbstractPattern *doc, QUndoCommand *parent = 0); virtual ~AddDetNode(); virtual void undo(); virtual void redo(); diff --git a/src/app/undocommands/addpatternpiece.cpp b/src/app/undocommands/addpatternpiece.cpp index 04c88df46..253f89e77 100644 --- a/src/app/undocommands/addpatternpiece.cpp +++ b/src/app/undocommands/addpatternpiece.cpp @@ -27,11 +27,10 @@ *************************************************************************/ #include "addpatternpiece.h" -#include "../xml/vpattern.h" //--------------------------------------------------------------------------------------------------------------------- -AddPatternPiece::AddPatternPiece(const QDomElement &xml, VPattern *doc, const QString &namePP, const QString &mPath, - QUndoCommand *parent) +AddPatternPiece::AddPatternPiece(const QDomElement &xml, VAbstractPattern *doc, const QString &namePP, + const QString &mPath, QUndoCommand *parent) : VUndoCommand(xml, doc, parent), namePP(namePP), mPath(mPath) { SCASSERT(namePP.isEmpty() == false); diff --git a/src/app/undocommands/addpatternpiece.h b/src/app/undocommands/addpatternpiece.h index 52416ac01..2e900267a 100644 --- a/src/app/undocommands/addpatternpiece.h +++ b/src/app/undocommands/addpatternpiece.h @@ -35,7 +35,7 @@ class AddPatternPiece : public VUndoCommand { Q_OBJECT public: - AddPatternPiece(const QDomElement &xml, VPattern *doc, const QString &namePP, const QString &mPath, + AddPatternPiece(const QDomElement &xml, VAbstractPattern *doc, const QString &namePP, const QString &mPath, QUndoCommand *parent = 0); virtual ~AddPatternPiece(); virtual void undo(); diff --git a/src/app/undocommands/addtocalc.cpp b/src/app/undocommands/addtocalc.cpp index bab94b40a..0ef79f65b 100644 --- a/src/app/undocommands/addtocalc.cpp +++ b/src/app/undocommands/addtocalc.cpp @@ -27,14 +27,13 @@ *************************************************************************/ #include "addtocalc.h" -#include "../xml/vpattern.h" #include "../tools/vabstracttool.h" #include "../core/vapplication.h" #include "../libs/vwidgets/vmaingraphicsscene.h" #include "../libs/vwidgets/vmaingraphicsview.h" //--------------------------------------------------------------------------------------------------------------------- -AddToCalc::AddToCalc(const QDomElement &xml, VPattern *doc, QUndoCommand *parent) +AddToCalc::AddToCalc(const QDomElement &xml, VAbstractPattern *doc, QUndoCommand *parent) : VUndoCommand(xml, doc, parent), nameActivDraw(doc->GetNameActivPP()), cursor(doc->getCursor()) { setText(tr("Add object")); diff --git a/src/app/undocommands/addtocalc.h b/src/app/undocommands/addtocalc.h index 261be91df..388caf91e 100644 --- a/src/app/undocommands/addtocalc.h +++ b/src/app/undocommands/addtocalc.h @@ -35,7 +35,7 @@ class AddToCalc : public VUndoCommand { Q_OBJECT public: - AddToCalc(const QDomElement &xml, VPattern *doc, QUndoCommand *parent = 0); + AddToCalc(const QDomElement &xml, VAbstractPattern *doc, QUndoCommand *parent = 0); virtual ~AddToCalc(); virtual void undo(); virtual void redo(); diff --git a/src/app/undocommands/adduniondetails.cpp b/src/app/undocommands/adduniondetails.cpp index f04f1cce8..a10c47340 100644 --- a/src/app/undocommands/adduniondetails.cpp +++ b/src/app/undocommands/adduniondetails.cpp @@ -27,10 +27,9 @@ *************************************************************************/ #include "adduniondetails.h" -#include "../xml/vpattern.h" //--------------------------------------------------------------------------------------------------------------------- -AddUnionDetails::AddUnionDetails(const QDomElement &xml, VPattern *doc, QUndoCommand *parent) +AddUnionDetails::AddUnionDetails(const QDomElement &xml, VAbstractPattern *doc, QUndoCommand *parent) : VUndoCommand(xml, doc, parent) { setText(tr("Add union details")); @@ -47,7 +46,7 @@ void AddUnionDetails::undo() qCDebug(vUndo, "Undo."); QDomElement modelingElement; - if (doc->GetActivNodeElement(VPattern::TagModeling, modelingElement)) + if (doc->GetActivNodeElement(VAbstractPattern::TagModeling, modelingElement)) { QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) @@ -66,7 +65,7 @@ void AddUnionDetails::undo() } else { - qCDebug(vUndo, "Can't find tag %s.", VPattern::TagModeling.toUtf8().constData()); + qCDebug(vUndo, "Can't find tag %s.", VAbstractPattern::TagModeling.toUtf8().constData()); return; } emit NeedFullParsing(); @@ -78,13 +77,13 @@ void AddUnionDetails::redo() qCDebug(vUndo, "Redo."); QDomElement modelingElement; - if (doc->GetActivNodeElement(VPattern::TagModeling, modelingElement)) + if (doc->GetActivNodeElement(VAbstractPattern::TagModeling, modelingElement)) { modelingElement.appendChild(xml); } else { - qCDebug(vUndo, "Can't find tag %s.", VPattern::TagModeling.toUtf8().constData()); + qCDebug(vUndo, "Can't find tag %s.", VAbstractPattern::TagModeling.toUtf8().constData()); return; } RedoFullParsing(); diff --git a/src/app/undocommands/adduniondetails.h b/src/app/undocommands/adduniondetails.h index 29ab151d4..e14e8a5f9 100644 --- a/src/app/undocommands/adduniondetails.h +++ b/src/app/undocommands/adduniondetails.h @@ -35,7 +35,7 @@ class AddUnionDetails : public VUndoCommand { Q_OBJECT public: - AddUnionDetails(const QDomElement &xml, VPattern *doc, QUndoCommand *parent = 0); + AddUnionDetails(const QDomElement &xml, VAbstractPattern *doc, QUndoCommand *parent = 0); virtual ~AddUnionDetails(); virtual void undo(); virtual void redo(); diff --git a/src/app/undocommands/deletedetail.cpp b/src/app/undocommands/deletedetail.cpp index eeff845de..3cfc70ff0 100644 --- a/src/app/undocommands/deletedetail.cpp +++ b/src/app/undocommands/deletedetail.cpp @@ -27,11 +27,10 @@ *************************************************************************/ #include "deletedetail.h" -#include "../xml/vpattern.h" #include "../tools/vtooldetail.h" //--------------------------------------------------------------------------------------------------------------------- -DeleteDetail::DeleteDetail(VPattern *doc, quint32 id, QUndoCommand *parent) +DeleteDetail::DeleteDetail(VAbstractPattern *doc, quint32 id, QUndoCommand *parent) : VUndoCommand(QDomElement(), doc, parent), parentNode(QDomNode()), siblingId(NULL_ID) { setText(tr("Delete tool")); diff --git a/src/app/undocommands/deletedetail.h b/src/app/undocommands/deletedetail.h index 8923d5244..46a991f35 100644 --- a/src/app/undocommands/deletedetail.h +++ b/src/app/undocommands/deletedetail.h @@ -36,7 +36,7 @@ class DeleteDetail : public VUndoCommand { Q_OBJECT public: - DeleteDetail(VPattern *doc, quint32 id, QUndoCommand *parent = 0); + DeleteDetail(VAbstractPattern *doc, quint32 id, QUndoCommand *parent = 0); virtual ~DeleteDetail(); virtual void undo(); virtual void redo(); diff --git a/src/app/undocommands/deletepatternpiece.cpp b/src/app/undocommands/deletepatternpiece.cpp index eb14c56b1..d8649f13c 100644 --- a/src/app/undocommands/deletepatternpiece.cpp +++ b/src/app/undocommands/deletepatternpiece.cpp @@ -27,11 +27,10 @@ *************************************************************************/ #include "deletepatternpiece.h" -#include "../xml/vpattern.h" #include "addpatternpiece.h" //--------------------------------------------------------------------------------------------------------------------- -DeletePatternPiece::DeletePatternPiece(VPattern *doc, const QString &namePP, QUndoCommand *parent) +DeletePatternPiece::DeletePatternPiece(VAbstractPattern *doc, const QString &namePP, QUndoCommand *parent) : VUndoCommand(QDomElement(), doc, parent), namePP(namePP), patternPiece(QDomElement()), mPath(QString()), previousPPName(QString()) { @@ -41,7 +40,7 @@ DeletePatternPiece::DeletePatternPiece(VPattern *doc, const QString &namePP, QUn patternPiece = patternP.cloneNode().toElement(); mPath = doc->MPath(); QDomNode previousPP = patternP.previousSibling();//find previous pattern piece - previousPPName = doc->GetParametrString(previousPP.toElement(), VPattern::AttrName, ""); + previousPPName = doc->GetParametrString(previousPP.toElement(), VAbstractPattern::AttrName, ""); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/undocommands/deletepatternpiece.h b/src/app/undocommands/deletepatternpiece.h index 1d29fab5d..64ff5027c 100644 --- a/src/app/undocommands/deletepatternpiece.h +++ b/src/app/undocommands/deletepatternpiece.h @@ -35,7 +35,7 @@ class DeletePatternPiece : public VUndoCommand { Q_OBJECT public: - DeletePatternPiece(VPattern *doc, const QString &namePP, QUndoCommand *parent = 0); + DeletePatternPiece(VAbstractPattern *doc, const QString &namePP, QUndoCommand *parent = 0); virtual ~DeletePatternPiece(); virtual void undo(); virtual void redo(); diff --git a/src/app/undocommands/deltool.cpp b/src/app/undocommands/deltool.cpp index 3d9455b9b..8114c434e 100644 --- a/src/app/undocommands/deltool.cpp +++ b/src/app/undocommands/deltool.cpp @@ -27,12 +27,11 @@ *************************************************************************/ #include "deltool.h" -#include "../xml/vpattern.h" #include #include "../tools/vtooldetail.h" //--------------------------------------------------------------------------------------------------------------------- -DelTool::DelTool(VPattern *doc, quint32 id, QUndoCommand *parent) +DelTool::DelTool(VAbstractPattern *doc, quint32 id, QUndoCommand *parent) : VUndoCommand(QDomElement(), doc, parent), parentNode(QDomNode()), siblingId(NULL_ID), nameActivDraw(doc->GetNameActivPP()) { diff --git a/src/app/undocommands/deltool.h b/src/app/undocommands/deltool.h index f92f9463f..dce673687 100644 --- a/src/app/undocommands/deltool.h +++ b/src/app/undocommands/deltool.h @@ -36,7 +36,7 @@ class DelTool : public VUndoCommand { Q_OBJECT public: - DelTool(VPattern *doc, quint32 id, QUndoCommand *parent = 0); + DelTool(VAbstractPattern *doc, quint32 id, QUndoCommand *parent = 0); virtual ~DelTool(); virtual void undo(); virtual void redo(); diff --git a/src/app/undocommands/movedetail.cpp b/src/app/undocommands/movedetail.cpp index a05dc8817..6fb508f91 100644 --- a/src/app/undocommands/movedetail.cpp +++ b/src/app/undocommands/movedetail.cpp @@ -29,13 +29,12 @@ #include "movedetail.h" #include #include -#include "../xml/vpattern.h" #include "../tools/vabstracttool.h" #include "../core/vapplication.h" //--------------------------------------------------------------------------------------------------------------------- -MoveDetail::MoveDetail(VPattern *doc, const double &x, const double &y, const quint32 &id, QGraphicsScene *scene, - QUndoCommand *parent) +MoveDetail::MoveDetail(VAbstractPattern *doc, const double &x, const double &y, const quint32 &id, + QGraphicsScene *scene, QUndoCommand *parent) : VUndoCommand(QDomElement(), doc, parent), oldX(0.0), oldY(0.0), newX(x), newY(y), scene(scene) { setText(QObject::tr("Move detail")); diff --git a/src/app/undocommands/movedetail.h b/src/app/undocommands/movedetail.h index 2c42a396a..3886d6252 100644 --- a/src/app/undocommands/movedetail.h +++ b/src/app/undocommands/movedetail.h @@ -37,7 +37,7 @@ class MoveDetail : public VUndoCommand { Q_OBJECT public: - MoveDetail(VPattern *doc, const double &x, const double &y, const quint32 &id, QGraphicsScene *scene, + MoveDetail(VAbstractPattern *doc, const double &x, const double &y, const quint32 &id, QGraphicsScene *scene, QUndoCommand *parent = 0); virtual ~MoveDetail(); virtual void undo(); diff --git a/src/app/undocommands/movelabel.cpp b/src/app/undocommands/movelabel.cpp index 4443975a2..edb284a22 100644 --- a/src/app/undocommands/movelabel.cpp +++ b/src/app/undocommands/movelabel.cpp @@ -29,12 +29,11 @@ #include "movelabel.h" #include #include -#include "../xml/vpattern.h" #include "../tools/vabstracttool.h" #include "../core/vapplication.h" //--------------------------------------------------------------------------------------------------------------------- -MoveLabel::MoveLabel(VPattern *doc, const double &x, const double &y, const quint32 &id, QGraphicsScene *scene, +MoveLabel::MoveLabel(VAbstractPattern *doc, const double &x, const double &y, const quint32 &id, QGraphicsScene *scene, QUndoCommand *parent) : VUndoCommand(QDomElement(), doc, parent), oldMx(0.0), oldMy(0.0), newMx(x), newMy(y), scene(scene) { diff --git a/src/app/undocommands/movelabel.h b/src/app/undocommands/movelabel.h index f3d277560..fcbfc6d2f 100644 --- a/src/app/undocommands/movelabel.h +++ b/src/app/undocommands/movelabel.h @@ -37,7 +37,7 @@ class MoveLabel : public VUndoCommand { Q_OBJECT public: - MoveLabel(VPattern *doc, const double &x, const double &y, const quint32 &id, QGraphicsScene *scene, + MoveLabel(VAbstractPattern *doc, const double &x, const double &y, const quint32 &id, QGraphicsScene *scene, QUndoCommand *parent = 0); virtual ~MoveLabel(); virtual void undo(); diff --git a/src/app/undocommands/movespline.cpp b/src/app/undocommands/movespline.cpp index ca50e7226..a09f0ed55 100644 --- a/src/app/undocommands/movespline.cpp +++ b/src/app/undocommands/movespline.cpp @@ -30,10 +30,9 @@ #include "../tools/vabstracttool.h" #include #include -#include "../xml/vpattern.h" //--------------------------------------------------------------------------------------------------------------------- -MoveSpline::MoveSpline(VPattern *doc, const VSpline *oldSpl, const VSpline &newSpl, const quint32 &id, +MoveSpline::MoveSpline(VAbstractPattern *doc, const VSpline *oldSpl, const VSpline &newSpl, const quint32 &id, QGraphicsScene *scene, QUndoCommand *parent) : VUndoCommand(QDomElement(), doc, parent), oldSpline(*oldSpl), newSpline(newSpl), scene(scene) { diff --git a/src/app/undocommands/movespline.h b/src/app/undocommands/movespline.h index b9f369be4..afdbd6a00 100644 --- a/src/app/undocommands/movespline.h +++ b/src/app/undocommands/movespline.h @@ -38,8 +38,8 @@ class MoveSpline : public VUndoCommand { Q_OBJECT public: - MoveSpline(VPattern *doc, const VSpline *oldSpl, const VSpline &spl, const quint32 &id, QGraphicsScene *scene, - QUndoCommand *parent = 0); + MoveSpline(VAbstractPattern *doc, const VSpline *oldSpl, const VSpline &spl, const quint32 &id, + QGraphicsScene *scene, QUndoCommand *parent = 0); virtual ~MoveSpline(); virtual void undo(); virtual void redo(); diff --git a/src/app/undocommands/movesplinepath.cpp b/src/app/undocommands/movesplinepath.cpp index 2520c3530..dff694b2f 100644 --- a/src/app/undocommands/movesplinepath.cpp +++ b/src/app/undocommands/movesplinepath.cpp @@ -31,7 +31,7 @@ #include "../tools/drawTools/vtoolsplinepath.h" //--------------------------------------------------------------------------------------------------------------------- -MoveSplinePath::MoveSplinePath(VPattern *doc, const VSplinePath &oldSplPath, const VSplinePath &newSplPath, +MoveSplinePath::MoveSplinePath(VAbstractPattern *doc, const VSplinePath &oldSplPath, const VSplinePath &newSplPath, const quint32 &id, QGraphicsScene *scene, QUndoCommand *parent) : VUndoCommand(QDomElement(), doc, parent), oldSplinePath(oldSplPath), newSplinePath(newSplPath), scene(scene) { diff --git a/src/app/undocommands/movesplinepath.h b/src/app/undocommands/movesplinepath.h index 3f05c84e7..60571fc3d 100644 --- a/src/app/undocommands/movesplinepath.h +++ b/src/app/undocommands/movesplinepath.h @@ -38,8 +38,8 @@ class MoveSplinePath : public VUndoCommand { Q_OBJECT public: - MoveSplinePath(VPattern *doc, const VSplinePath &oldSplPath, const VSplinePath &newSplPath, const quint32 &id, - QGraphicsScene *scene, QUndoCommand *parent = 0); + MoveSplinePath(VAbstractPattern *doc, const VSplinePath &oldSplPath, const VSplinePath &newSplPath, + const quint32 &id, QGraphicsScene *scene, QUndoCommand *parent = 0); virtual ~MoveSplinePath(); virtual void undo(); virtual void redo(); diff --git a/src/app/undocommands/movespoint.cpp b/src/app/undocommands/movespoint.cpp index 9a21d871f..53fbc93c6 100644 --- a/src/app/undocommands/movespoint.cpp +++ b/src/app/undocommands/movespoint.cpp @@ -29,13 +29,12 @@ #include "movespoint.h" #include #include -#include "../xml/vpattern.h" #include "../tools/vabstracttool.h" #include "../core/vapplication.h" //--------------------------------------------------------------------------------------------------------------------- -MoveSPoint::MoveSPoint(VPattern *doc, const double &x, const double &y, const quint32 &id, QGraphicsScene *scene, - QUndoCommand *parent) +MoveSPoint::MoveSPoint(VAbstractPattern *doc, const double &x, const double &y, const quint32 &id, + QGraphicsScene *scene, QUndoCommand *parent) : VUndoCommand(QDomElement(), doc, parent), oldX(0.0), oldY(0.0), newX(x), newY(y), scene(scene) { setText(tr("Move single point")); diff --git a/src/app/undocommands/movespoint.h b/src/app/undocommands/movespoint.h index 49e1d4ad2..62dd6d0b8 100644 --- a/src/app/undocommands/movespoint.h +++ b/src/app/undocommands/movespoint.h @@ -37,7 +37,7 @@ class MoveSPoint : public VUndoCommand { Q_OBJECT public: - MoveSPoint(VPattern *doc, const double &x, const double &y, const quint32 &id, QGraphicsScene *scene, + MoveSPoint(VAbstractPattern *doc, const double &x, const double &y, const quint32 &id, QGraphicsScene *scene, QUndoCommand *parent = 0); virtual ~MoveSPoint(); virtual void undo(); diff --git a/src/app/undocommands/renamepp.cpp b/src/app/undocommands/renamepp.cpp index f80c39d0e..3aee58ca4 100644 --- a/src/app/undocommands/renamepp.cpp +++ b/src/app/undocommands/renamepp.cpp @@ -30,10 +30,9 @@ #include #include "../options.h" -#include "../xml/vpattern.h" //--------------------------------------------------------------------------------------------------------------------- -RenamePP::RenamePP(VPattern *doc, const QString &newPPname, QComboBox *combo, QUndoCommand *parent) +RenamePP::RenamePP(VAbstractPattern *doc, const QString &newPPname, QComboBox *combo, QUndoCommand *parent) :VUndoCommand(QDomElement(), doc, parent), combo(combo), newPPname(newPPname), oldPPname(QString()) { setText(tr("Rename pattern piece")); diff --git a/src/app/undocommands/renamepp.h b/src/app/undocommands/renamepp.h index 84e790ac3..c52c7a01c 100644 --- a/src/app/undocommands/renamepp.h +++ b/src/app/undocommands/renamepp.h @@ -36,7 +36,7 @@ class RenamePP :public VUndoCommand { Q_OBJECT public: - RenamePP(VPattern *doc, const QString &newPPname, QComboBox *combo, QUndoCommand *parent = 0); + RenamePP(VAbstractPattern *doc, const QString &newPPname, QComboBox *combo, QUndoCommand *parent = 0); virtual ~RenamePP(); virtual void undo(); diff --git a/src/app/undocommands/savedetailoptions.cpp b/src/app/undocommands/savedetailoptions.cpp index 179bdc9f2..2a9c7cf67 100644 --- a/src/app/undocommands/savedetailoptions.cpp +++ b/src/app/undocommands/savedetailoptions.cpp @@ -31,8 +31,8 @@ #include //--------------------------------------------------------------------------------------------------------------------- -SaveDetailOptions::SaveDetailOptions(const VDetail &oldDet, const VDetail &newDet, VPattern *doc, const quint32 &id, - QGraphicsScene *scene, QUndoCommand *parent) +SaveDetailOptions::SaveDetailOptions(const VDetail &oldDet, const VDetail &newDet, VAbstractPattern *doc, + const quint32 &id, QGraphicsScene *scene, QUndoCommand *parent) : VUndoCommand(QDomElement(), doc, parent), oldDet(oldDet), newDet(newDet), scene(scene) { setText(tr("Save detail option")); diff --git a/src/app/undocommands/savedetailoptions.h b/src/app/undocommands/savedetailoptions.h index 9fb4394e8..a32b4fd91 100644 --- a/src/app/undocommands/savedetailoptions.h +++ b/src/app/undocommands/savedetailoptions.h @@ -38,7 +38,7 @@ class SaveDetailOptions : public VUndoCommand { Q_OBJECT public: - SaveDetailOptions(const VDetail &oldDet, const VDetail &newDet, VPattern *doc, const quint32 &id, + SaveDetailOptions(const VDetail &oldDet, const VDetail &newDet, VAbstractPattern *doc, const quint32 &id, QGraphicsScene *scene, QUndoCommand *parent = 0); virtual ~SaveDetailOptions(); virtual void undo(); diff --git a/src/app/undocommands/savetooloptions.cpp b/src/app/undocommands/savetooloptions.cpp index 9db984d78..99299c95d 100644 --- a/src/app/undocommands/savetooloptions.cpp +++ b/src/app/undocommands/savetooloptions.cpp @@ -28,11 +28,10 @@ #include "savetooloptions.h" #include "../options.h" -#include "../xml/vpattern.h" //--------------------------------------------------------------------------------------------------------------------- -SaveToolOptions::SaveToolOptions(const QDomElement &oldXml, const QDomElement &newXml, VPattern *doc, const quint32 &id, - QUndoCommand *parent) +SaveToolOptions::SaveToolOptions(const QDomElement &oldXml, const QDomElement &newXml, VAbstractPattern *doc, + const quint32 &id, QUndoCommand *parent) : VUndoCommand(QDomElement(), doc, parent), oldXml(oldXml), newXml(newXml) { setText(tr("Save tool option")); diff --git a/src/app/undocommands/savetooloptions.h b/src/app/undocommands/savetooloptions.h index 21cd29d9e..2051b7e53 100644 --- a/src/app/undocommands/savetooloptions.h +++ b/src/app/undocommands/savetooloptions.h @@ -35,7 +35,7 @@ class SaveToolOptions : public VUndoCommand { Q_OBJECT public: - SaveToolOptions(const QDomElement &oldXml, const QDomElement &newXml, VPattern *doc, const quint32 &id, + SaveToolOptions(const QDomElement &oldXml, const QDomElement &newXml, VAbstractPattern *doc, const quint32 &id, QUndoCommand *parent = 0); virtual ~SaveToolOptions(); virtual void undo(); diff --git a/src/app/undocommands/vundocommand.cpp b/src/app/undocommands/vundocommand.cpp index 873f66081..8ec73d30b 100644 --- a/src/app/undocommands/vundocommand.cpp +++ b/src/app/undocommands/vundocommand.cpp @@ -27,12 +27,12 @@ *************************************************************************/ #include "vundocommand.h" -#include "../xml/vpattern.h" +#include "../../libs/vmisc/def.h" Q_LOGGING_CATEGORY(vUndo, "v.undo") //--------------------------------------------------------------------------------------------------------------------- -VUndoCommand::VUndoCommand(const QDomElement &xml, VPattern *doc, QUndoCommand *parent) +VUndoCommand::VUndoCommand(const QDomElement &xml, VAbstractPattern *doc, QUndoCommand *parent) :QObject(), QUndoCommand(parent), xml(xml), doc(doc), nodeId(NULL_ID), redoFlag(false) { SCASSERT(doc != nullptr); diff --git a/src/app/undocommands/vundocommand.h b/src/app/undocommands/vundocommand.h index dc86281f8..608f91dfe 100644 --- a/src/app/undocommands/vundocommand.h +++ b/src/app/undocommands/vundocommand.h @@ -33,7 +33,7 @@ #include #include "../vmisc/logging.h" -#include "../xml/vpattern.h" +#include "../libs/ifc/xml/vabstractpattern.h" Q_DECLARE_LOGGING_CATEGORY(vUndo) @@ -57,7 +57,7 @@ class VUndoCommand : public QObject, public QUndoCommand { Q_OBJECT public: - VUndoCommand(const QDomElement &xml, VPattern *doc, QUndoCommand *parent = 0); + VUndoCommand(const QDomElement &xml, VAbstractPattern *doc, QUndoCommand *parent = 0); virtual ~VUndoCommand(); signals: void ClearScene(); @@ -65,7 +65,7 @@ signals: void NeedLiteParsing(const Document &parse); protected: QDomElement xml; - VPattern *doc; + VAbstractPattern *doc; quint32 nodeId; bool redoFlag; virtual void RedoFullParsing(); diff --git a/src/app/xml/vpattern.cpp b/src/app/xml/vpattern.cpp index 1ec85ab58..c518d4fe3 100644 --- a/src/app/xml/vpattern.cpp +++ b/src/app/xml/vpattern.cpp @@ -49,81 +49,10 @@ #include #include -const QString VPattern::TagPattern = QStringLiteral("pattern"); -const QString VPattern::TagCalculation = QStringLiteral("calculation"); -const QString VPattern::TagModeling = QStringLiteral("modeling"); -const QString VPattern::TagDetails = QStringLiteral("details"); -const QString VPattern::TagAuthor = QStringLiteral("author"); -const QString VPattern::TagDescription = QStringLiteral("description"); -const QString VPattern::TagNotes = QStringLiteral("notes"); -const QString VPattern::TagMeasurements = QStringLiteral("measurements"); -const QString VPattern::TagIncrements = QStringLiteral("increments"); -const QString VPattern::TagIncrement = QStringLiteral("increment"); -const QString VPattern::TagDraw = QStringLiteral("draw"); -const QString VPattern::TagPoint = QStringLiteral("point"); -const QString VPattern::TagLine = QStringLiteral("line"); -const QString VPattern::TagSpline = QStringLiteral("spline"); -const QString VPattern::TagArc = QStringLiteral("arc"); -const QString VPattern::TagTools = QStringLiteral("tools"); -const QString VPattern::TagGradation = QStringLiteral("gradation"); -const QString VPattern::TagHeights = QStringLiteral("heights"); -const QString VPattern::TagSizes = QStringLiteral("sizes"); - -const QString VPattern::AttrName = QStringLiteral("name"); -const QString VPattern::AttrType = QStringLiteral("type"); -const QString VPattern::AttrPath = QStringLiteral("path"); - -const QString VPattern::AttrAll = QStringLiteral("all"); - -const QString VPattern::AttrH92 = QStringLiteral("h92"); -const QString VPattern::AttrH98 = QStringLiteral("h98"); -const QString VPattern::AttrH104 = QStringLiteral("h104"); -const QString VPattern::AttrH110 = QStringLiteral("h110"); -const QString VPattern::AttrH116 = QStringLiteral("h116"); -const QString VPattern::AttrH122 = QStringLiteral("h122"); -const QString VPattern::AttrH128 = QStringLiteral("h128"); -const QString VPattern::AttrH134 = QStringLiteral("h134"); -const QString VPattern::AttrH140 = QStringLiteral("h140"); -const QString VPattern::AttrH146 = QStringLiteral("h146"); -const QString VPattern::AttrH152 = QStringLiteral("h152"); -const QString VPattern::AttrH158 = QStringLiteral("h158"); -const QString VPattern::AttrH164 = QStringLiteral("h164"); -const QString VPattern::AttrH170 = QStringLiteral("h170"); -const QString VPattern::AttrH176 = QStringLiteral("h176"); -const QString VPattern::AttrH182 = QStringLiteral("h182"); -const QString VPattern::AttrH188 = QStringLiteral("h188"); -const QString VPattern::AttrH194 = QStringLiteral("h194"); - -const QString VPattern::AttrS22 = QStringLiteral("s22"); -const QString VPattern::AttrS24 = QStringLiteral("s24"); -const QString VPattern::AttrS26 = QStringLiteral("s26"); -const QString VPattern::AttrS28 = QStringLiteral("s28"); -const QString VPattern::AttrS30 = QStringLiteral("s30"); -const QString VPattern::AttrS32 = QStringLiteral("s32"); -const QString VPattern::AttrS34 = QStringLiteral("s34"); -const QString VPattern::AttrS36 = QStringLiteral("s36"); -const QString VPattern::AttrS38 = QStringLiteral("s38"); -const QString VPattern::AttrS40 = QStringLiteral("s40"); -const QString VPattern::AttrS42 = QStringLiteral("s42"); -const QString VPattern::AttrS44 = QStringLiteral("s44"); -const QString VPattern::AttrS46 = QStringLiteral("s46"); -const QString VPattern::AttrS48 = QStringLiteral("s48"); -const QString VPattern::AttrS50 = QStringLiteral("s50"); -const QString VPattern::AttrS52 = QStringLiteral("s52"); -const QString VPattern::AttrS54 = QStringLiteral("s54"); -const QString VPattern::AttrS56 = QStringLiteral("s56"); - -const QString VPattern::IncrementName = QStringLiteral("name"); -const QString VPattern::IncrementBase = QStringLiteral("base"); -const QString VPattern::IncrementKsize = QStringLiteral("ksize"); -const QString VPattern::IncrementKgrowth = QStringLiteral("kgrowth"); -const QString VPattern::IncrementDescription = QStringLiteral("description"); - //--------------------------------------------------------------------------------------------------------------------- VPattern::VPattern(VContainer *data, Draw *mode, VMainGraphicsScene *sceneDraw, VMainGraphicsScene *sceneDetail, QObject *parent) - : QObject(parent), VDomDocument(), data(data), nameActivPP(QString()), tools(QHash()), - history(QVector()), cursor(0), patternPieces(QStringList()), mode(mode), sceneDraw(sceneDraw), + : VAbstractPattern(parent), data(data), patternPieces(QStringList()), mode(mode), sceneDraw(sceneDraw), sceneDetail(sceneDetail) { SCASSERT(sceneDraw != nullptr); @@ -167,132 +96,6 @@ void VPattern::CreateEmptyFile(const QString &tablePath) insertBefore(createProcessingInstruction("xml", "version=\"1.0\" encoding=\"UTF-8\""), this->firstChild()); } -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief ChangeActivPP set new active pattern piece name. - * @param name new name. - * @param parse parser file mode. - */ -void VPattern::ChangeActivPP(const QString &name, const Document &parse) -{ - Q_ASSERT_X(name.isEmpty() == false, "ChangeActivPP", "name pattern piece is empty"); - if (CheckExistNamePP(name) && this->nameActivPP != name) - { - this->nameActivPP = name; - if (parse == Document::FullParse) - { - emit ChangedActivPP(name); - } - } -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief GetActivDrawElement return draw tag for current pattern peace. - * @param element draw tag. - * @return true if found. - */ -bool VPattern::GetActivDrawElement(QDomElement &element) const -{ - if (nameActivPP.isEmpty() == false) - { - const QDomNodeList elements = this->documentElement().elementsByTagName( TagDraw ); - if (elements.size() == 0) - { - return false; - } - for ( qint32 i = 0; i < elements.count(); i++ ) - { - element = elements.at( i ).toElement(); - if (element.isNull() == false) - { - const QString fieldName = element.attribute( AttrName ); - if ( fieldName == nameActivPP ) - { - return true; - } - } - } - element = QDomElement(); - } - return false; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief appendPP add new pattern piece. - * - * Method check if not exist pattern piece with the same name and change name active pattern piece name, send signal - * about change pattern piece. Doen't add pattern piece to file structure. This task make SPoint tool. - * @param name pattern peace name. - * @return true if success. - */ -bool VPattern::appendPP(const QString &name) -{ - Q_ASSERT_X(name.isEmpty() == false, "appendPP", "name pattern piece is empty"); - if (name.isEmpty()) - { - return false; - } - if (CheckExistNamePP(name) == false) - { - if (nameActivPP.isEmpty()) - { - SetActivPP(name); - } - else - { - this->nameActivPP = name; - emit ChangedActivPP(name); - } - return true; - } - return false; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief ChangeNamePP change pattern piece name. - * @param oldName old pattern piece name. - * @param newName new pattern piece name. - * @return true if success. - */ -bool VPattern::ChangeNamePP(const QString& oldName, const QString &newName) -{ - Q_ASSERT_X(newName.isEmpty() == false, "SetNamePP", "new name pattern piece is empty"); - Q_ASSERT_X(oldName.isEmpty() == false, "SetNamePP", "old name pattern piece is empty"); - - if (CheckExistNamePP(oldName) == false) - { - qDebug()<<"Do not exist pattern piece with name"< 0, Q_FUNC_INFO, "id <= 0"); - SCASSERT(tool != nullptr); - tools.insert(id, tool); -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief UpdateToolData update tool in list tools. @@ -520,34 +275,6 @@ void VPattern::UpdateToolData(const quint32 &id, VContainer *data) tool->VDataTool::setData(data); } -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief IncrementReferens increment reference parent objects. - * @param id parent object id. - */ -void VPattern::IncrementReferens(quint32 id) const -{ - Q_ASSERT_X(id > 0, Q_FUNC_INFO, "id <= 0"); - ToolExists(id); - VDataTool *tool = tools.value(id); - SCASSERT(tool != nullptr); - tool->incrementReferens(); -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief DecrementReferens decrement reference parent objects. - * @param id parent object id. - */ -void VPattern::DecrementReferens(quint32 id) const -{ - Q_ASSERT_X(id > 0, Q_FUNC_INFO, "id <= 0"); - ToolExists(id); - VDataTool *tool = tools.value(id); - SCASSERT(tool != nullptr); - tool->decrementReferens(); -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief SPointActiveDraw return id base point current pattern peace. @@ -576,171 +303,6 @@ quint32 VPattern::SPointActiveDraw() return 0; } -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief CheckNameDraw check if exist pattern peace with this name. - * @param name pattern peace name. - * @return true if exist. - */ -bool VPattern::CheckExistNamePP(const QString &name) const -{ - Q_ASSERT_X(name.isEmpty() == false, "CheckNameDraw", "name draw is empty"); - const QDomNodeList elements = this->documentElement().elementsByTagName( TagDraw ); - if (elements.size() == 0) - { - return false; - } - for ( qint32 i = 0; i < elements.count(); i++ ) - { - const QDomElement elem = elements.at( i ).toElement(); - if (elem.isNull() == false) - { - if ( GetParametrString(elem, AttrName) == name ) - { - return true; - } - } - } - return false; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief SetActivPP set current pattern piece. - * @param name pattern peace name. - */ -void VPattern::SetActivPP(const QString &name) -{ - Q_ASSERT_X(name.isEmpty() == false, "SetActivPP", "name pattern piece is empty"); - this->nameActivPP = name; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief GetActivNodeElement find element in current pattern piece by name. - * @param name name tag. - * @param element element. - * @return true if found. - */ -bool VPattern::GetActivNodeElement(const QString &name, QDomElement &element) const -{ - Q_ASSERT_X(name.isEmpty() == false, "GetActivNodeElement", "name draw is empty"); - QDomElement drawElement; - if (GetActivDrawElement(drawElement)) - { - const QDomNodeList listElement = drawElement.elementsByTagName(name); - if (listElement.size() != 1) - { - return false; - } - element = listElement.at( 0 ).toElement(); - if (element.isNull() == false) - { - return true; - } - else - { - return false; - } - } - return false; -} - -//--------------------------------------------------------------------------------------------------------------------- -QString VPattern::MPath() const -{ - QDomNodeList list = elementsByTagName(TagMeasurements); - QDomElement element = list.at(0).toElement(); - if (element.isElement()) - { - return GetParametrString(element, AttrPath); - } - else - { - return QString(); - } -} - -//--------------------------------------------------------------------------------------------------------------------- -void VPattern::SetPath(const QString &path) -{ - if (path.isEmpty()) - { - qDebug()<<"Path to measurements is empty"<documentElement().elementsByTagName( TagDraw ); - if (elements.size() == 0) - { - return QDomElement(); - } - for ( qint32 i = 0; i < elements.count(); i++ ) - { - QDomElement element = elements.at( i ).toElement(); - if (element.isNull() == false) - { - if ( element.attribute( AttrName ) == name ) - { - return element; - } - } - } - } - return QDomElement(); -} - -//--------------------------------------------------------------------------------------------------------------------- -int VPattern::CountPP() const -{ - const QDomElement rootElement = this->documentElement(); - if (rootElement.isNull()) - { - return 0; - } - - return rootElement.elementsByTagName( TagDraw ).count(); -} - //--------------------------------------------------------------------------------------------------------------------- QRectF VPattern::ActiveDrawBoundingRect() const { @@ -2893,61 +2418,30 @@ QRectF VPattern::ToolBoundingRect(const QRectF &rec, const quint32 &id) const return recTool; } - //--------------------------------------------------------------------------------------------------------------------- -QVector VPattern::getLocalHistory() const +/** + * @brief IncrementReferens increment reference parent objects. + * @param id parent object id. + */ +void VPattern::IncrementReferens(quint32 id) const { - QVector historyPP; - for (qint32 i = 0; i< history.size(); ++i) - { - const VToolRecord tool = history.at(i); - if (tool.getNameDraw() != GetNameActivPP()) - { - continue; - } - historyPP.append(tool); - } - return historyPP; + Q_ASSERT_X(id > 0, Q_FUNC_INFO, "id <= 0"); + ToolExists(id); + VDataTool *tool = tools.value(id); + SCASSERT(tool != nullptr); + tool->incrementReferens(); } //--------------------------------------------------------------------------------------------------------------------- -quint32 VPattern::SiblingNodeId(const quint32 &nodeId) const +/** + * @brief DecrementReferens decrement reference parent objects. + * @param id parent object id. + */ +void VPattern::DecrementReferens(quint32 id) const { - quint32 siblingId = NULL_ID; - - const QVector history = getLocalHistory(); - for (qint32 i = 0; i < history.size(); ++i) - { - const VToolRecord tool = history.at(i); - if (nodeId == tool.getId()) - { - if (i == 0) - { - siblingId = NULL_ID; - } - else - { - for (qint32 j = i; j > 0; --j) - { - const VToolRecord tool = history.at(j-1); - switch ( tool.getTypeTool() ) - { - case Tool::Detail: - case Tool::UnionDetails: - case Tool::NodeArc: - case Tool::NodePoint: - case Tool::NodeSpline: - case Tool::NodeSplinePath: - continue; - break; - default: - siblingId = tool.getId(); - j = 0;// break loop - break; - } - } - } - } - } - return siblingId; + Q_ASSERT_X(id > 0, Q_FUNC_INFO, "id <= 0"); + ToolExists(id); + VDataTool *tool = tools.value(id); + SCASSERT(tool != nullptr); + tool->decrementReferens(); } diff --git a/src/app/xml/vpattern.h b/src/app/xml/vpattern.h index 9dc53bdff..3d5b99a4d 100644 --- a/src/app/xml/vpattern.h +++ b/src/app/xml/vpattern.h @@ -29,126 +29,37 @@ #ifndef VPATTERN_H #define VPATTERN_H -#include "../libs/ifc/xml/vdomdocument.h" +#include "../libs/ifc/xml/vabstractpattern.h" #include "../libs/ifc/xml/vtoolrecord.h" #include "../libs/vpatterndb/vcontainer.h" class VDataTool; class VMainGraphicsScene; -enum class Document : char { LiteParse, LitePPParse, FullParse }; enum class LabelType : char {NewPatternPiece, NewLabel}; enum class CrossCirclesPoint : char {FirstPoint = 1, SecondPoint = 2}; /** * @brief The VPattern class working with pattern file. */ -class VPattern : public QObject, public VDomDocument +class VPattern : public VAbstractPattern { Q_OBJECT public: VPattern(VContainer *data, Draw *mode, VMainGraphicsScene *sceneDraw, VMainGraphicsScene *sceneDetail, QObject *parent = nullptr); - void CreateEmptyFile(const QString &tablePath); - void ChangeActivPP(const QString& name, const Document &parse = Document::FullParse); - QString GetNameActivPP() const; - bool GetActivDrawElement(QDomElement &element) const; - bool appendPP(const QString& name); - bool ChangeNamePP(const QString& oldName, const QString &newName); - QDomElement GetPPElement(const QString &name); - bool CheckExistNamePP(const QString& name) const; - int CountPP() const; + virtual void CreateEmptyFile(const QString &tablePath); void Parse(const Document &parse); - QHash* getTools(); - VDataTool* getTool(const quint32 &id); - QVector *getHistory(); - QVector getLocalHistory() const; - quint32 getCursor() const; - void setCursor(const quint32 &value); + void setCurrentData(); - void AddTool(const quint32 &id, VDataTool *tool); void UpdateToolData(const quint32 &id, VContainer *data); - void IncrementReferens(quint32 id) const; - void DecrementReferens(quint32 id) const; + + virtual void IncrementReferens(quint32 id) const; + virtual void DecrementReferens(quint32 id) const; + quint32 SPointActiveDraw(); - bool isPatternModified() const; - void setPatternModified(bool value); - bool GetActivNodeElement(const QString& name, QDomElement& element) const; - QString MPath() const; - void SetPath(const QString &path); - Unit MUnit() const; - MeasurementsType MType() const; - static const QString TagPattern; - static const QString TagCalculation; - static const QString TagModeling; - static const QString TagDetails; - static const QString TagAuthor; - static const QString TagDescription; - static const QString TagNotes; - static const QString TagMeasurements; - static const QString TagIncrements; - static const QString TagIncrement; - static const QString TagDraw; - static const QString TagPoint; - static const QString TagLine; - static const QString TagSpline; - static const QString TagArc; - static const QString TagTools; - static const QString TagGradation; - static const QString TagHeights; - static const QString TagSizes; - - static const QString AttrName; - static const QString AttrType; - static const QString AttrPath; - - static const QString AttrAll; - - static const QString AttrH92; - static const QString AttrH98; - static const QString AttrH104; - static const QString AttrH110; - static const QString AttrH116; - static const QString AttrH122; - static const QString AttrH128; - static const QString AttrH134; - static const QString AttrH140; - static const QString AttrH146; - static const QString AttrH152; - static const QString AttrH158; - static const QString AttrH164; - static const QString AttrH170; - static const QString AttrH176; - static const QString AttrH182; - static const QString AttrH188; - static const QString AttrH194; - - static const QString AttrS22; - static const QString AttrS24; - static const QString AttrS26; - static const QString AttrS28; - static const QString AttrS30; - static const QString AttrS32; - static const QString AttrS34; - static const QString AttrS36; - static const QString AttrS38; - static const QString AttrS40; - static const QString AttrS42; - static const QString AttrS44; - static const QString AttrS46; - static const QString AttrS48; - static const QString AttrS50; - static const QString AttrS52; - static const QString AttrS54; - static const QString AttrS56; - - static const QString IncrementName; - static const QString IncrementBase; - static const QString IncrementKsize; - static const QString IncrementKgrowth; - static const QString IncrementDescription; virtual bool SaveDocument(const QString &fileName, QString &error) const; QStringList getPatternPieces() const; @@ -174,43 +85,6 @@ public: QString GenerateLabel(const LabelType &type)const; - quint32 SiblingNodeId(const quint32 &nodeId) const; -signals: - /** - * @brief ChangedActivDraw change active pattern peace. - * @param newName new pattern peace name. - */ - void ChangedActivPP(const QString &newName); - /** - * @brief ChangedNameDraw save new name pattern peace. - * @param oldName old name. - * @param newName new name. - */ - void ChangedNameDraw(const QString &oldName, const QString &newName); - /** - * @brief FullUpdateFromFile update tool data form file. - */ - void FullUpdateFromFile(); - /** - * @brief patternChanged emit if we have unsaved change. - */ - void patternChanged(bool saved); - /** - * @brief ShowTool highlight tool. - * @param id tool id. - * @param enable enable or disable highlight. - */ - void ShowTool(quint32 id, bool enable); - /** - * @brief ChangedCursor change cursor position. - * @param id tool id. - */ - void ChangedCursor(quint32 id); - void ClearMainWindow(); - void UndoCommand(); - void SetEnabledGUI(bool enabled); - void CheckLayout(); - void SetCurrentPP(const QString &patterPiece); public slots: void LiteParseTree(const Document &parse); void haveLiteChange(); @@ -225,18 +99,6 @@ private: /** @brief data container with data. */ VContainer *data; - /** @brief nameActivDraw name current pattern peace. */ - QString nameActivPP; - - /** @brief tools list with pointer on tools. */ - QHash tools; - - /** @brief history history records. */ - QVector history; - - /** @brief cursor cursor keep id tool after which we will add new tool in file. */ - quint32 cursor; - /** @brief patternPieces list of patern pieces names for combobox*/ QStringList patternPieces; @@ -246,7 +108,6 @@ private: VMainGraphicsScene *sceneDraw; VMainGraphicsScene *sceneDetail; - void SetActivPP(const QString& name); void ParseDrawElement(const QDomNode& node, const Document &parse); void ParseDrawMode(const QDomNode& node, const Document &parse, const Draw &mode); void ParseDetailElement(const QDomElement &domElement, @@ -278,49 +139,8 @@ private: void ParseCurrentPP(); void CheckTagExists(const QString &tag); QString GetLabelBase(unsigned int index)const; - void ToolExists(const quint32 &id) const; }; -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief GetNameActivPP return current pattern piece name. - * @return pattern piece name. - */ -inline QString VPattern::GetNameActivPP() const -{ - return nameActivPP; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getTools return list of tools pointers. - * @return list. - */ -inline QHash *VPattern::getTools() -{ - return &tools; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getHistory return list with list of history records. - * @return list of history records. - */ -inline QVector *VPattern::getHistory() -{ - return &history; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getCursor return cursor. - * @return cursor. - */ -inline quint32 VPattern::getCursor() const -{ - return cursor; -} - //--------------------------------------------------------------------------------------------------------------------- inline QStringList VPattern::getPatternPieces() const { diff --git a/src/libs/ifc/xml/vabstractpattern.cpp b/src/libs/ifc/xml/vabstractpattern.cpp new file mode 100644 index 000000000..878fdef35 --- /dev/null +++ b/src/libs/ifc/xml/vabstractpattern.cpp @@ -0,0 +1,560 @@ +/************************************************************************ + ** + ** @file vabstractpattern.cpp + ** @author Roman Telezhynskyi + ** @date 15 6, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#include "vabstractpattern.h" +#include "../vmisc/def.h" +#include "exception/vexceptionbadid.h" + +const QString VAbstractPattern::TagPattern = QStringLiteral("pattern"); +const QString VAbstractPattern::TagCalculation = QStringLiteral("calculation"); +const QString VAbstractPattern::TagModeling = QStringLiteral("modeling"); +const QString VAbstractPattern::TagDetails = QStringLiteral("details"); +const QString VAbstractPattern::TagAuthor = QStringLiteral("author"); +const QString VAbstractPattern::TagDescription = QStringLiteral("description"); +const QString VAbstractPattern::TagNotes = QStringLiteral("notes"); +const QString VAbstractPattern::TagMeasurements = QStringLiteral("measurements"); +const QString VAbstractPattern::TagIncrements = QStringLiteral("increments"); +const QString VAbstractPattern::TagIncrement = QStringLiteral("increment"); +const QString VAbstractPattern::TagDraw = QStringLiteral("draw"); +const QString VAbstractPattern::TagPoint = QStringLiteral("point"); +const QString VAbstractPattern::TagLine = QStringLiteral("line"); +const QString VAbstractPattern::TagSpline = QStringLiteral("spline"); +const QString VAbstractPattern::TagArc = QStringLiteral("arc"); +const QString VAbstractPattern::TagTools = QStringLiteral("tools"); +const QString VAbstractPattern::TagGradation = QStringLiteral("gradation"); +const QString VAbstractPattern::TagHeights = QStringLiteral("heights"); +const QString VAbstractPattern::TagSizes = QStringLiteral("sizes"); + +const QString VAbstractPattern::AttrName = QStringLiteral("name"); +const QString VAbstractPattern::AttrType = QStringLiteral("type"); +const QString VAbstractPattern::AttrPath = QStringLiteral("path"); + +const QString VAbstractPattern::AttrAll = QStringLiteral("all"); + +const QString VAbstractPattern::AttrH92 = QStringLiteral("h92"); +const QString VAbstractPattern::AttrH98 = QStringLiteral("h98"); +const QString VAbstractPattern::AttrH104 = QStringLiteral("h104"); +const QString VAbstractPattern::AttrH110 = QStringLiteral("h110"); +const QString VAbstractPattern::AttrH116 = QStringLiteral("h116"); +const QString VAbstractPattern::AttrH122 = QStringLiteral("h122"); +const QString VAbstractPattern::AttrH128 = QStringLiteral("h128"); +const QString VAbstractPattern::AttrH134 = QStringLiteral("h134"); +const QString VAbstractPattern::AttrH140 = QStringLiteral("h140"); +const QString VAbstractPattern::AttrH146 = QStringLiteral("h146"); +const QString VAbstractPattern::AttrH152 = QStringLiteral("h152"); +const QString VAbstractPattern::AttrH158 = QStringLiteral("h158"); +const QString VAbstractPattern::AttrH164 = QStringLiteral("h164"); +const QString VAbstractPattern::AttrH170 = QStringLiteral("h170"); +const QString VAbstractPattern::AttrH176 = QStringLiteral("h176"); +const QString VAbstractPattern::AttrH182 = QStringLiteral("h182"); +const QString VAbstractPattern::AttrH188 = QStringLiteral("h188"); +const QString VAbstractPattern::AttrH194 = QStringLiteral("h194"); + +const QString VAbstractPattern::AttrS22 = QStringLiteral("s22"); +const QString VAbstractPattern::AttrS24 = QStringLiteral("s24"); +const QString VAbstractPattern::AttrS26 = QStringLiteral("s26"); +const QString VAbstractPattern::AttrS28 = QStringLiteral("s28"); +const QString VAbstractPattern::AttrS30 = QStringLiteral("s30"); +const QString VAbstractPattern::AttrS32 = QStringLiteral("s32"); +const QString VAbstractPattern::AttrS34 = QStringLiteral("s34"); +const QString VAbstractPattern::AttrS36 = QStringLiteral("s36"); +const QString VAbstractPattern::AttrS38 = QStringLiteral("s38"); +const QString VAbstractPattern::AttrS40 = QStringLiteral("s40"); +const QString VAbstractPattern::AttrS42 = QStringLiteral("s42"); +const QString VAbstractPattern::AttrS44 = QStringLiteral("s44"); +const QString VAbstractPattern::AttrS46 = QStringLiteral("s46"); +const QString VAbstractPattern::AttrS48 = QStringLiteral("s48"); +const QString VAbstractPattern::AttrS50 = QStringLiteral("s50"); +const QString VAbstractPattern::AttrS52 = QStringLiteral("s52"); +const QString VAbstractPattern::AttrS54 = QStringLiteral("s54"); +const QString VAbstractPattern::AttrS56 = QStringLiteral("s56"); + +const QString VAbstractPattern::IncrementName = QStringLiteral("name"); +const QString VAbstractPattern::IncrementBase = QStringLiteral("base"); +const QString VAbstractPattern::IncrementKsize = QStringLiteral("ksize"); +const QString VAbstractPattern::IncrementKgrowth = QStringLiteral("kgrowth"); +const QString VAbstractPattern::IncrementDescription = QStringLiteral("description"); + +//--------------------------------------------------------------------------------------------------------------------- +VAbstractPattern::VAbstractPattern(QObject *parent) + : QObject(parent), VDomDocument(), nameActivPP(QString()), cursor(0), tools(QHash()), + history(QVector()) +{} + +//--------------------------------------------------------------------------------------------------------------------- +VAbstractPattern::~VAbstractPattern() +{} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief ChangeActivPP set new active pattern piece name. + * @param name new name. + * @param parse parser file mode. + */ +void VAbstractPattern::ChangeActivPP(const QString &name, const Document &parse) +{ + Q_ASSERT_X(name.isEmpty() == false, "ChangeActivPP", "name pattern piece is empty"); + if (CheckExistNamePP(name) && this->nameActivPP != name) + { + this->nameActivPP = name; + if (parse == Document::FullParse) + { + emit ChangedActivPP(name); + } + } +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetNameActivPP return current pattern piece name. + * @return pattern piece name. + */ +QString VAbstractPattern::GetNameActivPP() const +{ + return nameActivPP; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetActivDrawElement return draw tag for current pattern peace. + * @param element draw tag. + * @return true if found. + */ +bool VAbstractPattern::GetActivDrawElement(QDomElement &element) const +{ + if (nameActivPP.isEmpty() == false) + { + const QDomNodeList elements = this->documentElement().elementsByTagName( TagDraw ); + if (elements.size() == 0) + { + return false; + } + for ( qint32 i = 0; i < elements.count(); i++ ) + { + element = elements.at( i ).toElement(); + if (element.isNull() == false) + { + const QString fieldName = element.attribute( AttrName ); + if ( fieldName == nameActivPP ) + { + return true; + } + } + } + element = QDomElement(); + } + return false; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief CheckNameDraw check if exist pattern peace with this name. + * @param name pattern peace name. + * @return true if exist. + */ +bool VAbstractPattern::CheckExistNamePP(const QString &name) const +{ + Q_ASSERT_X(name.isEmpty() == false, "CheckNameDraw", "name draw is empty"); + const QDomNodeList elements = this->documentElement().elementsByTagName( TagDraw ); + if (elements.size() == 0) + { + return false; + } + for ( qint32 i = 0; i < elements.count(); i++ ) + { + const QDomElement elem = elements.at( i ).toElement(); + if (elem.isNull() == false) + { + if ( GetParametrString(elem, AttrName) == name ) + { + return true; + } + } + } + return false; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetActivNodeElement find element in current pattern piece by name. + * @param name name tag. + * @param element element. + * @return true if found. + */ +bool VAbstractPattern::GetActivNodeElement(const QString &name, QDomElement &element) const +{ + Q_ASSERT_X(name.isEmpty() == false, "GetActivNodeElement", "name draw is empty"); + QDomElement drawElement; + if (GetActivDrawElement(drawElement)) + { + const QDomNodeList listElement = drawElement.elementsByTagName(name); + if (listElement.size() != 1) + { + return false; + } + element = listElement.at( 0 ).toElement(); + if (element.isNull() == false) + { + return true; + } + else + { + return false; + } + } + return false; +} + +//--------------------------------------------------------------------------------------------------------------------- +int VAbstractPattern::CountPP() const +{ + const QDomElement rootElement = this->documentElement(); + if (rootElement.isNull()) + { + return 0; + } + + return rootElement.elementsByTagName( TagDraw ).count(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QDomElement VAbstractPattern::GetPPElement(const QString &name) +{ + if (name.isEmpty() == false) + { + const QDomNodeList elements = this->documentElement().elementsByTagName( TagDraw ); + if (elements.size() == 0) + { + return QDomElement(); + } + for ( qint32 i = 0; i < elements.count(); i++ ) + { + QDomElement element = elements.at( i ).toElement(); + if (element.isNull() == false) + { + if ( element.attribute( AttrName ) == name ) + { + return element; + } + } + } + } + return QDomElement(); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief ChangeNamePP change pattern piece name. + * @param oldName old pattern piece name. + * @param newName new pattern piece name. + * @return true if success. + */ +bool VAbstractPattern::ChangeNamePP(const QString &oldName, const QString &newName) +{ + Q_ASSERT_X(newName.isEmpty() == false, "SetNamePP", "new name pattern piece is empty"); + Q_ASSERT_X(oldName.isEmpty() == false, "SetNamePP", "old name pattern piece is empty"); + + if (CheckExistNamePP(oldName) == false) + { + qDebug()<<"Do not exist pattern piece with name"< 0, Q_FUNC_INFO, "id <= 0"); + SCASSERT(tool != nullptr); + tools.insert(id, tool); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getHistory return list with list of history records. + * @return list of history records. + */ +QVector *VAbstractPattern::getHistory() +{ + return &history; +} + +//--------------------------------------------------------------------------------------------------------------------- +QVector VAbstractPattern::getLocalHistory() const +{ + QVector historyPP; + for (qint32 i = 0; i< history.size(); ++i) + { + const VToolRecord tool = history.at(i); + if (tool.getNameDraw() != GetNameActivPP()) + { + continue; + } + historyPP.append(tool); + } + return historyPP; +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VAbstractPattern::MPath() const +{ + QDomNodeList list = elementsByTagName(TagMeasurements); + QDomElement element = list.at(0).toElement(); + if (element.isElement()) + { + return GetParametrString(element, AttrPath); + } + else + { + return QString(); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void VAbstractPattern::SetPath(const QString &path) +{ + if (path.isEmpty()) + { + qDebug()<<"Path to measurements is empty"< history = getLocalHistory(); + for (qint32 i = 0; i < history.size(); ++i) + { + const VToolRecord tool = history.at(i); + if (nodeId == tool.getId()) + { + if (i == 0) + { + siblingId = NULL_ID; + } + else + { + for (qint32 j = i; j > 0; --j) + { + const VToolRecord tool = history.at(j-1); + switch ( tool.getTypeTool() ) + { + case Tool::Detail: + case Tool::UnionDetails: + case Tool::NodeArc: + case Tool::NodePoint: + case Tool::NodeSpline: + case Tool::NodeSplinePath: + continue; + break; + default: + siblingId = tool.getId(); + j = 0;// break loop + break; + } + } + } + } + } + return siblingId; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VAbstractPattern::ToolExists(const quint32 &id) const +{ + if (tools.contains(id) == false) + { + throw VExceptionBadId(tr("Can't find tool in table."), id); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief SetActivPP set current pattern piece. + * @param name pattern peace name. + */ +void VAbstractPattern::SetActivPP(const QString &name) +{ + Q_ASSERT_X(name.isEmpty() == false, "SetActivPP", "name pattern piece is empty"); + this->nameActivPP = name; + emit ChangedActivPP(name); +} diff --git a/src/libs/ifc/xml/vabstractpattern.h b/src/libs/ifc/xml/vabstractpattern.h new file mode 100644 index 000000000..4c3b16bbe --- /dev/null +++ b/src/libs/ifc/xml/vabstractpattern.h @@ -0,0 +1,221 @@ +/************************************************************************ + ** + ** @file vabstractpattern.h + ** @author Roman Telezhynskyi + ** @date 15 6, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef VABSTRACTPATTERN_H +#define VABSTRACTPATTERN_H + +#include "vdomdocument.h" +#include "vtoolrecord.h" + +#include + +enum class Document : char { LiteParse, LitePPParse, FullParse }; + +class VDataTool; + +class VAbstractPattern : public QObject, public VDomDocument +{ + Q_OBJECT +public: + VAbstractPattern(QObject *parent = nullptr); + virtual ~VAbstractPattern(); + + virtual void CreateEmptyFile(const QString &tablePath)=0; + + void ChangeActivPP(const QString& name, const Document &parse = Document::FullParse); + QString GetNameActivPP() const; + bool CheckExistNamePP(const QString& name) const; + int CountPP() const; + QDomElement GetPPElement(const QString &name); + bool ChangeNamePP(const QString& oldName, const QString &newName); + bool appendPP(const QString& name); + + bool GetActivDrawElement(QDomElement &element) const; + bool GetActivNodeElement(const QString& name, QDomElement& element) const; + + quint32 getCursor() const; + void setCursor(const quint32 &value); + + virtual void IncrementReferens(quint32 id) const=0; + virtual void DecrementReferens(quint32 id) const=0; + + QHash *getTools(); + VDataTool *getTool(const quint32 &id); + void AddTool(const quint32 &id, VDataTool *tool); + + QVector *getHistory(); + QVector getLocalHistory() const; + + QString MPath() const; + void SetPath(const QString &path); + Unit MUnit() const; + MeasurementsType MType() const; + + quint32 SiblingNodeId(const quint32 &nodeId) const; + + static const QString TagPattern; + static const QString TagCalculation; + static const QString TagModeling; + static const QString TagDetails; + static const QString TagAuthor; + static const QString TagDescription; + static const QString TagNotes; + static const QString TagMeasurements; + static const QString TagIncrements; + static const QString TagIncrement; + static const QString TagDraw; + static const QString TagPoint; + static const QString TagLine; + static const QString TagSpline; + static const QString TagArc; + static const QString TagTools; + static const QString TagGradation; + static const QString TagHeights; + static const QString TagSizes; + + static const QString AttrName; + static const QString AttrType; + static const QString AttrPath; + + static const QString AttrAll; + + static const QString AttrH92; + static const QString AttrH98; + static const QString AttrH104; + static const QString AttrH110; + static const QString AttrH116; + static const QString AttrH122; + static const QString AttrH128; + static const QString AttrH134; + static const QString AttrH140; + static const QString AttrH146; + static const QString AttrH152; + static const QString AttrH158; + static const QString AttrH164; + static const QString AttrH170; + static const QString AttrH176; + static const QString AttrH182; + static const QString AttrH188; + static const QString AttrH194; + + static const QString AttrS22; + static const QString AttrS24; + static const QString AttrS26; + static const QString AttrS28; + static const QString AttrS30; + static const QString AttrS32; + static const QString AttrS34; + static const QString AttrS36; + static const QString AttrS38; + static const QString AttrS40; + static const QString AttrS42; + static const QString AttrS44; + static const QString AttrS46; + static const QString AttrS48; + static const QString AttrS50; + static const QString AttrS52; + static const QString AttrS54; + static const QString AttrS56; + + static const QString IncrementName; + static const QString IncrementBase; + static const QString IncrementKsize; + static const QString IncrementKgrowth; + static const QString IncrementDescription; + +signals: + /** + * @brief ChangedActivDraw change active pattern peace. + * @param newName new pattern peace name. + */ + void ChangedActivPP(const QString &newName); + + /** + * @brief ChangedCursor change cursor position. + * @param id tool id. + */ + void ChangedCursor(quint32 id); + + /** + * @brief ChangedNameDraw save new name pattern peace. + * @param oldName old name. + * @param newName new name. + */ + void ChangedNameDraw(const QString &oldName, const QString &newName); + /** + * @brief FullUpdateFromFile update tool data form file. + */ + void FullUpdateFromFile(); + /** + * @brief patternChanged emit if we have unsaved change. + */ + void patternChanged(bool saved); + /** + * @brief ShowTool highlight tool. + * @param id tool id. + * @param enable enable or disable highlight. + */ + void ShowTool(quint32 id, bool enable); + void ClearMainWindow(); + void UndoCommand(); + void SetEnabledGUI(bool enabled); + void CheckLayout(); + void SetCurrentPP(const QString &patterPiece); + +protected: + /** @brief nameActivDraw name current pattern peace. */ + QString nameActivPP; + + /** @brief cursor cursor keep id tool after which we will add new tool in file. */ + quint32 cursor; + + /** @brief tools list with pointer on tools. */ + QHash tools; + + /** @brief history history records. */ + QVector history; + + void ToolExists(const quint32 &id) const; + + void SetActivPP(const QString& name); + +private: + Q_DISABLE_COPY(VAbstractPattern) +}; + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getTools return list of tools pointers. + * @return list. + */ +inline QHash *VAbstractPattern::getTools() +{ + return &tools; +} + +#endif // VABSTRACTPATTERN_H diff --git a/src/libs/ifc/xml/xml.pri b/src/libs/ifc/xml/xml.pri index 81fd98886..65b44e814 100644 --- a/src/libs/ifc/xml/xml.pri +++ b/src/libs/ifc/xml/xml.pri @@ -5,10 +5,12 @@ HEADERS += \ $$PWD/vabstractconverter.h \ $$PWD/vdomdocument.h \ $$PWD/vpatternconverter.h \ - $$PWD/vtoolrecord.h + $$PWD/vtoolrecord.h \ + xml/vabstractpattern.h SOURCES += \ $$PWD/vabstractconverter.cpp \ $$PWD/vdomdocument.cpp \ $$PWD/vpatternconverter.cpp \ - $$PWD/vtoolrecord.cpp + $$PWD/vtoolrecord.cpp \ + xml/vabstractpattern.cpp From d969cfb2d5f1c1c9add2a19d2182361661d564b9 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 16 Jun 2015 12:04:48 +0300 Subject: [PATCH 16/22] Complited refactoring VPattern. --HG-- branch : feature --- src/app/xml/vpattern.cpp | 427 +------------------------ src/app/xml/vpattern.h | 41 +-- src/libs/ifc/xml/vabstractpattern.cpp | 433 +++++++++++++++++++++++++- src/libs/ifc/xml/vabstractpattern.h | 28 ++ 4 files changed, 468 insertions(+), 461 deletions(-) diff --git a/src/app/xml/vpattern.cpp b/src/app/xml/vpattern.cpp index c518d4fe3..d70dc53e5 100644 --- a/src/app/xml/vpattern.cpp +++ b/src/app/xml/vpattern.cpp @@ -52,8 +52,7 @@ //--------------------------------------------------------------------------------------------------------------------- VPattern::VPattern(VContainer *data, Draw *mode, VMainGraphicsScene *sceneDraw, VMainGraphicsScene *sceneDetail, QObject *parent) - : VAbstractPattern(parent), data(data), patternPieces(QStringList()), mode(mode), sceneDraw(sceneDraw), - sceneDetail(sceneDetail) + : VAbstractPattern(parent), data(data), mode(mode), sceneDraw(sceneDraw), sceneDetail(sceneDetail) { SCASSERT(sceneDraw != nullptr); SCASSERT(sceneDetail != nullptr); @@ -409,38 +408,6 @@ void VPattern::LiteParseTree(const Document &parse) qCDebug(vXML, "Scene size updated."); } -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief haveLiteChange we have unsaved change. - */ -void VPattern::haveLiteChange() -{ - emit patternChanged(false); -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief ShowHistoryTool hightlight tool. - * @param id tool id. - * @param enable enable or diasable hightlight. - */ -void VPattern::ShowHistoryTool(quint32 id, bool enable) -{ - emit ShowTool(id, enable); -} - -//--------------------------------------------------------------------------------------------------------------------- -void VPattern::NeedFullParsing() -{ - emit UndoCommand(); -} - -//--------------------------------------------------------------------------------------------------------------------- -void VPattern::ClearScene() -{ - emit ClearMainWindow(); -} - //--------------------------------------------------------------------------------------------------------------------- // cppcheck-suppress unusedFunction void VPattern::customEvent(QEvent *event) @@ -1356,75 +1323,6 @@ void VPattern::ParseCurrentPP() emit CheckLayout(); } -//--------------------------------------------------------------------------------------------------------------------- -void VPattern::CheckTagExists(const QString &tag) -{ - QDomNodeList list = elementsByTagName(tag); - if (list.size() == 0) - { - QStringList tags = QStringList() << TagVersion << TagAuthor << TagDescription << TagNotes << TagGradation; - QDomElement pattern = documentElement(); - switch (tags.indexOf(tag)) - { - case 0: //TagVersion - break;// Mandatory tag - case 1: //TagAuthor - pattern.insertAfter(createElement(TagAuthor), elementsByTagName(TagVersion).at(0)); - SetVersion(); - break; - case 2: //TagDescription - { - for (int i = tags.indexOf(tag)-1; i >= 0; --i) - { - QDomNodeList list = elementsByTagName(tags.at(i)); - if (list.isEmpty()) - { - continue; - } - pattern.insertAfter(createElement(TagDescription), list.at(0)); - } - SetVersion(); - break; - } - case 3: //TagNotes - { - for (int i = tags.indexOf(tag)-1; i >= 0; --i) - { - QDomNodeList list = elementsByTagName(tags.at(i)); - if (list.isEmpty()) - { - continue; - } - pattern.insertAfter(createElement(TagNotes), list.at(0)); - } - SetVersion(); - break; - } - case 4: //TagGradation - { - QDomElement gradation = createElement(TagGradation); - gradation.appendChild(createElement(TagHeights)); - gradation.appendChild(createElement(TagSizes)); - - for (int i = tags.indexOf(tag)-1; i >= 0; --i) - { - QDomNodeList list = elementsByTagName(tags.at(i)); - if (list.isEmpty()) - { - continue; - } - pattern.insertAfter(gradation, list.at(0)); - break; - } - SetVersion(); - break; - } - default: - break; - } - } -} - //--------------------------------------------------------------------------------------------------------------------- QString VPattern::GetLabelBase(unsigned int index) const { @@ -1834,288 +1732,6 @@ void VPattern::ParseIncrementsElement(const QDomNode &node) } } -//--------------------------------------------------------------------------------------------------------------------- -QMap VPattern::GetGradationHeights() const -{ - QMap map; - map.insert(GHeights::ALL, true); - map.insert(GHeights::H92, true); - map.insert(GHeights::H98, true); - map.insert(GHeights::H104, true); - map.insert(GHeights::H110, true); - map.insert(GHeights::H116, true); - map.insert(GHeights::H122, true); - map.insert(GHeights::H128, true); - map.insert(GHeights::H134, true); - map.insert(GHeights::H140, true); - map.insert(GHeights::H146, true); - map.insert(GHeights::H152, true); - map.insert(GHeights::H158, true); - map.insert(GHeights::H164, true); - map.insert(GHeights::H170, true); - map.insert(GHeights::H176, true); - map.insert(GHeights::H182, true); - map.insert(GHeights::H188, true); - map.insert(GHeights::H194, true); - - QDomNodeList tags = elementsByTagName(TagGradation); - if (tags.size() == 0) - { - return map; - } - - QStringList gTags = QStringList() << TagHeights << TagSizes; - QDomNode domNode = tags.at(0).firstChild(); - while (domNode.isNull() == false) - { - if (domNode.isElement()) - { - const QDomElement domElement = domNode.toElement(); - if (domElement.isNull() == false) - { - const QString defValue = QStringLiteral("true"); - switch (gTags.indexOf(domElement.tagName())) - { - case 0: // TagHeights - if (GetParametrBool(domElement, AttrAll, defValue)) - { - return map; - } - else - { - map.insert(GHeights::ALL, false); - } - - map.insert(GHeights::H92, GetParametrBool(domElement, AttrH92, defValue)); - map.insert(GHeights::H98, GetParametrBool(domElement, AttrH98, defValue)); - map.insert(GHeights::H104, GetParametrBool(domElement, AttrH104, defValue)); - map.insert(GHeights::H110, GetParametrBool(domElement, AttrH110, defValue)); - map.insert(GHeights::H116, GetParametrBool(domElement, AttrH116, defValue)); - map.insert(GHeights::H122, GetParametrBool(domElement, AttrH122, defValue)); - map.insert(GHeights::H128, GetParametrBool(domElement, AttrH128, defValue)); - map.insert(GHeights::H134, GetParametrBool(domElement, AttrH134, defValue)); - map.insert(GHeights::H140, GetParametrBool(domElement, AttrH140, defValue)); - map.insert(GHeights::H146, GetParametrBool(domElement, AttrH146, defValue)); - map.insert(GHeights::H152, GetParametrBool(domElement, AttrH152, defValue)); - map.insert(GHeights::H158, GetParametrBool(domElement, AttrH158, defValue)); - map.insert(GHeights::H164, GetParametrBool(domElement, AttrH164, defValue)); - map.insert(GHeights::H170, GetParametrBool(domElement, AttrH170, defValue)); - map.insert(GHeights::H176, GetParametrBool(domElement, AttrH176, defValue)); - map.insert(GHeights::H182, GetParametrBool(domElement, AttrH182, defValue)); - map.insert(GHeights::H188, GetParametrBool(domElement, AttrH188, defValue)); - map.insert(GHeights::H194, GetParametrBool(domElement, AttrH194, defValue)); - return map; - break; - case 1: // TagSizes - break; - default: - break; - } - } - } - domNode = domNode.nextSibling(); - } - return map; -} - -//--------------------------------------------------------------------------------------------------------------------- -void VPattern::SetGradationHeights(const QMap &options) -{ - CheckTagExists(TagGradation); - QDomNodeList tags = elementsByTagName(TagGradation); - if (tags.size() == 0) - { - qDebug()<<"Can't save tag "< VPattern::GetGradationSizes() const -{ - QMap map; - map.insert(GSizes::ALL, true); - map.insert(GSizes::S22, true); - map.insert(GSizes::S24, true); - map.insert(GSizes::S26, true); - map.insert(GSizes::S28, true); - map.insert(GSizes::S30, true); - map.insert(GSizes::S32, true); - map.insert(GSizes::S34, true); - map.insert(GSizes::S36, true); - map.insert(GSizes::S38, true); - map.insert(GSizes::S40, true); - map.insert(GSizes::S42, true); - map.insert(GSizes::S44, true); - map.insert(GSizes::S46, true); - map.insert(GSizes::S48, true); - map.insert(GSizes::S50, true); - map.insert(GSizes::S52, true); - map.insert(GSizes::S54, true); - map.insert(GSizes::S56, true); - - QDomNodeList tags = elementsByTagName(TagGradation); - if (tags.size() == 0) - { - return map; - } - - QStringList gTags = QStringList() << TagHeights << TagSizes; - QDomNode domNode = tags.at(0).firstChild(); - while (domNode.isNull() == false) - { - if (domNode.isElement()) - { - const QDomElement domElement = domNode.toElement(); - if (domElement.isNull() == false) - { - const QString defValue = QStringLiteral("true"); - switch (gTags.indexOf(domElement.tagName())) - { - case 0: // TagHeights - break; - case 1: // TagSizes - if (GetParametrBool(domElement, AttrAll, defValue)) - { - return map; - } - else - { - map.insert(GSizes::ALL, false); - } - - map.insert(GSizes::S22, GetParametrBool(domElement, AttrS22, defValue)); - map.insert(GSizes::S24, GetParametrBool(domElement, AttrS24, defValue)); - map.insert(GSizes::S26, GetParametrBool(domElement, AttrS26, defValue)); - map.insert(GSizes::S28, GetParametrBool(domElement, AttrS28, defValue)); - map.insert(GSizes::S30, GetParametrBool(domElement, AttrS30, defValue)); - map.insert(GSizes::S32, GetParametrBool(domElement, AttrS32, defValue)); - map.insert(GSizes::S34, GetParametrBool(domElement, AttrS34, defValue)); - map.insert(GSizes::S36, GetParametrBool(domElement, AttrS36, defValue)); - map.insert(GSizes::S38, GetParametrBool(domElement, AttrS38, defValue)); - map.insert(GSizes::S40, GetParametrBool(domElement, AttrS40, defValue)); - map.insert(GSizes::S42, GetParametrBool(domElement, AttrS42, defValue)); - map.insert(GSizes::S44, GetParametrBool(domElement, AttrS44, defValue)); - map.insert(GSizes::S46, GetParametrBool(domElement, AttrS46, defValue)); - map.insert(GSizes::S48, GetParametrBool(domElement, AttrS48, defValue)); - map.insert(GSizes::S50, GetParametrBool(domElement, AttrS50, defValue)); - map.insert(GSizes::S52, GetParametrBool(domElement, AttrS52, defValue)); - map.insert(GSizes::S54, GetParametrBool(domElement, AttrS54, defValue)); - map.insert(GSizes::S56, GetParametrBool(domElement, AttrS56, defValue)); - return map; - break; - default: - break; - } - } - } - domNode = domNode.nextSibling(); - } - return map; -} - -//--------------------------------------------------------------------------------------------------------------------- -void VPattern::SetGradationSizes(const QMap &options) -{ - CheckTagExists(TagGradation); - QDomNodeList tags = elementsByTagName(TagGradation); - if (tags.size() == 0) - { - qDebug()<<"Can't save tag "< GetGradationHeights() const; - void SetGradationHeights(const QMap &options); + QString GetAuthor() const; + void SetAuthor(const QString &text); - QMap GetGradationSizes() const; - void SetGradationSizes(const QMap &options); - - QString GetAuthor() const; - void SetAuthor(const QString &text); - - QString GetDescription() const; - void SetDescription(const QString &text); - - QString GetNotes() const; - void SetNotes(const QString &text); - - QString GetVersion() const; - void SetVersion(); - - QString GenerateLabel(const LabelType &type)const; + QString GenerateLabel(const LabelType &type)const; public slots: void LiteParseTree(const Document &parse); - void haveLiteChange(); - void ShowHistoryTool(quint32 id, bool enable); - void NeedFullParsing(); - void ClearScene(); + protected: virtual void customEvent(QEvent * event); + private: Q_DISABLE_COPY(VPattern) /** @brief data container with data. */ VContainer *data; - /** @brief patternPieces list of patern pieces names for combobox*/ - QStringList patternPieces; - /** @brief mode current draw mode. */ - Draw *mode; + Draw *mode; VMainGraphicsScene *sceneDraw; VMainGraphicsScene *sceneDetail; @@ -137,14 +117,7 @@ private: template QRectF ToolBoundingRect(const QRectF &rec, const quint32 &id) const; void ParseCurrentPP(); - void CheckTagExists(const QString &tag); QString GetLabelBase(unsigned int index)const; }; -//--------------------------------------------------------------------------------------------------------------------- -inline QStringList VPattern::getPatternPieces() const -{ - return patternPieces; -} - #endif // VPATTERN_H diff --git a/src/libs/ifc/xml/vabstractpattern.cpp b/src/libs/ifc/xml/vabstractpattern.cpp index 878fdef35..08a3a645e 100644 --- a/src/libs/ifc/xml/vabstractpattern.cpp +++ b/src/libs/ifc/xml/vabstractpattern.cpp @@ -29,6 +29,7 @@ #include "vabstractpattern.h" #include "../vmisc/def.h" #include "exception/vexceptionbadid.h" +#include "vpatternconverter.h" const QString VAbstractPattern::TagPattern = QStringLiteral("pattern"); const QString VAbstractPattern::TagCalculation = QStringLiteral("calculation"); @@ -103,7 +104,7 @@ const QString VAbstractPattern::IncrementDescription = QStringLiteral("descripti //--------------------------------------------------------------------------------------------------------------------- VAbstractPattern::VAbstractPattern(QObject *parent) : QObject(parent), VDomDocument(), nameActivPP(QString()), cursor(0), tools(QHash()), - history(QVector()) + history(QVector()), patternPieces(QStringList()) {} //--------------------------------------------------------------------------------------------------------------------- @@ -538,6 +539,367 @@ quint32 VAbstractPattern::SiblingNodeId(const quint32 &nodeId) const return siblingId; } +//--------------------------------------------------------------------------------------------------------------------- +QStringList VAbstractPattern::getPatternPieces() const +{ + return patternPieces; +} + +//--------------------------------------------------------------------------------------------------------------------- +QMap VAbstractPattern::GetGradationHeights() const +{ + QMap map; + map.insert(GHeights::ALL, true); + map.insert(GHeights::H92, true); + map.insert(GHeights::H98, true); + map.insert(GHeights::H104, true); + map.insert(GHeights::H110, true); + map.insert(GHeights::H116, true); + map.insert(GHeights::H122, true); + map.insert(GHeights::H128, true); + map.insert(GHeights::H134, true); + map.insert(GHeights::H140, true); + map.insert(GHeights::H146, true); + map.insert(GHeights::H152, true); + map.insert(GHeights::H158, true); + map.insert(GHeights::H164, true); + map.insert(GHeights::H170, true); + map.insert(GHeights::H176, true); + map.insert(GHeights::H182, true); + map.insert(GHeights::H188, true); + map.insert(GHeights::H194, true); + + QDomNodeList tags = elementsByTagName(TagGradation); + if (tags.size() == 0) + { + return map; + } + + QStringList gTags = QStringList() << TagHeights << TagSizes; + QDomNode domNode = tags.at(0).firstChild(); + while (domNode.isNull() == false) + { + if (domNode.isElement()) + { + const QDomElement domElement = domNode.toElement(); + if (domElement.isNull() == false) + { + const QString defValue = QStringLiteral("true"); + switch (gTags.indexOf(domElement.tagName())) + { + case 0: // TagHeights + if (GetParametrBool(domElement, AttrAll, defValue)) + { + return map; + } + else + { + map.insert(GHeights::ALL, false); + } + + map.insert(GHeights::H92, GetParametrBool(domElement, AttrH92, defValue)); + map.insert(GHeights::H98, GetParametrBool(domElement, AttrH98, defValue)); + map.insert(GHeights::H104, GetParametrBool(domElement, AttrH104, defValue)); + map.insert(GHeights::H110, GetParametrBool(domElement, AttrH110, defValue)); + map.insert(GHeights::H116, GetParametrBool(domElement, AttrH116, defValue)); + map.insert(GHeights::H122, GetParametrBool(domElement, AttrH122, defValue)); + map.insert(GHeights::H128, GetParametrBool(domElement, AttrH128, defValue)); + map.insert(GHeights::H134, GetParametrBool(domElement, AttrH134, defValue)); + map.insert(GHeights::H140, GetParametrBool(domElement, AttrH140, defValue)); + map.insert(GHeights::H146, GetParametrBool(domElement, AttrH146, defValue)); + map.insert(GHeights::H152, GetParametrBool(domElement, AttrH152, defValue)); + map.insert(GHeights::H158, GetParametrBool(domElement, AttrH158, defValue)); + map.insert(GHeights::H164, GetParametrBool(domElement, AttrH164, defValue)); + map.insert(GHeights::H170, GetParametrBool(domElement, AttrH170, defValue)); + map.insert(GHeights::H176, GetParametrBool(domElement, AttrH176, defValue)); + map.insert(GHeights::H182, GetParametrBool(domElement, AttrH182, defValue)); + map.insert(GHeights::H188, GetParametrBool(domElement, AttrH188, defValue)); + map.insert(GHeights::H194, GetParametrBool(domElement, AttrH194, defValue)); + return map; + break; + case 1: // TagSizes + break; + default: + break; + } + } + } + domNode = domNode.nextSibling(); + } + return map; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VAbstractPattern::SetGradationHeights(const QMap &options) +{ + CheckTagExists(TagGradation); + QDomNodeList tags = elementsByTagName(TagGradation); + if (tags.size() == 0) + { + qDebug()<<"Can't save tag "< VAbstractPattern::GetGradationSizes() const +{ + QMap map; + map.insert(GSizes::ALL, true); + map.insert(GSizes::S22, true); + map.insert(GSizes::S24, true); + map.insert(GSizes::S26, true); + map.insert(GSizes::S28, true); + map.insert(GSizes::S30, true); + map.insert(GSizes::S32, true); + map.insert(GSizes::S34, true); + map.insert(GSizes::S36, true); + map.insert(GSizes::S38, true); + map.insert(GSizes::S40, true); + map.insert(GSizes::S42, true); + map.insert(GSizes::S44, true); + map.insert(GSizes::S46, true); + map.insert(GSizes::S48, true); + map.insert(GSizes::S50, true); + map.insert(GSizes::S52, true); + map.insert(GSizes::S54, true); + map.insert(GSizes::S56, true); + + QDomNodeList tags = elementsByTagName(TagGradation); + if (tags.size() == 0) + { + return map; + } + + QStringList gTags = QStringList() << TagHeights << TagSizes; + QDomNode domNode = tags.at(0).firstChild(); + while (domNode.isNull() == false) + { + if (domNode.isElement()) + { + const QDomElement domElement = domNode.toElement(); + if (domElement.isNull() == false) + { + const QString defValue = QStringLiteral("true"); + switch (gTags.indexOf(domElement.tagName())) + { + case 0: // TagHeights + break; + case 1: // TagSizes + if (GetParametrBool(domElement, AttrAll, defValue)) + { + return map; + } + else + { + map.insert(GSizes::ALL, false); + } + + map.insert(GSizes::S22, GetParametrBool(domElement, AttrS22, defValue)); + map.insert(GSizes::S24, GetParametrBool(domElement, AttrS24, defValue)); + map.insert(GSizes::S26, GetParametrBool(domElement, AttrS26, defValue)); + map.insert(GSizes::S28, GetParametrBool(domElement, AttrS28, defValue)); + map.insert(GSizes::S30, GetParametrBool(domElement, AttrS30, defValue)); + map.insert(GSizes::S32, GetParametrBool(domElement, AttrS32, defValue)); + map.insert(GSizes::S34, GetParametrBool(domElement, AttrS34, defValue)); + map.insert(GSizes::S36, GetParametrBool(domElement, AttrS36, defValue)); + map.insert(GSizes::S38, GetParametrBool(domElement, AttrS38, defValue)); + map.insert(GSizes::S40, GetParametrBool(domElement, AttrS40, defValue)); + map.insert(GSizes::S42, GetParametrBool(domElement, AttrS42, defValue)); + map.insert(GSizes::S44, GetParametrBool(domElement, AttrS44, defValue)); + map.insert(GSizes::S46, GetParametrBool(domElement, AttrS46, defValue)); + map.insert(GSizes::S48, GetParametrBool(domElement, AttrS48, defValue)); + map.insert(GSizes::S50, GetParametrBool(domElement, AttrS50, defValue)); + map.insert(GSizes::S52, GetParametrBool(domElement, AttrS52, defValue)); + map.insert(GSizes::S54, GetParametrBool(domElement, AttrS54, defValue)); + map.insert(GSizes::S56, GetParametrBool(domElement, AttrS56, defValue)); + return map; + break; + default: + break; + } + } + } + domNode = domNode.nextSibling(); + } + return map; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VAbstractPattern::SetGradationSizes(const QMap &options) +{ + CheckTagExists(TagGradation); + QDomNodeList tags = elementsByTagName(TagGradation); + if (tags.size() == 0) + { + qDebug()<<"Can't save tag "<nameActivPP = name; emit ChangedActivPP(name); } + +//--------------------------------------------------------------------------------------------------------------------- +void VAbstractPattern::CheckTagExists(const QString &tag) +{ + QDomNodeList list = elementsByTagName(tag); + if (list.size() == 0) + { + QStringList tags = QStringList() << TagVersion << TagAuthor << TagDescription << TagNotes << TagGradation; + QDomElement pattern = documentElement(); + switch (tags.indexOf(tag)) + { + case 0: //TagVersion + break;// Mandatory tag + case 1: //TagAuthor + pattern.insertAfter(createElement(TagAuthor), elementsByTagName(TagVersion).at(0)); + SetVersion(); + break; + case 2: //TagDescription + { + for (int i = tags.indexOf(tag)-1; i >= 0; --i) + { + QDomNodeList list = elementsByTagName(tags.at(i)); + if (list.isEmpty()) + { + continue; + } + pattern.insertAfter(createElement(TagDescription), list.at(0)); + } + SetVersion(); + break; + } + case 3: //TagNotes + { + for (int i = tags.indexOf(tag)-1; i >= 0; --i) + { + QDomNodeList list = elementsByTagName(tags.at(i)); + if (list.isEmpty()) + { + continue; + } + pattern.insertAfter(createElement(TagNotes), list.at(0)); + } + SetVersion(); + break; + } + case 4: //TagGradation + { + QDomElement gradation = createElement(TagGradation); + gradation.appendChild(createElement(TagHeights)); + gradation.appendChild(createElement(TagSizes)); + + for (int i = tags.indexOf(tag)-1; i >= 0; --i) + { + QDomNodeList list = elementsByTagName(tags.at(i)); + if (list.isEmpty()) + { + continue; + } + pattern.insertAfter(gradation, list.at(0)); + break; + } + SetVersion(); + break; + } + default: + break; + } + } +} diff --git a/src/libs/ifc/xml/vabstractpattern.h b/src/libs/ifc/xml/vabstractpattern.h index 4c3b16bbe..5c2511a5d 100644 --- a/src/libs/ifc/xml/vabstractpattern.h +++ b/src/libs/ifc/xml/vabstractpattern.h @@ -78,6 +78,23 @@ public: quint32 SiblingNodeId(const quint32 &nodeId) const; + QStringList getPatternPieces() const; + + QMap GetGradationHeights() const; + void SetGradationHeights(const QMap &options); + + QMap GetGradationSizes() const; + void SetGradationSizes(const QMap &options); + + QString GetDescription() const; + void SetDescription(const QString &text); + + QString GetNotes() const; + void SetNotes(const QString &text); + + QString GetVersion() const; + void SetVersion(); + static const QString TagPattern; static const QString TagCalculation; static const QString TagModeling; @@ -187,6 +204,12 @@ signals: void CheckLayout(); void SetCurrentPP(const QString &patterPiece); +public slots: + void haveLiteChange(); + void ShowHistoryTool(quint32 id, bool enable); + void NeedFullParsing(); + void ClearScene(); + protected: /** @brief nameActivDraw name current pattern peace. */ QString nameActivPP; @@ -200,10 +223,15 @@ protected: /** @brief history history records. */ QVector history; + /** @brief patternPieces list of patern pieces names for combobox*/ + QStringList patternPieces; + void ToolExists(const quint32 &id) const; void SetActivPP(const QString& name); + void CheckTagExists(const QString &tag); + private: Q_DISABLE_COPY(VAbstractPattern) }; From 67dbe7409f9ee6e176fbb9ed8dae2f8c5ab66040 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 16 Jun 2015 12:06:51 +0300 Subject: [PATCH 17/22] Remove path to VMainGraphicsView. --HG-- branch : feature --- src/app/app.pro | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/app/app.pro b/src/app/app.pro index a806c91f0..bb1af6526 100644 --- a/src/app/app.pro +++ b/src/app/app.pro @@ -47,9 +47,6 @@ UI_DIR = uic # Suport subdirectories. Just better project code tree. include(app.pri) -# This include path help promoute VMainGraphicsView on main window. Without it compiler can't find path to custom view -INCLUDEPATH += "$${PWD}/widgets" - # Resource files. This files will be included in binary. RESOURCES += \ share/resources/icon.qrc \ # All other icons except cursors and Windows theme. From fab30e999f8e98a7fa2a798111570f44322b3a66 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 16 Jun 2015 18:01:17 +0300 Subject: [PATCH 18/22] Use VAbstractPattern in tools. --HG-- branch : feature --- src/app/tools/drawTools/vdrawtool.cpp | 4 ++-- src/app/tools/drawTools/vtoolpoint.cpp | 2 +- src/app/tools/drawTools/vtoolsinglepoint.cpp | 2 +- src/app/tools/drawTools/vtoolspline.cpp | 4 ++-- src/app/tools/drawTools/vtoolsplinepath.cpp | 4 ++-- src/app/tools/vabstracttool.cpp | 12 ++++++------ src/app/tools/vabstracttool.h | 8 ++++---- src/app/tools/vtooldetail.cpp | 4 ++-- src/app/undocommands/addtocalc.cpp | 4 ++-- src/libs/ifc/xml/vabstractpattern.h | 1 + 10 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/app/tools/drawTools/vdrawtool.cpp b/src/app/tools/drawTools/vdrawtool.cpp index eeabe8c91..c52726d64 100644 --- a/src/app/tools/drawTools/vdrawtool.cpp +++ b/src/app/tools/drawTools/vdrawtool.cpp @@ -131,7 +131,7 @@ void VDrawTool::SaveDialogChange() SaveDialog(newDomElement); SaveToolOptions *saveOptions = new SaveToolOptions(oldDomElement, newDomElement, doc, id); - connect(saveOptions, &SaveToolOptions::NeedLiteParsing, doc, &VPattern::LiteParseTree); + connect(saveOptions, &SaveToolOptions::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree); qApp->getUndoStack()->push(saveOptions); } else @@ -182,7 +182,7 @@ void VDrawTool::SaveOption(QSharedPointer &obj) SaveOptions(newDomElement, obj); SaveToolOptions *saveOptions = new SaveToolOptions(oldDomElement, newDomElement, doc, id); - connect(saveOptions, &SaveToolOptions::NeedLiteParsing, doc, &VPattern::LiteParseTree); + connect(saveOptions, &SaveToolOptions::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree); qApp->getUndoStack()->push(saveOptions); } else diff --git a/src/app/tools/drawTools/vtoolpoint.cpp b/src/app/tools/drawTools/vtoolpoint.cpp index 91d2ddf01..d1c0a94bb 100644 --- a/src/app/tools/drawTools/vtoolpoint.cpp +++ b/src/app/tools/drawTools/vtoolpoint.cpp @@ -136,7 +136,7 @@ void VToolPoint::NameChangePosition(const QPointF &pos) void VToolPoint::UpdateNamePosition(qreal mx, qreal my) { MoveLabel *moveLabel = new MoveLabel(doc, mx, my, id, this->scene()); - connect(moveLabel, &MoveLabel::NeedLiteParsing, doc, &VPattern::LiteParseTree); + connect(moveLabel, &MoveLabel::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree); qApp->getUndoStack()->push(moveLabel); } diff --git a/src/app/tools/drawTools/vtoolsinglepoint.cpp b/src/app/tools/drawTools/vtoolsinglepoint.cpp index f8b8c521c..0804cd307 100644 --- a/src/app/tools/drawTools/vtoolsinglepoint.cpp +++ b/src/app/tools/drawTools/vtoolsinglepoint.cpp @@ -146,7 +146,7 @@ QVariant VToolSinglePoint::itemChange(QGraphicsItem::GraphicsItemChange change, QPointF newPos = value.toPointF(); MoveSPoint *moveSP = new MoveSPoint(doc, newPos.x(), newPos.y(), id, this->scene()); - connect(moveSP, &MoveSPoint::NeedLiteParsing, doc, &VPattern::LiteParseTree); + connect(moveSP, &MoveSPoint::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree); qApp->getUndoStack()->push(moveSP); } return QGraphicsItem::itemChange(change, value); diff --git a/src/app/tools/drawTools/vtoolspline.cpp b/src/app/tools/drawTools/vtoolspline.cpp index 0985f93c1..8d9b1fba4 100644 --- a/src/app/tools/drawTools/vtoolspline.cpp +++ b/src/app/tools/drawTools/vtoolspline.cpp @@ -253,7 +253,7 @@ void VToolSpline::ControlPointChangePosition(const qint32 &indexSpline, const Sp } MoveSpline *moveSpl = new MoveSpline(doc, spline.data(), spl, id, this->scene()); - connect(moveSpl, &MoveSpline::NeedLiteParsing, doc, &VPattern::LiteParseTree); + connect(moveSpl, &MoveSpline::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree); qApp->getUndoStack()->push(moveSpl); } @@ -416,7 +416,7 @@ void VToolSpline::mouseMoveEvent(QGraphicsSceneMouseEvent *event) VSpline spl = VSpline(spline->GetP1(), p2, p3, spline->GetP4(), spline->GetKcurve()); MoveSpline *moveSpl = new MoveSpline(doc, spline.data(), spl, id, this->scene()); - connect(moveSpl, &MoveSpline::NeedLiteParsing, doc, &VPattern::LiteParseTree); + connect(moveSpl, &MoveSpline::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree); qApp->getUndoStack()->push(moveSpl); } diff --git a/src/app/tools/drawTools/vtoolsplinepath.cpp b/src/app/tools/drawTools/vtoolsplinepath.cpp index 0b176cfa1..e316f7a6e 100644 --- a/src/app/tools/drawTools/vtoolsplinepath.cpp +++ b/src/app/tools/drawTools/vtoolsplinepath.cpp @@ -211,7 +211,7 @@ void VToolSplinePath::ControlPointChangePosition(const qint32 &indexSpline, cons UpdateControlPoints(spl, newSplPath, indexSpline); MoveSplinePath *moveSplPath = new MoveSplinePath(doc, oldSplPath, newSplPath, id, this->scene()); - connect(moveSplPath, &VUndoCommand::NeedLiteParsing, doc, &VPattern::LiteParseTree); + connect(moveSplPath, &VUndoCommand::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree); qApp->getUndoStack()->push(moveSplPath); } @@ -493,7 +493,7 @@ void VToolSplinePath::mouseMoveEvent(QGraphicsSceneMouseEvent *event) UpdateControlPoints(spl, newSplPath, indexSpline); MoveSplinePath *moveSplPath = new MoveSplinePath(doc, oldSplPath, newSplPath, id, this->scene()); - connect(moveSplPath, &VUndoCommand::NeedLiteParsing, doc, &VPattern::LiteParseTree); + connect(moveSplPath, &VUndoCommand::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree); qApp->getUndoStack()->push(moveSplPath); } diff --git a/src/app/tools/vabstracttool.cpp b/src/app/tools/vabstracttool.cpp index f85c369f9..d68c3268a 100644 --- a/src/app/tools/vabstracttool.cpp +++ b/src/app/tools/vabstracttool.cpp @@ -111,13 +111,13 @@ const QString VAbstractTool::ColorYellow = QStringLiteral("yellow"); * @param id object id in container. * @param parent parent object. */ -VAbstractTool::VAbstractTool(VPattern *doc, VContainer *data, quint32 id, QObject *parent) +VAbstractTool::VAbstractTool(VAbstractPattern *doc, VContainer *data, quint32 id, QObject *parent) :VDataTool(data, parent), doc(doc), id(id), baseColor(Qt::black), vis(nullptr) { SCASSERT(doc != nullptr); - connect(this, &VAbstractTool::toolhaveChange, this->doc, &VPattern::haveLiteChange); - connect(this->doc, &VPattern::FullUpdateFromFile, this, &VAbstractTool::FullUpdateFromFile); - connect(this, &VAbstractTool::LiteUpdateTree, this->doc, &VPattern::LiteParseTree); + connect(this, &VAbstractTool::toolhaveChange, this->doc, &VAbstractPattern::haveLiteChange); + connect(this->doc, &VAbstractPattern::FullUpdateFromFile, this, &VAbstractTool::FullUpdateFromFile); + connect(this, &VAbstractTool::LiteUpdateTree, this->doc, &VAbstractPattern::LiteParseTree); } //--------------------------------------------------------------------------------------------------------------------- @@ -141,7 +141,7 @@ void VAbstractTool::DeleteTool(bool ask) } } DelTool *delTool = new DelTool(doc, id); - connect(delTool, &DelTool::NeedFullParsing, doc, &VPattern::NeedFullParsing); + connect(delTool, &DelTool::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing); qApp->getUndoStack()->push(delTool); } } @@ -333,7 +333,7 @@ const QStringList VAbstractTool::StylesList() * @param toolType tool type * @param doc dom document container */ -void VAbstractTool::AddRecord(const quint32 id, const Tool &toolType, VPattern *doc) +void VAbstractTool::AddRecord(const quint32 id, const Tool &toolType, VAbstractPattern *doc) { QVector *history = doc->getHistory(); VToolRecord record = VToolRecord(id, toolType, doc->GetNameActivPP()); diff --git a/src/app/tools/vabstracttool.h b/src/app/tools/vabstracttool.h index 92510807b..e2d029bab 100644 --- a/src/app/tools/vabstracttool.h +++ b/src/app/tools/vabstracttool.h @@ -30,7 +30,7 @@ #define VABSTRACTTOOL_H #include "vdatatool.h" -#include "../xml/vpattern.h" +#include "../../libs/ifc/xml/vabstractpattern.h" #include "../core/vapplication.h" #include "../libs/vwidgets/vmaingraphicsscene.h" #include "../visualization/visualization.h" @@ -51,7 +51,7 @@ class VAbstractTool: public VDataTool { Q_OBJECT public: - VAbstractTool(VPattern *doc, VContainer *data, quint32 id, QObject *parent = nullptr); + VAbstractTool(VAbstractPattern *doc, VContainer *data, quint32 id, QObject *parent = nullptr); virtual ~VAbstractTool(); quint32 getId() const; static const QString AttrType; @@ -124,7 +124,7 @@ public: static const QStringList Colors(); static QMap ColorsList(); - static void AddRecord(const quint32 id, const Tool &toolType, VPattern *doc); + static void AddRecord(const quint32 id, const Tool &toolType, VAbstractPattern *doc); const VContainer *getData() const; @@ -153,7 +153,7 @@ signals: void LiteUpdateTree(const Document &parse); protected: /** @brief doc dom document container */ - VPattern *doc; + VAbstractPattern *doc; /** @brief id object id. */ const quint32 id; diff --git a/src/app/tools/vtooldetail.cpp b/src/app/tools/vtooldetail.cpp index 6303b5284..a698b8b29 100644 --- a/src/app/tools/vtooldetail.cpp +++ b/src/app/tools/vtooldetail.cpp @@ -264,7 +264,7 @@ void VToolDetail::FullUpdateFromGuiOk(int result) VDetail oldDet = VAbstractTool::data.GetDetail(id); SaveDetailOptions *saveCommand = new SaveDetailOptions(oldDet, newDet, doc, id, this->scene()); - connect(saveCommand, &SaveDetailOptions::NeedLiteParsing, doc, &VPattern::LiteParseTree); + connect(saveCommand, &SaveDetailOptions::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree); qApp->getUndoStack()->push(saveCommand); } delete dialog; @@ -335,7 +335,7 @@ QVariant VToolDetail::itemChange(QGraphicsItem::GraphicsItemChange change, const QPointF newPos = value.toPointF(); MoveDetail *moveDet = new MoveDetail(doc, newPos.x(), newPos.y(), id, this->scene()); - connect(moveDet, &MoveDetail::NeedLiteParsing, doc, &VPattern::LiteParseTree); + connect(moveDet, &MoveDetail::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree); qApp->getUndoStack()->push(moveDet); } diff --git a/src/app/undocommands/addtocalc.cpp b/src/app/undocommands/addtocalc.cpp index 0ef79f65b..1e7148ebf 100644 --- a/src/app/undocommands/addtocalc.cpp +++ b/src/app/undocommands/addtocalc.cpp @@ -53,7 +53,7 @@ void AddToCalc::undo() doc->setCursor(cursor); QDomElement calcElement; - if (doc->GetActivNodeElement(VPattern::TagCalculation, calcElement)) + if (doc->GetActivNodeElement(VAbstractPattern::TagCalculation, calcElement)) { QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) @@ -93,7 +93,7 @@ void AddToCalc::redo() doc->setCursor(cursor); QDomElement calcElement; - if (doc->GetActivNodeElement(VPattern::TagCalculation, calcElement)) + if (doc->GetActivNodeElement(VAbstractPattern::TagCalculation, calcElement)) { if (cursor <= 0) { diff --git a/src/libs/ifc/xml/vabstractpattern.h b/src/libs/ifc/xml/vabstractpattern.h index 5c2511a5d..c6f0acf30 100644 --- a/src/libs/ifc/xml/vabstractpattern.h +++ b/src/libs/ifc/xml/vabstractpattern.h @@ -205,6 +205,7 @@ signals: void SetCurrentPP(const QString &patterPiece); public slots: + virtual void LiteParseTree(const Document &parse)=0; void haveLiteChange(); void ShowHistoryTool(quint32 id, bool enable); void NeedFullParsing(); From a312e763c09f281d242b1bc890f7a2958891d99c Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 18 Jun 2015 11:45:38 +0300 Subject: [PATCH 19/22] Move VFormula to library VPatternDB. New class VAbstractPattern. --HG-- branch : feature --- src/app/core/core.pri | 2 - src/app/core/vapplication.cpp | 27 +----- src/app/core/vapplication.h | 40 +------- src/app/core/vformulaproperty.cpp | 2 +- src/app/core/vformulapropertyeditor.h | 2 +- src/app/core/vtooloptionspropertybrowser.cpp | 2 +- src/app/tools/drawTools/vtoolarc.cpp | 2 +- .../tools/drawTools/vtoolarcwithlength.cpp | 2 +- src/app/tools/drawTools/vtoolcut.cpp | 2 +- src/app/tools/drawTools/vtoollinepoint.h | 2 +- .../vtoolpointfromcircleandtangent.cpp | 2 +- .../tools/drawTools/vtoolpointofcontact.cpp | 2 +- .../vtoolpointofintersectioncircles.cpp | 2 +- src/libs/ifc/ifcdef.h | 1 - src/libs/ifc/xml/vdomdocument.h | 1 + src/libs/vmisc/def.h | 1 + src/libs/vmisc/vabstractapplication.cpp | 61 ++++++++++++ src/libs/vmisc/vabstractapplication.h | 92 +++++++++++++++++++ src/libs/vmisc/vmisc.pri | 6 +- src/libs/vpatterndb/calculator.h | 2 +- .../core => libs/vpatterndb}/vformula.cpp | 9 +- src/{app/core => libs/vpatterndb}/vformula.h | 0 src/libs/vpatterndb/vpatterndb.pri | 6 +- 23 files changed, 186 insertions(+), 82 deletions(-) create mode 100644 src/libs/vmisc/vabstractapplication.cpp create mode 100644 src/libs/vmisc/vabstractapplication.h rename src/{app/core => libs/vpatterndb}/vformula.cpp (98%) rename src/{app/core => libs/vpatterndb}/vformula.h (100%) diff --git a/src/app/core/core.pri b/src/app/core/core.pri index 401024d03..7627b9046 100644 --- a/src/app/core/core.pri +++ b/src/app/core/core.pri @@ -3,14 +3,12 @@ HEADERS += \ $$PWD/vapplication.h \ - $$PWD/vformula.h \ $$PWD/vformulaproperty.h \ $$PWD/vformulapropertyeditor.h \ $$PWD/vtooloptionspropertybrowser.h SOURCES += \ $$PWD/vapplication.cpp \ - $$PWD/vformula.cpp \ $$PWD/vformulaproperty.cpp \ $$PWD/vformulapropertyeditor.cpp \ $$PWD/vtooloptionspropertybrowser.cpp diff --git a/src/app/core/vapplication.cpp b/src/app/core/vapplication.cpp index e461fc1da..cd70f6d5f 100644 --- a/src/app/core/vapplication.cpp +++ b/src/app/core/vapplication.cpp @@ -156,9 +156,9 @@ const QString VApplication::GistFileName = QStringLiteral("gist.json"); * @param argv command line. */ VApplication::VApplication(int &argc, char **argv) - : QApplication(argc, argv), _patternUnit(Unit::Cm), _patternType(MeasurementsType::Individual), + : VAbstractApplication(argc, argv), _patternUnit(Unit::Cm), trVars(nullptr), undoStack(nullptr), sceneView(nullptr), currentScene(nullptr), autoSaveTimer(nullptr), - mainWindow(nullptr), openingPattern(false), settings(nullptr), doc(nullptr), log(nullptr), + mainWindow(nullptr), openingPattern(false), doc(nullptr), log(nullptr), #if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0) out(nullptr), logLock(nullptr) #else @@ -572,29 +572,6 @@ void VApplication::setOpeningPattern() openingPattern = !openingPattern; } -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief VApplication::OpenSettings get acsses to application settings. - * - * Because we can create object in constructor we open file separately. - */ -void VApplication::OpenSettings() -{ - settings = new VSettings(QSettings::IniFormat, QSettings::UserScope, QApplication::organizationName(), - QApplication::applicationName(), this); -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief VApplication::getSettings hide settings constructor. - * @return pointer to class for acssesing to settings in ini file. - */ -VSettings *VApplication::getSettings() -{ - SCASSERT(settings != nullptr); - return settings; -} - //--------------------------------------------------------------------------------------------------------------------- QGraphicsScene *VApplication::getCurrentScene() const { diff --git a/src/app/core/vapplication.h b/src/app/core/vapplication.h index 1427e57f8..d480f4dba 100644 --- a/src/app/core/vapplication.h +++ b/src/app/core/vapplication.h @@ -29,13 +29,13 @@ #ifndef VAPPLICATION_H #define VAPPLICATION_H -#include +#include "../libs/vmisc/vabstractapplication.h" #include "../options.h" #include "../libs/vwidgets/vmaingraphicsview.h" #include "../libs/vpatterndb/vtranslatevars.h" #include "vsettings.h" -class VApplication;// used in define +class VApplication;// use in define class QUndoStack; class VMainGraphicsView; class VPattern; @@ -47,12 +47,12 @@ class QLockFile; #if defined(qApp) #undef qApp #endif -#define qApp (static_cast(QCoreApplication::instance())) +#define qApp (static_cast(VAbstractApplication::instance())) /** * @brief The VApplication class reimplamentation QApplication class. */ -class VApplication : public QApplication +class VApplication : public VAbstractApplication { Q_OBJECT public: @@ -64,8 +64,6 @@ public: Unit patternUnit() const; const Unit *patternUnitP() const; void setPatternUnit(const Unit &patternUnit); - MeasurementsType patternType() const; - void setPatternType(const MeasurementsType &patternType); void InitOptions(); @@ -78,14 +76,6 @@ public: QString translationsPath() const; - template - QString LocaleToString(const T &value) - { - QLocale loc; - qApp->getSettings()->GetOsSeparator() ? loc = QLocale::system() : loc = QLocale(QLocale::C); - return loc.toString(value); - } - QUndoStack *getUndoStack() const; VMainGraphicsView *getSceneView() const; void setSceneView(VMainGraphicsView *value); @@ -96,9 +86,6 @@ public: bool getOpeningPattern() const; void setOpeningPattern(); - void OpenSettings(); - VSettings *getSettings(); - QGraphicsScene *getCurrentScene() const; void setCurrentScene(QGraphicsScene *value); @@ -110,7 +97,7 @@ public: void StartLogging(); QTextStream *LogFile(); - const VTranslateVars *TrVars(); + virtual const VTranslateVars *TrVars(); void InitTrVars(); @@ -127,7 +114,6 @@ private slots: private: Q_DISABLE_COPY(VApplication) Unit _patternUnit; - MeasurementsType _patternType; VTranslateVars *trVars; QUndoStack *undoStack; VMainGraphicsView *sceneView; @@ -143,10 +129,6 @@ private: * we can allow user use Undo option. */ bool openingPattern; - /** - * @brief settings pointer to settings. Help hide constructor creation settings. Make make code more readable. - */ - VSettings *settings; VPattern *doc; QFile *log; @@ -185,18 +167,6 @@ inline const Unit *VApplication::patternUnitP() const return &_patternUnit; } -//--------------------------------------------------------------------------------------------------------------------- -inline MeasurementsType VApplication::patternType() const -{ - return _patternType; -} - -//--------------------------------------------------------------------------------------------------------------------- -inline void VApplication::setPatternType(const MeasurementsType &patternType) -{ - _patternType = patternType; -} - //--------------------------------------------------------------------------------------------------------------------- inline QUndoStack *VApplication::getUndoStack() const { diff --git a/src/app/core/vformulaproperty.cpp b/src/app/core/vformulaproperty.cpp index e42887c09..6be529d65 100644 --- a/src/app/core/vformulaproperty.cpp +++ b/src/app/core/vformulaproperty.cpp @@ -32,7 +32,7 @@ #include "../../libs/vpropertyexplorer/vproperty_p.h" #include "vformulapropertyeditor.h" #include "../../libs/vpropertyexplorer/vproperties.h" -#include "../core/vformula.h" +#include "../../libs/vpatterndb/vformula.h" enum class ChildType : char {Invalid = 0, Value = 1, Formula = 2}; diff --git a/src/app/core/vformulapropertyeditor.h b/src/app/core/vformulapropertyeditor.h index 3d3c529aa..e57910837 100644 --- a/src/app/core/vformulapropertyeditor.h +++ b/src/app/core/vformulapropertyeditor.h @@ -35,7 +35,7 @@ #include #include -#include "../core/vformula.h" +#include "../../libs/vpatterndb/vformula.h" class VFormulaPropertyEditor : public QWidget { diff --git a/src/app/core/vtooloptionspropertybrowser.cpp b/src/app/core/vtooloptionspropertybrowser.cpp index 7e47f60cf..61fbea81c 100644 --- a/src/app/core/vtooloptionspropertybrowser.cpp +++ b/src/app/core/vtooloptionspropertybrowser.cpp @@ -34,7 +34,7 @@ #include "../../libs/vwidgets/vcontrolpointspline.h" #include "../../libs/vpropertyexplorer/vproperties.h" #include "vformulaproperty.h" -#include "../core/vformula.h" +#include "../../libs/vpatterndb/vformula.h" #include #include diff --git a/src/app/tools/drawTools/vtoolarc.cpp b/src/app/tools/drawTools/vtoolarc.cpp index 5c98e36ef..a520dd08d 100644 --- a/src/app/tools/drawTools/vtoolarc.cpp +++ b/src/app/tools/drawTools/vtoolarc.cpp @@ -30,7 +30,7 @@ #include "../../libs/vpatterndb/calculator.h" #include "../../dialogs/tools/dialogarc.h" #include "../../libs/vgeometry/varc.h" -#include "../../core/vformula.h" +#include "../../libs/vpatterndb/vformula.h" #include "../../visualization/vistoolarc.h" #include diff --git a/src/app/tools/drawTools/vtoolarcwithlength.cpp b/src/app/tools/drawTools/vtoolarcwithlength.cpp index ae65670b5..bbcde358b 100644 --- a/src/app/tools/drawTools/vtoolarcwithlength.cpp +++ b/src/app/tools/drawTools/vtoolarcwithlength.cpp @@ -30,7 +30,7 @@ #include "../../libs/vpatterndb/calculator.h" #include "../../dialogs/tools/dialogarcwithlength.h" #include "../../libs/vgeometry/varc.h" -#include "../../core/vformula.h" +#include "../../libs/vpatterndb/vformula.h" #include "../../visualization/vistoolarcwithlength.h" #include diff --git a/src/app/tools/drawTools/vtoolcut.cpp b/src/app/tools/drawTools/vtoolcut.cpp index e6a2fce65..2fbf78129 100644 --- a/src/app/tools/drawTools/vtoolcut.cpp +++ b/src/app/tools/drawTools/vtoolcut.cpp @@ -28,7 +28,7 @@ #include "vtoolcut.h" #include "../../libs/vgeometry/vpointf.h" -#include "../../core/vformula.h" +#include "../../libs/vpatterndb/vformula.h" //--------------------------------------------------------------------------------------------------------------------- VToolCut::VToolCut(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula, diff --git a/src/app/tools/drawTools/vtoollinepoint.h b/src/app/tools/drawTools/vtoollinepoint.h index 93d020c68..b8646de6e 100644 --- a/src/app/tools/drawTools/vtoollinepoint.h +++ b/src/app/tools/drawTools/vtoollinepoint.h @@ -30,7 +30,7 @@ #define VTOOLLINEPOINT_H #include "vtoolpoint.h" -#include "../../core/vformula.h" +#include "../../../libs/vpatterndb/vformula.h" /** * @brief The VToolLinePoint class parent for all tools what create point with line. diff --git a/src/app/tools/drawTools/vtoolpointfromcircleandtangent.cpp b/src/app/tools/drawTools/vtoolpointfromcircleandtangent.cpp index 6156d55a5..350285d11 100644 --- a/src/app/tools/drawTools/vtoolpointfromcircleandtangent.cpp +++ b/src/app/tools/drawTools/vtoolpointfromcircleandtangent.cpp @@ -31,7 +31,7 @@ #include "../../libs/vgeometry/vpointf.h" #include "../../libs/vgeometry/varc.h" #include "../../visualization/vistoolpointfromcircleandtangent.h" -#include "../../core/vformula.h" +#include "../../libs/vpatterndb/vformula.h" const QString VToolPointFromCircleAndTangent::ToolType = QStringLiteral("pointFromCircleAndTangent"); diff --git a/src/app/tools/drawTools/vtoolpointofcontact.cpp b/src/app/tools/drawTools/vtoolpointofcontact.cpp index 026529f95..42ac9f46f 100644 --- a/src/app/tools/drawTools/vtoolpointofcontact.cpp +++ b/src/app/tools/drawTools/vtoolpointofcontact.cpp @@ -30,7 +30,7 @@ #include "../../libs/vpatterndb/calculator.h" #include "../../dialogs/tools/dialogpointofcontact.h" #include "../../libs/vgeometry/vpointf.h" -#include "../../core/vformula.h" +#include "../../libs/vpatterndb/vformula.h" #include "../../visualization/vistoolpointofcontact.h" #include diff --git a/src/app/tools/drawTools/vtoolpointofintersectioncircles.cpp b/src/app/tools/drawTools/vtoolpointofintersectioncircles.cpp index b5f7e5823..5eb6833bf 100644 --- a/src/app/tools/drawTools/vtoolpointofintersectioncircles.cpp +++ b/src/app/tools/drawTools/vtoolpointofintersectioncircles.cpp @@ -31,7 +31,7 @@ #include "../../libs/vgeometry/vpointf.h" #include "../../libs/vgeometry/varc.h" #include "../../visualization/vistoolpointofintersectioncircles.h" -#include "../../core/vformula.h" +#include "../../libs/vpatterndb/vformula.h" const QString VToolPointOfIntersectionCircles::ToolType = QStringLiteral("pointOfIntersectionCircles"); diff --git a/src/libs/ifc/ifcdef.h b/src/libs/ifc/ifcdef.h index e61a27a06..af4eb50ca 100644 --- a/src/libs/ifc/ifcdef.h +++ b/src/libs/ifc/ifcdef.h @@ -37,7 +37,6 @@ #endif /*Q_OS_WIN32*/ enum class Unit : char { Mm, Cm, Inch, Px }; -enum class MeasurementsType : char { Standard, Individual }; static const quint32 null_id = 0; diff --git a/src/libs/ifc/xml/vdomdocument.h b/src/libs/ifc/xml/vdomdocument.h index 20d78c8eb..ab86e8bb9 100644 --- a/src/libs/ifc/xml/vdomdocument.h +++ b/src/libs/ifc/xml/vdomdocument.h @@ -34,6 +34,7 @@ #include #include "ifcdef.h" +#include "../vmisc/def.h" #include "../vmisc/logging.h" Q_DECLARE_LOGGING_CATEGORY(vXML) diff --git a/src/libs/vmisc/def.h b/src/libs/vmisc/def.h index 0bab8864f..d1693a929 100644 --- a/src/libs/vmisc/def.h +++ b/src/libs/vmisc/def.h @@ -35,6 +35,7 @@ enum class NodeDetail : char { Contour, Modeling }; enum class SceneObject : char { Point, Line, Spline, Arc, SplinePath, Detail, Unknown }; +enum class MeasurementsType : char { Standard, Individual }; enum class Tool : unsigned char { diff --git a/src/libs/vmisc/vabstractapplication.cpp b/src/libs/vmisc/vabstractapplication.cpp new file mode 100644 index 000000000..7a31758cb --- /dev/null +++ b/src/libs/vmisc/vabstractapplication.cpp @@ -0,0 +1,61 @@ +/************************************************************************ + ** + ** @file vabstractapplication.cpp + ** @author Roman Telezhynskyi + ** @date 18 6, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#include "vabstractapplication.h" + +//--------------------------------------------------------------------------------------------------------------------- +VAbstractApplication::VAbstractApplication(int &argc, char **argv) + :QApplication(argc, argv), _patternType(MeasurementsType::Individual), settings(nullptr) +{} + +//--------------------------------------------------------------------------------------------------------------------- +VAbstractApplication::~VAbstractApplication() +{} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief OpenSettings get acsses to application settings. + * + * Because we can create object in constructor we open file separately. + */ +void VAbstractApplication::OpenSettings() +{ + settings = new VSettings(QSettings::IniFormat, QSettings::UserScope, QApplication::organizationName(), + QApplication::applicationName(), this); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getSettings hide settings constructor. + * @return pointer to class for acssesing to settings in ini file. + */ +VSettings *VAbstractApplication::getSettings() +{ + SCASSERT(settings != nullptr); + return settings; +} diff --git a/src/libs/vmisc/vabstractapplication.h b/src/libs/vmisc/vabstractapplication.h new file mode 100644 index 000000000..f420c4edc --- /dev/null +++ b/src/libs/vmisc/vabstractapplication.h @@ -0,0 +1,92 @@ +/************************************************************************ + ** + ** @file vabstractapplication.h + ** @author Roman Telezhynskyi + ** @date 18 6, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef VABSTRACTAPPLICATION_H +#define VABSTRACTAPPLICATION_H + +#include +#include "def.h" +#include "vsettings.h" + +class VAbstractApplication;// use in define +class VTranslateVars; + +#if defined(qApp) +#undef qApp +#endif +#define qApp (static_cast(QCoreApplication::instance())) + +class VAbstractApplication : public QApplication +{ +public: + VAbstractApplication(int &argc, char ** argv); + virtual ~VAbstractApplication(); + + virtual const VTranslateVars *TrVars()=0; + + MeasurementsType patternType() const; + void setPatternType(const MeasurementsType &patternType); + + void OpenSettings(); + VSettings *getSettings(); + + template + QString LocaleToString(const T &value); + + +private: + Q_DISABLE_COPY(VAbstractApplication) + MeasurementsType _patternType; + /** + * @brief settings pointer to settings. Help hide constructor creation settings. Make make code more readable. + */ + VSettings *settings; +}; + +//--------------------------------------------------------------------------------------------------------------------- +inline MeasurementsType VAbstractApplication::patternType() const +{ + return _patternType; +} + +//--------------------------------------------------------------------------------------------------------------------- +inline void VAbstractApplication::setPatternType(const MeasurementsType &patternType) +{ + _patternType = patternType; +} + +//--------------------------------------------------------------------------------------------------------------------- +template +QString VAbstractApplication::LocaleToString(const T &value) +{ + QLocale loc; + qApp->getSettings()->GetOsSeparator() ? loc = QLocale::system() : loc = QLocale(QLocale::C); + return loc.toString(value); +} + +#endif // VABSTRACTAPPLICATION_H diff --git a/src/libs/vmisc/vmisc.pri b/src/libs/vmisc/vmisc.pri index 658e0d301..e33858f0a 100644 --- a/src/libs/vmisc/vmisc.pri +++ b/src/libs/vmisc/vmisc.pri @@ -7,7 +7,8 @@ SOURCES += \ $$PWD/undoevent.cpp \ $$PWD/backport/qcommandlineoption.cpp \ $$PWD/backport/qcommandlineparser.cpp \ - $$PWD/vsettings.cpp + $$PWD/vsettings.cpp \ + $$PWD/vabstractapplication.cpp HEADERS += \ $$PWD/stable.h \ @@ -17,4 +18,5 @@ HEADERS += \ $$PWD/undoevent.h \ $$PWD/backport/qcommandlineoption.h \ $$PWD/backport/qcommandlineparser.h \ - $$PWD/vsettings.h + $$PWD/vsettings.h \ + $$PWD/vabstractapplication.h diff --git a/src/libs/vpatterndb/calculator.h b/src/libs/vpatterndb/calculator.h index db9dba192..9cb2b5a3f 100644 --- a/src/libs/vpatterndb/calculator.h +++ b/src/libs/vpatterndb/calculator.h @@ -30,7 +30,7 @@ #define CALCULATOR_H #include "../qmuparser/qmuparser.h" -#include "../ifc/ifcdef.h" +#include "../vmisc/def.h" class VContainer; diff --git a/src/app/core/vformula.cpp b/src/libs/vpatterndb/vformula.cpp similarity index 98% rename from src/app/core/vformula.cpp rename to src/libs/vpatterndb/vformula.cpp index 3cdca81f7..1de34fa53 100644 --- a/src/app/core/vformula.cpp +++ b/src/libs/vpatterndb/vformula.cpp @@ -27,10 +27,11 @@ *************************************************************************/ #include "vformula.h" -#include "../libs/vpatterndb/calculator.h" -#include "../libs/vpatterndb/vcontainer.h" -#include "../core/vapplication.h" -#include "../libs/vmisc/vsettings.h" +#include "calculator.h" +#include "vcontainer.h" +#include "../vmisc/vabstractapplication.h" +#include "../vmisc/vsettings.h" +#include "vtranslatevars.h" #include //VFormula diff --git a/src/app/core/vformula.h b/src/libs/vpatterndb/vformula.h similarity index 100% rename from src/app/core/vformula.h rename to src/libs/vpatterndb/vformula.h diff --git a/src/libs/vpatterndb/vpatterndb.pri b/src/libs/vpatterndb/vpatterndb.pri index 5cf261312..97e7281c6 100644 --- a/src/libs/vpatterndb/vpatterndb.pri +++ b/src/libs/vpatterndb/vpatterndb.pri @@ -21,7 +21,8 @@ SOURCES += \ $$PWD/variables/vmeasurement.cpp \ $$PWD/variables/vsplineangle.cpp \ $$PWD/variables/vsplinelength.cpp \ - $$PWD/variables/vvariable.cpp + $$PWD/variables/vvariable.cpp \ + $$PWD/vformula.cpp HEADERS += \ $$PWD/vcontainer.h \ @@ -54,4 +55,5 @@ HEADERS += \ $$PWD/variables/vsplineangle.h \ $$PWD/variables/vsplinelength.h \ $$PWD/variables/vvariable.h \ - $$PWD/variables/vvariable_p.h + $$PWD/variables/vvariable_p.h \ + $$PWD/vformula.h From b39546565901aa965979461e7090ba46ec9a1c37 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 18 Jun 2015 11:49:25 +0300 Subject: [PATCH 20/22] Rename getSettings. --HG-- branch : feature --- src/app/core/vapplication.cpp | 4 +- src/app/dialogs/app/configdialog.cpp | 4 +- .../dialogs/app/configpages/communitypage.cpp | 40 +++++++------- .../app/configpages/configurationpage.cpp | 36 ++++++------- src/app/dialogs/app/configpages/pathpage.cpp | 32 +++++------ .../dialogs/app/configpages/patternpage.cpp | 12 ++--- src/app/dialogs/app/dialogaboutapp.cpp | 2 +- src/app/dialogs/app/dialoghistory.cpp | 2 +- src/app/dialogs/app/dialogincrements.cpp | 6 +-- .../app/dialogindividualmeasurements.cpp | 8 +-- src/app/dialogs/app/dialoglayoutprogress.cpp | 2 +- src/app/dialogs/app/dialoglayoutsettings.cpp | 50 ++++++++--------- src/app/dialogs/app/dialogmeasurements.cpp | 2 +- .../dialogs/app/dialogpatternproperties.cpp | 2 +- src/app/dialogs/app/dialogpatternxmledit.cpp | 2 +- src/app/dialogs/app/dialogsavelayout.cpp | 4 +- .../app/dialogstandardmeasurements.cpp | 4 +- src/app/dialogs/app/dialogundo.cpp | 2 +- src/app/dialogs/tools/dialogalongline.cpp | 2 +- src/app/dialogs/tools/dialogarc.cpp | 6 +-- src/app/dialogs/tools/dialogarcwithlength.cpp | 6 +-- src/app/dialogs/tools/dialogbisector.cpp | 2 +- .../tools/dialogcurveintersectaxis.cpp | 2 +- src/app/dialogs/tools/dialogcutarc.cpp | 2 +- src/app/dialogs/tools/dialogcutspline.cpp | 2 +- src/app/dialogs/tools/dialogcutsplinepath.cpp | 2 +- .../dialogs/tools/dialogeditwrongformula.cpp | 2 +- src/app/dialogs/tools/dialogendline.cpp | 4 +- .../dialogs/tools/dialoglineintersectaxis.cpp | 2 +- src/app/dialogs/tools/dialognormal.cpp | 2 +- .../tools/dialogpointfromcircleandtangent.cpp | 2 +- .../dialogs/tools/dialogpointofcontact.cpp | 2 +- .../dialogpointofintersectioncircles.cpp | 4 +- src/app/dialogs/tools/dialogshoulderpoint.cpp | 2 +- src/app/dialogs/tools/dialogtool.cpp | 2 +- src/app/dialogs/tools/dialogtool.h | 2 +- src/app/mainwindow.cpp | 54 +++++++++---------- src/app/mainwindowsnogui.cpp | 6 +-- src/app/tools/vabstracttool.cpp | 4 +- src/app/visualization/visualization.cpp | 2 +- src/app/xml/vpattern.cpp | 4 +- src/libs/vmisc/vabstractapplication.cpp | 2 +- src/libs/vmisc/vabstractapplication.h | 4 +- src/libs/vpatterndb/vformula.cpp | 4 +- 44 files changed, 171 insertions(+), 171 deletions(-) diff --git a/src/app/core/vapplication.cpp b/src/app/core/vapplication.cpp index cd70f6d5f..943ce03f2 100644 --- a/src/app/core/vapplication.cpp +++ b/src/app/core/vapplication.cpp @@ -499,7 +499,7 @@ void VApplication::InitOptions() qDebug()<<"Command-line arguments:"<arguments(); qDebug()<<"Process ID:"<applicationPid(); - const QString checkedLocale = getSettings()->GetLocale(); + const QString checkedLocale = Settings()->GetLocale(); qDebug()<<"Checked locale:"<setFixedSize(QSize(750, 550)); - qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + qApp->Settings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); } //--------------------------------------------------------------------------------------------------------------------- @@ -157,7 +157,7 @@ void ConfigDialog::Apply() default: break; } - qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + qApp->Settings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); emit UpdateProperties(); setResult(QDialog::Accepted); } diff --git a/src/app/dialogs/app/configpages/communitypage.cpp b/src/app/dialogs/app/configpages/communitypage.cpp index f770e9ff9..abfe41366 100644 --- a/src/app/dialogs/app/configpages/communitypage.cpp +++ b/src/app/dialogs/app/configpages/communitypage.cpp @@ -58,17 +58,17 @@ CommunityPage::CommunityPage(QWidget *parent): //--------------------------------------------------------------------------------------------------------------------- void CommunityPage::Apply() { - qApp->getSettings()->SetServer(this->server->text()); - qApp->getSettings()->SetServerSecure(this->secureComm->isChecked()); - qApp->getSettings()->SetProxy(this->useProxy->isChecked()); - qApp->getSettings()->SetProxyAddress(this->proxyAddress->text()); - qApp->getSettings()->SetProxyPort(this->proxyPort->text()); - qApp->getSettings()->SetProxyUser(this->proxyUser->text()); - qApp->getSettings()->SetProxyPass(this->proxyPass->text()); + qApp->Settings()->SetServer(this->server->text()); + qApp->Settings()->SetServerSecure(this->secureComm->isChecked()); + qApp->Settings()->SetProxy(this->useProxy->isChecked()); + qApp->Settings()->SetProxyAddress(this->proxyAddress->text()); + qApp->Settings()->SetProxyPort(this->proxyPort->text()); + qApp->Settings()->SetProxyUser(this->proxyUser->text()); + qApp->Settings()->SetProxyPass(this->proxyPass->text()); - qApp->getSettings()->SetUsername(this->username->text()); - qApp->getSettings()->SetSavePassword(this->savePassword->isChecked()); - qApp->getSettings()->SetUserPassword(this->userpassword->text()); + qApp->Settings()->SetUsername(this->username->text()); + qApp->Settings()->SetSavePassword(this->savePassword->isChecked()); + qApp->Settings()->SetUserPassword(this->userpassword->text()); } @@ -103,9 +103,9 @@ QGroupBox *CommunityPage::ServerGroup() QGroupBox *ServerGroup = new QGroupBox(tr("Server")); QFormLayout *serverLayout = new QFormLayout; - CommunityPage::add_lineedit(&this->server, serverLayout, qApp->getSettings()->GetServer(), tr("Server name/IP")); + CommunityPage::add_lineedit(&this->server, serverLayout, qApp->Settings()->GetServer(), tr("Server name/IP")); - CommunityPage::add_checkbox(&this->secureComm, serverLayout, qApp->getSettings()->GetServerSecure(), + CommunityPage::add_checkbox(&this->secureComm, serverLayout, qApp->Settings()->GetServerSecure(), tr("Secure connection")); ServerGroup->setLayout(serverLayout); @@ -137,12 +137,12 @@ QGroupBox *CommunityPage::ProxyGroup() QFormLayout *proxyLayout = new QFormLayout; - CommunityPage::add_checkbox(&this->useProxy, proxyLayout, qApp->getSettings()->GetProxy(), tr("Use Proxy")); - CommunityPage::add_lineedit(&this->proxyAddress, proxyLayout, qApp->getSettings()->GetProxyAddress(), + CommunityPage::add_checkbox(&this->useProxy, proxyLayout, qApp->Settings()->GetProxy(), tr("Use Proxy")); + CommunityPage::add_lineedit(&this->proxyAddress, proxyLayout, qApp->Settings()->GetProxyAddress(), tr("Proxy address")); - CommunityPage::add_lineedit(&this->proxyPort, proxyLayout, qApp->getSettings()->GetProxyPort(), tr("Proxy port")); - CommunityPage::add_lineedit(&this->proxyUser, proxyLayout, qApp->getSettings()->GetProxyUser(), tr("Proxy user")); - CommunityPage::add_lineedit(&this->proxyPass, proxyLayout, qApp->getSettings()->GetProxyPass(), tr("Proxy pass")); + CommunityPage::add_lineedit(&this->proxyPort, proxyLayout, qApp->Settings()->GetProxyPort(), tr("Proxy port")); + CommunityPage::add_lineedit(&this->proxyUser, proxyLayout, qApp->Settings()->GetProxyUser(), tr("Proxy user")); + CommunityPage::add_lineedit(&this->proxyPass, proxyLayout, qApp->Settings()->GetProxyPass(), tr("Proxy pass")); connect(this->useProxy, &QCheckBox::stateChanged, this, &CommunityPage::ProxyCheckChanged); this->ProxyCheckChanged(); @@ -157,10 +157,10 @@ QGroupBox *CommunityPage::UserGroup() QGroupBox *userGroup = new QGroupBox(tr("User settings")); QFormLayout *userLayout = new QFormLayout; - CommunityPage::add_lineedit(&this->username, userLayout, qApp->getSettings()->GetUsername(), tr("User Name")); - CommunityPage::add_checkbox(&this->savePassword, userLayout, qApp->getSettings()->GetSavePassword(), + CommunityPage::add_lineedit(&this->username, userLayout, qApp->Settings()->GetUsername(), tr("User Name")); + CommunityPage::add_checkbox(&this->savePassword, userLayout, qApp->Settings()->GetSavePassword(), tr("Save password")); - CommunityPage::add_lineedit(&this->userpassword, userLayout, qApp->getSettings()->GetUserPassword(), + CommunityPage::add_lineedit(&this->userpassword, userLayout, qApp->Settings()->GetUserPassword(), tr("Password")); connect(this->savePassword, &QCheckBox::stateChanged, this, &CommunityPage::PasswordCheckChanged); diff --git a/src/app/dialogs/app/configpages/configurationpage.cpp b/src/app/dialogs/app/configpages/configurationpage.cpp index b394ab1d1..284c1ec17 100644 --- a/src/app/dialogs/app/configpages/configurationpage.cpp +++ b/src/app/dialogs/app/configpages/configurationpage.cpp @@ -67,23 +67,23 @@ ConfigurationPage::ConfigurationPage(QWidget *parent) //--------------------------------------------------------------------------------------------------------------------- void ConfigurationPage::Apply() { - qApp->getSettings()->SetAutosaveState(autoSaveCheck->isChecked()); - qApp->getSettings()->SetAutosaveTime(autoTime->value()); + qApp->Settings()->SetAutosaveState(autoSaveCheck->isChecked()); + qApp->Settings()->SetAutosaveTime(autoTime->value()); QTimer *autoSaveTimer = qApp->getAutoSaveTimer(); SCASSERT(autoSaveTimer); autoSaveCheck->isChecked() ? autoSaveTimer->start(autoTime->value()*60000) : autoSaveTimer->stop(); - qApp->getSettings()->SetOsSeparator(osOptionCheck->isChecked()); - qApp->getSettings()->SetSendReportState(sendReportCheck->isChecked()); - qApp->getSettings()->SetConfirmItemDelete(askPointDeletionCheck->isChecked()); - qApp->getSettings()->SetToolBarStyle(toolBarStyleCheck->isChecked()); + qApp->Settings()->SetOsSeparator(osOptionCheck->isChecked()); + qApp->Settings()->SetSendReportState(sendReportCheck->isChecked()); + qApp->Settings()->SetConfirmItemDelete(askPointDeletionCheck->isChecked()); + qApp->Settings()->SetToolBarStyle(toolBarStyleCheck->isChecked()); if (langChanged) { const QString locale = qvariant_cast(langCombo->itemData(langCombo->currentIndex())); - qApp->getSettings()->SetLocale(locale); + qApp->Settings()->SetLocale(locale); langChanged = false; const QString text = tr("Setup user interface language updated and will be used the next time start") + " " + QApplication::applicationName(); @@ -92,7 +92,7 @@ void ConfigurationPage::Apply() if (this->unitChanged) { const QString unit = qvariant_cast(this->unitCombo->itemData(this->unitCombo->currentIndex())); - qApp->getSettings()->SetUnit(unit); + qApp->Settings()->SetUnit(unit); this->unitChanged = false; const QString text = tr("Default unit updated and will be used the next pattern creation"); QMessageBox::information(this, QApplication::applicationName(), text); @@ -100,7 +100,7 @@ void ConfigurationPage::Apply() if (labelLangChanged) { const QString locale = qvariant_cast(labelCombo->itemData(labelCombo->currentIndex())); - qApp->getSettings()->SetLabelLanguage(locale); + qApp->Settings()->SetLabelLanguage(locale); labelLangChanged = false; } } @@ -129,11 +129,11 @@ QGroupBox *ConfigurationPage::SaveGroup() QGroupBox *saveGroup = new QGroupBox(tr("Save")); autoSaveCheck = new QCheckBox(tr("Auto-save modified pattern")); - autoSaveCheck->setChecked(qApp->getSettings()->GetAutosaveState()); + autoSaveCheck->setChecked(qApp->Settings()->GetAutosaveState()); autoTime = new QSpinBox(); autoTime->setRange(1, 60); - autoTime->setValue(qApp->getSettings()->GetAutosaveTime()); + autoTime->setValue(qApp->Settings()->GetAutosaveTime()); autoTime->setSuffix(tr("min")); QHBoxLayout *autosaveLayout = new QHBoxLayout; @@ -181,7 +181,7 @@ QGroupBox *ConfigurationPage::LangGroup() } // set default translators and language checked - qint32 index = langCombo->findData(qApp->getSettings()->GetLocale()); + qint32 index = langCombo->findData(qApp->Settings()->GetLocale()); if (index != -1) { langCombo->setCurrentIndex(index); @@ -197,7 +197,7 @@ QGroupBox *ConfigurationPage::LangGroup() QLabel *separatorLabel = new QLabel(tr("Decimal separator parts")); osOptionCheck = new QCheckBox(tr("With OS options (%1)").arg(QLocale::system().decimalPoint().toLatin1())); - osOptionCheck->setChecked(qApp->getSettings()->GetOsSeparator()); + osOptionCheck->setChecked(qApp->Settings()->GetOsSeparator()); QHBoxLayout *separatorLayout = new QHBoxLayout; separatorLayout->addWidget(separatorLabel); @@ -212,7 +212,7 @@ QGroupBox *ConfigurationPage::LangGroup() this->unitCombo->addItem(tr("Inches"), "in"); // set default unit - qint32 indexUnit = this->unitCombo->findData(qApp->getSettings()->GetUnit()); + qint32 indexUnit = this->unitCombo->findData(qApp->Settings()->GetUnit()); if (indexUnit != -1) { this->unitCombo->setCurrentIndex(indexUnit); @@ -231,7 +231,7 @@ QGroupBox *ConfigurationPage::LangGroup() SetLabelComboBox(VApplication::LabelLanguages()); - index = labelCombo->findData(qApp->getSettings()->GetLabelLanguage()); + index = labelCombo->findData(qApp->Settings()->GetLabelLanguage()); if (index != -1) { labelCombo->setCurrentIndex(index); @@ -261,7 +261,7 @@ QGroupBox *ConfigurationPage::SendGroup() QGroupBox *sendGroup = new QGroupBox(tr("Send crash reports")); sendReportCheck = new QCheckBox(tr("Send crash reports (recommended)")); - sendReportCheck->setChecked(qApp->getSettings()->GetSendReportState()); + sendReportCheck->setChecked(qApp->Settings()->GetSendReportState()); QLabel *description = new QLabel(tr("After each crash Valentina collect information that may help us fix a " "problem. We do not collect any personal information. Find more about what " @@ -286,7 +286,7 @@ QGroupBox *ConfigurationPage::DrawGroup() QGroupBox *drawGroup = new QGroupBox(tr("Pattern Editing")); askPointDeletionCheck = new QCheckBox(tr("Confirm item deletion")); - askPointDeletionCheck->setChecked(qApp->getSettings()->GetConfirmItemDelete()); + askPointDeletionCheck->setChecked(qApp->Settings()->GetConfirmItemDelete()); QVBoxLayout *editLayout = new QVBoxLayout; editLayout->addWidget(askPointDeletionCheck); @@ -301,7 +301,7 @@ QGroupBox *ConfigurationPage::ToolBarGroup() QGroupBox *toolBarGroup = new QGroupBox(tr("Toolbar")); toolBarStyleCheck = new QCheckBox(tr("The text appears under the icon. (recommended for beginners.)")); - toolBarStyleCheck->setChecked(qApp->getSettings()->GetToolBarStyle()); + toolBarStyleCheck->setChecked(qApp->Settings()->GetToolBarStyle()); QVBoxLayout *editLayout = new QVBoxLayout; editLayout->addWidget(toolBarStyleCheck); diff --git a/src/app/dialogs/app/configpages/pathpage.cpp b/src/app/dialogs/app/configpages/pathpage.cpp index 4ffe3cd6a..b08012b92 100644 --- a/src/app/dialogs/app/configpages/pathpage.cpp +++ b/src/app/dialogs/app/configpages/pathpage.cpp @@ -62,10 +62,10 @@ PathPage::PathPage(QWidget *parent) //--------------------------------------------------------------------------------------------------------------------- void PathPage::Apply() { - qApp->getSettings()->SetPathIndividualMeasurements(pathTable->item(0, 1)->text()); - qApp->getSettings()->SetPathStandardMeasurements(pathTable->item(1, 1)->text()); - qApp->getSettings()->SetPathPattern(pathTable->item(2, 1)->text()); - qApp->getSettings()->SetPathLayout(pathTable->item(3, 1)->text()); + qApp->Settings()->SetPathIndividualMeasurements(pathTable->item(0, 1)->text()); + qApp->Settings()->SetPathStandardMeasurements(pathTable->item(1, 1)->text()); + qApp->Settings()->SetPathPattern(pathTable->item(2, 1)->text()); + qApp->Settings()->SetPathLayout(pathTable->item(3, 1)->text()); } //--------------------------------------------------------------------------------------------------------------------- @@ -113,16 +113,16 @@ void PathPage::EditPath() switch (row) { case 0: // individual measurements - path = qApp->getSettings()->GetPathIndividualMeasurements(); + path = qApp->Settings()->GetPathIndividualMeasurements(); break; case 1: // standard measurements - path = qApp->getSettings()->GetPathStandardMeasurements(); + path = qApp->Settings()->GetPathStandardMeasurements(); break; case 2: // pattern path - path = qApp->getSettings()->GetPathPattern(); + path = qApp->Settings()->GetPathPattern(); break; case 3: // layout path - path = qApp->getSettings()->GetPathLayout(); + path = qApp->Settings()->GetPathLayout(); break; default: break; @@ -182,29 +182,29 @@ void PathPage::InitTable() { pathTable->setItem(0, 0, new QTableWidgetItem(tr("Individual measurements"))); - QTableWidgetItem *item = new QTableWidgetItem(qApp->getSettings()->GetPathIndividualMeasurements()); - item->setToolTip(qApp->getSettings()->GetPathIndividualMeasurements()); + QTableWidgetItem *item = new QTableWidgetItem(qApp->Settings()->GetPathIndividualMeasurements()); + item->setToolTip(qApp->Settings()->GetPathIndividualMeasurements()); pathTable->setItem(0, 1, item); } { pathTable->setItem(1, 0, new QTableWidgetItem(tr("Standard measurements"))); - QTableWidgetItem *item = new QTableWidgetItem(qApp->getSettings()->GetPathStandardMeasurements()); - item->setToolTip(qApp->getSettings()->GetPathStandardMeasurements()); + QTableWidgetItem *item = new QTableWidgetItem(qApp->Settings()->GetPathStandardMeasurements()); + item->setToolTip(qApp->Settings()->GetPathStandardMeasurements()); pathTable->setItem(1, 1, item); } { pathTable->setItem(2, 0, new QTableWidgetItem(tr("Patterns"))); - QTableWidgetItem *item = new QTableWidgetItem(qApp->getSettings()->GetPathPattern()); - item->setToolTip(qApp->getSettings()->GetPathPattern()); + QTableWidgetItem *item = new QTableWidgetItem(qApp->Settings()->GetPathPattern()); + item->setToolTip(qApp->Settings()->GetPathPattern()); pathTable->setItem(2, 1, item); } { pathTable->setItem(3, 0, new QTableWidgetItem(tr("Layout"))); - QTableWidgetItem *item = new QTableWidgetItem(qApp->getSettings()->GetPathLayout()); - item->setToolTip(qApp->getSettings()->GetPathLayout()); + QTableWidgetItem *item = new QTableWidgetItem(qApp->Settings()->GetPathLayout()); + item->setToolTip(qApp->Settings()->GetPathLayout()); pathTable->setItem(3, 1, item); } diff --git a/src/app/dialogs/app/configpages/patternpage.cpp b/src/app/dialogs/app/configpages/patternpage.cpp index a5a522bbc..43dd141ee 100644 --- a/src/app/dialogs/app/configpages/patternpage.cpp +++ b/src/app/dialogs/app/configpages/patternpage.cpp @@ -58,17 +58,17 @@ PatternPage::PatternPage(QWidget *parent): //--------------------------------------------------------------------------------------------------------------------- void PatternPage::Apply() { - qApp->getSettings()->SetUser(userName->text()); + qApp->Settings()->SetUser(userName->text()); // Scene antialiasing - qApp->getSettings()->SetGraphicalOutput(graphOutputCheck->isChecked()); + qApp->Settings()->SetGraphicalOutput(graphOutputCheck->isChecked()); qApp->getSceneView()->setRenderHint(QPainter::Antialiasing, graphOutputCheck->isChecked()); qApp->getSceneView()->setRenderHint(QPainter::SmoothPixmapTransform, graphOutputCheck->isChecked()); /* Maximum number of commands in undo stack may only be set when the undo stack is empty, since setting it on a * non-empty stack might delete the command at the current index. Calling setUndoLimit() on a non-empty stack * prints a warning and does nothing.*/ - qApp->getSettings()->SetUndoCount(undoCount->value()); + qApp->Settings()->SetUndoCount(undoCount->value()); } //--------------------------------------------------------------------------------------------------------------------- @@ -78,7 +78,7 @@ QGroupBox *PatternPage::UserGroup() QLabel *nameLabel = new QLabel(tr("User name")); userName = new QLineEdit; - userName->setText(qApp->getSettings()->GetUser()); + userName->setText(qApp->Settings()->GetUser()); QHBoxLayout *nameLayout = new QHBoxLayout; nameLayout->addWidget(nameLabel); @@ -96,7 +96,7 @@ QGroupBox *PatternPage::GraphOutputGroup() QGroupBox *graphOutputGroup = new QGroupBox(tr("Graphical output")); graphOutputCheck = new QCheckBox(tr("Use antialiasing")); - graphOutputCheck->setChecked(qApp->getSettings()->GetGraphicalOutput()); + graphOutputCheck->setChecked(qApp->Settings()->GetGraphicalOutput()); QHBoxLayout *graphLayout = new QHBoxLayout; graphLayout->addWidget(graphOutputCheck); @@ -114,7 +114,7 @@ QGroupBox *PatternPage::UndoGroup() QLabel *undoLabel = new QLabel(tr("Count steps (0 - no limit)")); undoCount = new QSpinBox; undoCount->setMinimum(0); - undoCount->setValue(qApp->getSettings()->GetUndoCount()); + undoCount->setValue(qApp->Settings()->GetUndoCount()); QHBoxLayout *countLayout = new QHBoxLayout; countLayout->addWidget(undoLabel); diff --git a/src/app/dialogs/app/dialogaboutapp.cpp b/src/app/dialogs/app/dialogaboutapp.cpp index c27706168..133341bef 100644 --- a/src/app/dialogs/app/dialogaboutapp.cpp +++ b/src/app/dialogs/app/dialogaboutapp.cpp @@ -42,7 +42,7 @@ DialogAboutApp::DialogAboutApp(QWidget *parent) : { ui->setupUi(this); - qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + qApp->Settings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); ui->label_Valentina_Version->setText(QString("Valentina %1").arg(APP_VERSION_STR)); ui->labelBuildRevision->setText(QString("Build revision: %1").arg(BUILD_REVISION)); diff --git a/src/app/dialogs/app/dialoghistory.cpp b/src/app/dialogs/app/dialoghistory.cpp index c5d5ba4f6..b8ab94a54 100644 --- a/src/app/dialogs/app/dialoghistory.cpp +++ b/src/app/dialogs/app/dialoghistory.cpp @@ -50,7 +50,7 @@ DialogHistory::DialogHistory(VContainer *data, VPattern *doc, QWidget *parent) { ui->setupUi(this); - qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + qApp->Settings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); bOk = ui->buttonBox->button(QDialogButtonBox::Ok); connect(bOk, &QPushButton::clicked, this, &DialogHistory::DialogAccepted); diff --git a/src/app/dialogs/app/dialogincrements.cpp b/src/app/dialogs/app/dialogincrements.cpp index 4841a4705..9339416e1 100644 --- a/src/app/dialogs/app/dialogincrements.cpp +++ b/src/app/dialogs/app/dialogincrements.cpp @@ -56,7 +56,7 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par { ui->setupUi(this); - qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + qApp->Settings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); qCDebug(vDialog, "Showing variables."); if (qApp->patternType() == MeasurementsType::Individual) @@ -613,7 +613,7 @@ void DialogIncrements::OpenTable() const QString filter(tr("Individual measurements (*.vit)")); //Use standard path to individual measurements - const QString path = qApp->getSettings()->GetPathIndividualMeasurements(); + const QString path = qApp->Settings()->GetPathIndividualMeasurements(); const QString filePath = QFileDialog::getOpenFileName(this, tr("Open file"), path, filter); if (filePath.isEmpty()) @@ -656,7 +656,7 @@ void DialogIncrements::OpenTable() { const QString filter(tr("Standard measurements (*.vst)")); //Use standard path to standard measurements - const QString path = qApp->getSettings()->GetPathStandardMeasurements(); + const QString path = qApp->Settings()->GetPathStandardMeasurements(); const QString filePath = QFileDialog::getOpenFileName(this, tr("Open file"), path, filter); if (filePath.isEmpty()) { diff --git a/src/app/dialogs/app/dialogindividualmeasurements.cpp b/src/app/dialogs/app/dialogindividualmeasurements.cpp index 7ee0ba41a..0f55478ac 100644 --- a/src/app/dialogs/app/dialogindividualmeasurements.cpp +++ b/src/app/dialogs/app/dialogindividualmeasurements.cpp @@ -47,7 +47,7 @@ DialogIndividualMeasurements::DialogIndividualMeasurements(VContainer *data, con { ui->setupUi(this); - qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + qApp->Settings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); QRect position = this->frameGeometry(); position.moveCenter(QDesktopWidget().availableGeometry().center()); @@ -199,7 +199,7 @@ void DialogIndividualMeasurements::CheckState() void DialogIndividualMeasurements::OpenTable() { const QString filter(tr("Individual measurements (*.vit)")); - const QString path = qApp->getSettings()->GetPathIndividualMeasurements(); + const QString path = qApp->Settings()->GetPathIndividualMeasurements(); QString fileName = QFileDialog::getOpenFileName(this, tr("Open file"), path, filter); if (fileName.isEmpty()) @@ -228,7 +228,7 @@ void DialogIndividualMeasurements::OpenTable() //--------------------------------------------------------------------------------------------------------------------- void DialogIndividualMeasurements::NewTable() { - const QString dir = qApp->getSettings()->GetPathIndividualMeasurements()+"/measurements.vit"; + const QString dir = qApp->Settings()->GetPathIndividualMeasurements()+"/measurements.vit"; QString name = QFileDialog::getSaveFileName(this, tr("Where save measurements?"), dir, tr("Individual measurements (*.vit)")); @@ -256,7 +256,7 @@ void DialogIndividualMeasurements::InitUnits() ui->comboBoxUnits->addItem(tr("Inches"), QVariant(VDomDocument::UnitsToStr(Unit::Inch))); // set default unit - const qint32 indexUnit = ui->comboBoxUnits->findData(qApp->getSettings()->GetUnit()); + const qint32 indexUnit = ui->comboBoxUnits->findData(qApp->Settings()->GetUnit()); if (indexUnit != -1) { ui->comboBoxUnits->setCurrentIndex(indexUnit); diff --git a/src/app/dialogs/app/dialoglayoutprogress.cpp b/src/app/dialogs/app/dialoglayoutprogress.cpp index ed326f51d..3e1a21977 100644 --- a/src/app/dialogs/app/dialoglayoutprogress.cpp +++ b/src/app/dialogs/app/dialoglayoutprogress.cpp @@ -41,7 +41,7 @@ DialogLayoutProgress::DialogLayoutProgress(int count, QWidget *parent) { ui->setupUi(this); - qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + qApp->Settings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); ui->progressBar->setMaximum(maxCount); ui->progressBar->setValue(0); diff --git a/src/app/dialogs/app/dialoglayoutsettings.cpp b/src/app/dialogs/app/dialoglayoutsettings.cpp index 7f8cb65f8..da245ed6c 100644 --- a/src/app/dialogs/app/dialoglayoutsettings.cpp +++ b/src/app/dialogs/app/dialoglayoutsettings.cpp @@ -52,7 +52,7 @@ DialogLayoutSettings::DialogLayoutSettings(VLayoutGenerator *generator, QWidget { ui->setupUi(this); - qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + qApp->Settings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); ReadSettings(); @@ -359,8 +359,8 @@ void DialogLayoutSettings::InitPaperUnits() ui->comboBoxPaperSizeUnit->addItem(tr("Pixels"), QVariant(VDomDocument::UnitsToStr(Unit::Px))); // set default unit - oldPaperUnit = VDomDocument::StrToUnits(qApp->getSettings()->GetUnit()); - const qint32 indexUnit = ui->comboBoxPaperSizeUnit->findData(qApp->getSettings()->GetUnit()); + oldPaperUnit = VDomDocument::StrToUnits(qApp->Settings()->GetUnit()); + const qint32 indexUnit = ui->comboBoxPaperSizeUnit->findData(qApp->Settings()->GetUnit()); if (indexUnit != -1) { ui->comboBoxPaperSizeUnit->setCurrentIndex(indexUnit); @@ -375,8 +375,8 @@ void DialogLayoutSettings::InitLayoutUnits() ui->comboBoxLayoutUnit->addItem(tr("Inches"), QVariant(VDomDocument::UnitsToStr(Unit::Inch))); // set default unit - oldLayoutUnit = VDomDocument::StrToUnits(qApp->getSettings()->GetUnit()); - const qint32 indexUnit = ui->comboBoxLayoutUnit->findData(qApp->getSettings()->GetUnit()); + oldLayoutUnit = VDomDocument::StrToUnits(qApp->Settings()->GetUnit()); + const qint32 indexUnit = ui->comboBoxLayoutUnit->findData(qApp->Settings()->GetUnit()); if (indexUnit != -1) { ui->comboBoxLayoutUnit->setCurrentIndex(indexUnit); @@ -607,33 +607,33 @@ void DialogLayoutSettings::ReadSettings() MinimumPaperSize(); MinimumLayoutSize(); - SetLayoutWidth(qApp->getSettings()->GetLayoutWidth()); - SetShift(qApp->getSettings()->GetLayoutShift()); + SetLayoutWidth(qApp->Settings()->GetLayoutWidth()); + SetShift(qApp->Settings()->GetLayoutShift()); - const qreal width = UnitConvertor(qApp->getSettings()->GetLayoutPaperWidth(), Unit::Px, LayoutUnit()); - const qreal height = UnitConvertor(qApp->getSettings()->GetLayoutPaperHeight(), Unit::Px, LayoutUnit()); + const qreal width = UnitConvertor(qApp->Settings()->GetLayoutPaperWidth(), Unit::Px, LayoutUnit()); + const qreal height = UnitConvertor(qApp->Settings()->GetLayoutPaperHeight(), Unit::Px, LayoutUnit()); SheetSize(QSizeF(width, height)); - SetGroup(qApp->getSettings()->GetLayoutGroup()); - SetRotate(qApp->getSettings()->GetLayoutRotate()); - SetIncrease(qApp->getSettings()->GetLayoutRotationIncrease()); - SetAutoCrop(qApp->getSettings()->GetLayoutAutoCrop()); - SetSaveLength(qApp->getSettings()->GetLayoutSaveLength()); - SetUnitePages(qApp->getSettings()->GetLayoutUnitePages()); + SetGroup(qApp->Settings()->GetLayoutGroup()); + SetRotate(qApp->Settings()->GetLayoutRotate()); + SetIncrease(qApp->Settings()->GetLayoutRotationIncrease()); + SetAutoCrop(qApp->Settings()->GetLayoutAutoCrop()); + SetSaveLength(qApp->Settings()->GetLayoutSaveLength()); + SetUnitePages(qApp->Settings()->GetLayoutUnitePages()); } //--------------------------------------------------------------------------------------------------------------------- void DialogLayoutSettings::WriteSettings() const { - qApp->getSettings()->SetLayoutWidth(GetLayoutWidth()); - qApp->getSettings()->SetLayoutGroup(GetGroup()); - qApp->getSettings()->SetLayoutPaperHeight(GetPaperHeight()); - qApp->getSettings()->SetLayoutPaperWidth(GetPaperWidth()); - qApp->getSettings()->SetLayoutShift(GetShift()); - qApp->getSettings()->SetLayoutRotate(GetRotate()); - qApp->getSettings()->SetLayoutRotationIncrease(GetIncrease()); - qApp->getSettings()->SetLayoutAutoCrop(GetAutoCrop()); - qApp->getSettings()->SetLayoutSaveLength(IsSaveLength()); - qApp->getSettings()->SetLayoutUnitePages(IsUnitePages()); + qApp->Settings()->SetLayoutWidth(GetLayoutWidth()); + qApp->Settings()->SetLayoutGroup(GetGroup()); + qApp->Settings()->SetLayoutPaperHeight(GetPaperHeight()); + qApp->Settings()->SetLayoutPaperWidth(GetPaperWidth()); + qApp->Settings()->SetLayoutShift(GetShift()); + qApp->Settings()->SetLayoutRotate(GetRotate()); + qApp->Settings()->SetLayoutRotationIncrease(GetIncrease()); + qApp->Settings()->SetLayoutAutoCrop(GetAutoCrop()); + qApp->Settings()->SetLayoutSaveLength(IsSaveLength()); + qApp->Settings()->SetLayoutUnitePages(IsUnitePages()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/app/dialogmeasurements.cpp b/src/app/dialogs/app/dialogmeasurements.cpp index c9d49c8fa..f68ce2b68 100644 --- a/src/app/dialogs/app/dialogmeasurements.cpp +++ b/src/app/dialogs/app/dialogmeasurements.cpp @@ -36,7 +36,7 @@ DialogMeasurements::DialogMeasurements(QWidget *parent) : { ui->setupUi(this); - qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + qApp->Settings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); connect(ui->toolButtonStandard, &QToolButton::clicked, this, &DialogMeasurements::StandardMeasurements); connect(ui->toolButtonIndividual, &QToolButton::clicked, this, &DialogMeasurements::IndividualMeasurements); diff --git a/src/app/dialogs/app/dialogpatternproperties.cpp b/src/app/dialogs/app/dialogpatternproperties.cpp index 0cea50d57..c696e4e40 100644 --- a/src/app/dialogs/app/dialogpatternproperties.cpp +++ b/src/app/dialogs/app/dialogpatternproperties.cpp @@ -45,7 +45,7 @@ DialogPatternProperties::DialogPatternProperties(VPattern *doc, QWidget *parent) SCASSERT(doc != nullptr); - qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + qApp->Settings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); ui->lineEditAuthor->setText(doc->GetAuthor()); connect(ui->lineEditAuthor, &QLineEdit::editingFinished, this, &DialogPatternProperties::DescEdited); diff --git a/src/app/dialogs/app/dialogpatternxmledit.cpp b/src/app/dialogs/app/dialogpatternxmledit.cpp index 55c45f6fe..a0bebec2b 100644 --- a/src/app/dialogs/app/dialogpatternxmledit.cpp +++ b/src/app/dialogs/app/dialogpatternxmledit.cpp @@ -46,7 +46,7 @@ DialogPatternXmlEdit::DialogPatternXmlEdit(QWidget *parent, VPattern *xmldoc) { ui->setupUi(this); - qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + qApp->Settings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); this->xmlmodel = new VXMLTreeView(); this->doc=xmldoc; diff --git a/src/app/dialogs/app/dialogsavelayout.cpp b/src/app/dialogs/app/dialogsavelayout.cpp index c0cc09bc3..41259902c 100644 --- a/src/app/dialogs/app/dialogsavelayout.cpp +++ b/src/app/dialogs/app/dialogsavelayout.cpp @@ -43,7 +43,7 @@ DialogSaveLayout::DialogSaveLayout(const QMap &formates, int c { ui->setupUi(this); - qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + qApp->Settings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); QPushButton *bOk = ui->buttonBox->button(QDialogButtonBox::Ok); SCASSERT(bOk != nullptr); @@ -67,7 +67,7 @@ DialogSaveLayout::DialogSaveLayout(const QMap &formates, int c connect(ui->pushButtonBrowse, &QPushButton::clicked, this, &DialogSaveLayout::Browse); connect(ui->lineEditPath, &QLineEdit::textChanged, this, &DialogSaveLayout::PathChanged); - ui->lineEditPath->setText(qApp->getSettings()->GetPathLayout()); + ui->lineEditPath->setText(qApp->Settings()->GetPathLayout()); ShowExample();//Show example for current format. } diff --git a/src/app/dialogs/app/dialogstandardmeasurements.cpp b/src/app/dialogs/app/dialogstandardmeasurements.cpp index bc76284ab..233beb747 100644 --- a/src/app/dialogs/app/dialogstandardmeasurements.cpp +++ b/src/app/dialogs/app/dialogstandardmeasurements.cpp @@ -47,7 +47,7 @@ DialogStandardMeasurements::DialogStandardMeasurements(VContainer *data, const Q { ui->setupUi(this); - qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + qApp->Settings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); QRect position = this->frameGeometry(); position.moveCenter(QDesktopWidget().availableGeometry().center()); @@ -153,7 +153,7 @@ void DialogStandardMeasurements::LoadStandardTables() qCDebug(vStMeasur, "Loading standard table."); QStringList filters{"*.vst"}; //Use standard path to standard measurements - const QString path = qApp->getSettings()->GetPathStandardMeasurements(); + const QString path = qApp->Settings()->GetPathStandardMeasurements(); QDir tablesDir(path); tablesDir.setNameFilters(filters); tablesDir.setCurrent(path); diff --git a/src/app/dialogs/app/dialogundo.cpp b/src/app/dialogs/app/dialogundo.cpp index 4c396efa8..c58ca6511 100644 --- a/src/app/dialogs/app/dialogundo.cpp +++ b/src/app/dialogs/app/dialogundo.cpp @@ -39,7 +39,7 @@ DialogUndo::DialogUndo(QWidget *parent) { ui->setupUi(this); - qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + qApp->Settings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); bool opening = qApp->getOpeningPattern(); if (opening) diff --git a/src/app/dialogs/tools/dialogalongline.cpp b/src/app/dialogs/tools/dialogalongline.cpp index 0f81da4ee..48cd4f89d 100644 --- a/src/app/dialogs/tools/dialogalongline.cpp +++ b/src/app/dialogs/tools/dialogalongline.cpp @@ -306,7 +306,7 @@ QString DialogAlongLine::GetTypeLine() const */ QString DialogAlongLine::GetFormula() const { - return qApp->TrVars()->FormulaFromUser(formula, qApp->getSettings()->GetOsSeparator()); + return qApp->TrVars()->FormulaFromUser(formula, qApp->Settings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogarc.cpp b/src/app/dialogs/tools/dialogarc.cpp index a5ffd15d7..d1cf87595 100644 --- a/src/app/dialogs/tools/dialogarc.cpp +++ b/src/app/dialogs/tools/dialogarc.cpp @@ -424,7 +424,7 @@ quint32 DialogArc::GetCenter() const */ QString DialogArc::GetRadius() const { - return qApp->TrVars()->FormulaFromUser(radius, qApp->getSettings()->GetOsSeparator()); + return qApp->TrVars()->FormulaFromUser(radius, qApp->Settings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- @@ -434,7 +434,7 @@ QString DialogArc::GetRadius() const */ QString DialogArc::GetF1() const { - return qApp->TrVars()->FormulaFromUser(f1, qApp->getSettings()->GetOsSeparator()); + return qApp->TrVars()->FormulaFromUser(f1, qApp->Settings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- @@ -444,5 +444,5 @@ QString DialogArc::GetF1() const */ QString DialogArc::GetF2() const { - return qApp->TrVars()->FormulaFromUser(f2, qApp->getSettings()->GetOsSeparator()); + return qApp->TrVars()->FormulaFromUser(f2, qApp->Settings()->GetOsSeparator()); } diff --git a/src/app/dialogs/tools/dialogarcwithlength.cpp b/src/app/dialogs/tools/dialogarcwithlength.cpp index f809e80ae..a47126578 100644 --- a/src/app/dialogs/tools/dialogarcwithlength.cpp +++ b/src/app/dialogs/tools/dialogarcwithlength.cpp @@ -109,7 +109,7 @@ void DialogArcWithLength::SetCenter(const quint32 &value) //--------------------------------------------------------------------------------------------------------------------- QString DialogArcWithLength::GetRadius() const { - return qApp->TrVars()->FormulaFromUser(radius, qApp->getSettings()->GetOsSeparator()); + return qApp->TrVars()->FormulaFromUser(radius, qApp->Settings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- @@ -133,7 +133,7 @@ void DialogArcWithLength::SetRadius(const QString &value) //--------------------------------------------------------------------------------------------------------------------- QString DialogArcWithLength::GetF1() const { - return qApp->TrVars()->FormulaFromUser(f1, qApp->getSettings()->GetOsSeparator()); + return qApp->TrVars()->FormulaFromUser(f1, qApp->Settings()->GetOsSeparator()); } void DialogArcWithLength::SetF1(const QString &value) @@ -156,7 +156,7 @@ void DialogArcWithLength::SetF1(const QString &value) //--------------------------------------------------------------------------------------------------------------------- QString DialogArcWithLength::GetLength() const { - return qApp->TrVars()->FormulaFromUser(length, qApp->getSettings()->GetOsSeparator()); + return qApp->TrVars()->FormulaFromUser(length, qApp->Settings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogbisector.cpp b/src/app/dialogs/tools/dialogbisector.cpp index e8c7d95c6..f22ae407b 100644 --- a/src/app/dialogs/tools/dialogbisector.cpp +++ b/src/app/dialogs/tools/dialogbisector.cpp @@ -342,7 +342,7 @@ QString DialogBisector::GetTypeLine() const */ QString DialogBisector::GetFormula() const { - return qApp->TrVars()->FormulaFromUser(formula, qApp->getSettings()->GetOsSeparator()); + return qApp->TrVars()->FormulaFromUser(formula, qApp->Settings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp b/src/app/dialogs/tools/dialogcurveintersectaxis.cpp index fd0dd5bc7..0af9b1d28 100644 --- a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp +++ b/src/app/dialogs/tools/dialogcurveintersectaxis.cpp @@ -99,7 +99,7 @@ void DialogCurveIntersectAxis::SetTypeLine(const QString &value) //--------------------------------------------------------------------------------------------------------------------- QString DialogCurveIntersectAxis::GetAngle() const { - return qApp->TrVars()->FormulaFromUser(formulaAngle, qApp->getSettings()->GetOsSeparator()); + return qApp->TrVars()->FormulaFromUser(formulaAngle, qApp->Settings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogcutarc.cpp b/src/app/dialogs/tools/dialogcutarc.cpp index 5c96add17..7025bab80 100644 --- a/src/app/dialogs/tools/dialogcutarc.cpp +++ b/src/app/dialogs/tools/dialogcutarc.cpp @@ -216,7 +216,7 @@ void DialogCutArc::SetPointName(const QString &value) */ QString DialogCutArc::GetFormula() const { - return qApp->TrVars()->FormulaFromUser(formula, qApp->getSettings()->GetOsSeparator()); + return qApp->TrVars()->FormulaFromUser(formula, qApp->Settings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogcutspline.cpp b/src/app/dialogs/tools/dialogcutspline.cpp index ed9769543..eba616608 100644 --- a/src/app/dialogs/tools/dialogcutspline.cpp +++ b/src/app/dialogs/tools/dialogcutspline.cpp @@ -210,7 +210,7 @@ void DialogCutSpline::ShowVisualization() */ QString DialogCutSpline::GetFormula() const { - return qApp->TrVars()->FormulaFromUser(formula, qApp->getSettings()->GetOsSeparator()); + return qApp->TrVars()->FormulaFromUser(formula, qApp->Settings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogcutsplinepath.cpp b/src/app/dialogs/tools/dialogcutsplinepath.cpp index 41e66f00d..3b62c85ef 100644 --- a/src/app/dialogs/tools/dialogcutsplinepath.cpp +++ b/src/app/dialogs/tools/dialogcutsplinepath.cpp @@ -210,7 +210,7 @@ void DialogCutSplinePath::ShowVisualization() */ QString DialogCutSplinePath::GetFormula() const { - return qApp->TrVars()->FormulaFromUser(formula, qApp->getSettings()->GetOsSeparator()); + return qApp->TrVars()->FormulaFromUser(formula, qApp->Settings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogeditwrongformula.cpp b/src/app/dialogs/tools/dialogeditwrongformula.cpp index 7c8b78079..ac2df7d50 100644 --- a/src/app/dialogs/tools/dialogeditwrongformula.cpp +++ b/src/app/dialogs/tools/dialogeditwrongformula.cpp @@ -385,7 +385,7 @@ void DialogEditWrongFormula::setPostfix(const QString &value) //--------------------------------------------------------------------------------------------------------------------- QString DialogEditWrongFormula::GetFormula() const { - return qApp->TrVars()->FormulaFromUser(formula, qApp->getSettings()->GetOsSeparator()); + return qApp->TrVars()->FormulaFromUser(formula, qApp->Settings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogendline.cpp b/src/app/dialogs/tools/dialogendline.cpp index 6f6e429d1..002b10a7b 100644 --- a/src/app/dialogs/tools/dialogendline.cpp +++ b/src/app/dialogs/tools/dialogendline.cpp @@ -355,7 +355,7 @@ QString DialogEndLine::GetTypeLine() const */ QString DialogEndLine::GetFormula() const { - return qApp->TrVars()->FormulaFromUser(formulaLength, qApp->getSettings()->GetOsSeparator()); + return qApp->TrVars()->FormulaFromUser(formulaLength, qApp->Settings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- @@ -365,7 +365,7 @@ QString DialogEndLine::GetFormula() const */ QString DialogEndLine::GetAngle() const { - return qApp->TrVars()->FormulaFromUser(formulaAngle, qApp->getSettings()->GetOsSeparator()); + return qApp->TrVars()->FormulaFromUser(formulaAngle, qApp->Settings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.cpp b/src/app/dialogs/tools/dialoglineintersectaxis.cpp index 0402769b4..0ad55d5fd 100644 --- a/src/app/dialogs/tools/dialoglineintersectaxis.cpp +++ b/src/app/dialogs/tools/dialoglineintersectaxis.cpp @@ -107,7 +107,7 @@ void DialogLineIntersectAxis::SetTypeLine(const QString &value) //--------------------------------------------------------------------------------------------------------------------- QString DialogLineIntersectAxis::GetAngle() const { - return qApp->TrVars()->FormulaFromUser(formulaAngle, qApp->getSettings()->GetOsSeparator()); + return qApp->TrVars()->FormulaFromUser(formulaAngle, qApp->Settings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialognormal.cpp b/src/app/dialogs/tools/dialognormal.cpp index 8285bd333..37f0408cc 100644 --- a/src/app/dialogs/tools/dialognormal.cpp +++ b/src/app/dialogs/tools/dialognormal.cpp @@ -315,7 +315,7 @@ QString DialogNormal::GetTypeLine() const */ QString DialogNormal::GetFormula() const { - return qApp->TrVars()->FormulaFromUser(formula, qApp->getSettings()->GetOsSeparator()); + return qApp->TrVars()->FormulaFromUser(formula, qApp->Settings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogpointfromcircleandtangent.cpp b/src/app/dialogs/tools/dialogpointfromcircleandtangent.cpp index 9608b2344..803675563 100644 --- a/src/app/dialogs/tools/dialogpointfromcircleandtangent.cpp +++ b/src/app/dialogs/tools/dialogpointfromcircleandtangent.cpp @@ -112,7 +112,7 @@ void DialogPointFromCircleAndTangent::SetCircleCenterId(const quint32 &value) QString DialogPointFromCircleAndTangent::GetCircleRadius() const { return qApp->TrVars()->FormulaFromUser(ui->plainTextEditRadius->toPlainText(), - qApp->getSettings()->GetOsSeparator()); + qApp->Settings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogpointofcontact.cpp b/src/app/dialogs/tools/dialogpointofcontact.cpp index 08c17c0e3..bd4c6df7c 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.cpp +++ b/src/app/dialogs/tools/dialogpointofcontact.cpp @@ -304,7 +304,7 @@ void DialogPointOfContact::SetPointName(const QString &value) */ QString DialogPointOfContact::getRadius() const { - return qApp->TrVars()->FormulaFromUser(radius, qApp->getSettings()->GetOsSeparator()); + return qApp->TrVars()->FormulaFromUser(radius, qApp->Settings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogpointofintersectioncircles.cpp b/src/app/dialogs/tools/dialogpointofintersectioncircles.cpp index a8c0779a3..a83bba9ac 100644 --- a/src/app/dialogs/tools/dialogpointofintersectioncircles.cpp +++ b/src/app/dialogs/tools/dialogpointofintersectioncircles.cpp @@ -144,7 +144,7 @@ void DialogPointOfIntersectionCircles::SetSecondCircleCenterId(const quint32 &va QString DialogPointOfIntersectionCircles::GetFirstCircleRadius() const { return qApp->TrVars()->FormulaFromUser(ui->plainTextEditCircle1Radius->toPlainText(), - qApp->getSettings()->GetOsSeparator()); + qApp->Settings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- @@ -169,7 +169,7 @@ void DialogPointOfIntersectionCircles::SetFirstCircleRadius(const QString &value QString DialogPointOfIntersectionCircles::GetSecondCircleRadius() const { return qApp->TrVars()->FormulaFromUser(ui->plainTextEditCircle2Radius->toPlainText(), - qApp->getSettings()->GetOsSeparator()); + qApp->Settings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogshoulderpoint.cpp b/src/app/dialogs/tools/dialogshoulderpoint.cpp index b1c3ae863..deac5ef6f 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.cpp +++ b/src/app/dialogs/tools/dialogshoulderpoint.cpp @@ -341,7 +341,7 @@ QString DialogShoulderPoint::GetTypeLine() const */ QString DialogShoulderPoint::GetFormula() const { - return qApp->TrVars()->FormulaFromUser(formula, qApp->getSettings()->GetOsSeparator()); + return qApp->TrVars()->FormulaFromUser(formula, qApp->Settings()->GetOsSeparator()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogtool.cpp b/src/app/dialogs/tools/dialogtool.cpp index 6019f634b..612c31f1a 100644 --- a/src/app/dialogs/tools/dialogtool.cpp +++ b/src/app/dialogs/tools/dialogtool.cpp @@ -461,7 +461,7 @@ qreal DialogTool::Eval(const QString &text, bool &flag, QLabel *label, const QSt QString formula = text; formula.replace("\n", " "); // Translate to internal look. - formula = qApp->TrVars()->FormulaFromUser(formula, qApp->getSettings()->GetOsSeparator()); + formula = qApp->TrVars()->FormulaFromUser(formula, qApp->Settings()->GetOsSeparator()); Calculator *cal = new Calculator(data, qApp->patternType()); result = cal->EvalFormula(formula); delete cal; diff --git a/src/app/dialogs/tools/dialogtool.h b/src/app/dialogs/tools/dialogtool.h index f3f04e449..20b8e102c 100644 --- a/src/app/dialogs/tools/dialogtool.h +++ b/src/app/dialogs/tools/dialogtool.h @@ -257,7 +257,7 @@ protected: SCASSERT(bCancel != nullptr); connect(bCancel, &QPushButton::clicked, this, &DialogTool::DialogRejected); - qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + qApp->Settings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); } template /** diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index 7adae9c6a..b604823f4 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -1480,7 +1480,7 @@ bool MainWindow::SaveAs() QString dir; if (curFile.isEmpty()) { - dir = qApp->getSettings()->GetPathPattern() + "/" + tr("pattern") + ".val"; + dir = qApp->Settings()->GetPathPattern() + "/" + tr("pattern") + ".val"; } else { @@ -1513,9 +1513,9 @@ bool MainWindow::SaveAs() if (oldFileName != curFile) {// Now we have new file name after save as. // But still have previous name in restore list. We should delete them. - QStringList restoreFiles = qApp->getSettings()->GetRestoreFileList(); + QStringList restoreFiles = qApp->Settings()->GetRestoreFileList(); restoreFiles.removeAll(oldFileName); - qApp->getSettings()->SetRestoreFileList(restoreFiles); + qApp->Settings()->SetRestoreFileList(restoreFiles); } return result; } @@ -1564,7 +1564,7 @@ void MainWindow::Open() qCDebug(vMainWindow, "Openning new file."); const QString filter(tr("Pattern files (*.val)")); //Get list last open files - const QStringList files = qApp->getSettings()->GetRecentFileList(); + const QStringList files = qApp->Settings()->GetRecentFileList(); QString dir; if (files.isEmpty()) { @@ -1676,9 +1676,9 @@ void MainWindow::FileClosedCorrect() WriteSettings(); //File was closed correct. - QStringList restoreFiles = qApp->getSettings()->GetRestoreFileList(); + QStringList restoreFiles = qApp->Settings()->GetRestoreFileList(); restoreFiles.removeAll(curFile); - qApp->getSettings()->SetRestoreFileList(restoreFiles); + qApp->Settings()->SetRestoreFileList(restoreFiles); // Remove autosave file QFile autofile(curFile +".autosave"); @@ -2309,7 +2309,7 @@ void MainWindow::setCurrentFile(const QString &fileName) else { qCDebug(vMainWindow, "Updating recent file list."); - QStringList files = qApp->getSettings()->GetRecentFileList(); + QStringList files = qApp->Settings()->GetRecentFileList(); files.removeAll(fileName); files.prepend(fileName); while (files.size() > MaxRecentFiles) @@ -2317,14 +2317,14 @@ void MainWindow::setCurrentFile(const QString &fileName) files.removeLast(); } - qApp->getSettings()->SetRecentFileList(files); + qApp->Settings()->SetRecentFileList(files); UpdateRecentFileActions(); qCDebug(vMainWindow, "Updating restore file list."); - QStringList restoreFiles = qApp->getSettings()->GetRestoreFileList(); + QStringList restoreFiles = qApp->Settings()->GetRestoreFileList(); restoreFiles.removeAll(fileName); restoreFiles.prepend(fileName); - qApp->getSettings()->SetRestoreFileList(restoreFiles); + qApp->Settings()->SetRestoreFileList(restoreFiles); } shownName+="[*]"; setWindowTitle(shownName); @@ -2348,17 +2348,17 @@ QString MainWindow::strippedName(const QString &fullFileName) void MainWindow::ReadSettings() { qCDebug(vMainWindow, "Reading settings."); - restoreGeometry(qApp->getSettings()->GetGeometry()); - restoreState(qApp->getSettings()->GetWindowState()); - restoreState(qApp->getSettings()->GetToolbarsState(), APP_VERSION); + restoreGeometry(qApp->Settings()->GetGeometry()); + restoreState(qApp->Settings()->GetWindowState()); + restoreState(qApp->Settings()->GetToolbarsState(), APP_VERSION); // Scene antialiasing - const bool graphOutputValue = qApp->getSettings()->GetGraphicalOutput(); + const bool graphOutputValue = qApp->Settings()->GetGraphicalOutput(); ui->view->setRenderHint(QPainter::Antialiasing, graphOutputValue); ui->view->setRenderHint(QPainter::SmoothPixmapTransform, graphOutputValue); // Stack limit - qApp->getUndoStack()->setUndoLimit(qApp->getSettings()->GetUndoCount()); + qApp->getUndoStack()->setUndoLimit(qApp->Settings()->GetUndoCount()); // Text under tool buton icon ToolBarStyles(); @@ -2372,9 +2372,9 @@ void MainWindow::WriteSettings() { ActionDraw(true); - qApp->getSettings()->SetGeometry(saveGeometry()); - qApp->getSettings()->SetWindowState(saveState()); - qApp->getSettings()->SetToolbarsState(saveState(APP_VERSION)); + qApp->Settings()->SetGeometry(saveGeometry()); + qApp->Settings()->SetWindowState(saveState()); + qApp->Settings()->SetToolbarsState(saveState(APP_VERSION)); } //--------------------------------------------------------------------------------------------------------------------- @@ -2406,7 +2406,7 @@ bool MainWindow::MaybeSave() void MainWindow::UpdateRecentFileActions() { qCDebug(vMainWindow, "Updating recent file actions."); - const QStringList files = qApp->getSettings()->GetRecentFileList(); + const QStringList files = qApp->Settings()->GetRecentFileList(); const int numRecentFiles = qMin(files.size(), static_cast(MaxRecentFiles)); for (int i = 0; i < numRecentFiles; ++i) @@ -2685,9 +2685,9 @@ void MainWindow::InitAutoSave() connect(autoSaveTimer, &QTimer::timeout, this, &MainWindow::AutoSavePattern); autoSaveTimer->stop(); - if (qApp->getSettings()->GetAutosaveState()) + if (qApp->Settings()->GetAutosaveState()) { - const qint32 autoTime = qApp->getSettings()->GetAutosaveTime(); + const qint32 autoTime = qApp->Settings()->GetAutosaveTime(); autoSaveTimer->start(autoTime*60000); qCDebug(vMainWindow, "Autosaving each %d minutes.", autoTime); } @@ -2871,7 +2871,7 @@ QStringList MainWindow::GetUnlokedRestoreFileList() const #if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0) QStringList restoreFiles; //Take all files that need to be restored - QStringList files = qApp->getSettings()->GetRestoreFileList(); + QStringList files = qApp->Settings()->GetRestoreFileList(); if (files.size() > 0) { for (int i = 0; i < files.size(); ++i) @@ -2893,7 +2893,7 @@ QStringList MainWindow::GetUnlokedRestoreFileList() const files.removeAll(restoreFiles.at(i)); } - qApp->getSettings()->SetRestoreFileList(files); + qApp->Settings()->SetRestoreFileList(files); } return restoreFiles; @@ -2905,7 +2905,7 @@ QStringList MainWindow::GetUnlokedRestoreFileList() const //--------------------------------------------------------------------------------------------------------------------- void MainWindow::WindowsLocale() { - qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + qApp->Settings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); } //--------------------------------------------------------------------------------------------------------------------- @@ -2939,7 +2939,7 @@ void MainWindow::ShowPaper(int index) //--------------------------------------------------------------------------------------------------------------------- void MainWindow::ToolBarStyle(QToolBar *bar) { - if (qApp->getSettings()->GetToolBarStyle()) + if (qApp->Settings()->GetToolBarStyle()) { bar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); } @@ -3023,14 +3023,14 @@ QString MainWindow::CheckPathToMeasurements(const QString &path, const Measureme { filter = tr("Standard measurements (*.vst)"); //Use standard path to standard measurements - const QString path = qApp->getSettings()->GetPathStandardMeasurements(); + const QString path = qApp->Settings()->GetPathStandardMeasurements(); mPath = QFileDialog::getOpenFileName(this, tr("Open file"), path, filter); } else { filter = tr("Individual measurements (*.vit)"); //Use standard path to individual measurements - const QString path = qApp->getSettings()->GetPathIndividualMeasurements(); + const QString path = qApp->Settings()->GetPathIndividualMeasurements(); mPath = QFileDialog::getOpenFileName(this, tr("Open file"), path, filter); } diff --git a/src/app/mainwindowsnogui.cpp b/src/app/mainwindowsnogui.cpp index 8ab38c3c4..5ed8ca531 100644 --- a/src/app/mainwindowsnogui.cpp +++ b/src/app/mainwindowsnogui.cpp @@ -154,7 +154,7 @@ void MainWindowsNoGUI::ExportLayoutAs() suf.replace(".", ""); const QString path = dialog.Path(); - qApp->getSettings()->SetPathLayout(path); + qApp->Settings()->SetPathLayout(path); const QString mask = dialog.FileName(); for (int i=0; i < scenes.size(); ++i) @@ -719,7 +719,7 @@ void MainWindowsNoGUI::SaveLayoutAs() printer.setOutputFormat(QPrinter::PdfFormat); QString fileName = QFileDialog::getSaveFileName(this, tr("Print to pdf"), - qApp->getSettings()->GetPathLayout()+"/"+FileName()+".pdf", + qApp->Settings()->GetPathLayout()+"/"+FileName()+".pdf", tr("PDF file (*.pdf)")); if (not fileName.isEmpty()) { @@ -728,7 +728,7 @@ void MainWindowsNoGUI::SaveLayoutAs() { fileName.append(".pdf"); } - qApp->getSettings()->SetPathLayout(f.absolutePath()); + qApp->Settings()->SetPathLayout(f.absolutePath()); printer.setOutputFileName(fileName); printer.setResolution(static_cast(PrintDPI)); diff --git a/src/app/tools/vabstracttool.cpp b/src/app/tools/vabstracttool.cpp index d68c3268a..e0699cdba 100644 --- a/src/app/tools/vabstracttool.cpp +++ b/src/app/tools/vabstracttool.cpp @@ -149,7 +149,7 @@ void VAbstractTool::DeleteTool(bool ask) //--------------------------------------------------------------------------------------------------------------------- int VAbstractTool::ConfirmDeletion() { - if (false == qApp->getSettings()->GetConfirmItemDelete()) + if (false == qApp->Settings()->GetConfirmItemDelete()) { return QMessageBox::Yes; } @@ -165,7 +165,7 @@ int VAbstractTool::ConfirmDeletion() if (dialogResult == QDialog::Accepted) { - qApp->getSettings()->SetConfirmItemDelete(not msgBox.isChecked()); + qApp->Settings()->SetConfirmItemDelete(not msgBox.isChecked()); } return dialogResult == QDialog::Accepted ? QMessageBox::Yes : QMessageBox::No; diff --git a/src/app/visualization/visualization.cpp b/src/app/visualization/visualization.cpp index 8b78e2d08..c7e8b9fa4 100644 --- a/src/app/visualization/visualization.cpp +++ b/src/app/visualization/visualization.cpp @@ -145,7 +145,7 @@ qreal Visualization::FindVal(const QString &expression) // Replace line return with spaces for calc if exist QString formula = expression; formula.replace("\n", " "); - formula = qApp->TrVars()->FormulaFromUser(formula, qApp->getSettings()->GetOsSeparator()); + formula = qApp->TrVars()->FormulaFromUser(formula, qApp->Settings()->GetOsSeparator()); Calculator *cal = new Calculator(Visualization::data, qApp->patternType()); val = cal->EvalFormula(formula); delete cal; diff --git a/src/app/xml/vpattern.cpp b/src/app/xml/vpattern.cpp index d70dc53e5..b86ad5b92 100644 --- a/src/app/xml/vpattern.cpp +++ b/src/app/xml/vpattern.cpp @@ -1328,7 +1328,7 @@ QString VPattern::GetLabelBase(unsigned int index) const { QStringList list = VApplication::LabelLanguages(); QStringList alphabet; - switch (list.indexOf(qApp->getSettings()->GetLabelLanguage())) + switch (list.indexOf(qApp->Settings()->GetLabelLanguage())) { case 0: // de { @@ -1735,7 +1735,7 @@ void VPattern::ParseIncrementsElement(const QDomNode &node) //--------------------------------------------------------------------------------------------------------------------- QString VPattern::GetAuthor() const { - return UniqueTagText(TagAuthor, qApp->getSettings()->GetUser()); + return UniqueTagText(TagAuthor, qApp->Settings()->GetUser()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vmisc/vabstractapplication.cpp b/src/libs/vmisc/vabstractapplication.cpp index 7a31758cb..20b79751d 100644 --- a/src/libs/vmisc/vabstractapplication.cpp +++ b/src/libs/vmisc/vabstractapplication.cpp @@ -54,7 +54,7 @@ void VAbstractApplication::OpenSettings() * @brief getSettings hide settings constructor. * @return pointer to class for acssesing to settings in ini file. */ -VSettings *VAbstractApplication::getSettings() +VSettings *VAbstractApplication::Settings() { SCASSERT(settings != nullptr); return settings; diff --git a/src/libs/vmisc/vabstractapplication.h b/src/libs/vmisc/vabstractapplication.h index f420c4edc..dc8cfc57b 100644 --- a/src/libs/vmisc/vabstractapplication.h +++ b/src/libs/vmisc/vabstractapplication.h @@ -53,7 +53,7 @@ public: void setPatternType(const MeasurementsType &patternType); void OpenSettings(); - VSettings *getSettings(); + VSettings *Settings(); template QString LocaleToString(const T &value); @@ -85,7 +85,7 @@ template QString VAbstractApplication::LocaleToString(const T &value) { QLocale loc; - qApp->getSettings()->GetOsSeparator() ? loc = QLocale::system() : loc = QLocale(QLocale::C); + qApp->Settings()->GetOsSeparator() ? loc = QLocale::system() : loc = QLocale(QLocale::C); return loc.toString(value); } diff --git a/src/libs/vpatterndb/vformula.cpp b/src/libs/vpatterndb/vformula.cpp index 1de34fa53..70b3caab3 100644 --- a/src/libs/vpatterndb/vformula.cpp +++ b/src/libs/vpatterndb/vformula.cpp @@ -103,7 +103,7 @@ QString VFormula::GetFormula(FormulaType type) const } else { - return qApp->TrVars()->FormulaFromUser(formula, qApp->getSettings()->GetOsSeparator()); + return qApp->TrVars()->FormulaFromUser(formula, qApp->Settings()->GetOsSeparator()); } } @@ -227,7 +227,7 @@ void VFormula::Eval() try { Calculator *cal = new Calculator(data, qApp->patternType()); - QString expression = qApp->TrVars()->FormulaFromUser(formula, qApp->getSettings()->GetOsSeparator()); + QString expression = qApp->TrVars()->FormulaFromUser(formula, qApp->Settings()->GetOsSeparator()); const qreal result = cal->EvalFormula(expression); delete cal; From bfaeddfc85d4349559ac9f91a01b7195f67f3d0d Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 18 Jun 2015 20:23:24 +0300 Subject: [PATCH 21/22] VTools static library. --HG-- branch : feature --- share/translations.pro | 5 +- src/app/app.pri | 3 - src/app/app.pro | 45 ++++--- src/app/core/vapplication.cpp | 73 +---------- src/app/core/vapplication.h | 80 ----------- src/app/core/vformulapropertyeditor.cpp | 2 +- src/app/core/vtooloptionspropertybrowser.cpp | 4 +- src/app/dialogs/app/dialoghistory.cpp | 8 +- src/app/dialogs/app/dialoghistory.h | 2 +- src/app/dialogs/app/dialogincrements.cpp | 2 + src/app/dialogs/app/dialogincrements.h | 2 +- src/app/dialogs/dialogs.h | 28 ---- src/app/dialogs/dialogs.pri | 95 +------------- src/app/mainwindow.h | 1 + src/app/options.cpp | 4 - src/app/options.h | 6 - src/app/xml/vpattern.cpp | 30 +++-- src/app/xml/vpattern.h | 7 +- src/libs/ifc/ifcdef.cpp | 111 ---------------- src/libs/ifc/ifcdef.h | 10 +- src/libs/ifc/xml/vabstractpattern.h | 7 + src/libs/ifc/xml/vdomdocument.h | 2 +- src/libs/libs.pro | 5 +- src/libs/vgeometry/vgeometry.pro | 9 -- src/libs/vmisc/def.cpp | 124 ++++++++++++++++++ src/libs/vmisc/def.h | 16 +++ src/libs/vmisc/vabstractapplication.cpp | 68 +++++++++- src/libs/vmisc/vabstractapplication.h | 94 ++++++++++++- src/libs/vpatterndb/vcontainer.cpp | 4 +- src/libs/vpatterndb/vcontainer.h | 2 +- src/libs/vtools/dialogs/dialogs.pri | 98 ++++++++++++++ .../support}/dialogeditwrongformula.cpp | 7 +- .../dialogs/support}/dialogeditwrongformula.h | 2 +- .../support}/dialogeditwrongformula.ui | 0 .../vtools/dialogs/support}/dialogundo.cpp | 4 +- .../vtools/dialogs/support}/dialogundo.h | 0 .../vtools/dialogs/support}/dialogundo.ui | 0 src/libs/vtools/dialogs/tooldialogs.h | 63 +++++++++ .../vtools}/dialogs/tools/dialogalongline.cpp | 5 +- .../vtools}/dialogs/tools/dialogalongline.h | 0 .../vtools}/dialogs/tools/dialogalongline.ui | 0 .../vtools}/dialogs/tools/dialogarc.cpp | 9 +- .../vtools}/dialogs/tools/dialogarc.h | 0 .../vtools}/dialogs/tools/dialogarc.ui | 0 .../dialogs/tools/dialogarcwithlength.cpp | 9 +- .../dialogs/tools/dialogarcwithlength.h | 0 .../dialogs/tools/dialogarcwithlength.ui | 0 .../vtools}/dialogs/tools/dialogbisector.cpp | 9 +- .../vtools}/dialogs/tools/dialogbisector.h | 0 .../vtools}/dialogs/tools/dialogbisector.ui | 0 .../tools/dialogcurveintersectaxis.cpp | 9 +- .../dialogs/tools/dialogcurveintersectaxis.h | 0 .../dialogs/tools/dialogcurveintersectaxis.ui | 0 .../vtools}/dialogs/tools/dialogcutarc.cpp | 10 +- .../vtools}/dialogs/tools/dialogcutarc.h | 0 .../vtools}/dialogs/tools/dialogcutarc.ui | 0 .../vtools}/dialogs/tools/dialogcutspline.cpp | 8 +- .../vtools}/dialogs/tools/dialogcutspline.h | 0 .../vtools}/dialogs/tools/dialogcutspline.ui | 0 .../dialogs/tools/dialogcutsplinepath.cpp | 8 +- .../dialogs/tools/dialogcutsplinepath.h | 0 .../dialogs/tools/dialogcutsplinepath.ui | 0 .../vtools}/dialogs/tools/dialogdetail.cpp | 11 +- .../vtools}/dialogs/tools/dialogdetail.h | 0 .../vtools}/dialogs/tools/dialogdetail.ui | 0 .../vtools}/dialogs/tools/dialogendline.cpp | 9 +- .../vtools}/dialogs/tools/dialogendline.h | 0 .../vtools}/dialogs/tools/dialogendline.ui | 0 .../vtools}/dialogs/tools/dialogheight.cpp | 0 .../vtools}/dialogs/tools/dialogheight.h | 0 .../vtools}/dialogs/tools/dialogheight.ui | 0 .../vtools}/dialogs/tools/dialogline.cpp | 7 +- .../vtools}/dialogs/tools/dialogline.h | 0 .../vtools}/dialogs/tools/dialogline.ui | 0 .../dialogs/tools/dialoglineintersect.cpp | 1 - .../dialogs/tools/dialoglineintersect.h | 0 .../dialogs/tools/dialoglineintersect.ui | 0 .../dialogs/tools/dialoglineintersectaxis.cpp | 9 +- .../dialogs/tools/dialoglineintersectaxis.h | 0 .../dialogs/tools/dialoglineintersectaxis.ui | 0 .../vtools}/dialogs/tools/dialognormal.cpp | 5 +- .../vtools}/dialogs/tools/dialognormal.h | 0 .../vtools}/dialogs/tools/dialognormal.ui | 0 .../tools/dialogpointfromarcandtangent.cpp | 0 .../tools/dialogpointfromarcandtangent.h | 0 .../tools/dialogpointfromarcandtangent.ui | 0 .../tools/dialogpointfromcircleandtangent.cpp | 9 +- .../tools/dialogpointfromcircleandtangent.h | 0 .../tools/dialogpointfromcircleandtangent.ui | 0 .../dialogs/tools/dialogpointofcontact.cpp | 10 +- .../dialogs/tools/dialogpointofcontact.h | 0 .../dialogs/tools/dialogpointofcontact.ui | 0 .../tools/dialogpointofintersection.cpp | 7 +- .../dialogs/tools/dialogpointofintersection.h | 0 .../tools/dialogpointofintersection.ui | 0 .../tools/dialogpointofintersectionarcs.cpp | 0 .../tools/dialogpointofintersectionarcs.h | 1 - .../tools/dialogpointofintersectionarcs.ui | 0 .../dialogpointofintersectioncircles.cpp | 9 +- .../tools/dialogpointofintersectioncircles.h | 1 - .../tools/dialogpointofintersectioncircles.ui | 0 .../dialogs/tools/dialogshoulderpoint.cpp | 9 +- .../dialogs/tools/dialogshoulderpoint.h | 0 .../dialogs/tools/dialogshoulderpoint.ui | 0 .../dialogs/tools/dialogsinglepoint.cpp | 0 .../vtools}/dialogs/tools/dialogsinglepoint.h | 0 .../dialogs/tools/dialogsinglepoint.ui | 0 .../vtools}/dialogs/tools/dialogspline.cpp | 0 .../vtools}/dialogs/tools/dialogspline.h | 0 .../vtools}/dialogs/tools/dialogspline.ui | 0 .../dialogs/tools/dialogsplinepath.cpp | 0 .../vtools}/dialogs/tools/dialogsplinepath.h | 0 .../vtools}/dialogs/tools/dialogsplinepath.ui | 0 .../vtools}/dialogs/tools/dialogtool.cpp | 17 ++- .../vtools}/dialogs/tools/dialogtool.h | 8 +- .../vtools}/dialogs/tools/dialogtriangle.cpp | 7 +- .../vtools}/dialogs/tools/dialogtriangle.h | 0 .../vtools}/dialogs/tools/dialogtriangle.ui | 0 .../dialogs/tools/dialoguniondetails.cpp | 0 .../dialogs/tools/dialoguniondetails.h | 0 .../dialogs/tools/dialoguniondetails.ui | 0 src/libs/vtools/stable.cpp | 30 +++++ src/libs/vtools/stable.h | 82 ++++++++++++ .../vtools}/tools/drawTools/drawtools.h | 0 .../tools/drawTools/vabstractspline.cpp | 2 +- .../vtools}/tools/drawTools/vabstractspline.h | 5 +- .../vtools}/tools/drawTools/vdrawtool.cpp | 22 ++-- .../vtools}/tools/drawTools/vdrawtool.h | 9 +- .../tools/drawTools/vtoolalongline.cpp | 14 +- .../vtools}/tools/drawTools/vtoolalongline.h | 8 +- .../vtools}/tools/drawTools/vtoolarc.cpp | 14 +- .../vtools}/tools/drawTools/vtoolarc.h | 6 +- .../tools/drawTools/vtoolarcwithlength.cpp | 13 +- .../tools/drawTools/vtoolarcwithlength.h | 9 +- .../vtools}/tools/drawTools/vtoolbisector.cpp | 12 +- .../vtools}/tools/drawTools/vtoolbisector.h | 9 +- .../drawTools/vtoolcurveintersectaxis.cpp | 17 ++- .../tools/drawTools/vtoolcurveintersectaxis.h | 6 +- .../vtools}/tools/drawTools/vtoolcut.cpp | 2 +- .../vtools}/tools/drawTools/vtoolcut.h | 5 +- .../vtools}/tools/drawTools/vtoolcutarc.cpp | 14 +- .../vtools}/tools/drawTools/vtoolcutarc.h | 8 +- .../tools/drawTools/vtoolcutspline.cpp | 13 +- .../vtools}/tools/drawTools/vtoolcutspline.h | 8 +- .../tools/drawTools/vtoolcutsplinepath.cpp | 13 +- .../tools/drawTools/vtoolcutsplinepath.h | 8 +- .../vtools}/tools/drawTools/vtoolendline.cpp | 17 ++- .../vtools}/tools/drawTools/vtoolendline.h | 9 +- .../vtools}/tools/drawTools/vtoolheight.cpp | 7 +- .../vtools}/tools/drawTools/vtoolheight.h | 8 +- .../vtools}/tools/drawTools/vtoolline.cpp | 7 +- .../vtools}/tools/drawTools/vtoolline.h | 7 +- .../tools/drawTools/vtoollineintersect.cpp | 6 +- .../tools/drawTools/vtoollineintersect.h | 8 +- .../drawTools/vtoollineintersectaxis.cpp | 16 ++- .../tools/drawTools/vtoollineintersectaxis.h | 7 +- .../tools/drawTools/vtoollinepoint.cpp | 2 +- .../vtools}/tools/drawTools/vtoollinepoint.h | 4 +- .../vtools}/tools/drawTools/vtoolnormal.cpp | 12 +- .../vtools}/tools/drawTools/vtoolnormal.h | 8 +- .../vtools}/tools/drawTools/vtoolpoint.cpp | 2 +- .../vtools}/tools/drawTools/vtoolpoint.h | 2 +- .../drawTools/vtoolpointfromarcandtangent.cpp | 6 +- .../drawTools/vtoolpointfromarcandtangent.h | 7 +- .../vtoolpointfromcircleandtangent.cpp | 7 +- .../vtoolpointfromcircleandtangent.h | 7 +- .../tools/drawTools/vtoolpointofcontact.cpp | 13 +- .../tools/drawTools/vtoolpointofcontact.h | 16 ++- .../drawTools/vtoolpointofintersection.cpp | 8 +- .../drawTools/vtoolpointofintersection.h | 6 +- .../vtoolpointofintersectionarcs.cpp | 6 +- .../drawTools/vtoolpointofintersectionarcs.h | 7 +- .../vtoolpointofintersectioncircles.cpp | 7 +- .../vtoolpointofintersectioncircles.h | 8 +- .../tools/drawTools/vtoolshoulderpoint.cpp | 12 +- .../tools/drawTools/vtoolshoulderpoint.h | 8 +- .../tools/drawTools/vtoolsinglepoint.cpp | 21 ++- .../tools/drawTools/vtoolsinglepoint.h | 2 +- .../vtools}/tools/drawTools/vtoolspline.cpp | 11 +- .../vtools}/tools/drawTools/vtoolspline.h | 7 +- .../tools/drawTools/vtoolsplinepath.cpp | 9 +- .../vtools}/tools/drawTools/vtoolsplinepath.h | 11 +- .../vtools}/tools/drawTools/vtooltriangle.cpp | 7 +- .../vtools}/tools/drawTools/vtooltriangle.h | 8 +- .../vtools}/tools/nodeDetails/nodedetails.h | 0 .../tools/nodeDetails/vabstractnode.cpp | 7 +- .../vtools}/tools/nodeDetails/vabstractnode.h | 2 +- .../vtools}/tools/nodeDetails/vnodearc.cpp | 8 +- .../vtools}/tools/nodeDetails/vnodearc.h | 5 +- .../vtools}/tools/nodeDetails/vnodepoint.cpp | 10 +- .../vtools}/tools/nodeDetails/vnodepoint.h | 5 +- .../vtools}/tools/nodeDetails/vnodespline.cpp | 9 +- .../vtools}/tools/nodeDetails/vnodespline.h | 6 +- .../tools/nodeDetails/vnodesplinepath.cpp | 8 +- .../tools/nodeDetails/vnodesplinepath.h | 5 +- src/{app => libs/vtools}/tools/tools.h | 0 src/{app => libs/vtools}/tools/tools.pri | 0 .../vtools}/tools/vabstracttool.cpp | 14 +- .../vtools}/tools/vabstracttool.h | 6 +- src/{app => libs/vtools}/tools/vdatatool.cpp | 0 src/{app => libs/vtools}/tools/vdatatool.h | 2 +- .../vtools}/tools/vtooldetail.cpp | 26 ++-- src/{app => libs/vtools}/tools/vtooldetail.h | 7 +- .../vtools}/tools/vtooluniondetails.cpp | 18 +-- .../vtools}/tools/vtooluniondetails.h | 13 +- .../vtools}/undocommands/adddet.cpp | 0 .../vtools}/undocommands/adddet.h | 0 .../vtools}/undocommands/adddetnode.cpp | 0 .../vtools}/undocommands/adddetnode.h | 0 .../vtools}/undocommands/addpatternpiece.cpp | 0 .../vtools}/undocommands/addpatternpiece.h | 0 .../vtools}/undocommands/addtocalc.cpp | 5 +- .../vtools}/undocommands/addtocalc.h | 0 .../vtools}/undocommands/adduniondetails.cpp | 0 .../vtools}/undocommands/adduniondetails.h | 0 .../vtools}/undocommands/deletedetail.cpp | 2 +- .../vtools}/undocommands/deletedetail.h | 0 .../undocommands/deletepatternpiece.cpp | 0 .../vtools}/undocommands/deletepatternpiece.h | 0 .../vtools}/undocommands/deltool.cpp | 0 .../vtools}/undocommands/deltool.h | 0 .../vtools}/undocommands/movedetail.cpp | 5 +- .../vtools}/undocommands/movedetail.h | 0 .../vtools}/undocommands/movelabel.cpp | 5 +- .../vtools}/undocommands/movelabel.h | 0 .../vtools}/undocommands/movespline.cpp | 2 + .../vtools}/undocommands/movespline.h | 2 +- .../vtools}/undocommands/movesplinepath.cpp | 0 .../vtools}/undocommands/movesplinepath.h | 2 +- .../vtools}/undocommands/movespoint.cpp | 5 +- .../vtools}/undocommands/movespoint.h | 0 .../vtools}/undocommands/renamepp.cpp | 1 - .../vtools}/undocommands/renamepp.h | 0 .../undocommands/savedetailoptions.cpp | 2 + .../vtools}/undocommands/savedetailoptions.h | 0 .../vtools}/undocommands/savetooloptions.cpp | 1 - .../vtools}/undocommands/savetooloptions.h | 0 .../vtools}/undocommands/undocommands.pri | 0 .../vtools}/undocommands/vundocommand.cpp | 0 .../vtools}/undocommands/vundocommand.h | 4 +- .../vtools}/visualization/visline.cpp | 0 .../vtools}/visualization/visline.h | 0 .../vtools}/visualization/vispath.cpp | 0 .../vtools}/visualization/vispath.h | 0 .../visualization/vistoolalongline.cpp | 4 +- .../vtools}/visualization/vistoolalongline.h | 0 .../vtools}/visualization/vistoolarc.cpp | 6 +- .../vtools}/visualization/vistoolarc.h | 0 .../visualization/vistoolarcwithlength.cpp | 6 +- .../visualization/vistoolarcwithlength.h | 0 .../vtools}/visualization/vistoolbisector.cpp | 4 +- .../vtools}/visualization/vistoolbisector.h | 0 .../vistoolcurveintersectaxis.cpp | 4 +- .../visualization/vistoolcurveintersectaxis.h | 0 .../vtools}/visualization/vistoolcutarc.cpp | 4 +- .../vtools}/visualization/vistoolcutarc.h | 0 .../visualization/vistoolcutspline.cpp | 4 +- .../vtools}/visualization/vistoolcutspline.h | 0 .../visualization/vistoolcutsplinepath.cpp | 4 +- .../visualization/vistoolcutsplinepath.h | 0 .../vtools}/visualization/vistoolendline.cpp | 4 +- .../vtools}/visualization/vistoolendline.h | 0 .../vtools}/visualization/vistoolheight.cpp | 2 +- .../vtools}/visualization/vistoolheight.h | 0 .../vtools}/visualization/vistoolline.cpp | 4 +- .../vtools}/visualization/vistoolline.h | 0 .../visualization/vistoollineintersect.cpp | 4 +- .../visualization/vistoollineintersect.h | 0 .../vistoollineintersectaxis.cpp | 4 +- .../visualization/vistoollineintersectaxis.h | 0 .../vtools}/visualization/vistoolnormal.cpp | 2 +- .../vtools}/visualization/vistoolnormal.h | 0 .../vistoolpointfromarcandtangent.cpp | 6 +- .../vistoolpointfromarcandtangent.h | 2 +- .../vistoolpointfromcircleandtangent.cpp | 4 +- .../vistoolpointfromcircleandtangent.h | 2 +- .../visualization/vistoolpointofcontact.cpp | 2 +- .../visualization/vistoolpointofcontact.h | 0 .../vistoolpointofintersection.cpp | 4 +- .../vistoolpointofintersection.h | 0 .../vistoolpointofintersectionarcs.cpp | 7 +- .../vistoolpointofintersectionarcs.h | 4 +- .../vistoolpointofintersectioncircles.cpp | 4 +- .../vistoolpointofintersectioncircles.h | 2 +- .../visualization/vistoolshoulderpoint.cpp | 2 +- .../visualization/vistoolshoulderpoint.h | 0 .../vtools}/visualization/vistoolspline.cpp | 6 +- .../vtools}/visualization/vistoolspline.h | 0 .../visualization/vistoolsplinepath.cpp | 0 .../vtools}/visualization/vistoolsplinepath.h | 2 +- .../vtools}/visualization/vistooltriangle.cpp | 4 +- .../vtools}/visualization/vistooltriangle.h | 0 .../vtools}/visualization/visualization.cpp | 5 +- .../vtools}/visualization/visualization.h | 4 +- .../vtools}/visualization/visualization.pri | 0 src/libs/vtools/vtools.pri | 13 ++ src/libs/vtools/vtools.pro | 106 +++++++++++++++ src/libs/vwidgets/stable.h | 2 +- 298 files changed, 1333 insertions(+), 946 deletions(-) create mode 100644 src/libs/vtools/dialogs/dialogs.pri rename src/{app/dialogs/tools => libs/vtools/dialogs/support}/dialogeditwrongformula.cpp (98%) rename src/{app/dialogs/tools => libs/vtools/dialogs/support}/dialogeditwrongformula.h (99%) rename src/{app/dialogs/tools => libs/vtools/dialogs/support}/dialogeditwrongformula.ui (100%) rename src/{app/dialogs/app => libs/vtools/dialogs/support}/dialogundo.cpp (96%) rename src/{app/dialogs/app => libs/vtools/dialogs/support}/dialogundo.h (100%) rename src/{app/dialogs/app => libs/vtools/dialogs/support}/dialogundo.ui (100%) create mode 100644 src/libs/vtools/dialogs/tooldialogs.h rename src/{app => libs/vtools}/dialogs/tools/dialogalongline.cpp (98%) rename src/{app => libs/vtools}/dialogs/tools/dialogalongline.h (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogalongline.ui (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogarc.cpp (98%) rename src/{app => libs/vtools}/dialogs/tools/dialogarc.h (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogarc.ui (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogarcwithlength.cpp (98%) rename src/{app => libs/vtools}/dialogs/tools/dialogarcwithlength.h (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogarcwithlength.ui (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogbisector.cpp (98%) rename src/{app => libs/vtools}/dialogs/tools/dialogbisector.h (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogbisector.ui (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogcurveintersectaxis.cpp (98%) rename src/{app => libs/vtools}/dialogs/tools/dialogcurveintersectaxis.h (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogcurveintersectaxis.ui (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogcutarc.cpp (97%) rename src/{app => libs/vtools}/dialogs/tools/dialogcutarc.h (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogcutarc.ui (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogcutspline.cpp (97%) rename src/{app => libs/vtools}/dialogs/tools/dialogcutspline.h (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogcutspline.ui (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogcutsplinepath.cpp (97%) rename src/{app => libs/vtools}/dialogs/tools/dialogcutsplinepath.h (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogcutsplinepath.ui (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogdetail.cpp (98%) rename src/{app => libs/vtools}/dialogs/tools/dialogdetail.h (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogdetail.ui (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogendline.cpp (98%) rename src/{app => libs/vtools}/dialogs/tools/dialogendline.h (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogendline.ui (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogheight.cpp (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogheight.h (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogheight.ui (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogline.cpp (97%) rename src/{app => libs/vtools}/dialogs/tools/dialogline.h (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogline.ui (100%) rename src/{app => libs/vtools}/dialogs/tools/dialoglineintersect.cpp (99%) rename src/{app => libs/vtools}/dialogs/tools/dialoglineintersect.h (100%) rename src/{app => libs/vtools}/dialogs/tools/dialoglineintersect.ui (100%) rename src/{app => libs/vtools}/dialogs/tools/dialoglineintersectaxis.cpp (98%) rename src/{app => libs/vtools}/dialogs/tools/dialoglineintersectaxis.h (100%) rename src/{app => libs/vtools}/dialogs/tools/dialoglineintersectaxis.ui (100%) rename src/{app => libs/vtools}/dialogs/tools/dialognormal.cpp (98%) rename src/{app => libs/vtools}/dialogs/tools/dialognormal.h (100%) rename src/{app => libs/vtools}/dialogs/tools/dialognormal.ui (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogpointfromarcandtangent.cpp (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogpointfromarcandtangent.h (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogpointfromarcandtangent.ui (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogpointfromcircleandtangent.cpp (98%) rename src/{app => libs/vtools}/dialogs/tools/dialogpointfromcircleandtangent.h (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogpointfromcircleandtangent.ui (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogpointofcontact.cpp (98%) rename src/{app => libs/vtools}/dialogs/tools/dialogpointofcontact.h (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogpointofcontact.ui (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogpointofintersection.cpp (97%) rename src/{app => libs/vtools}/dialogs/tools/dialogpointofintersection.h (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogpointofintersection.ui (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogpointofintersectionarcs.cpp (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogpointofintersectionarcs.h (98%) rename src/{app => libs/vtools}/dialogs/tools/dialogpointofintersectionarcs.ui (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogpointofintersectioncircles.cpp (98%) rename src/{app => libs/vtools}/dialogs/tools/dialogpointofintersectioncircles.h (99%) rename src/{app => libs/vtools}/dialogs/tools/dialogpointofintersectioncircles.ui (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogshoulderpoint.cpp (98%) rename src/{app => libs/vtools}/dialogs/tools/dialogshoulderpoint.h (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogshoulderpoint.ui (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogsinglepoint.cpp (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogsinglepoint.h (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogsinglepoint.ui (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogspline.cpp (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogspline.h (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogspline.ui (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogsplinepath.cpp (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogsplinepath.h (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogsplinepath.ui (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogtool.cpp (98%) rename src/{app => libs/vtools}/dialogs/tools/dialogtool.h (98%) rename src/{app => libs/vtools}/dialogs/tools/dialogtriangle.cpp (98%) rename src/{app => libs/vtools}/dialogs/tools/dialogtriangle.h (100%) rename src/{app => libs/vtools}/dialogs/tools/dialogtriangle.ui (100%) rename src/{app => libs/vtools}/dialogs/tools/dialoguniondetails.cpp (100%) rename src/{app => libs/vtools}/dialogs/tools/dialoguniondetails.h (100%) rename src/{app => libs/vtools}/dialogs/tools/dialoguniondetails.ui (100%) create mode 100644 src/libs/vtools/stable.cpp create mode 100644 src/libs/vtools/stable.h rename src/{app => libs/vtools}/tools/drawTools/drawtools.h (100%) rename src/{app => libs/vtools}/tools/drawTools/vabstractspline.cpp (98%) rename src/{app => libs/vtools}/tools/drawTools/vabstractspline.h (96%) rename src/{app => libs/vtools}/tools/drawTools/vdrawtool.cpp (94%) rename src/{app => libs/vtools}/tools/drawTools/vdrawtool.h (96%) rename src/{app => libs/vtools}/tools/drawTools/vtoolalongline.cpp (96%) rename src/{app => libs/vtools}/tools/drawTools/vtoolalongline.h (89%) rename src/{app => libs/vtools}/tools/drawTools/vtoolarc.cpp (97%) rename src/{app => libs/vtools}/tools/drawTools/vtoolarc.h (92%) rename src/{app => libs/vtools}/tools/drawTools/vtoolarcwithlength.cpp (96%) rename src/{app => libs/vtools}/tools/drawTools/vtoolarcwithlength.h (89%) rename src/{app => libs/vtools}/tools/drawTools/vtoolbisector.cpp (97%) rename src/{app => libs/vtools}/tools/drawTools/vtoolbisector.h (89%) rename src/{app => libs/vtools}/tools/drawTools/vtoolcurveintersectaxis.cpp (95%) rename src/{app => libs/vtools}/tools/drawTools/vtoolcurveintersectaxis.h (94%) rename src/{app => libs/vtools}/tools/drawTools/vtoolcut.cpp (98%) rename src/{app => libs/vtools}/tools/drawTools/vtoolcut.h (95%) rename src/{app => libs/vtools}/tools/drawTools/vtoolcutarc.cpp (95%) rename src/{app => libs/vtools}/tools/drawTools/vtoolcutarc.h (88%) rename src/{app => libs/vtools}/tools/drawTools/vtoolcutspline.cpp (96%) rename src/{app => libs/vtools}/tools/drawTools/vtoolcutspline.h (89%) rename src/{app => libs/vtools}/tools/drawTools/vtoolcutsplinepath.cpp (97%) rename src/{app => libs/vtools}/tools/drawTools/vtoolcutsplinepath.h (90%) rename src/{app => libs/vtools}/tools/drawTools/vtoolendline.cpp (94%) rename src/{app => libs/vtools}/tools/drawTools/vtoolendline.h (87%) rename src/{app => libs/vtools}/tools/drawTools/vtoolheight.cpp (97%) rename src/{app => libs/vtools}/tools/drawTools/vtoolheight.h (89%) rename src/{app => libs/vtools}/tools/drawTools/vtoolline.cpp (98%) rename src/{app => libs/vtools}/tools/drawTools/vtoolline.h (92%) rename src/{app => libs/vtools}/tools/drawTools/vtoollineintersect.cpp (98%) rename src/{app => libs/vtools}/tools/drawTools/vtoollineintersect.h (91%) rename src/{app => libs/vtools}/tools/drawTools/vtoollineintersectaxis.cpp (95%) rename src/{app => libs/vtools}/tools/drawTools/vtoollineintersectaxis.h (92%) rename src/{app => libs/vtools}/tools/drawTools/vtoollinepoint.cpp (98%) rename src/{app => libs/vtools}/tools/drawTools/vtoollinepoint.h (94%) rename src/{app => libs/vtools}/tools/drawTools/vtoolnormal.cpp (96%) rename src/{app => libs/vtools}/tools/drawTools/vtoolnormal.h (89%) rename src/{app => libs/vtools}/tools/drawTools/vtoolpoint.cpp (99%) rename src/{app => libs/vtools}/tools/drawTools/vtoolpoint.h (97%) rename src/{app => libs/vtools}/tools/drawTools/vtoolpointfromarcandtangent.cpp (98%) rename src/{app => libs/vtools}/tools/drawTools/vtoolpointfromarcandtangent.h (93%) rename src/{app => libs/vtools}/tools/drawTools/vtoolpointfromcircleandtangent.cpp (98%) rename src/{app => libs/vtools}/tools/drawTools/vtoolpointfromcircleandtangent.h (93%) rename src/{app => libs/vtools}/tools/drawTools/vtoolpointofcontact.cpp (97%) rename src/{app => libs/vtools}/tools/drawTools/vtoolpointofcontact.h (79%) rename src/{app => libs/vtools}/tools/drawTools/vtoolpointofintersection.cpp (96%) rename src/{app => libs/vtools}/tools/drawTools/vtoolpointofintersection.h (93%) rename src/{app => libs/vtools}/tools/drawTools/vtoolpointofintersectionarcs.cpp (98%) rename src/{app => libs/vtools}/tools/drawTools/vtoolpointofintersectionarcs.h (92%) rename src/{app => libs/vtools}/tools/drawTools/vtoolpointofintersectioncircles.cpp (98%) rename src/{app => libs/vtools}/tools/drawTools/vtoolpointofintersectioncircles.h (92%) rename src/{app => libs/vtools}/tools/drawTools/vtoolshoulderpoint.cpp (97%) rename src/{app => libs/vtools}/tools/drawTools/vtoolshoulderpoint.h (91%) rename src/{app => libs/vtools}/tools/drawTools/vtoolsinglepoint.cpp (94%) rename src/{app => libs/vtools}/tools/drawTools/vtoolsinglepoint.h (96%) rename src/{app => libs/vtools}/tools/drawTools/vtoolspline.cpp (98%) rename src/{app => libs/vtools}/tools/drawTools/vtoolspline.h (92%) rename src/{app => libs/vtools}/tools/drawTools/vtoolsplinepath.cpp (98%) rename src/{app => libs/vtools}/tools/drawTools/vtoolsplinepath.h (89%) rename src/{app => libs/vtools}/tools/drawTools/vtooltriangle.cpp (98%) rename src/{app => libs/vtools}/tools/drawTools/vtooltriangle.h (92%) rename src/{app => libs/vtools}/tools/nodeDetails/nodedetails.h (100%) rename src/{app => libs/vtools}/tools/nodeDetails/vabstractnode.cpp (96%) rename src/{app => libs/vtools}/tools/nodeDetails/vabstractnode.h (95%) rename src/{app => libs/vtools}/tools/nodeDetails/vnodearc.cpp (96%) rename src/{app => libs/vtools}/tools/nodeDetails/vnodearc.h (90%) rename src/{app => libs/vtools}/tools/nodeDetails/vnodepoint.cpp (97%) rename src/{app => libs/vtools}/tools/nodeDetails/vnodepoint.h (92%) rename src/{app => libs/vtools}/tools/nodeDetails/vnodespline.cpp (96%) rename src/{app => libs/vtools}/tools/nodeDetails/vnodespline.h (89%) rename src/{app => libs/vtools}/tools/nodeDetails/vnodesplinepath.cpp (96%) rename src/{app => libs/vtools}/tools/nodeDetails/vnodesplinepath.h (90%) rename src/{app => libs/vtools}/tools/tools.h (100%) rename src/{app => libs/vtools}/tools/tools.pri (100%) rename src/{app => libs/vtools}/tools/vabstracttool.cpp (98%) rename src/{app => libs/vtools}/tools/vabstracttool.h (98%) rename src/{app => libs/vtools}/tools/vdatatool.cpp (100%) rename src/{app => libs/vtools}/tools/vdatatool.h (98%) rename src/{app => libs/vtools}/tools/vtooldetail.cpp (97%) rename src/{app => libs/vtools}/tools/vtooldetail.h (94%) rename src/{app => libs/vtools}/tools/vtooluniondetails.cpp (98%) rename src/{app => libs/vtools}/tools/vtooluniondetails.h (89%) rename src/{app => libs/vtools}/undocommands/adddet.cpp (100%) rename src/{app => libs/vtools}/undocommands/adddet.h (100%) rename src/{app => libs/vtools}/undocommands/adddetnode.cpp (100%) rename src/{app => libs/vtools}/undocommands/adddetnode.h (100%) rename src/{app => libs/vtools}/undocommands/addpatternpiece.cpp (100%) rename src/{app => libs/vtools}/undocommands/addpatternpiece.h (100%) rename src/{app => libs/vtools}/undocommands/addtocalc.cpp (97%) rename src/{app => libs/vtools}/undocommands/addtocalc.h (100%) rename src/{app => libs/vtools}/undocommands/adduniondetails.cpp (100%) rename src/{app => libs/vtools}/undocommands/adduniondetails.h (100%) rename src/{app => libs/vtools}/undocommands/deletedetail.cpp (98%) rename src/{app => libs/vtools}/undocommands/deletedetail.h (100%) rename src/{app => libs/vtools}/undocommands/deletepatternpiece.cpp (100%) rename src/{app => libs/vtools}/undocommands/deletepatternpiece.h (100%) rename src/{app => libs/vtools}/undocommands/deltool.cpp (100%) rename src/{app => libs/vtools}/undocommands/deltool.h (100%) rename src/{app => libs/vtools}/undocommands/movedetail.cpp (99%) rename src/{app => libs/vtools}/undocommands/movedetail.h (100%) rename src/{app => libs/vtools}/undocommands/movelabel.cpp (98%) rename src/{app => libs/vtools}/undocommands/movelabel.h (100%) rename src/{app => libs/vtools}/undocommands/movespline.cpp (98%) rename src/{app => libs/vtools}/undocommands/movespline.h (98%) rename src/{app => libs/vtools}/undocommands/movesplinepath.cpp (100%) rename src/{app => libs/vtools}/undocommands/movesplinepath.h (98%) rename src/{app => libs/vtools}/undocommands/movespoint.cpp (99%) rename src/{app => libs/vtools}/undocommands/movespoint.h (100%) rename src/{app => libs/vtools}/undocommands/renamepp.cpp (99%) rename src/{app => libs/vtools}/undocommands/renamepp.h (100%) rename src/{app => libs/vtools}/undocommands/savedetailoptions.cpp (99%) rename src/{app => libs/vtools}/undocommands/savedetailoptions.h (100%) rename src/{app => libs/vtools}/undocommands/savetooloptions.cpp (99%) rename src/{app => libs/vtools}/undocommands/savetooloptions.h (100%) rename src/{app => libs/vtools}/undocommands/undocommands.pri (100%) rename src/{app => libs/vtools}/undocommands/vundocommand.cpp (100%) rename src/{app => libs/vtools}/undocommands/vundocommand.h (97%) rename src/{app => libs/vtools}/visualization/visline.cpp (100%) rename src/{app => libs/vtools}/visualization/visline.h (100%) rename src/{app => libs/vtools}/visualization/vispath.cpp (100%) rename src/{app => libs/vtools}/visualization/vispath.h (100%) rename src/{app => libs/vtools}/visualization/vistoolalongline.cpp (97%) rename src/{app => libs/vtools}/visualization/vistoolalongline.h (100%) rename src/{app => libs/vtools}/visualization/vistoolarc.cpp (96%) rename src/{app => libs/vtools}/visualization/vistoolarc.h (100%) rename src/{app => libs/vtools}/visualization/vistoolarcwithlength.cpp (96%) rename src/{app => libs/vtools}/visualization/vistoolarcwithlength.h (100%) rename src/{app => libs/vtools}/visualization/vistoolbisector.cpp (98%) rename src/{app => libs/vtools}/visualization/vistoolbisector.h (100%) rename src/{app => libs/vtools}/visualization/vistoolcurveintersectaxis.cpp (98%) rename src/{app => libs/vtools}/visualization/vistoolcurveintersectaxis.h (100%) rename src/{app => libs/vtools}/visualization/vistoolcutarc.cpp (97%) rename src/{app => libs/vtools}/visualization/vistoolcutarc.h (100%) rename src/{app => libs/vtools}/visualization/vistoolcutspline.cpp (97%) rename src/{app => libs/vtools}/visualization/vistoolcutspline.h (100%) rename src/{app => libs/vtools}/visualization/vistoolcutsplinepath.cpp (98%) rename src/{app => libs/vtools}/visualization/vistoolcutsplinepath.h (100%) rename src/{app => libs/vtools}/visualization/vistoolendline.cpp (97%) rename src/{app => libs/vtools}/visualization/vistoolendline.h (100%) rename src/{app => libs/vtools}/visualization/vistoolheight.cpp (99%) rename src/{app => libs/vtools}/visualization/vistoolheight.h (100%) rename src/{app => libs/vtools}/visualization/vistoolline.cpp (97%) rename src/{app => libs/vtools}/visualization/vistoolline.h (100%) rename src/{app => libs/vtools}/visualization/vistoollineintersect.cpp (98%) rename src/{app => libs/vtools}/visualization/vistoollineintersect.h (100%) rename src/{app => libs/vtools}/visualization/vistoollineintersectaxis.cpp (98%) rename src/{app => libs/vtools}/visualization/vistoollineintersectaxis.h (100%) rename src/{app => libs/vtools}/visualization/vistoolnormal.cpp (99%) rename src/{app => libs/vtools}/visualization/vistoolnormal.h (100%) rename src/{app => libs/vtools}/visualization/vistoolpointfromarcandtangent.cpp (97%) rename src/{app => libs/vtools}/visualization/vistoolpointfromarcandtangent.h (98%) rename src/{app => libs/vtools}/visualization/vistoolpointfromcircleandtangent.cpp (98%) rename src/{app => libs/vtools}/visualization/vistoolpointfromcircleandtangent.h (98%) rename src/{app => libs/vtools}/visualization/vistoolpointofcontact.cpp (99%) rename src/{app => libs/vtools}/visualization/vistoolpointofcontact.h (100%) rename src/{app => libs/vtools}/visualization/vistoolpointofintersection.cpp (97%) rename src/{app => libs/vtools}/visualization/vistoolpointofintersection.h (100%) rename src/{app => libs/vtools}/visualization/vistoolpointofintersectionarcs.cpp (96%) rename src/{app => libs/vtools}/visualization/vistoolpointofintersectionarcs.h (96%) rename src/{app => libs/vtools}/visualization/vistoolpointofintersectioncircles.cpp (98%) rename src/{app => libs/vtools}/visualization/vistoolpointofintersectioncircles.h (98%) rename src/{app => libs/vtools}/visualization/vistoolshoulderpoint.cpp (99%) rename src/{app => libs/vtools}/visualization/vistoolshoulderpoint.h (100%) rename src/{app => libs/vtools}/visualization/vistoolspline.cpp (97%) rename src/{app => libs/vtools}/visualization/vistoolspline.h (100%) rename src/{app => libs/vtools}/visualization/vistoolsplinepath.cpp (100%) rename src/{app => libs/vtools}/visualization/vistoolsplinepath.h (98%) rename src/{app => libs/vtools}/visualization/vistooltriangle.cpp (98%) rename src/{app => libs/vtools}/visualization/vistooltriangle.h (100%) rename src/{app => libs/vtools}/visualization/visualization.cpp (98%) rename src/{app => libs/vtools}/visualization/visualization.h (97%) rename src/{app => libs/vtools}/visualization/visualization.pri (100%) create mode 100644 src/libs/vtools/vtools.pri create mode 100644 src/libs/vtools/vtools.pro diff --git a/share/translations.pro b/share/translations.pro index 7ea6a416b..3dffe4e10 100644 --- a/share/translations.pro +++ b/share/translations.pro @@ -16,7 +16,8 @@ DEPENDPATH += \ ../src/libs/vlayout \ ../src/libs/vgeometry \ ../src/libs/vpatterndb \ - ../src/libs/vmisc + ../src/libs/vmisc \ + ../src/libs/vtools include(../src/app/app.pri) include(../src/libs/qmuparser/qmuparser.pri) @@ -26,6 +27,8 @@ include(../src/libs/vobj/vobj.pri) include(../src/libs/vlayout/vlayout.pri) include(../src/libs/vgeometry/vgeometry.pri) include(../src/libs/vpatterndb/vpatterndb.pri) +include(../src/libs/vmisc/vmisc.pri) +include(../src/libs/vtools/vtools.pri) # Add here path to new translation file with name "valentina_*_*.ts" if you want to add new language. # Same paths in variable INSTALL_TRANSLATIONS (app.pro). diff --git a/src/app/app.pri b/src/app/app.pri index 807bc2eae..b1d37898b 100644 --- a/src/app/app.pri +++ b/src/app/app.pri @@ -1,9 +1,6 @@ # Suport subdirectories. Just better project code tree. include(dialogs/dialogs.pri) -include(tools/tools.pri) include(xml/xml.pri) -include(undocommands/undocommands.pri) -include(visualization/visualization.pri) include(core/core.pri) # ADD TO EACH PATH $$PWD VARIABLE!!!!!! diff --git a/src/app/app.pro b/src/app/app.pro index bb1af6526..b9b809e4e 100644 --- a/src/app/app.pro +++ b/src/app/app.pro @@ -83,6 +83,7 @@ CONFIG(debug, debug|release){ -isystem "$${OUT_PWD}/$${UI_DIR}" \ -isystem "$${OUT_PWD}/$${MOC_DIR}" \ -isystem "$${OUT_PWD}/$${RCC_DIR}" \ + -isystem "$${OUT_PWD}/../libs/vtools/$${UI_DIR}" \ # For VTools UI files $$GCC_DEBUG_CXXFLAGS # See Valentina.pri for more details. noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer @@ -101,6 +102,7 @@ CONFIG(debug, debug|release){ -isystem "$${OUT_PWD}/$${UI_DIR}" \ -isystem "$${OUT_PWD}/$${MOC_DIR}" \ -isystem "$${OUT_PWD}/$${RCC_DIR}" \ + -isystem "$${OUT_PWD}/../libs/vtools/$${UI_DIR}" \ # For VTools UI files $$CLANG_DEBUG_CXXFLAGS # See Valentina.pri for more details. # -isystem key works only for headers. In some cases it's not enough. But we can't delete this warnings and @@ -560,6 +562,27 @@ else:unix: LIBS += -L$${OUT_PWD}/../libs/vpropertyexplorer/$${DESTDIR} -lvproper INCLUDEPATH += $${PWD}/../libs/vpropertyexplorer DEPENDPATH += $${PWD}/../libs/vpropertyexplorer +# When the GNU linker sees a library, it discards all symbols that it doesn't need. +# Add dependent library the first. + +#VPatternDB static library (depend on vgeometry) +unix|win32: LIBS += -L$$OUT_PWD/../libs/vpatterndb/$${DESTDIR} -lvpatterndb + +INCLUDEPATH += $$PWD/../libs/vpatterndb +DEPENDPATH += $$PWD/../libs/vpatterndb + +win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vpatterndb/$${DESTDIR}/vpatterndb.lib +else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vpatterndb/$${DESTDIR}/libvpatterndb.a + +# VGeometry static library (depend on ifc) +unix|win32: LIBS += -L$$OUT_PWD/../libs/vgeometry/$${DESTDIR}/ -lvgeometry + +INCLUDEPATH += $$PWD/../libs/vgeometry +DEPENDPATH += $$PWD/../libs/vgeometry + +win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vgeometry/$${DESTDIR}/vgeometry.lib +else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vgeometry/$${DESTDIR}/libvgeometry.a + # IFC static library unix|win32: LIBS += -L$$OUT_PWD/../libs/ifc/$${DESTDIR}/ -lifc @@ -587,23 +610,15 @@ DEPENDPATH += $$PWD/../libs/vlayout win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vlayout/$${DESTDIR}/vlayout.lib else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vlayout/$${DESTDIR}/libvlayout.a -# VGeometry static library -unix|win32: LIBS += -L$$OUT_PWD/../libs/vgeometry/$${DESTDIR}/ -lvgeometry +#VTools static library (depend on vwidgets and vmisc) +unix|win32: LIBS += -L$$OUT_PWD/../libs/vtools/$${DESTDIR}/ -lvtools -INCLUDEPATH += $$PWD/../libs/vgeometry -DEPENDPATH += $$PWD/../libs/vgeometry +INCLUDEPATH += $$PWD/../libs/vtools +INCLUDEPATH += $$OUT_PWD/../libs/vtools/$${UI_DIR} # For UI files +DEPENDPATH += $$PWD/../libs/vtools -win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vgeometry/$${DESTDIR}/vgeometry.lib -else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vgeometry/$${DESTDIR}/libvgeometry.a - -#VPatternDB static library -unix|win32: LIBS += -L$$OUT_PWD/../libs/vpatterndb/$${DESTDIR}/ -lvpatterndb - -INCLUDEPATH += $$PWD/../libs/vpatterndb -DEPENDPATH += $$PWD/../libs/vpatterndb - -win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vpatterndb/$${DESTDIR}/vpatterndb.lib -else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vpatterndb/$${DESTDIR}/libvpatterndb.a +win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vtools/$${DESTDIR}/vtools.lib +else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vtools/$${DESTDIR}/libvtools.a #VMisc static library unix|win32: LIBS += -L$$OUT_PWD/../libs/vmisc/$${DESTDIR}/ -lvmisc diff --git a/src/app/core/vapplication.cpp b/src/app/core/vapplication.cpp index 943ce03f2..91415c7ed 100644 --- a/src/app/core/vapplication.cpp +++ b/src/app/core/vapplication.cpp @@ -32,7 +32,7 @@ #include "../libs/ifc/exception/vexceptionconversionerror.h" #include "../libs/ifc/exception/vexceptionemptyparameter.h" #include "../libs/ifc/exception/vexceptionwrongid.h" -#include "vmaingraphicsview.h" +#include "../libs/vwidgets/vmaingraphicsview.h" #include "../version.h" #include "../vmisc/logging.h" @@ -156,9 +156,9 @@ const QString VApplication::GistFileName = QStringLiteral("gist.json"); * @param argv command line. */ VApplication::VApplication(int &argc, char **argv) - : VAbstractApplication(argc, argv), _patternUnit(Unit::Cm), - trVars(nullptr), undoStack(nullptr), sceneView(nullptr), currentScene(nullptr), autoSaveTimer(nullptr), - mainWindow(nullptr), openingPattern(false), doc(nullptr), log(nullptr), + : VAbstractApplication(argc, argv), + trVars(nullptr), autoSaveTimer(nullptr), + log(nullptr), #if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0) out(nullptr), logLock(nullptr) #else @@ -223,15 +223,6 @@ void VApplication::NewValentina(const QString &fileName) } } -//--------------------------------------------------------------------------------------------------------------------- -void VApplication::CheckFactor(qreal &oldFactor, const qreal &Newfactor) -{ - if (Newfactor <= 2 && Newfactor >= 0.5) - { - oldFactor = Newfactor; - } -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief notify Reimplemented from QApplication::notify(). @@ -465,12 +456,6 @@ void VApplication::ClearOldLogs() const } } -//--------------------------------------------------------------------------------------------------------------------- -void VApplication::setPatternUnit(const Unit &patternUnit) -{ - _patternUnit = patternUnit; -} - //--------------------------------------------------------------------------------------------------------------------- void VApplication::InitOptions() { @@ -535,56 +520,6 @@ void VApplication::InitOptions() } } -//--------------------------------------------------------------------------------------------------------------------- -double VApplication::toPixel(double val) const -{ - return ToPixel(val, _patternUnit); -} - -//--------------------------------------------------------------------------------------------------------------------- -double VApplication::fromPixel(double pix) const -{ - return FromPixel(pix, _patternUnit); -} - -//--------------------------------------------------------------------------------------------------------------------- -QWidget *VApplication::getMainWindow() const -{ - return mainWindow; -} - -//--------------------------------------------------------------------------------------------------------------------- -void VApplication::setMainWindow(QWidget *value) -{ - SCASSERT(value != nullptr) - mainWindow = value; -} - -//--------------------------------------------------------------------------------------------------------------------- -bool VApplication::getOpeningPattern() const -{ - return openingPattern; -} - -//--------------------------------------------------------------------------------------------------------------------- -void VApplication::setOpeningPattern() -{ - openingPattern = !openingPattern; -} - -//--------------------------------------------------------------------------------------------------------------------- -QGraphicsScene *VApplication::getCurrentScene() const -{ - SCASSERT(currentScene != nullptr); - return currentScene; -} - -//--------------------------------------------------------------------------------------------------------------------- -void VApplication::setCurrentScene(QGraphicsScene *value) -{ - currentScene = value; -} - //--------------------------------------------------------------------------------------------------------------------- QStringList VApplication::LabelLanguages() { diff --git a/src/app/core/vapplication.h b/src/app/core/vapplication.h index d480f4dba..bb86c87fd 100644 --- a/src/app/core/vapplication.h +++ b/src/app/core/vapplication.h @@ -36,7 +36,6 @@ #include "vsettings.h" class VApplication;// use in define -class QUndoStack; class VMainGraphicsView; class VPattern; class QFile; @@ -59,38 +58,18 @@ public: VApplication(int &argc, char ** argv); virtual ~VApplication(); static void NewValentina(const QString &fileName = QString()); - static void CheckFactor(qreal &oldFactor, const qreal &Newfactor); virtual bool notify(QObject * receiver, QEvent * event); - Unit patternUnit() const; - const Unit *patternUnitP() const; - void setPatternUnit(const Unit &patternUnit); void InitOptions(); - double toPixel(double val) const; - double fromPixel(double pix) const; - #if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0) static bool TryLock(QLockFile *lock); #endif //QT_VERSION >= QT_VERSION_CHECK(5, 1, 0) QString translationsPath() const; - QUndoStack *getUndoStack() const; - VMainGraphicsView *getSceneView() const; - void setSceneView(VMainGraphicsView *value); QTimer *getAutoSaveTimer() const; void setAutoSaveTimer(QTimer *value); - QWidget *getMainWindow() const; - void setMainWindow(QWidget *value); - bool getOpeningPattern() const; - void setOpeningPattern(); - - QGraphicsScene *getCurrentScene() const; - void setCurrentScene(QGraphicsScene *value); - - void setCurrentDocument(VPattern *doc); - VPattern *getCurrentDocument()const; static QStringList LabelLanguages(); @@ -100,7 +79,6 @@ public: virtual const VTranslateVars *TrVars(); void InitTrVars(); - #if defined(Q_OS_WIN) && defined(Q_CC_GNU) static void DrMingw(); void CollectReports() const; @@ -113,24 +91,9 @@ private slots: private: Q_DISABLE_COPY(VApplication) - Unit _patternUnit; VTranslateVars *trVars; - QUndoStack *undoStack; - VMainGraphicsView *sceneView; - QGraphicsScene *currentScene; QTimer *autoSaveTimer; - /** - * @brief mainWindow pointer to main window. Usefull if need create modal dialog. Without pointer to main window - * modality doesn't work. - */ - QWidget *mainWindow; - /** - * @brief openingPattern true when we opening pattern. If something will be wrong in formula this help understand if - * we can allow user use Undo option. - */ - bool openingPattern; - VPattern *doc; QFile *log; QTextStream *out; #if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0) @@ -155,36 +118,6 @@ private: void ClearOldLogs()const; }; -//--------------------------------------------------------------------------------------------------------------------- -inline Unit VApplication::patternUnit() const -{ - return _patternUnit; -} - -//--------------------------------------------------------------------------------------------------------------------- -inline const Unit *VApplication::patternUnitP() const -{ - return &_patternUnit; -} - -//--------------------------------------------------------------------------------------------------------------------- -inline QUndoStack *VApplication::getUndoStack() const -{ - return undoStack; -} - -//--------------------------------------------------------------------------------------------------------------------- -inline VMainGraphicsView *VApplication::getSceneView() const -{ - return sceneView; -} - -//--------------------------------------------------------------------------------------------------------------------- -inline void VApplication::setSceneView(VMainGraphicsView *value) -{ - sceneView = value; -} - //--------------------------------------------------------------------------------------------------------------------- inline QTimer *VApplication::getAutoSaveTimer() const { @@ -197,17 +130,4 @@ inline void VApplication::setAutoSaveTimer(QTimer *value) autoSaveTimer = value; } -//--------------------------------------------------------------------------------------------------------------------- -inline void VApplication::setCurrentDocument(VPattern *doc) -{ - this->doc = doc; -} - -//--------------------------------------------------------------------------------------------------------------------- -inline VPattern *VApplication::getCurrentDocument() const -{ - SCASSERT(doc != nullptr) - return doc; -} - #endif // VAPPLICATION_H diff --git a/src/app/core/vformulapropertyeditor.cpp b/src/app/core/vformulapropertyeditor.cpp index f208fee4a..b64c276c7 100644 --- a/src/app/core/vformulapropertyeditor.cpp +++ b/src/app/core/vformulapropertyeditor.cpp @@ -35,7 +35,7 @@ #include #include "../../libs/vpropertyexplorer/vproperty.h" -#include "../dialogs/tools/dialogeditwrongformula.h" +#include "../../libs/vtools/dialogs/support/dialogeditwrongformula.h" using namespace VPE; diff --git a/src/app/core/vtooloptionspropertybrowser.cpp b/src/app/core/vtooloptionspropertybrowser.cpp index 61fbea81c..3965a5d03 100644 --- a/src/app/core/vtooloptionspropertybrowser.cpp +++ b/src/app/core/vtooloptionspropertybrowser.cpp @@ -27,9 +27,9 @@ *************************************************************************/ #include "vtooloptionspropertybrowser.h" -#include "../tools/drawTools/drawtools.h" +#include "../../libs/vtools/tools/drawTools/drawtools.h" #include "../core/vapplication.h" -#include "vmaingraphicsview.h" +#include "../../libs/vwidgets/vmaingraphicsview.h" #include "../../libs/vwidgets/vgraphicssimpletextitem.h" #include "../../libs/vwidgets/vcontrolpointspline.h" #include "../../libs/vpropertyexplorer/vproperties.h" diff --git a/src/app/dialogs/app/dialoghistory.cpp b/src/app/dialogs/app/dialoghistory.cpp index b8ab94a54..7aaa5cbee 100644 --- a/src/app/dialogs/app/dialoghistory.cpp +++ b/src/app/dialogs/app/dialoghistory.cpp @@ -31,10 +31,10 @@ #include "../../libs/vgeometry/varc.h" #include "../../libs/vgeometry/vsplinepath.h" #include "../../libs/vgeometry/vpointf.h" -#include "../../tools/vabstracttool.h" -#include "../../tools/drawTools/vtoolcutspline.h" -#include "../../tools/drawTools/vtoolcutsplinepath.h" -#include "../../tools/drawTools/vtoolcutarc.h" +#include "../../libs/vtools/tools/vabstracttool.h" +#include "../../libs/vtools/tools/drawTools/vtoolcutspline.h" +#include "../../libs/vtools/tools/drawTools/vtoolcutsplinepath.h" +#include "../../libs/vtools/tools/drawTools/vtoolcutarc.h" #include "../../xml/vpattern.h" //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/app/dialoghistory.h b/src/app/dialogs/app/dialoghistory.h index 57f57f257..74156e5a7 100644 --- a/src/app/dialogs/app/dialoghistory.h +++ b/src/app/dialogs/app/dialoghistory.h @@ -29,7 +29,7 @@ #ifndef DIALOGHISTORY_H #define DIALOGHISTORY_H -#include "../tools/dialogtool.h" +#include "../../libs/vtools/dialogs/tools/dialogtool.h" #include diff --git a/src/app/dialogs/app/dialogincrements.cpp b/src/app/dialogs/app/dialogincrements.cpp index 9339416e1..ee6cb8fe1 100644 --- a/src/app/dialogs/app/dialogincrements.cpp +++ b/src/app/dialogs/app/dialogincrements.cpp @@ -34,6 +34,8 @@ #include "../../xml/vstandardmeasurements.h" #include "../../xml/vindividualmeasurements.h" #include "../../libs/vmisc/vsettings.h" +#include "../../libs/qmuparser/qmudef.h" +#include "../../libs/vpatterndb/vtranslatevars.h" #include #include diff --git a/src/app/dialogs/app/dialogincrements.h b/src/app/dialogs/app/dialogincrements.h index 7d8d61c2a..69e6917d5 100644 --- a/src/app/dialogs/app/dialogincrements.h +++ b/src/app/dialogs/app/dialogincrements.h @@ -29,7 +29,7 @@ #ifndef DIALOGINCREMENTS_H #define DIALOGINCREMENTS_H -#include "../tools/dialogtool.h" +#include "../../libs/vtools/dialogs/tools/dialogtool.h" #include "../../xml/vpattern.h" class VIndividualMeasurements; diff --git a/src/app/dialogs/dialogs.h b/src/app/dialogs/dialogs.h index 9e55341a3..9ed30f866 100644 --- a/src/app/dialogs/dialogs.h +++ b/src/app/dialogs/dialogs.h @@ -29,34 +29,6 @@ #ifndef DIALOGS_H #define DIALOGS_H -#include "tools/dialogalongline.h" -#include "tools/dialogarc.h" -#include "tools/dialogarcwithlength.h" -#include "tools/dialogbisector.h" -#include "tools/dialogdetail.h" -#include "tools/dialogendline.h" -#include "tools/dialogline.h" -#include "tools/dialoglineintersect.h" -#include "tools/dialognormal.h" -#include "tools/dialogpointofcontact.h" -#include "tools/dialogshoulderpoint.h" -#include "tools/dialogsinglepoint.h" -#include "tools/dialogspline.h" -#include "tools/dialogsplinepath.h" -#include "tools/dialogheight.h" -#include "tools/dialogcutarc.h" -#include "tools/dialogcutspline.h" -#include "tools/dialogcutsplinepath.h" -#include "tools/dialoguniondetails.h" -#include "tools/dialogtriangle.h" -#include "tools/dialogpointofintersection.h" -#include "tools/dialoglineintersectaxis.h" -#include "tools/dialogcurveintersectaxis.h" -#include "tools/dialogpointofintersectionarcs.h" -#include "tools/dialogpointofintersectioncircles.h" -#include "tools/dialogpointfromcircleandtangent.h" -#include "tools/dialogpointfromarcandtangent.h" - #include "app/dialoghistory.h" #include "app/dialogincrements.h" #include "app/configdialog.h" diff --git a/src/app/dialogs/dialogs.pri b/src/app/dialogs/dialogs.pri index 0bf0be853..a761da7ad 100644 --- a/src/app/dialogs/dialogs.pri +++ b/src/app/dialogs/dialogs.pri @@ -3,29 +3,6 @@ HEADERS += \ $$PWD/dialogs.h \ - $$PWD/tools/dialogtriangle.h \ - $$PWD/tools/dialogtool.h \ - $$PWD/tools/dialogsplinepath.h \ - $$PWD/tools/dialogspline.h \ - $$PWD/tools/dialogsinglepoint.h \ - $$PWD/tools/dialogshoulderpoint.h \ - $$PWD/tools/dialogpointofintersection.h \ - $$PWD/tools/dialogpointofcontact.h \ - $$PWD/tools/dialognormal.h \ - $$PWD/tools/dialoglineintersect.h \ - $$PWD/tools/dialogline.h \ - $$PWD/tools/dialogheight.h \ - $$PWD/tools/dialogendline.h \ - $$PWD/tools/dialogdetail.h \ - $$PWD/tools/dialogbisector.h \ - $$PWD/tools/dialogarc.h \ - $$PWD/tools/dialogalongline.h \ - $$PWD/tools/dialogcutspline.h \ - $$PWD/tools/dialogcutsplinepath.h \ - $$PWD/tools/dialoguniondetails.h \ - $$PWD/tools/dialogcutarc.h \ - $$PWD/tools/dialogeditwrongformula.h \ - $$PWD/tools/dialoglineintersectaxis.h \ $$PWD/app/dialogincrements.h \ $$PWD/app/dialoghistory.h \ $$PWD/app/configdialog.h \ @@ -40,41 +17,11 @@ HEADERS += \ $$PWD/app/configpages/patternpage.h \ $$PWD/app/configpages/communitypage.h \ $$PWD/app/configpages/pathpage.h \ - $$PWD/app/dialogundo.h \ - $$PWD/tools/dialogcurveintersectaxis.h \ $$PWD/app/dialoglayoutsettings.h \ $$PWD/app/dialoglayoutprogress.h \ - $$PWD/app/dialogsavelayout.h \ - $$PWD/tools/dialogpointofintersectionarcs.h \ - $$PWD/tools/dialogpointofintersectioncircles.h \ - $$PWD/tools/dialogpointfromcircleandtangent.h \ - $$PWD/tools/dialogpointfromarcandtangent.h \ - $$PWD/tools/dialogarcwithlength.h + $$PWD/app/dialogsavelayout.h SOURCES += \ - $$PWD/tools/dialogtriangle.cpp \ - $$PWD/tools/dialogtool.cpp \ - $$PWD/tools/dialogsplinepath.cpp \ - $$PWD/tools/dialogspline.cpp \ - $$PWD/tools/dialogsinglepoint.cpp \ - $$PWD/tools/dialogshoulderpoint.cpp \ - $$PWD/tools/dialogpointofintersection.cpp \ - $$PWD/tools/dialogpointofcontact.cpp \ - $$PWD/tools/dialognormal.cpp \ - $$PWD/tools/dialoglineintersect.cpp \ - $$PWD/tools/dialogline.cpp \ - $$PWD/tools/dialogheight.cpp \ - $$PWD/tools/dialogendline.cpp \ - $$PWD/tools/dialogdetail.cpp \ - $$PWD/tools/dialogbisector.cpp \ - $$PWD/tools/dialogarc.cpp \ - $$PWD/tools/dialogalongline.cpp \ - $$PWD/tools/dialogcutspline.cpp \ - $$PWD/tools/dialogcutsplinepath.cpp \ - $$PWD/tools/dialoguniondetails.cpp \ - $$PWD/tools/dialogcutarc.cpp \ - $$PWD/tools/dialogeditwrongformula.cpp \ - $$PWD/tools/dialoglineintersectaxis.cpp \ $$PWD/app/dialogincrements.cpp \ $$PWD/app/dialoghistory.cpp \ $$PWD/app/configdialog.cpp \ @@ -88,40 +35,11 @@ SOURCES += \ $$PWD/app/configpages/patternpage.cpp \ $$PWD/app/configpages/communitypage.cpp \ $$PWD/app/configpages/pathpage.cpp \ - $$PWD/app/dialogundo.cpp \ - $$PWD/tools/dialogcurveintersectaxis.cpp \ $$PWD/app/dialoglayoutsettings.cpp \ $$PWD/app/dialoglayoutprogress.cpp \ - $$PWD/app/dialogsavelayout.cpp \ - $$PWD/tools/dialogpointofintersectionarcs.cpp \ - $$PWD/tools/dialogpointofintersectioncircles.cpp \ - $$PWD/tools/dialogpointfromcircleandtangent.cpp \ - $$PWD/tools/dialogpointfromarcandtangent.cpp \ - $$PWD/tools/dialogarcwithlength.cpp + $$PWD/app/dialogsavelayout.cpp FORMS += \ - $$PWD/tools/dialogtriangle.ui \ - $$PWD/tools/dialogsplinepath.ui \ - $$PWD/tools/dialogspline.ui \ - $$PWD/tools/dialogsinglepoint.ui \ - $$PWD/tools/dialogshoulderpoint.ui \ - $$PWD/tools/dialogpointofintersection.ui \ - $$PWD/tools/dialogpointofcontact.ui \ - $$PWD/tools/dialognormal.ui \ - $$PWD/tools/dialoglineintersect.ui \ - $$PWD/tools/dialogline.ui \ - $$PWD/tools/dialogheight.ui \ - $$PWD/tools/dialogendline.ui \ - $$PWD/tools/dialogdetail.ui \ - $$PWD/tools/dialogbisector.ui \ - $$PWD/tools/dialogarc.ui \ - $$PWD/tools/dialogalongline.ui \ - $$PWD/tools/dialogcutspline.ui \ - $$PWD/tools/dialogcutsplinepath.ui \ - $$PWD/tools/dialoguniondetails.ui \ - $$PWD/tools/dialogcutarc.ui \ - $$PWD/tools/dialogeditwrongformula.ui \ - $$PWD/tools/dialoglineintersectaxis.ui \ $$PWD/app/dialogincrements.ui \ $$PWD/app/dialoghistory.ui \ $$PWD/app/dialogpatternproperties.ui \ @@ -130,13 +48,6 @@ FORMS += \ $$PWD/app/dialogindividualmeasurements.ui \ $$PWD/app/dialogaboutapp.ui \ $$PWD/app/dialogpatternxmledit.ui \ - $$PWD/app/dialogundo.ui \ - $$PWD/tools/dialogcurveintersectaxis.ui \ $$PWD/app/dialoglayoutsettings.ui \ $$PWD/app/dialoglayoutprogress.ui \ - $$PWD/app/dialogsavelayout.ui \ - $$PWD/tools/dialogpointofintersectionarcs.ui \ - $$PWD/tools/dialogpointofintersectioncircles.ui \ - $$PWD/tools/dialogpointfromcircleandtangent.ui \ - $$PWD/tools/dialogpointfromarcandtangent.ui \ - $$PWD/tools/dialogarcwithlength.ui + $$PWD/app/dialogsavelayout.ui diff --git a/src/app/mainwindow.h b/src/app/mainwindow.h index 9751d35e7..37d1f8395 100644 --- a/src/app/mainwindow.h +++ b/src/app/mainwindow.h @@ -31,6 +31,7 @@ #include "mainwindowsnogui.h" #include "../libs/vwidgets/vmaingraphicsview.h" +#include "../libs/vtools/dialogs/tooldialogs.h" #include "dialogs/dialogs.h" #include "tools/vtooldetail.h" #include "tools/vtooluniondetails.h" diff --git a/src/app/options.cpp b/src/app/options.cpp index 2cc70763b..5983df9a4 100644 --- a/src/app/options.cpp +++ b/src/app/options.cpp @@ -28,7 +28,3 @@ #include "options.h" #include - -// From documantation: If you use QStringLiteral you should avoid declaring the same literal in multiple places: This -// furthermore blows up the binary sizes. -const QString degreeSymbol = QStringLiteral("°"); diff --git a/src/app/options.h b/src/app/options.h index f98ddce0c..61d989004 100644 --- a/src/app/options.h +++ b/src/app/options.h @@ -47,12 +47,6 @@ class QString; class QStringList; -#define SceneSize 50000 -#define DefPointRadius 1.5//mm - -extern const QString degreeSymbol; - -enum class Source : char { FromGui, FromFile, FromTool }; enum class Contour : char { OpenContour, CloseContour }; #endif // OPTIONS_H diff --git a/src/app/xml/vpattern.cpp b/src/app/xml/vpattern.cpp index b86ad5b92..a251be714 100644 --- a/src/app/xml/vpattern.cpp +++ b/src/app/xml/vpattern.cpp @@ -27,23 +27,25 @@ *************************************************************************/ #include "vpattern.h" -#include "../tools/vdatatool.h" -#include "../tools/vtooldetail.h" -#include "../tools/vtooluniondetails.h" -#include "../tools/drawTools/drawtools.h" -#include "../tools/nodeDetails/nodedetails.h" -#include "../libs/ifc/exception/vexceptionobjecterror.h" -#include "../libs/ifc/exception/vexceptionwrongid.h" -#include "../libs/ifc/exception/vexceptionconversionerror.h" -#include "../libs/ifc/exception/vexceptionemptyparameter.h" -#include "../libs/ifc/exception/vexceptionundo.h" -#include "../libs/ifc/xml/vpatternconverter.h" -#include "../libs/vmisc/undoevent.h" -#include "../libs/vmisc/vsettings.h" +#include "../../libs/vtools/tools/vdatatool.h" +#include "../../libs/vtools/tools/vtooldetail.h" +#include "../../libs/vtools/tools/vtooluniondetails.h" +#include "../../libs/vtools/tools/drawTools/drawtools.h" +#include "../../libs/vtools/tools/nodeDetails/nodedetails.h" +#include "../../libs/ifc/exception/vexceptionobjecterror.h" +#include "../../libs/ifc/exception/vexceptionwrongid.h" +#include "../../libs/ifc/exception/vexceptionconversionerror.h" +#include "../../libs/ifc/exception/vexceptionemptyparameter.h" +#include "../../libs/ifc/exception/vexceptionundo.h" +#include "../../libs/ifc/xml/vpatternconverter.h" +#include "../../libs/vmisc/undoevent.h" +#include "../../libs/vmisc/vsettings.h" #include "vstandardmeasurements.h" #include "vindividualmeasurements.h" #include "../../libs/qmuparser/qmuparsererror.h" -#include "../libs/vgeometry/varc.h" +#include "../../libs/vgeometry/varc.h" +#include "../xml/vpattern.h" +#include "../core/vapplication.h" #include #include diff --git a/src/app/xml/vpattern.h b/src/app/xml/vpattern.h index 733b17fae..cf2e7496b 100644 --- a/src/app/xml/vpattern.h +++ b/src/app/xml/vpattern.h @@ -36,9 +36,6 @@ class VDataTool; class VMainGraphicsScene; -enum class LabelType : char {NewPatternPiece, NewLabel}; -enum class CrossCirclesPoint : char {FirstPoint = 1, SecondPoint = 2}; - /** * @brief The VPattern class working with pattern file. */ @@ -54,7 +51,7 @@ public: void Parse(const Document &parse); void setCurrentData(); - void UpdateToolData(const quint32 &id, VContainer *data); + virtual void UpdateToolData(const quint32 &id, VContainer *data); virtual void IncrementReferens(quint32 id) const; virtual void DecrementReferens(quint32 id) const; @@ -68,7 +65,7 @@ public: QString GetAuthor() const; void SetAuthor(const QString &text); - QString GenerateLabel(const LabelType &type)const; + virtual QString GenerateLabel(const LabelType &type)const; public slots: void LiteParseTree(const Document &parse); diff --git a/src/libs/ifc/ifcdef.cpp b/src/libs/ifc/ifcdef.cpp index 8bfc8d93c..cd00687a7 100644 --- a/src/libs/ifc/ifcdef.cpp +++ b/src/libs/ifc/ifcdef.cpp @@ -28,8 +28,6 @@ #include "ifcdef.h" -const qreal PrintDPI = 96.0; - #define DefWidth 1.2//mm //--------------------------------------------------------------------------------------------------------------------- @@ -59,112 +57,3 @@ qreal WidthHairLine(Unit patternUnit) { return WidthMainLine(patternUnit)/3.0; } - -//--------------------------------------------------------------------------------------------------------------------- -double ToPixel(double val, const Unit &unit) -{ - switch (unit) - { - case Unit::Mm: - return (val / 25.4) * PrintDPI; - case Unit::Cm: - return ((val * 10.0) / 25.4) * PrintDPI; - case Unit::Inch: - return val * PrintDPI; - case Unit::Px: - return val; - default: - break; - } - return 0; -} - -//--------------------------------------------------------------------------------------------------------------------- -double FromPixel(double pix, const Unit &unit) -{ - switch (unit) - { - case Unit::Mm: - return (pix / PrintDPI) * 25.4; - case Unit::Cm: - return ((pix / PrintDPI) * 25.4) / 10.0; - case Unit::Inch: - return pix / PrintDPI; - case Unit::Px: - return pix; - default: - break; - } - return 0; -} - -//--------------------------------------------------------------------------------------------------------------------- -qreal UnitConvertor(qreal value, const Unit &from, const Unit &to) -{ - switch (from) - { - case Unit::Mm: - switch (to) - { - case Unit::Mm: - return value; - case Unit::Cm: - return value / 10.0; - case Unit::Inch: - return value / 25.4; - case Unit::Px: - return (value / 25.4) * PrintDPI; - default: - break; - } - break; - case Unit::Cm: - switch (to) - { - case Unit::Mm: - return value * 10.0; - case Unit::Cm: - return value; - case Unit::Inch: - return value / 2.54; - case Unit::Px: - return ((value * 10.0) / 25.4) * PrintDPI; - default: - break; - } - break; - case Unit::Inch: - switch (to) - { - case Unit::Mm: - return value * 25.4; - case Unit::Cm: - return value * 2.54; - case Unit::Inch: - return value; - case Unit::Px: - return value * PrintDPI; - default: - break; - } - break; - case Unit::Px: - switch (to) - { - case Unit::Mm: - return (value / PrintDPI) * 25.4; - case Unit::Cm: - return ((value / PrintDPI) * 25.4) / 10.0; - case Unit::Inch: - return value / PrintDPI; - case Unit::Px: - return value; - default: - break; - } - break; - default: - break; - } - return 0; -} diff --git a/src/libs/ifc/ifcdef.h b/src/libs/ifc/ifcdef.h index af4eb50ca..e84290cce 100644 --- a/src/libs/ifc/ifcdef.h +++ b/src/libs/ifc/ifcdef.h @@ -30,14 +30,13 @@ #define IFCDEF_H #include +#include "../vmisc/def.h" #ifdef Q_OS_WIN32 extern Q_CORE_EXPORT int qt_ntfs_permission_lookup; #include #endif /*Q_OS_WIN32*/ -enum class Unit : char { Mm, Cm, Inch, Px }; - static const quint32 null_id = 0; #define NULL_ID null_id//use this value for initialization variables that keeps id values. 0 mean uknown id value. @@ -58,14 +57,7 @@ static const quint32 null_id = 0; # define V_NOEXCEPT_EXPR(x) # endif -extern const qreal PrintDPI; - qreal WidthMainLine(Unit patternUnit); qreal WidthHairLine(Unit patternUnit); -double ToPixel(double val, const Unit &unit); -double FromPixel(double pix, const Unit &unit); - -qreal UnitConvertor(qreal value, const Unit &from, const Unit &to); - #endif // IFCDEF_H diff --git a/src/libs/ifc/xml/vabstractpattern.h b/src/libs/ifc/xml/vabstractpattern.h index c6f0acf30..201d9009c 100644 --- a/src/libs/ifc/xml/vabstractpattern.h +++ b/src/libs/ifc/xml/vabstractpattern.h @@ -35,8 +35,11 @@ #include enum class Document : char { LiteParse, LitePPParse, FullParse }; +enum class CrossCirclesPoint : char {FirstPoint = 1, SecondPoint = 2}; +enum class LabelType : char {NewPatternPiece, NewLabel}; class VDataTool; +class VContainer; class VAbstractPattern : public QObject, public VDomDocument { @@ -64,6 +67,10 @@ public: virtual void IncrementReferens(quint32 id) const=0; virtual void DecrementReferens(quint32 id) const=0; + virtual QString GenerateLabel(const LabelType &type)const=0; + + virtual void UpdateToolData(const quint32 &id, VContainer *data)=0; + QHash *getTools(); VDataTool *getTool(const quint32 &id); void AddTool(const quint32 &id, VDataTool *tool); diff --git a/src/libs/ifc/xml/vdomdocument.h b/src/libs/ifc/xml/vdomdocument.h index ab86e8bb9..b52c480f5 100644 --- a/src/libs/ifc/xml/vdomdocument.h +++ b/src/libs/ifc/xml/vdomdocument.h @@ -33,7 +33,7 @@ #include #include -#include "ifcdef.h" +#include "../ifc/ifcdef.h" #include "../vmisc/def.h" #include "../vmisc/logging.h" diff --git a/src/libs/libs.pro b/src/libs/libs.pro index 83421d31b..0a75596bf 100644 --- a/src/libs/libs.pro +++ b/src/libs/libs.pro @@ -8,6 +8,5 @@ SUBDIRS = \ vgeometry \ vpatterndb \ vmisc \ - vwidgets - -vgeometry.depends = ifc + vwidgets \ + vtools diff --git a/src/libs/vgeometry/vgeometry.pro b/src/libs/vgeometry/vgeometry.pro index 43e050a5a..6676a3fda 100644 --- a/src/libs/vgeometry/vgeometry.pro +++ b/src/libs/vgeometry/vgeometry.pro @@ -94,12 +94,3 @@ CONFIG(debug, debug|release){ } } } - -# IFC static library -unix|win32: LIBS += -L$$OUT_PWD/../ifc/$${DESTDIR}/ -lifc - -INCLUDEPATH += $$PWD/../ifc -DEPENDPATH += $$PWD/../ifc - -win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../ifc/$${DESTDIR}/ifc.lib -else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../ifc/$${DESTDIR}/libifc.a diff --git a/src/libs/vmisc/def.cpp b/src/libs/vmisc/def.cpp index ed9826849..70ae01836 100644 --- a/src/libs/vmisc/def.cpp +++ b/src/libs/vmisc/def.cpp @@ -222,6 +222,10 @@ const QString in_Oprt = QStringLiteral("in"); const QString cursorArrowOpenHand = QStringLiteral("://cursor/cursor-arrow-openhand.png"); const QString cursorArrowCloseHand = QStringLiteral("://cursor/cursor-arrow-closehand.png"); +// From documantation: If you use QStringLiteral you should avoid declaring the same literal in multiple places: This +// furthermore blows up the binary sizes. +const QString degreeSymbol = QStringLiteral("°"); + //--------------------------------------------------------------------------------------------------------------------- void SetOverrideCursor(const QString &pixmapPath, int hotX, int hotY) { @@ -263,3 +267,123 @@ void RestoreOverrideCursor(const QString &pixmapPath) } #endif } + +const qreal PrintDPI = 96.0; + +//--------------------------------------------------------------------------------------------------------------------- +double ToPixel(double val, const Unit &unit) +{ + switch (unit) + { + case Unit::Mm: + return (val / 25.4) * PrintDPI; + case Unit::Cm: + return ((val * 10.0) / 25.4) * PrintDPI; + case Unit::Inch: + return val * PrintDPI; + case Unit::Px: + return val; + default: + break; + } + return 0; +} + +//--------------------------------------------------------------------------------------------------------------------- +double FromPixel(double pix, const Unit &unit) +{ + switch (unit) + { + case Unit::Mm: + return (pix / PrintDPI) * 25.4; + case Unit::Cm: + return ((pix / PrintDPI) * 25.4) / 10.0; + case Unit::Inch: + return pix / PrintDPI; + case Unit::Px: + return pix; + default: + break; + } + return 0; +} + +//--------------------------------------------------------------------------------------------------------------------- +qreal UnitConvertor(qreal value, const Unit &from, const Unit &to) +{ + switch (from) + { + case Unit::Mm: + switch (to) + { + case Unit::Mm: + return value; + case Unit::Cm: + return value / 10.0; + case Unit::Inch: + return value / 25.4; + case Unit::Px: + return (value / 25.4) * PrintDPI; + default: + break; + } + break; + case Unit::Cm: + switch (to) + { + case Unit::Mm: + return value * 10.0; + case Unit::Cm: + return value; + case Unit::Inch: + return value / 2.54; + case Unit::Px: + return ((value * 10.0) / 25.4) * PrintDPI; + default: + break; + } + break; + case Unit::Inch: + switch (to) + { + case Unit::Mm: + return value * 25.4; + case Unit::Cm: + return value * 2.54; + case Unit::Inch: + return value; + case Unit::Px: + return value * PrintDPI; + default: + break; + } + break; + case Unit::Px: + switch (to) + { + case Unit::Mm: + return (value / PrintDPI) * 25.4; + case Unit::Cm: + return ((value / PrintDPI) * 25.4) / 10.0; + case Unit::Inch: + return value / PrintDPI; + case Unit::Px: + return value; + default: + break; + } + break; + default: + break; + } + return 0; +} + +//--------------------------------------------------------------------------------------------------------------------- +void CheckFactor(qreal &oldFactor, const qreal &Newfactor) +{ + if (Newfactor <= 2 && Newfactor >= 0.5) + { + oldFactor = Newfactor; + } +} diff --git a/src/libs/vmisc/def.h b/src/libs/vmisc/def.h index d1693a929..067ae0b6d 100644 --- a/src/libs/vmisc/def.h +++ b/src/libs/vmisc/def.h @@ -33,9 +33,14 @@ #include #include +#define SceneSize 50000 +#define DefPointRadius 1.5//mm + enum class NodeDetail : char { Contour, Modeling }; enum class SceneObject : char { Point, Line, Spline, Arc, SplinePath, Detail, Unknown }; enum class MeasurementsType : char { Standard, Individual }; +enum class Unit : char { Mm, Cm, Inch, Px }; +enum class Source : char { FromGui, FromFile, FromTool }; enum class Tool : unsigned char { @@ -372,7 +377,18 @@ extern const QString in_Oprt; extern const QString cursorArrowOpenHand; extern const QString cursorArrowCloseHand; +extern const QString degreeSymbol; + void SetOverrideCursor(const QString & pixmapPath, int hotX = -1, int hotY = -1); void RestoreOverrideCursor(const QString & pixmapPath); +extern const qreal PrintDPI; + +double ToPixel(double val, const Unit &unit); +double FromPixel(double pix, const Unit &unit); + +qreal UnitConvertor(qreal value, const Unit &from, const Unit &to); + +void CheckFactor(qreal &oldFactor, const qreal &Newfactor); + #endif // DEF_H diff --git a/src/libs/vmisc/vabstractapplication.cpp b/src/libs/vmisc/vabstractapplication.cpp index 20b79751d..dbda77219 100644 --- a/src/libs/vmisc/vabstractapplication.cpp +++ b/src/libs/vmisc/vabstractapplication.cpp @@ -27,16 +27,44 @@ *************************************************************************/ #include "vabstractapplication.h" +#include "../vmisc/def.h" //--------------------------------------------------------------------------------------------------------------------- VAbstractApplication::VAbstractApplication(int &argc, char **argv) - :QApplication(argc, argv), _patternType(MeasurementsType::Individual), settings(nullptr) + :QApplication(argc, argv), + undoStack(nullptr), + mainWindow(nullptr), + _patternUnit(Unit::Cm), + _patternType(MeasurementsType::Individual), + settings(nullptr), + currentScene(nullptr), + sceneView(nullptr), + doc(nullptr), + openingPattern(false) {} //--------------------------------------------------------------------------------------------------------------------- VAbstractApplication::~VAbstractApplication() {} +//--------------------------------------------------------------------------------------------------------------------- +Unit VAbstractApplication::patternUnit() const +{ + return _patternUnit; +} + +//--------------------------------------------------------------------------------------------------------------------- +const Unit *VAbstractApplication::patternUnitP() const +{ + return &_patternUnit; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VAbstractApplication::setPatternUnit(const Unit &patternUnit) +{ + _patternUnit = patternUnit; +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief OpenSettings get acsses to application settings. @@ -59,3 +87,41 @@ VSettings *VAbstractApplication::Settings() SCASSERT(settings != nullptr); return settings; } + + +//--------------------------------------------------------------------------------------------------------------------- +QGraphicsScene *VAbstractApplication::getCurrentScene() const +{ + SCASSERT(currentScene != nullptr); + return currentScene; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VAbstractApplication::setCurrentScene(QGraphicsScene *value) +{ + currentScene = value; +} + +//--------------------------------------------------------------------------------------------------------------------- +VMainGraphicsView *VAbstractApplication::getSceneView() const +{ + return sceneView; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VAbstractApplication::setSceneView(VMainGraphicsView *value) +{ + sceneView = value; +} + +//--------------------------------------------------------------------------------------------------------------------- +double VAbstractApplication::toPixel(double val) const +{ + return ToPixel(val, _patternUnit); +} + +//--------------------------------------------------------------------------------------------------------------------- +double VAbstractApplication::fromPixel(double pix) const +{ + return FromPixel(pix, _patternUnit); +} diff --git a/src/libs/vmisc/vabstractapplication.h b/src/libs/vmisc/vabstractapplication.h index dc8cfc57b..89f2a1ad2 100644 --- a/src/libs/vmisc/vabstractapplication.h +++ b/src/libs/vmisc/vabstractapplication.h @@ -30,11 +30,15 @@ #define VABSTRACTAPPLICATION_H #include +#include #include "def.h" #include "vsettings.h" class VAbstractApplication;// use in define class VTranslateVars; +class VAbstractPattern; +class VMainGraphicsView; +class QUndoStack; #if defined(qApp) #undef qApp @@ -49,23 +53,67 @@ public: virtual const VTranslateVars *TrVars()=0; + Unit patternUnit() const; + const Unit *patternUnitP() const; + void setPatternUnit(const Unit &patternUnit); + MeasurementsType patternType() const; void setPatternType(const MeasurementsType &patternType); void OpenSettings(); - VSettings *Settings(); + VSettings *Settings(); template QString LocaleToString(const T &value); + QGraphicsScene *getCurrentScene() const; + void setCurrentScene(QGraphicsScene *value); + + VMainGraphicsView *getSceneView() const; + void setSceneView(VMainGraphicsView *value); + + double toPixel(double val) const; + double fromPixel(double pix) const; + + void setCurrentDocument(VAbstractPattern *doc); + VAbstractPattern *getCurrentDocument()const; + + bool getOpeningPattern() const; + void setOpeningPattern(); + + QWidget *getMainWindow() const; + void setMainWindow(QWidget *value); + + QUndoStack *getUndoStack() const; + +protected: + QUndoStack *undoStack; + + /** + * @brief mainWindow pointer to main window. Usefull if need create modal dialog. Without pointer to main window + * modality doesn't work. + */ + QWidget *mainWindow; private: Q_DISABLE_COPY(VAbstractApplication) + Unit _patternUnit; MeasurementsType _patternType; /** * @brief settings pointer to settings. Help hide constructor creation settings. Make make code more readable. */ VSettings *settings; + + QGraphicsScene *currentScene; + VMainGraphicsView *sceneView; + + VAbstractPattern *doc; + + /** + * @brief openingPattern true when we opening pattern. If something will be wrong in formula this help understand if + * we can allow user use Undo option. + */ + bool openingPattern; }; //--------------------------------------------------------------------------------------------------------------------- @@ -89,4 +137,48 @@ QString VAbstractApplication::LocaleToString(const T &value) return loc.toString(value); } +//--------------------------------------------------------------------------------------------------------------------- +inline void VAbstractApplication::setCurrentDocument(VAbstractPattern *doc) +{ + this->doc = doc; +} + +//--------------------------------------------------------------------------------------------------------------------- +inline VAbstractPattern *VAbstractApplication::getCurrentDocument() const +{ + SCASSERT(doc != nullptr) + return doc; +} + +//--------------------------------------------------------------------------------------------------------------------- +inline bool VAbstractApplication::getOpeningPattern() const +{ + return openingPattern; +} + +//--------------------------------------------------------------------------------------------------------------------- +inline void VAbstractApplication::setOpeningPattern() +{ + openingPattern = !openingPattern; +} + +//--------------------------------------------------------------------------------------------------------------------- +inline QWidget *VAbstractApplication::getMainWindow() const +{ + return mainWindow; +} + +//--------------------------------------------------------------------------------------------------------------------- +inline void VAbstractApplication::setMainWindow(QWidget *value) +{ + SCASSERT(value != nullptr) + mainWindow = value; +} + +//--------------------------------------------------------------------------------------------------------------------- +inline QUndoStack *VAbstractApplication::getUndoStack() const +{ + return undoStack; +} + #endif // VABSTRACTAPPLICATION_H diff --git a/src/libs/vpatterndb/vcontainer.cpp b/src/libs/vpatterndb/vcontainer.cpp index eb9d4e3d8..14d90b9ef 100644 --- a/src/libs/vpatterndb/vcontainer.cpp +++ b/src/libs/vpatterndb/vcontainer.cpp @@ -454,9 +454,9 @@ const QMap > VContainer::DataAnglesArcs() con } //--------------------------------------------------------------------------------------------------------------------- -const QMap > VContainer::DataAnglesCurves() const +const QMap > VContainer::DataAnglesCurves() const { - return DataVar(VarType::SplineAngle); + return DataVar(VarType::SplineAngle); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vpatterndb/vcontainer.h b/src/libs/vpatterndb/vcontainer.h index 7197c171a..3e5260afc 100644 --- a/src/libs/vpatterndb/vcontainer.h +++ b/src/libs/vpatterndb/vcontainer.h @@ -156,7 +156,7 @@ public: const QMap > DataAngleLines() const; const QMap > DataRadiusesArcs() const; const QMap > DataAnglesArcs() const; - const QMap > DataAnglesCurves() const; + const QMap > DataAnglesCurves() const; static bool IsUnique(const QString &name); diff --git a/src/libs/vtools/dialogs/dialogs.pri b/src/libs/vtools/dialogs/dialogs.pri new file mode 100644 index 000000000..442315bba --- /dev/null +++ b/src/libs/vtools/dialogs/dialogs.pri @@ -0,0 +1,98 @@ +# ADD TO EACH PATH $$PWD VARIABLE!!!!!! +# This need for corect working file translations.pro + +HEADERS += \ + $$PWD/tooldialogs.h \ + $$PWD/tools/dialogalongline.h \ + $$PWD/tools/dialogarc.h \ + $$PWD/tools/dialogarcwithlength.h \ + $$PWD/tools/dialogbisector.h \ + $$PWD/tools/dialogcurveintersectaxis.h \ + $$PWD/tools/dialogcutarc.h \ + $$PWD/tools/dialogcutspline.h \ + $$PWD/tools/dialogcutsplinepath.h \ + $$PWD/tools/dialogdetail.h \ + $$PWD/tools/dialogendline.h \ + $$PWD/tools/dialogheight.h \ + $$PWD/tools/dialogline.h \ + $$PWD/tools/dialoglineintersect.h \ + $$PWD/tools/dialoglineintersectaxis.h \ + $$PWD/tools/dialognormal.h \ + $$PWD/tools/dialogpointfromarcandtangent.h \ + $$PWD/tools/dialogpointfromcircleandtangent.h \ + $$PWD/tools/dialogpointofcontact.h \ + $$PWD/tools/dialogpointofintersection.h \ + $$PWD/tools/dialogpointofintersectionarcs.h \ + $$PWD/tools/dialogpointofintersectioncircles.h \ + $$PWD/tools/dialogshoulderpoint.h \ + $$PWD/tools/dialogsinglepoint.h \ + $$PWD/tools/dialogspline.h \ + $$PWD/tools/dialogsplinepath.h \ + $$PWD/tools/dialogtool.h \ + $$PWD/tools/dialogtriangle.h \ + $$PWD/tools/dialoguniondetails.h \ + $$PWD/support/dialogeditwrongformula.h \ + $$PWD/support/dialogundo.h + +SOURCES += \ + $$PWD/tools/dialogalongline.cpp \ + $$PWD/tools/dialogarc.cpp \ + $$PWD/tools/dialogarcwithlength.cpp \ + $$PWD/tools/dialogbisector.cpp \ + $$PWD/tools/dialogcurveintersectaxis.cpp \ + $$PWD/tools/dialogcutarc.cpp \ + $$PWD/tools/dialogcutspline.cpp \ + $$PWD/tools/dialogcutsplinepath.cpp \ + $$PWD/tools/dialogdetail.cpp \ + $$PWD/tools/dialogendline.cpp \ + $$PWD/tools/dialogheight.cpp \ + $$PWD/tools/dialogline.cpp \ + $$PWD/tools/dialoglineintersect.cpp \ + $$PWD/tools/dialoglineintersectaxis.cpp \ + $$PWD/tools/dialognormal.cpp \ + $$PWD/tools/dialogpointfromarcandtangent.cpp \ + $$PWD/tools/dialogpointfromcircleandtangent.cpp \ + $$PWD/tools/dialogpointofcontact.cpp \ + $$PWD/tools/dialogpointofintersection.cpp \ + $$PWD/tools/dialogpointofintersectionarcs.cpp \ + $$PWD/tools/dialogpointofintersectioncircles.cpp \ + $$PWD/tools/dialogshoulderpoint.cpp \ + $$PWD/tools/dialogsinglepoint.cpp \ + $$PWD/tools/dialogspline.cpp \ + $$PWD/tools/dialogsplinepath.cpp \ + $$PWD/tools/dialogtool.cpp \ + $$PWD/tools/dialogtriangle.cpp \ + $$PWD/tools/dialoguniondetails.cpp \ + $$PWD/support/dialogeditwrongformula.cpp \ + $$PWD/support/dialogundo.cpp + +FORMS += \ + $$PWD/tools/dialogalongline.ui \ + $$PWD/tools/dialogarc.ui \ + $$PWD/tools/dialogarcwithlength.ui \ + $$PWD/tools/dialogbisector.ui \ + $$PWD/tools/dialogcurveintersectaxis.ui \ + $$PWD/tools/dialogcutarc.ui \ + $$PWD/tools/dialogcutspline.ui \ + $$PWD/tools/dialogcutsplinepath.ui \ + $$PWD/tools/dialogdetail.ui \ + $$PWD/tools/dialogendline.ui \ + $$PWD/tools/dialogheight.ui \ + $$PWD/tools/dialogline.ui \ + $$PWD/tools/dialoglineintersect.ui \ + $$PWD/tools/dialoglineintersectaxis.ui \ + $$PWD/tools/dialognormal.ui \ + $$PWD/tools/dialogpointfromarcandtangent.ui \ + $$PWD/tools/dialogpointfromcircleandtangent.ui \ + $$PWD/tools/dialogpointofcontact.ui \ + $$PWD/tools/dialogpointofintersection.ui \ + $$PWD/tools/dialogpointofintersectionarcs.ui \ + $$PWD/tools/dialogpointofintersectioncircles.ui \ + $$PWD/tools/dialogshoulderpoint.ui \ + $$PWD/tools/dialogsinglepoint.ui \ + $$PWD/tools/dialogspline.ui \ + $$PWD/tools/dialogsplinepath.ui \ + $$PWD/tools/dialogtriangle.ui \ + $$PWD/tools/dialoguniondetails.ui \ + $$PWD/support/dialogeditwrongformula.ui \ + $$PWD/support/dialogundo.ui diff --git a/src/app/dialogs/tools/dialogeditwrongformula.cpp b/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp similarity index 98% rename from src/app/dialogs/tools/dialogeditwrongformula.cpp rename to src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp index ac2df7d50..000744c4d 100644 --- a/src/app/dialogs/tools/dialogeditwrongformula.cpp +++ b/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp @@ -28,7 +28,8 @@ #include "dialogeditwrongformula.h" #include "ui_dialogeditwrongformula.h" -#include "../../libs/vpatterndb/vcontainer.h" +#include "../../../vpatterndb/vcontainer.h" +#include "../../../vpatterndb/vtranslatevars.h" //--------------------------------------------------------------------------------------------------------------------- DialogEditWrongFormula::DialogEditWrongFormula(const VContainer *data, const quint32 &toolId, QWidget *parent) @@ -203,8 +204,8 @@ void DialogEditWrongFormula::ValChenged(int row) if (ui->radioButtonAnglesCurves->isChecked()) { const QString desc = QString("%1(%2) - %3").arg(item->text()) - .arg(*data->GetVariable(qApp->TrVars()->VarFromUser(item->text()))->GetValue()) - .arg(tr("Curve angle")); + .arg(*data->GetVariable(qApp->TrVars()->VarFromUser(item->text()))->GetValue()) + .arg(tr("Curve angle")); ui->labelDescription->setText(desc); return; } diff --git a/src/app/dialogs/tools/dialogeditwrongformula.h b/src/libs/vtools/dialogs/support/dialogeditwrongformula.h similarity index 99% rename from src/app/dialogs/tools/dialogeditwrongformula.h rename to src/libs/vtools/dialogs/support/dialogeditwrongformula.h index 18a3b5dfc..8c299ba58 100644 --- a/src/app/dialogs/tools/dialogeditwrongformula.h +++ b/src/libs/vtools/dialogs/support/dialogeditwrongformula.h @@ -29,7 +29,7 @@ #ifndef DIALOGEDITWRONGFORMULA_H #define DIALOGEDITWRONGFORMULA_H -#include "dialogtool.h" +#include "../tools/dialogtool.h" namespace Ui { diff --git a/src/app/dialogs/tools/dialogeditwrongformula.ui b/src/libs/vtools/dialogs/support/dialogeditwrongformula.ui similarity index 100% rename from src/app/dialogs/tools/dialogeditwrongformula.ui rename to src/libs/vtools/dialogs/support/dialogeditwrongformula.ui diff --git a/src/app/dialogs/app/dialogundo.cpp b/src/libs/vtools/dialogs/support/dialogundo.cpp similarity index 96% rename from src/app/dialogs/app/dialogundo.cpp rename to src/libs/vtools/dialogs/support/dialogundo.cpp index c58ca6511..f915051be 100644 --- a/src/app/dialogs/app/dialogundo.cpp +++ b/src/libs/vtools/dialogs/support/dialogundo.cpp @@ -28,8 +28,8 @@ #include "dialogundo.h" #include "ui_dialogundo.h" -#include "../../core/vapplication.h" -#include "../../libs/ifc/exception/vexceptionundo.h" +#include "../../../ifc/exception/vexceptionundo.h" +#include "../../../vmisc/vabstractapplication.h" #include #include diff --git a/src/app/dialogs/app/dialogundo.h b/src/libs/vtools/dialogs/support/dialogundo.h similarity index 100% rename from src/app/dialogs/app/dialogundo.h rename to src/libs/vtools/dialogs/support/dialogundo.h diff --git a/src/app/dialogs/app/dialogundo.ui b/src/libs/vtools/dialogs/support/dialogundo.ui similarity index 100% rename from src/app/dialogs/app/dialogundo.ui rename to src/libs/vtools/dialogs/support/dialogundo.ui diff --git a/src/libs/vtools/dialogs/tooldialogs.h b/src/libs/vtools/dialogs/tooldialogs.h new file mode 100644 index 000000000..bcce4f6cf --- /dev/null +++ b/src/libs/vtools/dialogs/tooldialogs.h @@ -0,0 +1,63 @@ +/************************************************************************ + ** + ** @file dialogs.h + ** @author Roman Telezhynskyi + ** @date 16 6, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef TOOLDIALOGS_H +#define TOOLDIALOGS_H + +#include "dialogs/tools/dialogalongline.h" +#include "dialogs/tools/dialogarc.h" +#include "dialogs/tools/dialogarcwithlength.h" +#include "dialogs/tools/dialogbisector.h" +#include "dialogs/tools/dialogdetail.h" +#include "dialogs/tools/dialogendline.h" +#include "dialogs/tools/dialogline.h" +#include "dialogs/tools/dialoglineintersect.h" +#include "dialogs/tools/dialognormal.h" +#include "dialogs/tools/dialogpointofcontact.h" +#include "dialogs/tools/dialogshoulderpoint.h" +#include "dialogs/tools/dialogsinglepoint.h" +#include "dialogs/tools/dialogspline.h" +#include "dialogs/tools/dialogsplinepath.h" +#include "dialogs/tools/dialogheight.h" +#include "dialogs/tools/dialogcutarc.h" +#include "dialogs/tools/dialogcutspline.h" +#include "dialogs/tools/dialogcutsplinepath.h" +#include "dialogs/tools/dialoguniondetails.h" +#include "dialogs/tools/dialogtriangle.h" +#include "dialogs/tools/dialogpointofintersection.h" +#include "dialogs/tools/dialoglineintersectaxis.h" +#include "dialogs/tools/dialogcurveintersectaxis.h" +#include "dialogs/tools/dialogpointofintersectionarcs.h" +#include "dialogs/tools/dialogpointofintersectioncircles.h" +#include "dialogs/tools/dialogpointfromcircleandtangent.h" +#include "dialogs/tools/dialogpointfromarcandtangent.h" + +#include "dialogs/support/dialogeditwrongformula.h" +#include "dialogs/support/dialogundo.h" + +#endif // TOOLDIALOGS_H diff --git a/src/app/dialogs/tools/dialogalongline.cpp b/src/libs/vtools/dialogs/tools/dialogalongline.cpp similarity index 98% rename from src/app/dialogs/tools/dialogalongline.cpp rename to src/libs/vtools/dialogs/tools/dialogalongline.cpp index 48cd4f89d..82793bb45 100644 --- a/src/app/dialogs/tools/dialogalongline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogalongline.cpp @@ -30,8 +30,9 @@ #include "ui_dialogalongline.h" #include "../../visualization/vistoolalongline.h" #include "../../tools/vabstracttool.h" -#include "../../libs/vwidgets/vmaingraphicsscene.h" -#include "dialogeditwrongformula.h" +#include "../../../vwidgets/vmaingraphicsscene.h" +#include "../../../vpatterndb/vtranslatevars.h" +#include "../support/dialogeditwrongformula.h" #include diff --git a/src/app/dialogs/tools/dialogalongline.h b/src/libs/vtools/dialogs/tools/dialogalongline.h similarity index 100% rename from src/app/dialogs/tools/dialogalongline.h rename to src/libs/vtools/dialogs/tools/dialogalongline.h diff --git a/src/app/dialogs/tools/dialogalongline.ui b/src/libs/vtools/dialogs/tools/dialogalongline.ui similarity index 100% rename from src/app/dialogs/tools/dialogalongline.ui rename to src/libs/vtools/dialogs/tools/dialogalongline.ui diff --git a/src/app/dialogs/tools/dialogarc.cpp b/src/libs/vtools/dialogs/tools/dialogarc.cpp similarity index 98% rename from src/app/dialogs/tools/dialogarc.cpp rename to src/libs/vtools/dialogs/tools/dialogarc.cpp index d1cf87595..3224f5065 100644 --- a/src/app/dialogs/tools/dialogarc.cpp +++ b/src/libs/vtools/dialogs/tools/dialogarc.cpp @@ -32,11 +32,12 @@ #include #include -#include "../../libs/vgeometry/vpointf.h" -#include "../../libs/vpatterndb/vcontainer.h" -#include "../../libs/ifc/xml/vdomdocument.h" +#include "../../../vgeometry/vpointf.h" +#include "../../../vpatterndb/vcontainer.h" +#include "../../../vpatterndb/vtranslatevars.h" +#include "../../../ifc/xml/vdomdocument.h" #include "../../visualization/vistoolarc.h" -#include "dialogeditwrongformula.h" +#include "../support/dialogeditwrongformula.h" //--------------------------------------------------------------------------------------------------------------------- /** diff --git a/src/app/dialogs/tools/dialogarc.h b/src/libs/vtools/dialogs/tools/dialogarc.h similarity index 100% rename from src/app/dialogs/tools/dialogarc.h rename to src/libs/vtools/dialogs/tools/dialogarc.h diff --git a/src/app/dialogs/tools/dialogarc.ui b/src/libs/vtools/dialogs/tools/dialogarc.ui similarity index 100% rename from src/app/dialogs/tools/dialogarc.ui rename to src/libs/vtools/dialogs/tools/dialogarc.ui diff --git a/src/app/dialogs/tools/dialogarcwithlength.cpp b/src/libs/vtools/dialogs/tools/dialogarcwithlength.cpp similarity index 98% rename from src/app/dialogs/tools/dialogarcwithlength.cpp rename to src/libs/vtools/dialogs/tools/dialogarcwithlength.cpp index a47126578..824e93a57 100644 --- a/src/app/dialogs/tools/dialogarcwithlength.cpp +++ b/src/libs/vtools/dialogs/tools/dialogarcwithlength.cpp @@ -32,11 +32,12 @@ #include #include -#include "../../libs/vgeometry/vpointf.h" -#include "../../libs/vpatterndb/vcontainer.h" -#include "../../libs/ifc/xml/vdomdocument.h" +#include "../../../vgeometry/vpointf.h" +#include "../../../vpatterndb/vcontainer.h" +#include "../../../vpatterndb/vtranslatevars.h" +#include "../../../ifc/xml/vdomdocument.h" #include "../../visualization/vistoolarcwithlength.h" -#include "dialogeditwrongformula.h" +#include "../support/dialogeditwrongformula.h" //--------------------------------------------------------------------------------------------------------------------- DialogArcWithLength::DialogArcWithLength(const VContainer *data, const quint32 &toolId, QWidget *parent) diff --git a/src/app/dialogs/tools/dialogarcwithlength.h b/src/libs/vtools/dialogs/tools/dialogarcwithlength.h similarity index 100% rename from src/app/dialogs/tools/dialogarcwithlength.h rename to src/libs/vtools/dialogs/tools/dialogarcwithlength.h diff --git a/src/app/dialogs/tools/dialogarcwithlength.ui b/src/libs/vtools/dialogs/tools/dialogarcwithlength.ui similarity index 100% rename from src/app/dialogs/tools/dialogarcwithlength.ui rename to src/libs/vtools/dialogs/tools/dialogarcwithlength.ui diff --git a/src/app/dialogs/tools/dialogbisector.cpp b/src/libs/vtools/dialogs/tools/dialogbisector.cpp similarity index 98% rename from src/app/dialogs/tools/dialogbisector.cpp rename to src/libs/vtools/dialogs/tools/dialogbisector.cpp index f22ae407b..495db4c07 100644 --- a/src/app/dialogs/tools/dialogbisector.cpp +++ b/src/libs/vtools/dialogs/tools/dialogbisector.cpp @@ -29,12 +29,13 @@ #include "dialogbisector.h" #include "ui_dialogbisector.h" -#include "../../libs/vgeometry/vpointf.h" -#include "../../libs/vpatterndb/vcontainer.h" +#include "../vgeometry/vpointf.h" +#include "../vpatterndb/vcontainer.h" +#include "../vpatterndb/vtranslatevars.h" #include "../../visualization/vistoolbisector.h" -#include "../../libs/vwidgets/vmaingraphicsscene.h" +#include "../vwidgets/vmaingraphicsscene.h" #include "../../tools/vabstracttool.h" -#include "dialogeditwrongformula.h" +#include "../support/dialogeditwrongformula.h" //--------------------------------------------------------------------------------------------------------------------- /** diff --git a/src/app/dialogs/tools/dialogbisector.h b/src/libs/vtools/dialogs/tools/dialogbisector.h similarity index 100% rename from src/app/dialogs/tools/dialogbisector.h rename to src/libs/vtools/dialogs/tools/dialogbisector.h diff --git a/src/app/dialogs/tools/dialogbisector.ui b/src/libs/vtools/dialogs/tools/dialogbisector.ui similarity index 100% rename from src/app/dialogs/tools/dialogbisector.ui rename to src/libs/vtools/dialogs/tools/dialogbisector.ui diff --git a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp b/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.cpp similarity index 98% rename from src/app/dialogs/tools/dialogcurveintersectaxis.cpp rename to src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.cpp index 0af9b1d28..41fe7d6f3 100644 --- a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp +++ b/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.cpp @@ -29,12 +29,13 @@ #include "dialogcurveintersectaxis.h" #include "ui_dialogcurveintersectaxis.h" -#include "../../libs/vgeometry/vpointf.h" -#include "../../libs/vpatterndb/vcontainer.h" +#include "../../../vgeometry/vpointf.h" +#include "../../../vpatterndb/vcontainer.h" +#include "../../../vpatterndb/vtranslatevars.h" #include "../../visualization/vistoolcurveintersectaxis.h" -#include "../../libs/vwidgets/vmaingraphicsscene.h" +#include "../../../vwidgets/vmaingraphicsscene.h" #include "../../tools/vabstracttool.h" -#include "dialogeditwrongformula.h" +#include "../support/dialogeditwrongformula.h" #include diff --git a/src/app/dialogs/tools/dialogcurveintersectaxis.h b/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.h similarity index 100% rename from src/app/dialogs/tools/dialogcurveintersectaxis.h rename to src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.h diff --git a/src/app/dialogs/tools/dialogcurveintersectaxis.ui b/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.ui similarity index 100% rename from src/app/dialogs/tools/dialogcurveintersectaxis.ui rename to src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.ui diff --git a/src/app/dialogs/tools/dialogcutarc.cpp b/src/libs/vtools/dialogs/tools/dialogcutarc.cpp similarity index 97% rename from src/app/dialogs/tools/dialogcutarc.cpp rename to src/libs/vtools/dialogs/tools/dialogcutarc.cpp index 7025bab80..46c02de81 100644 --- a/src/app/dialogs/tools/dialogcutarc.cpp +++ b/src/libs/vtools/dialogs/tools/dialogcutarc.cpp @@ -29,12 +29,12 @@ #include "dialogcutarc.h" #include "ui_dialogcutarc.h" -#include "../../libs/vgeometry/varc.h" -#include "../../libs/vpatterndb/vcontainer.h" +#include "../../../vgeometry/varc.h" +#include "../../../vpatterndb/vcontainer.h" +#include "../../../vpatterndb/vtranslatevars.h" #include "../../visualization/vistoolcutarc.h" -#include "../../libs/vwidgets/vmaingraphicsscene.h" -#include "../../xml/vpattern.h" -#include "dialogeditwrongformula.h" +#include "../../../vwidgets/vmaingraphicsscene.h" +#include "../support/dialogeditwrongformula.h" //--------------------------------------------------------------------------------------------------------------------- /** diff --git a/src/app/dialogs/tools/dialogcutarc.h b/src/libs/vtools/dialogs/tools/dialogcutarc.h similarity index 100% rename from src/app/dialogs/tools/dialogcutarc.h rename to src/libs/vtools/dialogs/tools/dialogcutarc.h diff --git a/src/app/dialogs/tools/dialogcutarc.ui b/src/libs/vtools/dialogs/tools/dialogcutarc.ui similarity index 100% rename from src/app/dialogs/tools/dialogcutarc.ui rename to src/libs/vtools/dialogs/tools/dialogcutarc.ui diff --git a/src/app/dialogs/tools/dialogcutspline.cpp b/src/libs/vtools/dialogs/tools/dialogcutspline.cpp similarity index 97% rename from src/app/dialogs/tools/dialogcutspline.cpp rename to src/libs/vtools/dialogs/tools/dialogcutspline.cpp index eba616608..6424936a1 100644 --- a/src/app/dialogs/tools/dialogcutspline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogcutspline.cpp @@ -29,11 +29,11 @@ #include "dialogcutspline.h" #include "ui_dialogcutspline.h" -#include "../../libs/vgeometry/vspline.h" -#include "../../libs/vpatterndb/vcontainer.h" -#include "../../xml/vpattern.h" +#include "../../../vgeometry/vspline.h" +#include "../../../vpatterndb/vcontainer.h" +#include "../../../vpatterndb/vtranslatevars.h" #include "../../visualization/vistoolcutspline.h" -#include "dialogeditwrongformula.h" +#include "../support/dialogeditwrongformula.h" //--------------------------------------------------------------------------------------------------------------------- /** diff --git a/src/app/dialogs/tools/dialogcutspline.h b/src/libs/vtools/dialogs/tools/dialogcutspline.h similarity index 100% rename from src/app/dialogs/tools/dialogcutspline.h rename to src/libs/vtools/dialogs/tools/dialogcutspline.h diff --git a/src/app/dialogs/tools/dialogcutspline.ui b/src/libs/vtools/dialogs/tools/dialogcutspline.ui similarity index 100% rename from src/app/dialogs/tools/dialogcutspline.ui rename to src/libs/vtools/dialogs/tools/dialogcutspline.ui diff --git a/src/app/dialogs/tools/dialogcutsplinepath.cpp b/src/libs/vtools/dialogs/tools/dialogcutsplinepath.cpp similarity index 97% rename from src/app/dialogs/tools/dialogcutsplinepath.cpp rename to src/libs/vtools/dialogs/tools/dialogcutsplinepath.cpp index 3b62c85ef..f9128f4c7 100644 --- a/src/app/dialogs/tools/dialogcutsplinepath.cpp +++ b/src/libs/vtools/dialogs/tools/dialogcutsplinepath.cpp @@ -29,11 +29,11 @@ #include "dialogcutsplinepath.h" #include "ui_dialogcutsplinepath.h" -#include "../../libs/vgeometry/vsplinepath.h" -#include "../../libs/vpatterndb/vcontainer.h" -#include "../../xml/vpattern.h" +#include "../../../vgeometry/vsplinepath.h" +#include "../../../vpatterndb/vcontainer.h" +#include "../../../vpatterndb/vtranslatevars.h" #include "../../visualization/vistoolcutsplinepath.h" -#include "dialogeditwrongformula.h" +#include "../support/dialogeditwrongformula.h" //--------------------------------------------------------------------------------------------------------------------- /** diff --git a/src/app/dialogs/tools/dialogcutsplinepath.h b/src/libs/vtools/dialogs/tools/dialogcutsplinepath.h similarity index 100% rename from src/app/dialogs/tools/dialogcutsplinepath.h rename to src/libs/vtools/dialogs/tools/dialogcutsplinepath.h diff --git a/src/app/dialogs/tools/dialogcutsplinepath.ui b/src/libs/vtools/dialogs/tools/dialogcutsplinepath.ui similarity index 100% rename from src/app/dialogs/tools/dialogcutsplinepath.ui rename to src/libs/vtools/dialogs/tools/dialogcutsplinepath.ui diff --git a/src/app/dialogs/tools/dialogdetail.cpp b/src/libs/vtools/dialogs/tools/dialogdetail.cpp similarity index 98% rename from src/app/dialogs/tools/dialogdetail.cpp rename to src/libs/vtools/dialogs/tools/dialogdetail.cpp index 30c53d53c..b42229ee8 100644 --- a/src/app/dialogs/tools/dialogdetail.cpp +++ b/src/libs/vtools/dialogs/tools/dialogdetail.cpp @@ -30,12 +30,11 @@ #include -#include "../../libs/vgeometry/varc.h" -#include "../../libs/vgeometry/vpointf.h" -#include "../../libs/vgeometry/vsplinepath.h" -#include "../../libs/vpatterndb/vcontainer.h" -#include "../../libs/ifc/xml/vdomdocument.h" -#include "../../xml/vabstractmeasurements.h" +#include "../../../vgeometry/varc.h" +#include "../../../vgeometry/vpointf.h" +#include "../../../vgeometry/vsplinepath.h" +#include "../../../vpatterndb/vcontainer.h" +#include "../../../ifc/xml/vdomdocument.h" //--------------------------------------------------------------------------------------------------------------------- /** diff --git a/src/app/dialogs/tools/dialogdetail.h b/src/libs/vtools/dialogs/tools/dialogdetail.h similarity index 100% rename from src/app/dialogs/tools/dialogdetail.h rename to src/libs/vtools/dialogs/tools/dialogdetail.h diff --git a/src/app/dialogs/tools/dialogdetail.ui b/src/libs/vtools/dialogs/tools/dialogdetail.ui similarity index 100% rename from src/app/dialogs/tools/dialogdetail.ui rename to src/libs/vtools/dialogs/tools/dialogdetail.ui diff --git a/src/app/dialogs/tools/dialogendline.cpp b/src/libs/vtools/dialogs/tools/dialogendline.cpp similarity index 98% rename from src/app/dialogs/tools/dialogendline.cpp rename to src/libs/vtools/dialogs/tools/dialogendline.cpp index 002b10a7b..a193ed962 100644 --- a/src/app/dialogs/tools/dialogendline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogendline.cpp @@ -29,12 +29,13 @@ #include "dialogendline.h" #include "ui_dialogendline.h" -#include "../../libs/vgeometry/vpointf.h" -#include "../../libs/vpatterndb/vcontainer.h" +#include "../../../vgeometry/vpointf.h" +#include "../../../vpatterndb/vcontainer.h" +#include "../../../vpatterndb/vtranslatevars.h" #include "../../visualization/vistoolendline.h" -#include "../../libs/vwidgets/vmaingraphicsscene.h" +#include "../../../vwidgets/vmaingraphicsscene.h" #include "../../tools/vabstracttool.h" -#include "dialogeditwrongformula.h" +#include "../support/dialogeditwrongformula.h" #include //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogendline.h b/src/libs/vtools/dialogs/tools/dialogendline.h similarity index 100% rename from src/app/dialogs/tools/dialogendline.h rename to src/libs/vtools/dialogs/tools/dialogendline.h diff --git a/src/app/dialogs/tools/dialogendline.ui b/src/libs/vtools/dialogs/tools/dialogendline.ui similarity index 100% rename from src/app/dialogs/tools/dialogendline.ui rename to src/libs/vtools/dialogs/tools/dialogendline.ui diff --git a/src/app/dialogs/tools/dialogheight.cpp b/src/libs/vtools/dialogs/tools/dialogheight.cpp similarity index 100% rename from src/app/dialogs/tools/dialogheight.cpp rename to src/libs/vtools/dialogs/tools/dialogheight.cpp diff --git a/src/app/dialogs/tools/dialogheight.h b/src/libs/vtools/dialogs/tools/dialogheight.h similarity index 100% rename from src/app/dialogs/tools/dialogheight.h rename to src/libs/vtools/dialogs/tools/dialogheight.h diff --git a/src/app/dialogs/tools/dialogheight.ui b/src/libs/vtools/dialogs/tools/dialogheight.ui similarity index 100% rename from src/app/dialogs/tools/dialogheight.ui rename to src/libs/vtools/dialogs/tools/dialogheight.ui diff --git a/src/app/dialogs/tools/dialogline.cpp b/src/libs/vtools/dialogs/tools/dialogline.cpp similarity index 97% rename from src/app/dialogs/tools/dialogline.cpp rename to src/libs/vtools/dialogs/tools/dialogline.cpp index d3badadb5..6f3839a5e 100644 --- a/src/app/dialogs/tools/dialogline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogline.cpp @@ -29,11 +29,10 @@ #include "dialogline.h" #include "ui_dialogline.h" -#include "../../libs/vgeometry/vpointf.h" -#include "../../libs/vpatterndb/vcontainer.h" +#include "../../../vgeometry/vpointf.h" +#include "../../../vpatterndb/vcontainer.h" #include "../../visualization/vistoolline.h" -#include "../../core/vapplication.h" -#include "../../libs/vwidgets/vmaingraphicsscene.h" +#include "../../../vwidgets/vmaingraphicsscene.h" #include "../../tools/vabstracttool.h" //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogline.h b/src/libs/vtools/dialogs/tools/dialogline.h similarity index 100% rename from src/app/dialogs/tools/dialogline.h rename to src/libs/vtools/dialogs/tools/dialogline.h diff --git a/src/app/dialogs/tools/dialogline.ui b/src/libs/vtools/dialogs/tools/dialogline.ui similarity index 100% rename from src/app/dialogs/tools/dialogline.ui rename to src/libs/vtools/dialogs/tools/dialogline.ui diff --git a/src/app/dialogs/tools/dialoglineintersect.cpp b/src/libs/vtools/dialogs/tools/dialoglineintersect.cpp similarity index 99% rename from src/app/dialogs/tools/dialoglineintersect.cpp rename to src/libs/vtools/dialogs/tools/dialoglineintersect.cpp index adb003cf5..da3a4e742 100644 --- a/src/app/dialogs/tools/dialoglineintersect.cpp +++ b/src/libs/vtools/dialogs/tools/dialoglineintersect.cpp @@ -33,7 +33,6 @@ #include "../../libs/vpatterndb/vcontainer.h" #include "../../visualization/vistoollineintersect.h" #include "../../libs/vwidgets/vmaingraphicsscene.h" -#include "../../xml/vpattern.h" //--------------------------------------------------------------------------------------------------------------------- /** diff --git a/src/app/dialogs/tools/dialoglineintersect.h b/src/libs/vtools/dialogs/tools/dialoglineintersect.h similarity index 100% rename from src/app/dialogs/tools/dialoglineintersect.h rename to src/libs/vtools/dialogs/tools/dialoglineintersect.h diff --git a/src/app/dialogs/tools/dialoglineintersect.ui b/src/libs/vtools/dialogs/tools/dialoglineintersect.ui similarity index 100% rename from src/app/dialogs/tools/dialoglineintersect.ui rename to src/libs/vtools/dialogs/tools/dialoglineintersect.ui diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.cpp b/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.cpp similarity index 98% rename from src/app/dialogs/tools/dialoglineintersectaxis.cpp rename to src/libs/vtools/dialogs/tools/dialoglineintersectaxis.cpp index 0ad55d5fd..ebca04988 100644 --- a/src/app/dialogs/tools/dialoglineintersectaxis.cpp +++ b/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.cpp @@ -29,12 +29,13 @@ #include "dialoglineintersectaxis.h" #include "ui_dialoglineintersectaxis.h" -#include "../../libs/vgeometry/vpointf.h" -#include "../../libs/vpatterndb/vcontainer.h" +#include "../../../vgeometry/vpointf.h" +#include "../../../vpatterndb/vcontainer.h" +#include "../../../vpatterndb/vtranslatevars.h" #include "../../visualization/vistoollineintersectaxis.h" -#include "../../libs/vwidgets/vmaingraphicsscene.h" +#include "../../../vwidgets/vmaingraphicsscene.h" #include "../../tools/vabstracttool.h" -#include "dialogeditwrongformula.h" +#include "../support/dialogeditwrongformula.h" #include diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.h b/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.h similarity index 100% rename from src/app/dialogs/tools/dialoglineintersectaxis.h rename to src/libs/vtools/dialogs/tools/dialoglineintersectaxis.h diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.ui b/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.ui similarity index 100% rename from src/app/dialogs/tools/dialoglineintersectaxis.ui rename to src/libs/vtools/dialogs/tools/dialoglineintersectaxis.ui diff --git a/src/app/dialogs/tools/dialognormal.cpp b/src/libs/vtools/dialogs/tools/dialognormal.cpp similarity index 98% rename from src/app/dialogs/tools/dialognormal.cpp rename to src/libs/vtools/dialogs/tools/dialognormal.cpp index 37f0408cc..1480b5728 100644 --- a/src/app/dialogs/tools/dialognormal.cpp +++ b/src/libs/vtools/dialogs/tools/dialognormal.cpp @@ -29,9 +29,10 @@ #include "dialognormal.h" #include "ui_dialognormal.h" #include "../../visualization/vistoolnormal.h" -#include "../../../libs/vwidgets/vmaingraphicsscene.h" +#include "../../../vwidgets/vmaingraphicsscene.h" #include "../../tools/vabstracttool.h" -#include "dialogeditwrongformula.h" +#include "../support/dialogeditwrongformula.h" +#include "../../../vpatterndb/vtranslatevars.h" //--------------------------------------------------------------------------------------------------------------------- /** diff --git a/src/app/dialogs/tools/dialognormal.h b/src/libs/vtools/dialogs/tools/dialognormal.h similarity index 100% rename from src/app/dialogs/tools/dialognormal.h rename to src/libs/vtools/dialogs/tools/dialognormal.h diff --git a/src/app/dialogs/tools/dialognormal.ui b/src/libs/vtools/dialogs/tools/dialognormal.ui similarity index 100% rename from src/app/dialogs/tools/dialognormal.ui rename to src/libs/vtools/dialogs/tools/dialognormal.ui diff --git a/src/app/dialogs/tools/dialogpointfromarcandtangent.cpp b/src/libs/vtools/dialogs/tools/dialogpointfromarcandtangent.cpp similarity index 100% rename from src/app/dialogs/tools/dialogpointfromarcandtangent.cpp rename to src/libs/vtools/dialogs/tools/dialogpointfromarcandtangent.cpp diff --git a/src/app/dialogs/tools/dialogpointfromarcandtangent.h b/src/libs/vtools/dialogs/tools/dialogpointfromarcandtangent.h similarity index 100% rename from src/app/dialogs/tools/dialogpointfromarcandtangent.h rename to src/libs/vtools/dialogs/tools/dialogpointfromarcandtangent.h diff --git a/src/app/dialogs/tools/dialogpointfromarcandtangent.ui b/src/libs/vtools/dialogs/tools/dialogpointfromarcandtangent.ui similarity index 100% rename from src/app/dialogs/tools/dialogpointfromarcandtangent.ui rename to src/libs/vtools/dialogs/tools/dialogpointfromarcandtangent.ui diff --git a/src/app/dialogs/tools/dialogpointfromcircleandtangent.cpp b/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.cpp similarity index 98% rename from src/app/dialogs/tools/dialogpointfromcircleandtangent.cpp rename to src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.cpp index 803675563..fa9c61d9b 100644 --- a/src/app/dialogs/tools/dialogpointfromcircleandtangent.cpp +++ b/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.cpp @@ -29,11 +29,12 @@ #include "dialogpointfromcircleandtangent.h" #include "ui_dialogpointfromcircleandtangent.h" -#include "../../libs/vgeometry/vpointf.h" -#include "../../libs/vpatterndb/vcontainer.h" +#include "../../../vgeometry/vpointf.h" +#include "../../../vpatterndb/vcontainer.h" +#include "../../../vpatterndb/vtranslatevars.h" #include "../../visualization/vistoolpointfromcircleandtangent.h" -#include "../../libs/vwidgets/vmaingraphicsscene.h" -#include "dialogeditwrongformula.h" +#include "../../../vwidgets/vmaingraphicsscene.h" +#include "../support/dialogeditwrongformula.h" //--------------------------------------------------------------------------------------------------------------------- DialogPointFromCircleAndTangent::DialogPointFromCircleAndTangent(const VContainer *data, const quint32 &toolId, diff --git a/src/app/dialogs/tools/dialogpointfromcircleandtangent.h b/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.h similarity index 100% rename from src/app/dialogs/tools/dialogpointfromcircleandtangent.h rename to src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.h diff --git a/src/app/dialogs/tools/dialogpointfromcircleandtangent.ui b/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.ui similarity index 100% rename from src/app/dialogs/tools/dialogpointfromcircleandtangent.ui rename to src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.ui diff --git a/src/app/dialogs/tools/dialogpointofcontact.cpp b/src/libs/vtools/dialogs/tools/dialogpointofcontact.cpp similarity index 98% rename from src/app/dialogs/tools/dialogpointofcontact.cpp rename to src/libs/vtools/dialogs/tools/dialogpointofcontact.cpp index bd4c6df7c..56d9c9808 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.cpp +++ b/src/libs/vtools/dialogs/tools/dialogpointofcontact.cpp @@ -28,12 +28,12 @@ #include "dialogpointofcontact.h" -#include "../../libs/vgeometry/vpointf.h" -#include "../../libs/vpatterndb/vcontainer.h" +#include "../../../vgeometry/vpointf.h" +#include "../../../vpatterndb/vcontainer.h" +#include "../../../vpatterndb/vtranslatevars.h" #include "../../visualization/vistoolpointofcontact.h" -#include "../libs/vwidgets/vmaingraphicsscene.h" -#include "../../xml/vpattern.h" -#include "dialogeditwrongformula.h" +#include "../../../vwidgets/vmaingraphicsscene.h" +#include "../support/dialogeditwrongformula.h" //--------------------------------------------------------------------------------------------------------------------- /** diff --git a/src/app/dialogs/tools/dialogpointofcontact.h b/src/libs/vtools/dialogs/tools/dialogpointofcontact.h similarity index 100% rename from src/app/dialogs/tools/dialogpointofcontact.h rename to src/libs/vtools/dialogs/tools/dialogpointofcontact.h diff --git a/src/app/dialogs/tools/dialogpointofcontact.ui b/src/libs/vtools/dialogs/tools/dialogpointofcontact.ui similarity index 100% rename from src/app/dialogs/tools/dialogpointofcontact.ui rename to src/libs/vtools/dialogs/tools/dialogpointofcontact.ui diff --git a/src/app/dialogs/tools/dialogpointofintersection.cpp b/src/libs/vtools/dialogs/tools/dialogpointofintersection.cpp similarity index 97% rename from src/app/dialogs/tools/dialogpointofintersection.cpp rename to src/libs/vtools/dialogs/tools/dialogpointofintersection.cpp index 510154b4b..ed249ae5b 100644 --- a/src/app/dialogs/tools/dialogpointofintersection.cpp +++ b/src/libs/vtools/dialogs/tools/dialogpointofintersection.cpp @@ -29,11 +29,10 @@ #include "dialogpointofintersection.h" #include "ui_dialogpointofintersection.h" -#include "../../libs/vgeometry/vpointf.h" -#include "../../libs/vpatterndb/vcontainer.h" +#include "../../../vgeometry/vpointf.h" +#include "../../../vpatterndb/vcontainer.h" #include "../../visualization/vistoolpointofintersection.h" -#include "../../libs/vwidgets/vmaingraphicsscene.h" -#include "../../xml/vpattern.h" +#include "../../../vwidgets/vmaingraphicsscene.h" //--------------------------------------------------------------------------------------------------------------------- /** diff --git a/src/app/dialogs/tools/dialogpointofintersection.h b/src/libs/vtools/dialogs/tools/dialogpointofintersection.h similarity index 100% rename from src/app/dialogs/tools/dialogpointofintersection.h rename to src/libs/vtools/dialogs/tools/dialogpointofintersection.h diff --git a/src/app/dialogs/tools/dialogpointofintersection.ui b/src/libs/vtools/dialogs/tools/dialogpointofintersection.ui similarity index 100% rename from src/app/dialogs/tools/dialogpointofintersection.ui rename to src/libs/vtools/dialogs/tools/dialogpointofintersection.ui diff --git a/src/app/dialogs/tools/dialogpointofintersectionarcs.cpp b/src/libs/vtools/dialogs/tools/dialogpointofintersectionarcs.cpp similarity index 100% rename from src/app/dialogs/tools/dialogpointofintersectionarcs.cpp rename to src/libs/vtools/dialogs/tools/dialogpointofintersectionarcs.cpp diff --git a/src/app/dialogs/tools/dialogpointofintersectionarcs.h b/src/libs/vtools/dialogs/tools/dialogpointofintersectionarcs.h similarity index 98% rename from src/app/dialogs/tools/dialogpointofintersectionarcs.h rename to src/libs/vtools/dialogs/tools/dialogpointofintersectionarcs.h index c57909acd..b33e70f92 100644 --- a/src/app/dialogs/tools/dialogpointofintersectionarcs.h +++ b/src/libs/vtools/dialogs/tools/dialogpointofintersectionarcs.h @@ -30,7 +30,6 @@ #define DIALOGPOINTOFINTERSECTIONARCS_H #include "dialogtool.h" -#include "../../xml/vpattern.h" namespace Ui { diff --git a/src/app/dialogs/tools/dialogpointofintersectionarcs.ui b/src/libs/vtools/dialogs/tools/dialogpointofintersectionarcs.ui similarity index 100% rename from src/app/dialogs/tools/dialogpointofintersectionarcs.ui rename to src/libs/vtools/dialogs/tools/dialogpointofintersectionarcs.ui diff --git a/src/app/dialogs/tools/dialogpointofintersectioncircles.cpp b/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.cpp similarity index 98% rename from src/app/dialogs/tools/dialogpointofintersectioncircles.cpp rename to src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.cpp index a83bba9ac..df7e723f6 100644 --- a/src/app/dialogs/tools/dialogpointofintersectioncircles.cpp +++ b/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.cpp @@ -29,11 +29,12 @@ #include "dialogpointofintersectioncircles.h" #include "ui_dialogpointofintersectioncircles.h" -#include "../../libs/vgeometry/vpointf.h" -#include "../../libs/vpatterndb/vcontainer.h" +#include "../../../vgeometry/vpointf.h" +#include "../../../vpatterndb/vcontainer.h" +#include "../../../vpatterndb/vtranslatevars.h" #include "../../visualization/vistoolpointofintersectioncircles.h" -#include "../../libs/vwidgets/vmaingraphicsscene.h" -#include "dialogeditwrongformula.h" +#include "../../../vwidgets/vmaingraphicsscene.h" +#include "../support/dialogeditwrongformula.h" //--------------------------------------------------------------------------------------------------------------------- DialogPointOfIntersectionCircles::DialogPointOfIntersectionCircles(const VContainer *data, const quint32 &toolId, diff --git a/src/app/dialogs/tools/dialogpointofintersectioncircles.h b/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.h similarity index 99% rename from src/app/dialogs/tools/dialogpointofintersectioncircles.h rename to src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.h index 192564776..06521767d 100644 --- a/src/app/dialogs/tools/dialogpointofintersectioncircles.h +++ b/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.h @@ -30,7 +30,6 @@ #define DIALOGPOINTOFINTERSECTIONCIRCLES_H #include "dialogtool.h" -#include "../../xml/vpattern.h" namespace Ui { diff --git a/src/app/dialogs/tools/dialogpointofintersectioncircles.ui b/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.ui similarity index 100% rename from src/app/dialogs/tools/dialogpointofintersectioncircles.ui rename to src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.ui diff --git a/src/app/dialogs/tools/dialogshoulderpoint.cpp b/src/libs/vtools/dialogs/tools/dialogshoulderpoint.cpp similarity index 98% rename from src/app/dialogs/tools/dialogshoulderpoint.cpp rename to src/libs/vtools/dialogs/tools/dialogshoulderpoint.cpp index deac5ef6f..e30f7c1e6 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.cpp +++ b/src/libs/vtools/dialogs/tools/dialogshoulderpoint.cpp @@ -29,12 +29,13 @@ #include "dialogshoulderpoint.h" #include "ui_dialogshoulderpoint.h" -#include "../../libs/vgeometry/vpointf.h" -#include "../../libs/vpatterndb/vcontainer.h" +#include "../../../vgeometry/vpointf.h" +#include "../../../vpatterndb/vcontainer.h" +#include "../../../vpatterndb/vtranslatevars.h" #include "../../visualization/vistoolshoulderpoint.h" -#include "../libs/vwidgets/vmaingraphicsscene.h" +#include "../../../vwidgets/vmaingraphicsscene.h" #include "../../tools/vabstracttool.h" -#include "dialogeditwrongformula.h" +#include "../support/dialogeditwrongformula.h" //--------------------------------------------------------------------------------------------------------------------- /** diff --git a/src/app/dialogs/tools/dialogshoulderpoint.h b/src/libs/vtools/dialogs/tools/dialogshoulderpoint.h similarity index 100% rename from src/app/dialogs/tools/dialogshoulderpoint.h rename to src/libs/vtools/dialogs/tools/dialogshoulderpoint.h diff --git a/src/app/dialogs/tools/dialogshoulderpoint.ui b/src/libs/vtools/dialogs/tools/dialogshoulderpoint.ui similarity index 100% rename from src/app/dialogs/tools/dialogshoulderpoint.ui rename to src/libs/vtools/dialogs/tools/dialogshoulderpoint.ui diff --git a/src/app/dialogs/tools/dialogsinglepoint.cpp b/src/libs/vtools/dialogs/tools/dialogsinglepoint.cpp similarity index 100% rename from src/app/dialogs/tools/dialogsinglepoint.cpp rename to src/libs/vtools/dialogs/tools/dialogsinglepoint.cpp diff --git a/src/app/dialogs/tools/dialogsinglepoint.h b/src/libs/vtools/dialogs/tools/dialogsinglepoint.h similarity index 100% rename from src/app/dialogs/tools/dialogsinglepoint.h rename to src/libs/vtools/dialogs/tools/dialogsinglepoint.h diff --git a/src/app/dialogs/tools/dialogsinglepoint.ui b/src/libs/vtools/dialogs/tools/dialogsinglepoint.ui similarity index 100% rename from src/app/dialogs/tools/dialogsinglepoint.ui rename to src/libs/vtools/dialogs/tools/dialogsinglepoint.ui diff --git a/src/app/dialogs/tools/dialogspline.cpp b/src/libs/vtools/dialogs/tools/dialogspline.cpp similarity index 100% rename from src/app/dialogs/tools/dialogspline.cpp rename to src/libs/vtools/dialogs/tools/dialogspline.cpp diff --git a/src/app/dialogs/tools/dialogspline.h b/src/libs/vtools/dialogs/tools/dialogspline.h similarity index 100% rename from src/app/dialogs/tools/dialogspline.h rename to src/libs/vtools/dialogs/tools/dialogspline.h diff --git a/src/app/dialogs/tools/dialogspline.ui b/src/libs/vtools/dialogs/tools/dialogspline.ui similarity index 100% rename from src/app/dialogs/tools/dialogspline.ui rename to src/libs/vtools/dialogs/tools/dialogspline.ui diff --git a/src/app/dialogs/tools/dialogsplinepath.cpp b/src/libs/vtools/dialogs/tools/dialogsplinepath.cpp similarity index 100% rename from src/app/dialogs/tools/dialogsplinepath.cpp rename to src/libs/vtools/dialogs/tools/dialogsplinepath.cpp diff --git a/src/app/dialogs/tools/dialogsplinepath.h b/src/libs/vtools/dialogs/tools/dialogsplinepath.h similarity index 100% rename from src/app/dialogs/tools/dialogsplinepath.h rename to src/libs/vtools/dialogs/tools/dialogsplinepath.h diff --git a/src/app/dialogs/tools/dialogsplinepath.ui b/src/libs/vtools/dialogs/tools/dialogsplinepath.ui similarity index 100% rename from src/app/dialogs/tools/dialogsplinepath.ui rename to src/libs/vtools/dialogs/tools/dialogsplinepath.ui diff --git a/src/app/dialogs/tools/dialogtool.cpp b/src/libs/vtools/dialogs/tools/dialogtool.cpp similarity index 98% rename from src/app/dialogs/tools/dialogtool.cpp rename to src/libs/vtools/dialogs/tools/dialogtool.cpp index 612c31f1a..209b3fb43 100644 --- a/src/app/dialogs/tools/dialogtool.cpp +++ b/src/libs/vtools/dialogs/tools/dialogtool.cpp @@ -27,14 +27,17 @@ *************************************************************************/ #include "dialogtool.h" -#include "../../libs/vpatterndb/calculator.h" -#include "../../libs/vpatterndb/vcontainer.h" -#include "../../libs/vgeometry/varc.h" -#include "../../libs/vgeometry/vpointf.h" -#include "../../libs/vgeometry/vsplinepath.h" +#include "../../../vpatterndb/calculator.h" +#include "../../../vpatterndb/vcontainer.h" +#include "../../../vpatterndb/vtranslatevars.h" +#include "../../../vgeometry/varc.h" +#include "../../../vgeometry/vpointf.h" +#include "../../../vgeometry/vsplinepath.h" #include "../../tools/vabstracttool.h" -#include "../../../libs/qmuparser/qmuparsererror.h" -#include "../../libs/ifc/xml/vdomdocument.h" +#include "../../../qmuparser/qmuparsererror.h" +#include "../../../qmuparser/qmudef.h" +#include "../../../ifc/xml/vdomdocument.h" + #include #include #include diff --git a/src/app/dialogs/tools/dialogtool.h b/src/libs/vtools/dialogs/tools/dialogtool.h similarity index 98% rename from src/app/dialogs/tools/dialogtool.h rename to src/libs/vtools/dialogs/tools/dialogtool.h index 20b8e102c..1b9ffd2db 100644 --- a/src/app/dialogs/tools/dialogtool.h +++ b/src/libs/vtools/dialogs/tools/dialogtool.h @@ -29,11 +29,11 @@ #ifndef DIALOGTOOL_H #define DIALOGTOOL_H -#include "../../core/vapplication.h" -#include "../libs/vmisc/logging.h" -#include "../libs/vwidgets/vmaingraphicsscene.h" +#include "../../../vmisc/vabstractapplication.h" +#include "../../../vmisc/logging.h" +#include "../../../vwidgets/vmaingraphicsscene.h" #include "../../visualization/visualization.h" -#include "../../xml/vpattern.h" +#include "../../../ifc/xml/vabstractpattern.h" #include #include diff --git a/src/app/dialogs/tools/dialogtriangle.cpp b/src/libs/vtools/dialogs/tools/dialogtriangle.cpp similarity index 98% rename from src/app/dialogs/tools/dialogtriangle.cpp rename to src/libs/vtools/dialogs/tools/dialogtriangle.cpp index 97bfbee1b..74a8bc681 100644 --- a/src/app/dialogs/tools/dialogtriangle.cpp +++ b/src/libs/vtools/dialogs/tools/dialogtriangle.cpp @@ -28,11 +28,10 @@ #include "dialogtriangle.h" #include "ui_dialogtriangle.h" -#include "../../libs/vgeometry/vpointf.h" -#include "../../libs/vpatterndb/vcontainer.h" +#include "../../../vgeometry/vpointf.h" +#include "../../../vpatterndb/vcontainer.h" #include "../../visualization/vistooltriangle.h" -#include "../libs/vwidgets/vmaingraphicsscene.h" -#include "../../xml/vpattern.h" +#include "../../../vwidgets/vmaingraphicsscene.h" //--------------------------------------------------------------------------------------------------------------------- /** diff --git a/src/app/dialogs/tools/dialogtriangle.h b/src/libs/vtools/dialogs/tools/dialogtriangle.h similarity index 100% rename from src/app/dialogs/tools/dialogtriangle.h rename to src/libs/vtools/dialogs/tools/dialogtriangle.h diff --git a/src/app/dialogs/tools/dialogtriangle.ui b/src/libs/vtools/dialogs/tools/dialogtriangle.ui similarity index 100% rename from src/app/dialogs/tools/dialogtriangle.ui rename to src/libs/vtools/dialogs/tools/dialogtriangle.ui diff --git a/src/app/dialogs/tools/dialoguniondetails.cpp b/src/libs/vtools/dialogs/tools/dialoguniondetails.cpp similarity index 100% rename from src/app/dialogs/tools/dialoguniondetails.cpp rename to src/libs/vtools/dialogs/tools/dialoguniondetails.cpp diff --git a/src/app/dialogs/tools/dialoguniondetails.h b/src/libs/vtools/dialogs/tools/dialoguniondetails.h similarity index 100% rename from src/app/dialogs/tools/dialoguniondetails.h rename to src/libs/vtools/dialogs/tools/dialoguniondetails.h diff --git a/src/app/dialogs/tools/dialoguniondetails.ui b/src/libs/vtools/dialogs/tools/dialoguniondetails.ui similarity index 100% rename from src/app/dialogs/tools/dialoguniondetails.ui rename to src/libs/vtools/dialogs/tools/dialoguniondetails.ui diff --git a/src/libs/vtools/stable.cpp b/src/libs/vtools/stable.cpp new file mode 100644 index 000000000..e291c2801 --- /dev/null +++ b/src/libs/vtools/stable.cpp @@ -0,0 +1,30 @@ +/************************************************************************ + ** + ** @file stable.cpp + ** @author Roman Telezhynskyi + ** @date November 15, 2013 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2013-2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +// Build the precompiled headers. +#include "stable.h" diff --git a/src/libs/vtools/stable.h b/src/libs/vtools/stable.h new file mode 100644 index 000000000..fd7241f19 --- /dev/null +++ b/src/libs/vtools/stable.h @@ -0,0 +1,82 @@ +/************************************************************************ + ** + ** @file stable.h + ** @author Roman Telezhynskyi + ** @date November 15, 2013 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2013-2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef STABLE_H +#define STABLE_H + +/* I like to include this pragma too, so the build log indicates if pre-compiled headers were in use. */ +#ifndef __clang__ +#pragma message("Compiling precompiled headers for VTools library.\n") +#endif + +/* Add C includes here */ + +#if defined __cplusplus +/* Add C++ includes here */ +#include + +/*In all cases we need include core header for getting defined values*/ +//#ifdef QT_CORE_LIB +//# include +//#endif + +#ifdef QT_GUI_LIB +# include +#endif + +#ifdef QT_XML_LIB +# include +#endif + +//In Windows you can't use same header in all modes. +#if !defined(Q_OS_WIN) +# ifdef QT_WIDGETS_LIB +# include +# endif + +# ifdef QT_SVG_LIB +# include +# endif + +# ifdef QT_PRINTSUPPORT_LIB +# include +# endif + + //Build doesn't work, if include this headers on Windows. +# ifdef QT_XMLPATTERNS_LIB +# include +# endif + +# ifdef QT_NETWORK_LIB +# include +# endif +#endif/*Q_OS_WIN*/ + +#endif /*__cplusplus*/ + +#endif // STABLE_H diff --git a/src/app/tools/drawTools/drawtools.h b/src/libs/vtools/tools/drawTools/drawtools.h similarity index 100% rename from src/app/tools/drawTools/drawtools.h rename to src/libs/vtools/tools/drawTools/drawtools.h diff --git a/src/app/tools/drawTools/vabstractspline.cpp b/src/libs/vtools/tools/drawTools/vabstractspline.cpp similarity index 98% rename from src/app/tools/drawTools/vabstractspline.cpp rename to src/libs/vtools/tools/drawTools/vabstractspline.cpp index 8d5840880..e3c043b58 100644 --- a/src/app/tools/drawTools/vabstractspline.cpp +++ b/src/libs/vtools/tools/drawTools/vabstractspline.cpp @@ -32,7 +32,7 @@ const QString VAbstractSpline::TagName = QStringLiteral("spline"); //--------------------------------------------------------------------------------------------------------------------- -VAbstractSpline::VAbstractSpline(VPattern *doc, VContainer *data, quint32 id, QGraphicsItem *parent) +VAbstractSpline::VAbstractSpline(VAbstractPattern *doc, VContainer *data, quint32 id, QGraphicsItem *parent) :VDrawTool(doc, data, id), QGraphicsPathItem(parent), controlPoints(QVector()), sceneType(SceneObject::Unknown), isHovered(false), detailsMode(false) {} diff --git a/src/app/tools/drawTools/vabstractspline.h b/src/libs/vtools/tools/drawTools/vabstractspline.h similarity index 96% rename from src/app/tools/drawTools/vabstractspline.h rename to src/libs/vtools/tools/drawTools/vabstractspline.h index 48f90295c..23e4d6160 100644 --- a/src/app/tools/drawTools/vabstractspline.h +++ b/src/libs/vtools/tools/drawTools/vabstractspline.h @@ -30,14 +30,15 @@ #define VABSTRACTSPLINE_H #include "vdrawtool.h" +#include "../../../vwidgets/vcontrolpointspline.h" + #include -#include "../libs/vwidgets/vcontrolpointspline.h" class VAbstractSpline:public VDrawTool, public QGraphicsPathItem { Q_OBJECT public: - VAbstractSpline(VPattern *doc, VContainer *data, quint32 id, QGraphicsItem * parent = nullptr); + VAbstractSpline(VAbstractPattern *doc, VContainer *data, quint32 id, QGraphicsItem * parent = nullptr); virtual ~VAbstractSpline(); // cppcheck-suppress duplInheritedMember static const QString TagName; diff --git a/src/app/tools/drawTools/vdrawtool.cpp b/src/libs/vtools/tools/drawTools/vdrawtool.cpp similarity index 94% rename from src/app/tools/drawTools/vdrawtool.cpp rename to src/libs/vtools/tools/drawTools/vdrawtool.cpp index c52726d64..a8c9ab8cf 100644 --- a/src/app/tools/drawTools/vdrawtool.cpp +++ b/src/libs/vtools/tools/drawTools/vdrawtool.cpp @@ -28,13 +28,13 @@ #include "vdrawtool.h" -#include -#include "../../dialogs/tools/dialogeditwrongformula.h" -#include "../../dialogs/app/dialogundo.h" -#include "../libs/vpatterndb/calculator.h" +#include "../../../qmuparser/qmuparsererror.h" +#include "../../dialogs/support/dialogeditwrongformula.h" +#include "../../dialogs/support/dialogundo.h" +#include "../../../vpatterndb/calculator.h" #include "../../undocommands/addtocalc.h" #include "../../undocommands/savetooloptions.h" -#include "../../libs/ifc/exception/vexceptionundo.h" +#include "../../../ifc/exception/vexceptionundo.h" qreal VDrawTool::factor = 1; @@ -45,13 +45,13 @@ qreal VDrawTool::factor = 1; * @param data container with variables. * @param id object id in container. */ -VDrawTool::VDrawTool(VPattern *doc, VContainer *data, quint32 id, QObject *parent) +VDrawTool::VDrawTool(VAbstractPattern *doc, VContainer *data, quint32 id, QObject *parent) :VAbstractTool(doc, data, id, parent), nameActivDraw(doc->GetNameActivPP()), dialog(nullptr), typeLine(TypeLineLine), lineColor(ColorBlack), enabled(true) { - connect(this->doc, &VPattern::ChangedActivPP, this, &VDrawTool::ChangedActivDraw); - connect(this->doc, &VPattern::ChangedNameDraw, this, &VDrawTool::ChangedNameDraw); - connect(this->doc, &VPattern::ShowTool, this, &VDrawTool::ShowTool); + connect(this->doc, &VAbstractPattern::ChangedActivPP, this, &VDrawTool::ChangedActivDraw); + connect(this->doc, &VAbstractPattern::ChangedNameDraw, this, &VDrawTool::ChangedNameDraw); + connect(this->doc, &VAbstractPattern::ShowTool, this, &VDrawTool::ShowTool); } //--------------------------------------------------------------------------------------------------------------------- @@ -255,7 +255,7 @@ void VDrawTool::DialogLinkDestroy() */ void VDrawTool::SetFactor(qreal factor) { - VApplication::CheckFactor(this->factor, factor); + CheckFactor(this->factor, factor); } //--------------------------------------------------------------------------------------------------------------------- @@ -351,7 +351,7 @@ qreal VDrawTool::CheckFormula(const quint32 &toolId, QString &formula, VContaine void VDrawTool::AddToCalculation(const QDomElement &domElement) { AddToCalc *addToCal = new AddToCalc(domElement, doc); - connect(addToCal, &AddToCalc::NeedFullParsing, doc, &VPattern::NeedFullParsing); + connect(addToCal, &AddToCalc::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing); qApp->getUndoStack()->push(addToCal); } diff --git a/src/app/tools/drawTools/vdrawtool.h b/src/libs/vtools/tools/drawTools/vdrawtool.h similarity index 96% rename from src/app/tools/drawTools/vdrawtool.h rename to src/libs/vtools/tools/drawTools/vdrawtool.h index 9e968dc46..1057af0f7 100644 --- a/src/app/tools/drawTools/vdrawtool.h +++ b/src/libs/vtools/tools/drawTools/vdrawtool.h @@ -30,12 +30,13 @@ #define VDRAWTOOL_H #include "../vabstracttool.h" +#include "../../dialogs/tools/dialogtool.h" +#include "../../../vwidgets/vmaingraphicsscene.h" +#include "../../../vwidgets/vmaingraphicsview.h" + #include #include #include -#include "../../dialogs/tools/dialogtool.h" -#include "../../libs/vwidgets/vmaingraphicsscene.h" -#include "../../xml/vpattern.h" /** * @brief The VDrawTool abstract class for all draw tool. @@ -45,7 +46,7 @@ class VDrawTool : public VAbstractTool Q_OBJECT public: - VDrawTool(VPattern *doc, VContainer *data, quint32 id, QObject *parent = nullptr); + VDrawTool(VAbstractPattern *doc, VContainer *data, quint32 id, QObject *parent = nullptr); virtual ~VDrawTool(); /** @brief factor scene scale factor. */ diff --git a/src/app/tools/drawTools/vtoolalongline.cpp b/src/libs/vtools/tools/drawTools/vtoolalongline.cpp similarity index 96% rename from src/app/tools/drawTools/vtoolalongline.cpp rename to src/libs/vtools/tools/drawTools/vtoolalongline.cpp index 9b50106ea..e14c2a0b8 100644 --- a/src/app/tools/drawTools/vtoolalongline.cpp +++ b/src/libs/vtools/tools/drawTools/vtoolalongline.cpp @@ -27,10 +27,11 @@ *************************************************************************/ #include "vtoolalongline.h" -#include "../../libs/vpatterndb/calculator.h" +#include "../../../vpatterndb/calculator.h" +#include "../../../vpatterndb/vtranslatevars.h" #include "../../dialogs/tools/dialogalongline.h" -#include "../../libs/vgeometry/vpointf.h" -#include "../../libs/ifc/exception/vexceptionobjecterror.h" +#include "../../../vgeometry/vpointf.h" +#include "../../../ifc/exception/vexceptionobjecterror.h" #include "../../visualization/vistoolalongline.h" const QString VToolAlongLine::ToolType = QStringLiteral("alongLine"); @@ -48,7 +49,7 @@ const QString VToolAlongLine::ToolType = QStringLiteral("alongLine"); * @param typeCreation way we create this tool. * @param parent parent object. */ -VToolAlongLine::VToolAlongLine(VPattern *doc, VContainer *data, quint32 id, const QString &formula, +VToolAlongLine::VToolAlongLine(VAbstractPattern *doc, VContainer *data, quint32 id, const QString &formula, const quint32 &firstPointId, const quint32 &secondPointId, const QString &typeLine, const QString &lineColor, const Source &typeCreation, QGraphicsItem *parent) @@ -192,7 +193,8 @@ void VToolAlongLine::setDialog() * @param doc dom document container. * @param data container with variables. */ -VToolAlongLine* VToolAlongLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data) +VToolAlongLine* VToolAlongLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, + VContainer *data) { SCASSERT(dialog != nullptr); DialogAlongLine *dialogTool = qobject_cast(dialog); @@ -233,7 +235,7 @@ VToolAlongLine* VToolAlongLine::Create(DialogTool *dialog, VMainGraphicsScene *s VToolAlongLine* VToolAlongLine::Create(const quint32 _id, const QString &pointName, const QString &typeLine, const QString &lineColor, QString &formula, const quint32 &firstPointId, const quint32 &secondPointId, const qreal &mx, const qreal &my, - VMainGraphicsScene *scene, VPattern *doc, VContainer *data, + VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) { const QSharedPointer firstPoint = data->GeometricObject(firstPointId); diff --git a/src/app/tools/drawTools/vtoolalongline.h b/src/libs/vtools/tools/drawTools/vtoolalongline.h similarity index 89% rename from src/app/tools/drawTools/vtoolalongline.h rename to src/libs/vtools/tools/drawTools/vtoolalongline.h index 9fe5acd38..a770db865 100644 --- a/src/app/tools/drawTools/vtoolalongline.h +++ b/src/libs/vtools/tools/drawTools/vtoolalongline.h @@ -39,15 +39,17 @@ class VToolAlongLine : public VToolLinePoint Q_OBJECT public: - VToolAlongLine(VPattern *doc, VContainer *data, quint32 id, const QString &formula, const quint32 &firstPointId, + VToolAlongLine(VAbstractPattern *doc, VContainer *data, quint32 id, const QString &formula, + const quint32 &firstPointId, const quint32 &secondPointId, const QString &typeLine, const QString &lineColor, const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual void setDialog(); - static VToolAlongLine* Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); + static VToolAlongLine* Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolAlongLine* Create(const quint32 _id, const QString &pointName, const QString &typeLine, const QString &lineColor, QString &formula, const quint32 &firstPointId, const quint32 &secondPointId, const qreal &mx, const qreal &my, - VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, + VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data, + const Document &parse, const Source &typeCreation); static const QString ToolType; virtual int type() const {return Type;} diff --git a/src/app/tools/drawTools/vtoolarc.cpp b/src/libs/vtools/tools/drawTools/vtoolarc.cpp similarity index 97% rename from src/app/tools/drawTools/vtoolarc.cpp rename to src/libs/vtools/tools/drawTools/vtoolarc.cpp index a520dd08d..0fd4073e3 100644 --- a/src/app/tools/drawTools/vtoolarc.cpp +++ b/src/libs/vtools/tools/drawTools/vtoolarc.cpp @@ -27,10 +27,11 @@ *************************************************************************/ #include "vtoolarc.h" -#include "../../libs/vpatterndb/calculator.h" +#include "../../../vpatterndb/calculator.h" +#include "../../../vpatterndb/vtranslatevars.h" #include "../../dialogs/tools/dialogarc.h" -#include "../../libs/vgeometry/varc.h" -#include "../../libs/vpatterndb/vformula.h" +#include "../../../vgeometry/varc.h" +#include "../../../vpatterndb/vformula.h" #include "../../visualization/vistoolarc.h" #include @@ -47,7 +48,8 @@ const QString VToolArc::ToolType = QStringLiteral("simple"); * @param typeCreation way we create this tool. * @param parent parent object */ -VToolArc::VToolArc(VPattern *doc, VContainer *data, quint32 id, const QString &color, const Source &typeCreation, +VToolArc::VToolArc(VAbstractPattern *doc, VContainer *data, quint32 id, const QString &color, + const Source &typeCreation, QGraphicsItem *parent) :VAbstractSpline(doc, data, id, parent) { @@ -88,7 +90,7 @@ void VToolArc::setDialog() * @param doc dom document container * @param data container with variables */ -VToolArc* VToolArc::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data) +VToolArc* VToolArc::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { SCASSERT(dialog != nullptr); DialogArc *dialogTool = qobject_cast(dialog); @@ -122,7 +124,7 @@ VToolArc* VToolArc::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPatte * @param typeCreation way we create this tool. */ VToolArc* VToolArc::Create(const quint32 _id, const quint32 ¢er, QString &radius, QString &f1, QString &f2, - const QString &color, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, + const QString &color, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) { qreal calcRadius = 0, calcF1 = 0, calcF2 = 0; diff --git a/src/app/tools/drawTools/vtoolarc.h b/src/libs/vtools/tools/drawTools/vtoolarc.h similarity index 92% rename from src/app/tools/drawTools/vtoolarc.h rename to src/libs/vtools/tools/drawTools/vtoolarc.h index e67072579..46339e84c 100644 --- a/src/app/tools/drawTools/vtoolarc.h +++ b/src/libs/vtools/tools/drawTools/vtoolarc.h @@ -40,12 +40,12 @@ class VToolArc :public VAbstractSpline { Q_OBJECT public: - VToolArc(VPattern *doc, VContainer *data, quint32 id, const QString &color, const Source &typeCreation, + VToolArc(VAbstractPattern *doc, VContainer *data, quint32 id, const QString &color, const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual void setDialog(); - static VToolArc* Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); + static VToolArc* Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolArc* Create(const quint32 _id, const quint32 ¢er, QString &radius, QString &f1, QString &f2, - const QString &color, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, + const QString &color, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation); static const QString TagName; static const QString ToolType; diff --git a/src/app/tools/drawTools/vtoolarcwithlength.cpp b/src/libs/vtools/tools/drawTools/vtoolarcwithlength.cpp similarity index 96% rename from src/app/tools/drawTools/vtoolarcwithlength.cpp rename to src/libs/vtools/tools/drawTools/vtoolarcwithlength.cpp index bbcde358b..1f9b25054 100644 --- a/src/app/tools/drawTools/vtoolarcwithlength.cpp +++ b/src/libs/vtools/tools/drawTools/vtoolarcwithlength.cpp @@ -27,10 +27,11 @@ *************************************************************************/ #include "vtoolarcwithlength.h" -#include "../../libs/vpatterndb/calculator.h" +#include "../../../vpatterndb/calculator.h" +#include "../../../vpatterndb/vtranslatevars.h" #include "../../dialogs/tools/dialogarcwithlength.h" -#include "../../libs/vgeometry/varc.h" -#include "../../libs/vpatterndb/vformula.h" +#include "../../../vgeometry/varc.h" +#include "../../../vpatterndb/vformula.h" #include "../../visualization/vistoolarcwithlength.h" #include @@ -39,7 +40,7 @@ const QString VToolArcWithLength::TagName = QStringLiteral("arc"); const QString VToolArcWithLength::ToolType = QStringLiteral("arcWithLength"); //--------------------------------------------------------------------------------------------------------------------- -VToolArcWithLength::VToolArcWithLength(VPattern *doc, VContainer *data, quint32 id, const QString &color, +VToolArcWithLength::VToolArcWithLength(VAbstractPattern *doc, VContainer *data, quint32 id, const QString &color, const Source &typeCreation, QGraphicsItem *parent) :VAbstractSpline(doc, data, id, parent) { @@ -70,7 +71,7 @@ void VToolArcWithLength::setDialog() } //--------------------------------------------------------------------------------------------------------------------- -VToolArcWithLength *VToolArcWithLength::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, +VToolArcWithLength *VToolArcWithLength::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { SCASSERT(dialog != nullptr); @@ -93,7 +94,7 @@ VToolArcWithLength *VToolArcWithLength::Create(DialogTool *dialog, VMainGraphics //--------------------------------------------------------------------------------------------------------------------- VToolArcWithLength *VToolArcWithLength::Create(const quint32 _id, const quint32 ¢er, QString &radius, QString &f1, QString &length, const QString &color, VMainGraphicsScene *scene, - VPattern *doc, VContainer *data, const Document &parse, + VAbstractPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) { qreal calcRadius = 0, calcF1 = 0, calcLength = 0; diff --git a/src/app/tools/drawTools/vtoolarcwithlength.h b/src/libs/vtools/tools/drawTools/vtoolarcwithlength.h similarity index 89% rename from src/app/tools/drawTools/vtoolarcwithlength.h rename to src/libs/vtools/tools/drawTools/vtoolarcwithlength.h index 38d3e7cbd..63054f455 100644 --- a/src/app/tools/drawTools/vtoolarcwithlength.h +++ b/src/libs/vtools/tools/drawTools/vtoolarcwithlength.h @@ -37,13 +37,16 @@ class VToolArcWithLength : public VAbstractSpline { Q_OBJECT public: - VToolArcWithLength(VPattern *doc, VContainer *data, quint32 id, const QString &color, const Source &typeCreation, + VToolArcWithLength(VAbstractPattern *doc, VContainer *data, quint32 id, const QString &color, + const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual void setDialog(); - static VToolArcWithLength* Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); + static VToolArcWithLength* Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, + VContainer *data); static VToolArcWithLength* Create(const quint32 _id, const quint32 ¢er, QString &radius, QString &f1, - QString &length, const QString &color, VMainGraphicsScene *scene, VPattern *doc, + QString &length, const QString &color, VMainGraphicsScene *scene, + VAbstractPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation); static const QString TagName; static const QString ToolType; diff --git a/src/app/tools/drawTools/vtoolbisector.cpp b/src/libs/vtools/tools/drawTools/vtoolbisector.cpp similarity index 97% rename from src/app/tools/drawTools/vtoolbisector.cpp rename to src/libs/vtools/tools/drawTools/vtoolbisector.cpp index def7fd069..eb7f32f6a 100644 --- a/src/app/tools/drawTools/vtoolbisector.cpp +++ b/src/libs/vtools/tools/drawTools/vtoolbisector.cpp @@ -27,9 +27,10 @@ *************************************************************************/ #include "vtoolbisector.h" -#include "../../libs/vpatterndb/calculator.h" +#include "../../../vpatterndb/calculator.h" +#include "../../../vpatterndb/vtranslatevars.h" #include "../../dialogs/tools/dialogbisector.h" -#include "../../libs/vgeometry/vpointf.h" +#include "../../../vgeometry/vpointf.h" #include "../../visualization/vistoolbisector.h" const QString VToolBisector::ToolType = QStringLiteral("bisector"); @@ -48,7 +49,7 @@ const QString VToolBisector::ToolType = QStringLiteral("bisector"); * @param typeCreation way we create this tool. * @param parent parent object. */ -VToolBisector::VToolBisector(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, +VToolBisector::VToolBisector(VAbstractPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &lineColor, const QString &formula, const quint32 &firstPointId, const quint32 &secondPointId, const quint32 &thirdPointId, const Source &typeCreation, QGraphicsItem *parent) @@ -123,7 +124,7 @@ void VToolBisector::setDialog() * @param doc dom document container. * @param data container with variables. */ -VToolBisector* VToolBisector::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, +VToolBisector* VToolBisector::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { SCASSERT(dialog != nullptr); @@ -167,7 +168,8 @@ VToolBisector* VToolBisector::Create(DialogTool *dialog, VMainGraphicsScene *sce VToolBisector* VToolBisector::Create(const quint32 _id, QString &formula, const quint32 &firstPointId, const quint32 &secondPointId, const quint32 &thirdPointId, const QString &typeLine, const QString &lineColor, const QString &pointName, const qreal &mx, - const qreal &my, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, + const qreal &my, VMainGraphicsScene *scene, VAbstractPattern *doc, + VContainer *data, const Document &parse, const Source &typeCreation) { const QSharedPointer firstPoint = data->GeometricObject(firstPointId); diff --git a/src/app/tools/drawTools/vtoolbisector.h b/src/libs/vtools/tools/drawTools/vtoolbisector.h similarity index 89% rename from src/app/tools/drawTools/vtoolbisector.h rename to src/libs/vtools/tools/drawTools/vtoolbisector.h index 040753725..9c8902983 100644 --- a/src/app/tools/drawTools/vtoolbisector.h +++ b/src/libs/vtools/tools/drawTools/vtoolbisector.h @@ -39,18 +39,21 @@ class VToolBisector : public VToolLinePoint Q_OBJECT public: - VToolBisector(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &lineColor, + VToolBisector(VAbstractPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, + const QString &lineColor, const QString &formula, const quint32 &firstPointId, const quint32 &secondPointId, const quint32 &thirdPointId, const Source &typeCreation, QGraphicsItem * parent = nullptr); static qreal BisectorAngle(const QPointF &firstPoint, const QPointF &secondPoint, const QPointF &thirdPoint); static QPointF FindPoint(const QPointF &firstPoint, const QPointF &secondPoint, const QPointF &thirdPoint, const qreal& length); virtual void setDialog(); - static VToolBisector* Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); + static VToolBisector* Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, + VContainer *data); static VToolBisector* Create(const quint32 _id, QString &formula, const quint32 &firstPointId, const quint32 &secondPointId, const quint32 &thirdPointId, const QString &typeLine, const QString &lineColor, const QString &pointName, const qreal &mx, const qreal &my, - VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, + VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data, + const Document &parse, const Source &typeCreation); static const QString ToolType; virtual int type() const {return Type;} diff --git a/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp b/src/libs/vtools/tools/drawTools/vtoolcurveintersectaxis.cpp similarity index 95% rename from src/app/tools/drawTools/vtoolcurveintersectaxis.cpp rename to src/libs/vtools/tools/drawTools/vtoolcurveintersectaxis.cpp index 2520c1e1b..1b3df0490 100644 --- a/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp +++ b/src/libs/vtools/tools/drawTools/vtoolcurveintersectaxis.cpp @@ -27,17 +27,18 @@ *************************************************************************/ #include "vtoolcurveintersectaxis.h" -#include "../../libs/vwidgets/vmaingraphicsscene.h" -#include "../../libs/vpatterndb/calculator.h" +#include "../../../vwidgets/vmaingraphicsscene.h" +#include "../../../vpatterndb/calculator.h" +#include "../../../vpatterndb/vtranslatevars.h" #include "../../dialogs/tools/dialogcurveintersectaxis.h" -#include "../../dialogs/tools/dialogeditwrongformula.h" -#include "../../libs/vgeometry/vpointf.h" +#include "../../dialogs/support/dialogeditwrongformula.h" +#include "../../../vgeometry/vpointf.h" #include "../../visualization/vistoolcurveintersectaxis.h" const QString VToolCurveIntersectAxis::ToolType = QStringLiteral("curveIntersectAxis"); //--------------------------------------------------------------------------------------------------------------------- -VToolCurveIntersectAxis::VToolCurveIntersectAxis(VPattern *doc, VContainer *data, const quint32 &id, +VToolCurveIntersectAxis::VToolCurveIntersectAxis(VAbstractPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &lineColor, const QString &formulaAngle, const quint32 &basePointId, const quint32 &curveId, const Source &typeCreation, @@ -69,7 +70,8 @@ void VToolCurveIntersectAxis::setDialog() } //--------------------------------------------------------------------------------------------------------------------- -VToolCurveIntersectAxis *VToolCurveIntersectAxis::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, +VToolCurveIntersectAxis *VToolCurveIntersectAxis::Create(DialogTool *dialog, VMainGraphicsScene *scene, + VAbstractPattern *doc, VContainer *data) { SCASSERT(dialog != nullptr); @@ -97,7 +99,8 @@ VToolCurveIntersectAxis *VToolCurveIntersectAxis::Create(const quint32 _id, cons const QString &typeLine, const QString &lineColor, QString &formulaAngle, const quint32 &basePointId, const quint32 &curveId, const qreal &mx, const qreal &my, - VMainGraphicsScene *scene, VPattern *doc, VContainer *data, + VMainGraphicsScene *scene, VAbstractPattern *doc, + VContainer *data, const Document &parse, const Source &typeCreation) { const QSharedPointer basePoint = data->GeometricObject(basePointId); diff --git a/src/app/tools/drawTools/vtoolcurveintersectaxis.h b/src/libs/vtools/tools/drawTools/vtoolcurveintersectaxis.h similarity index 94% rename from src/app/tools/drawTools/vtoolcurveintersectaxis.h rename to src/libs/vtools/tools/drawTools/vtoolcurveintersectaxis.h index 52dfb9e9b..08930c408 100644 --- a/src/app/tools/drawTools/vtoolcurveintersectaxis.h +++ b/src/libs/vtools/tools/drawTools/vtoolcurveintersectaxis.h @@ -35,18 +35,18 @@ class VToolCurveIntersectAxis : public VToolLinePoint { Q_OBJECT public: - VToolCurveIntersectAxis(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, + VToolCurveIntersectAxis(VAbstractPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &lineColor, const QString &formulaAngle, const quint32 &basePointId, const quint32 &curveId, const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual ~VToolCurveIntersectAxis(); virtual void setDialog(); - static VToolCurveIntersectAxis *Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, + static VToolCurveIntersectAxis *Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolCurveIntersectAxis *Create(const quint32 _id, const QString &pointName, const QString &typeLine, const QString &lineColor, QString &formulaAngle, const quint32 &basePointId, const quint32 &curveId, const qreal &mx, const qreal &my, - VMainGraphicsScene *scene, VPattern *doc, VContainer *data, + VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation); static QPointF FindPoint(const QPointF &point, qreal angle, const QSharedPointer &curve); diff --git a/src/app/tools/drawTools/vtoolcut.cpp b/src/libs/vtools/tools/drawTools/vtoolcut.cpp similarity index 98% rename from src/app/tools/drawTools/vtoolcut.cpp rename to src/libs/vtools/tools/drawTools/vtoolcut.cpp index 2fbf78129..bac317390 100644 --- a/src/app/tools/drawTools/vtoolcut.cpp +++ b/src/libs/vtools/tools/drawTools/vtoolcut.cpp @@ -31,7 +31,7 @@ #include "../../libs/vpatterndb/vformula.h" //--------------------------------------------------------------------------------------------------------------------- -VToolCut::VToolCut(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula, +VToolCut::VToolCut(VAbstractPattern *doc, VContainer *data, const quint32 &id, const QString &formula, const quint32 &curveCutId, const quint32 &curve1id, const quint32 &curve2id, const QString &color, QGraphicsItem *parent) :VToolPoint(doc, data, id, parent), formula(formula), firstCurve(nullptr), secondCurve(nullptr), diff --git a/src/app/tools/drawTools/vtoolcut.h b/src/libs/vtools/tools/drawTools/vtoolcut.h similarity index 95% rename from src/app/tools/drawTools/vtoolcut.h rename to src/libs/vtools/tools/drawTools/vtoolcut.h index eb71ac1d7..a5073b0c5 100644 --- a/src/app/tools/drawTools/vtoolcut.h +++ b/src/libs/vtools/tools/drawTools/vtoolcut.h @@ -30,7 +30,7 @@ #define VTOOLCUT_H #include "vtoolpoint.h" -#include "../../libs/vwidgets/vsimplecurve.h" +#include "../../../vwidgets/vsimplecurve.h" #include "vabstractspline.h" class VFormula; @@ -39,7 +39,8 @@ class VToolCut : public VToolPoint { Q_OBJECT public: - VToolCut(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula, const quint32 &curveCutId, + VToolCut(VAbstractPattern *doc, VContainer *data, const quint32 &id, const QString &formula, + const quint32 &curveCutId, const quint32 &curve1id, const quint32 &curve2id, const QString &color, QGraphicsItem * parent = nullptr); virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::Cut)}; diff --git a/src/app/tools/drawTools/vtoolcutarc.cpp b/src/libs/vtools/tools/drawTools/vtoolcutarc.cpp similarity index 95% rename from src/app/tools/drawTools/vtoolcutarc.cpp rename to src/libs/vtools/tools/drawTools/vtoolcutarc.cpp index 075d96b63..bf779a791 100644 --- a/src/app/tools/drawTools/vtoolcutarc.cpp +++ b/src/libs/vtools/tools/drawTools/vtoolcutarc.cpp @@ -27,10 +27,11 @@ *************************************************************************/ #include "vtoolcutarc.h" -#include "../../libs/vpatterndb/calculator.h" +#include "../../../vpatterndb/calculator.h" +#include "../../../vpatterndb/vtranslatevars.h" #include "../../dialogs/tools/dialogcutarc.h" -#include "../../libs/vgeometry/vpointf.h" -#include "../../libs/vgeometry/varc.h" +#include "../../../vgeometry/vpointf.h" +#include "../../../vgeometry/varc.h" #include "../../visualization/vistoolcutarc.h" const QString VToolCutArc::ToolType = QStringLiteral("cutArc"); @@ -48,7 +49,7 @@ const QString VToolCutArc::ToolType = QStringLiteral("cutArc"); * @param typeCreation way we create this tool. * @param parent parent object. */ -VToolCutArc::VToolCutArc(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula, +VToolCutArc::VToolCutArc(VAbstractPattern *doc, VContainer *data, const quint32 &id, const QString &formula, const quint32 &arcId, const quint32 &arc1id, const quint32 &arc2id, const QString &color, const Source &typeCreation, QGraphicsItem * parent) :VToolCut(doc, data, id, formula, arcId, arc1id, arc2id, color, parent) @@ -83,7 +84,7 @@ void VToolCutArc::setDialog() * @param doc dom document container. * @param data container with variables. */ -VToolCutArc* VToolCutArc::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data) +VToolCutArc* VToolCutArc::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { SCASSERT(dialog != nullptr); DialogCutArc *dialogTool = qobject_cast(dialog); @@ -118,7 +119,8 @@ VToolCutArc* VToolCutArc::Create(DialogTool *dialog, VMainGraphicsScene *scene, */ VToolCutArc* VToolCutArc::Create(const quint32 _id, const QString &pointName, QString &formula, const quint32 &arcId, const qreal &mx, const qreal &my, const QString &color, VMainGraphicsScene *scene, - VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) + VAbstractPattern *doc, VContainer *data, const Document &parse, + const Source &typeCreation) { const QSharedPointer arc = data->GeometricObject(arcId); diff --git a/src/app/tools/drawTools/vtoolcutarc.h b/src/libs/vtools/tools/drawTools/vtoolcutarc.h similarity index 88% rename from src/app/tools/drawTools/vtoolcutarc.h rename to src/libs/vtools/tools/drawTools/vtoolcutarc.h index cfe4d11b6..b805d4f10 100644 --- a/src/app/tools/drawTools/vtoolcutarc.h +++ b/src/libs/vtools/tools/drawTools/vtoolcutarc.h @@ -38,14 +38,16 @@ class VToolCutArc : public VToolCut { Q_OBJECT public: - VToolCutArc(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula, const quint32 &arcId, + VToolCutArc(VAbstractPattern *doc, VContainer *data, const quint32 &id, const QString &formula, + const quint32 &arcId, const quint32 &arc1id, const quint32 &arc2id, const QString &color, const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual void setDialog(); - static VToolCutArc* Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); + static VToolCutArc* Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolCutArc* Create(const quint32 _id, const QString &pointName, QString &formula, const quint32 &arcId, const qreal &mx, const qreal &my, const QString &color, VMainGraphicsScene *scene, - VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation); + VAbstractPattern *doc, VContainer *data, const Document &parse, + const Source &typeCreation); static const QString ToolType; virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::CutArc)}; diff --git a/src/app/tools/drawTools/vtoolcutspline.cpp b/src/libs/vtools/tools/drawTools/vtoolcutspline.cpp similarity index 96% rename from src/app/tools/drawTools/vtoolcutspline.cpp rename to src/libs/vtools/tools/drawTools/vtoolcutspline.cpp index 2ad1bae44..ce3b01beb 100644 --- a/src/app/tools/drawTools/vtoolcutspline.cpp +++ b/src/libs/vtools/tools/drawTools/vtoolcutspline.cpp @@ -27,11 +27,12 @@ *************************************************************************/ #include "vtoolcutspline.h" -#include "../../libs/vpatterndb/calculator.h" +#include "../../../vpatterndb/calculator.h" +#include "../../../vpatterndb/vtranslatevars.h" #include "../../dialogs/tools/dialogcutspline.h" -#include "../../libs/vgeometry/vpointf.h" +#include "../../../vgeometry/vpointf.h" #include "../../visualization/vistoolcutspline.h" -#include "../../libs/vgeometry/vspline.h" +#include "../../../vgeometry/vspline.h" const QString VToolCutSpline::ToolType = QStringLiteral("cutSpline"); const QString VToolCutSpline::AttrSpline = QStringLiteral("spline"); @@ -47,7 +48,7 @@ const QString VToolCutSpline::AttrSpline = QStringLiteral("spline"); * @param typeCreation way we create this tool. * @param parent parent object. */ -VToolCutSpline::VToolCutSpline(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula, +VToolCutSpline::VToolCutSpline(VAbstractPattern *doc, VContainer *data, const quint32 &id, const QString &formula, const quint32 &splineId, const quint32 &spl1id, const quint32 &spl2id, const QString &color, const Source &typeCreation, QGraphicsItem *parent) :VToolCut(doc, data, id, formula, splineId, spl1id, spl2id, color, parent) @@ -83,7 +84,7 @@ void VToolCutSpline::setDialog() * @param data container with variables. */ VToolCutSpline* VToolCutSpline::Create(DialogTool *dialog, VMainGraphicsScene *scene, - VPattern *doc, VContainer *data) + VAbstractPattern *doc, VContainer *data) { SCASSERT(dialog != nullptr); DialogCutSpline *dialogTool = qobject_cast(dialog); @@ -119,7 +120,7 @@ VToolCutSpline* VToolCutSpline::Create(DialogTool *dialog, VMainGraphicsScene *s */ VToolCutSpline* VToolCutSpline::Create(const quint32 _id, const QString &pointName, QString &formula, const quint32 &splineId, const qreal &mx, const qreal &my, const QString &color, - VMainGraphicsScene *scene, VPattern *doc, VContainer *data, + VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) { const QSharedPointer spl = data->GeometricObject(splineId); diff --git a/src/app/tools/drawTools/vtoolcutspline.h b/src/libs/vtools/tools/drawTools/vtoolcutspline.h similarity index 89% rename from src/app/tools/drawTools/vtoolcutspline.h rename to src/libs/vtools/tools/drawTools/vtoolcutspline.h index 164463d47..df3c92d66 100644 --- a/src/app/tools/drawTools/vtoolcutspline.h +++ b/src/libs/vtools/tools/drawTools/vtoolcutspline.h @@ -39,14 +39,16 @@ class VToolCutSpline : public VToolCut Q_OBJECT public: - VToolCutSpline(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula, + VToolCutSpline(VAbstractPattern *doc, VContainer *data, const quint32 &id, const QString &formula, const quint32 &splineId, const quint32 &spl1id, const quint32 &spl2id, const QString &color, const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual void setDialog(); - static VToolCutSpline *Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); + static VToolCutSpline *Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, + VContainer *data); static VToolCutSpline *Create(const quint32 _id, const QString &pointName, QString &formula, const quint32 &splineId, const qreal &mx, const qreal &my, const QString &color, - VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, + VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data, + const Document &parse, const Source &typeCreation); static const QString ToolType; static const QString AttrSpline; diff --git a/src/app/tools/drawTools/vtoolcutsplinepath.cpp b/src/libs/vtools/tools/drawTools/vtoolcutsplinepath.cpp similarity index 97% rename from src/app/tools/drawTools/vtoolcutsplinepath.cpp rename to src/libs/vtools/tools/drawTools/vtoolcutsplinepath.cpp index 2e8ef38ee..724ca3571 100644 --- a/src/app/tools/drawTools/vtoolcutsplinepath.cpp +++ b/src/libs/vtools/tools/drawTools/vtoolcutsplinepath.cpp @@ -27,11 +27,12 @@ *************************************************************************/ #include "vtoolcutsplinepath.h" -#include "../../libs/vpatterndb/calculator.h" +#include "../../../vpatterndb/calculator.h" +#include "../../../vpatterndb/vtranslatevars.h" #include "../../dialogs/tools/dialogcutsplinepath.h" -#include "../../libs/vgeometry/vpointf.h" +#include "../../../vgeometry/vpointf.h" #include "../../visualization/vistoolcutsplinepath.h" -#include "../../libs/vgeometry/vsplinepath.h" +#include "../../../vgeometry/vsplinepath.h" const QString VToolCutSplinePath::ToolType = QStringLiteral("cutSplinePath"); const QString VToolCutSplinePath::AttrSplinePath = QStringLiteral("splinePath"); @@ -49,7 +50,7 @@ const QString VToolCutSplinePath::AttrSplinePath = QStringLiteral("splinePath"); * @param typeCreation way we create this tool. * @param parent parent object. */ -VToolCutSplinePath::VToolCutSplinePath(VPattern *doc, VContainer *data, const quint32 &id, +VToolCutSplinePath::VToolCutSplinePath(VAbstractPattern *doc, VContainer *data, const quint32 &id, const QString &formula, const quint32 &splinePathId, const quint32 &splPath1id, const quint32 &splPath2id, const QString &color, const Source &typeCreation, QGraphicsItem *parent) @@ -85,7 +86,7 @@ void VToolCutSplinePath::setDialog() * @param doc dom document container. * @param data container with variables. */ -VToolCutSplinePath* VToolCutSplinePath::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, +VToolCutSplinePath* VToolCutSplinePath::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { SCASSERT(dialog != nullptr); @@ -122,7 +123,7 @@ VToolCutSplinePath* VToolCutSplinePath::Create(DialogTool *dialog, VMainGraphics */ VToolCutSplinePath* VToolCutSplinePath::Create(const quint32 _id, const QString &pointName, QString &formula, const quint32 &splinePathId, const qreal &mx, const qreal &my, - const QString &color, VMainGraphicsScene *scene, VPattern *doc, + const QString &color, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) { const QSharedPointer splPath = data->GeometricObject(splinePathId); diff --git a/src/app/tools/drawTools/vtoolcutsplinepath.h b/src/libs/vtools/tools/drawTools/vtoolcutsplinepath.h similarity index 90% rename from src/app/tools/drawTools/vtoolcutsplinepath.h rename to src/libs/vtools/tools/drawTools/vtoolcutsplinepath.h index 1e230f3cf..0fd9107bc 100644 --- a/src/app/tools/drawTools/vtoolcutsplinepath.h +++ b/src/libs/vtools/tools/drawTools/vtoolcutsplinepath.h @@ -40,14 +40,16 @@ class VToolCutSplinePath : public VToolCut Q_OBJECT public: - VToolCutSplinePath(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula, + VToolCutSplinePath(VAbstractPattern *doc, VContainer *data, const quint32 &id, const QString &formula, const quint32 &splinePathId, const quint32 &splPath1id, const quint32 &splPath2id, const QString &color, const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual void setDialog(); - static VToolCutSplinePath *Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); + static VToolCutSplinePath *Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, + VContainer *data); static VToolCutSplinePath *Create(const quint32 _id, const QString &pointName, QString &formula, const quint32 &splinePathId, const qreal &mx, const qreal &my, - const QString &color, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, + const QString &color, VMainGraphicsScene *scene, VAbstractPattern *doc, + VContainer *data, const Document &parse, const Source &typeCreation); static const QString ToolType; static const QString AttrSplinePath; diff --git a/src/app/tools/drawTools/vtoolendline.cpp b/src/libs/vtools/tools/drawTools/vtoolendline.cpp similarity index 94% rename from src/app/tools/drawTools/vtoolendline.cpp rename to src/libs/vtools/tools/drawTools/vtoolendline.cpp index c44d267a7..24c9f027e 100644 --- a/src/app/tools/drawTools/vtoolendline.cpp +++ b/src/libs/vtools/tools/drawTools/vtoolendline.cpp @@ -27,11 +27,12 @@ *************************************************************************/ #include "vtoolendline.h" -#include "../../libs/vwidgets/vmaingraphicsscene.h" -#include "../../libs/vpatterndb/calculator.h" +#include "../../../vwidgets/vmaingraphicsscene.h" +#include "../../../vpatterndb/calculator.h" +#include "../../../vpatterndb/vtranslatevars.h" #include "../../dialogs/tools/dialogendline.h" -#include "../../dialogs/tools/dialogeditwrongformula.h" -#include "../../libs/vgeometry/vpointf.h" +#include "../../dialogs/support/dialogeditwrongformula.h" +#include "../../../vgeometry/vpointf.h" #include "../../visualization/vistoolendline.h" const QString VToolEndLine::ToolType = QStringLiteral("endLine"); @@ -49,7 +50,7 @@ const QString VToolEndLine::ToolType = QStringLiteral("endLine"); * @param typeCreation way we create this tool. * @param parent parent object. */ -VToolEndLine::VToolEndLine(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, +VToolEndLine::VToolEndLine(VAbstractPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &lineColor, const QString &formulaLength, const QString &formulaAngle, const quint32 &basePointId, const Source &typeCreation, QGraphicsItem *parent) :VToolLinePoint(doc, data, id, typeLine, lineColor, formulaLength, basePointId, 0, parent), @@ -90,7 +91,8 @@ void VToolEndLine::setDialog() * @param data container with variables. * @return the created tool */ -VToolEndLine* VToolEndLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data) +VToolEndLine* VToolEndLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, + VContainer *data) { SCASSERT(dialog != nullptr); DialogEndLine *dialogTool = qobject_cast(dialog); @@ -134,7 +136,8 @@ VToolEndLine* VToolEndLine::Create(DialogTool *dialog, VMainGraphicsScene *scene VToolEndLine* VToolEndLine::Create(const quint32 _id, const QString &pointName, const QString &typeLine, const QString &lineColor, QString &formulaLength, QString &formulaAngle, const quint32 &basePointId, const qreal &mx, const qreal &my, - VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, + VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data, + const Document &parse, const Source &typeCreation) { const QSharedPointer basePoint = data->GeometricObject(basePointId); diff --git a/src/app/tools/drawTools/vtoolendline.h b/src/libs/vtools/tools/drawTools/vtoolendline.h similarity index 87% rename from src/app/tools/drawTools/vtoolendline.h rename to src/libs/vtools/tools/drawTools/vtoolendline.h index b8c0d6977..95277c137 100644 --- a/src/app/tools/drawTools/vtoolendline.h +++ b/src/libs/vtools/tools/drawTools/vtoolendline.h @@ -39,16 +39,19 @@ class VToolEndLine : public VToolLinePoint Q_OBJECT public: - VToolEndLine(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &lineColor, + VToolEndLine(VAbstractPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, + const QString &lineColor, const QString &formulaLength, const QString &formulaAngle, const quint32 &basePointId, const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual ~VToolEndLine(); virtual void setDialog(); - static VToolEndLine *Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); + static VToolEndLine *Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, + VContainer *data); static VToolEndLine *Create(const quint32 _id, const QString &pointName, const QString &typeLine, const QString &lineColor, QString &formulaLength, QString &formulaAngle, const quint32 &basePointId, const qreal &mx, const qreal &my, - VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, + VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data, + const Document &parse, const Source &typeCreation); static const QString ToolType; virtual int type() const {return Type;} diff --git a/src/app/tools/drawTools/vtoolheight.cpp b/src/libs/vtools/tools/drawTools/vtoolheight.cpp similarity index 97% rename from src/app/tools/drawTools/vtoolheight.cpp rename to src/libs/vtools/tools/drawTools/vtoolheight.cpp index 2e119838e..cc229400b 100644 --- a/src/app/tools/drawTools/vtoolheight.cpp +++ b/src/libs/vtools/tools/drawTools/vtoolheight.cpp @@ -46,7 +46,7 @@ const QString VToolHeight::ToolType = QStringLiteral("height"); * @param typeCreation way we create this tool. * @param parent parent object. */ -VToolHeight::VToolHeight(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, +VToolHeight::VToolHeight(VAbstractPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &lineColor, const quint32 &basePointId, const quint32 &p1LineId, const quint32 &p2LineId, const Source &typeCreation, QGraphicsItem * parent) :VToolLinePoint(doc, data, id, typeLine, lineColor, QString(), basePointId, 0, parent), p1LineId(p1LineId), @@ -82,7 +82,7 @@ void VToolHeight::setDialog() * @param data container with variables. * @return the created tool */ -VToolHeight* VToolHeight::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data) +VToolHeight* VToolHeight::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { SCASSERT(dialog != nullptr); DialogHeight *dialogTool = qobject_cast(dialog); @@ -125,7 +125,8 @@ VToolHeight* VToolHeight::Create(DialogTool *dialog, VMainGraphicsScene *scene, VToolHeight* VToolHeight::Create(const quint32 _id, const QString &pointName, const QString &typeLine, const QString &lineColor, const quint32 &basePointId, const quint32 &p1LineId, const quint32 &p2LineId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, - VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) + VAbstractPattern *doc, VContainer *data, const Document &parse, + const Source &typeCreation) { const QSharedPointer basePoint = data->GeometricObject(basePointId); const QSharedPointer p1Line = data->GeometricObject(p1LineId); diff --git a/src/app/tools/drawTools/vtoolheight.h b/src/libs/vtools/tools/drawTools/vtoolheight.h similarity index 89% rename from src/app/tools/drawTools/vtoolheight.h rename to src/libs/vtools/tools/drawTools/vtoolheight.h index f8ec5637c..244ffcd0a 100644 --- a/src/app/tools/drawTools/vtoolheight.h +++ b/src/libs/vtools/tools/drawTools/vtoolheight.h @@ -39,15 +39,17 @@ class VToolHeight: public VToolLinePoint Q_OBJECT public: - VToolHeight(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &lineColor, + VToolHeight(VAbstractPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, + const QString &lineColor, const quint32 &basePointId, const quint32 &p1LineId, const quint32 &p2LineId, const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual void setDialog(); - static VToolHeight *Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); + static VToolHeight *Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolHeight *Create(const quint32 _id, const QString &pointName, const QString &typeLine, const QString &lineColor, const quint32 &basePointId, const quint32 &p1LineId, const quint32 &p2LineId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, - VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation); + VAbstractPattern *doc, VContainer *data, const Document &parse, + const Source &typeCreation); static QPointF FindPoint(const QLineF &line, const QPointF &point); static const QString ToolType; virtual int type() const {return Type;} diff --git a/src/app/tools/drawTools/vtoolline.cpp b/src/libs/vtools/tools/drawTools/vtoolline.cpp similarity index 98% rename from src/app/tools/drawTools/vtoolline.cpp rename to src/libs/vtools/tools/drawTools/vtoolline.cpp index 0ef1cbfe7..462426451 100644 --- a/src/app/tools/drawTools/vtoolline.cpp +++ b/src/libs/vtools/tools/drawTools/vtoolline.cpp @@ -47,7 +47,7 @@ const QString VToolLine::TagName = QStringLiteral("line"); * @param typeCreation way we create this tool. * @param parent parent object. */ -VToolLine::VToolLine(VPattern *doc, VContainer *data, quint32 id, quint32 firstPoint, quint32 secondPoint, +VToolLine::VToolLine(VAbstractPattern *doc, VContainer *data, quint32 id, quint32 firstPoint, quint32 secondPoint, const QString &typeLine, const QString &lineColor, const Source &typeCreation, QGraphicsItem *parent) :VDrawTool(doc, data, id), QGraphicsLineItem(parent), firstPoint(firstPoint), secondPoint(secondPoint) @@ -91,7 +91,7 @@ void VToolLine::setDialog() * @param doc dom document container. * @param data container with variables. */ -VToolLine *VToolLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data) +VToolLine *VToolLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { SCASSERT(dialog != nullptr); DialogLine *dialogTool = qobject_cast(dialog); @@ -126,7 +126,8 @@ VToolLine *VToolLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPat */ VToolLine * VToolLine::Create(const quint32 &_id, const quint32 &firstPoint, const quint32 &secondPoint, const QString &typeLine, const QString &lineColor, VMainGraphicsScene *scene, - VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) + VAbstractPattern *doc, VContainer *data, const Document &parse, + const Source &typeCreation) { SCASSERT(scene != nullptr); SCASSERT(doc != nullptr); diff --git a/src/app/tools/drawTools/vtoolline.h b/src/libs/vtools/tools/drawTools/vtoolline.h similarity index 92% rename from src/app/tools/drawTools/vtoolline.h rename to src/libs/vtools/tools/drawTools/vtoolline.h index 733995acf..49d7d98ac 100644 --- a/src/app/tools/drawTools/vtoolline.h +++ b/src/libs/vtools/tools/drawTools/vtoolline.h @@ -39,14 +39,15 @@ class VToolLine: public VDrawTool, public QGraphicsLineItem { Q_OBJECT public: - VToolLine(VPattern *doc, VContainer *data, quint32 id, quint32 firstPoint, quint32 secondPoint, + VToolLine(VAbstractPattern *doc, VContainer *data, quint32 id, quint32 firstPoint, quint32 secondPoint, const QString &typeLine, const QString &lineColor, const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual void setDialog(); - static VToolLine *Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); + static VToolLine *Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolLine *Create(const quint32 &_id, const quint32 &firstPoint, const quint32 &secondPoint, const QString &typeLine, const QString &lineColor, VMainGraphicsScene *scene, - VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation); + VAbstractPattern *doc, VContainer *data, const Document &parse, + const Source &typeCreation); static const QString TagName; virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0); virtual int type() const {return Type;} diff --git a/src/app/tools/drawTools/vtoollineintersect.cpp b/src/libs/vtools/tools/drawTools/vtoollineintersect.cpp similarity index 98% rename from src/app/tools/drawTools/vtoollineintersect.cpp rename to src/libs/vtools/tools/drawTools/vtoollineintersect.cpp index d64615c34..6d0c640c4 100644 --- a/src/app/tools/drawTools/vtoollineintersect.cpp +++ b/src/libs/vtools/tools/drawTools/vtoollineintersect.cpp @@ -46,7 +46,7 @@ const QString VToolLineIntersect::ToolType = QStringLiteral("lineIntersect"); * @param typeCreation way we create this tool. * @param parent parent object. */ -VToolLineIntersect::VToolLineIntersect(VPattern *doc, VContainer *data, const quint32 &id, +VToolLineIntersect::VToolLineIntersect(VAbstractPattern *doc, VContainer *data, const quint32 &id, const quint32 &p1Line1, const quint32 &p2Line1, const quint32 &p1Line2, const quint32 &p2Line2, const Source &typeCreation, QGraphicsItem *parent) @@ -82,7 +82,7 @@ void VToolLineIntersect::setDialog() * @param data container with variables. * @return the created tool */ -VToolLineIntersect* VToolLineIntersect::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, +VToolLineIntersect* VToolLineIntersect::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { SCASSERT(dialog != nullptr); @@ -124,7 +124,7 @@ VToolLineIntersect* VToolLineIntersect::Create(DialogTool *dialog, VMainGraphics VToolLineIntersect* 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, + VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) { const QSharedPointer p1Line1 = data->GeometricObject(p1Line1Id); diff --git a/src/app/tools/drawTools/vtoollineintersect.h b/src/libs/vtools/tools/drawTools/vtoollineintersect.h similarity index 91% rename from src/app/tools/drawTools/vtoollineintersect.h rename to src/libs/vtools/tools/drawTools/vtoollineintersect.h index a28f2e010..0994f4dbd 100644 --- a/src/app/tools/drawTools/vtoollineintersect.h +++ b/src/libs/vtools/tools/drawTools/vtoollineintersect.h @@ -38,14 +38,16 @@ class VToolLineIntersect:public VToolPoint { Q_OBJECT public: - VToolLineIntersect(VPattern *doc, VContainer *data, const quint32 &id, const quint32 &p1Line1, + VToolLineIntersect(VAbstractPattern *doc, VContainer *data, const quint32 &id, const quint32 &p1Line1, const quint32 &p2Line1, const quint32 &p1Line2, const quint32 &p2Line2, const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual void setDialog(); - static VToolLineIntersect *Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); + static VToolLineIntersect *Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, + VContainer *data); static 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, + const qreal &mx, const qreal &my, VMainGraphicsScene *scene, + VAbstractPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation); static const QString ToolType; virtual int type() const {return Type;} diff --git a/src/app/tools/drawTools/vtoollineintersectaxis.cpp b/src/libs/vtools/tools/drawTools/vtoollineintersectaxis.cpp similarity index 95% rename from src/app/tools/drawTools/vtoollineintersectaxis.cpp rename to src/libs/vtools/tools/drawTools/vtoollineintersectaxis.cpp index 4dbc92919..a6a2928cd 100644 --- a/src/app/tools/drawTools/vtoollineintersectaxis.cpp +++ b/src/libs/vtools/tools/drawTools/vtoollineintersectaxis.cpp @@ -27,17 +27,18 @@ *************************************************************************/ #include "vtoollineintersectaxis.h" -#include "../../libs/vwidgets/vmaingraphicsscene.h" -#include "../../libs/vpatterndb/calculator.h" +#include "../../../vwidgets/vmaingraphicsscene.h" +#include "../../../vpatterndb/calculator.h" +#include "../../../vpatterndb/vtranslatevars.h" #include "../../dialogs/tools/dialoglineintersectaxis.h" -#include "../../dialogs/tools/dialogeditwrongformula.h" -#include "../../libs/vgeometry/vpointf.h" +#include "../../dialogs/support/dialogeditwrongformula.h" +#include "../../../vgeometry/vpointf.h" #include "../../visualization/vistoollineintersectaxis.h" const QString VToolLineIntersectAxis::ToolType = QStringLiteral("lineIntersectAxis"); //--------------------------------------------------------------------------------------------------------------------- -VToolLineIntersectAxis::VToolLineIntersectAxis(VPattern *doc, VContainer *data, const quint32 &id, +VToolLineIntersectAxis::VToolLineIntersectAxis(VAbstractPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &lineColor, const QString &formulaAngle, const quint32 &basePointId, const quint32 &firstPointId, const quint32 &secondPointId, @@ -70,7 +71,8 @@ void VToolLineIntersectAxis::setDialog() } //--------------------------------------------------------------------------------------------------------------------- -VToolLineIntersectAxis *VToolLineIntersectAxis::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, +VToolLineIntersectAxis *VToolLineIntersectAxis::Create(DialogTool *dialog, VMainGraphicsScene *scene, + VAbstractPattern *doc, VContainer *data) { SCASSERT(dialog != nullptr); @@ -100,7 +102,7 @@ VToolLineIntersectAxis *VToolLineIntersectAxis::Create(const quint32 _id, const QString &formulaAngle, const quint32 &basePointId, const quint32 &firstPointId, const quint32 &secondPointId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, - VPattern *doc, VContainer *data, const Document &parse, + VAbstractPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) { const QSharedPointer basePoint = data->GeometricObject(basePointId); diff --git a/src/app/tools/drawTools/vtoollineintersectaxis.h b/src/libs/vtools/tools/drawTools/vtoollineintersectaxis.h similarity index 92% rename from src/app/tools/drawTools/vtoollineintersectaxis.h rename to src/libs/vtools/tools/drawTools/vtoollineintersectaxis.h index d9166ddfb..470516595 100644 --- a/src/app/tools/drawTools/vtoollineintersectaxis.h +++ b/src/libs/vtools/tools/drawTools/vtoollineintersectaxis.h @@ -35,19 +35,20 @@ class VToolLineIntersectAxis : public VToolLinePoint { Q_OBJECT public: - VToolLineIntersectAxis(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, + VToolLineIntersectAxis(VAbstractPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &lineColor, const QString &formulaAngle, const quint32 &basePointId, const quint32 &firstPointId, const quint32 &secondPointId, const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual ~VToolLineIntersectAxis(); virtual void setDialog(); - static VToolLineIntersectAxis *Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, + static VToolLineIntersectAxis *Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolLineIntersectAxis *Create(const quint32 _id, const QString &pointName, const QString &typeLine, const QString &lineColor, QString &formulaAngle, const quint32 &basePointId, const quint32 &firstPointId, const quint32 &secondPointId, - const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, + const qreal &mx, const qreal &my, VMainGraphicsScene *scene, + VAbstractPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation); static QPointF FindPoint(const QLineF &axis, const QLineF &line); diff --git a/src/app/tools/drawTools/vtoollinepoint.cpp b/src/libs/vtools/tools/drawTools/vtoollinepoint.cpp similarity index 98% rename from src/app/tools/drawTools/vtoollinepoint.cpp rename to src/libs/vtools/tools/drawTools/vtoollinepoint.cpp index 2a13dbc0b..c60e1854b 100644 --- a/src/app/tools/drawTools/vtoollinepoint.cpp +++ b/src/libs/vtools/tools/drawTools/vtoollinepoint.cpp @@ -42,7 +42,7 @@ * @param angle line angle. * @param parent parent object. */ -VToolLinePoint::VToolLinePoint(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, +VToolLinePoint::VToolLinePoint(VAbstractPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &lineColor, const QString &formula, const quint32 &basePointId, const qreal &angle, QGraphicsItem *parent) :VToolPoint(doc, data, id, parent), formulaLength(formula), angle(angle), basePointId(basePointId), diff --git a/src/app/tools/drawTools/vtoollinepoint.h b/src/libs/vtools/tools/drawTools/vtoollinepoint.h similarity index 94% rename from src/app/tools/drawTools/vtoollinepoint.h rename to src/libs/vtools/tools/drawTools/vtoollinepoint.h index b8646de6e..5820aba05 100644 --- a/src/app/tools/drawTools/vtoollinepoint.h +++ b/src/libs/vtools/tools/drawTools/vtoollinepoint.h @@ -30,7 +30,7 @@ #define VTOOLLINEPOINT_H #include "vtoolpoint.h" -#include "../../../libs/vpatterndb/vformula.h" +#include "../../../vpatterndb/vformula.h" /** * @brief The VToolLinePoint class parent for all tools what create point with line. @@ -39,7 +39,7 @@ class VToolLinePoint : public VToolPoint { Q_OBJECT public: - VToolLinePoint(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const + VToolLinePoint(VAbstractPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &lineColor, const QString &formula, const quint32 &basePointId, const qreal &angle, QGraphicsItem * parent = nullptr); virtual ~VToolLinePoint(); diff --git a/src/app/tools/drawTools/vtoolnormal.cpp b/src/libs/vtools/tools/drawTools/vtoolnormal.cpp similarity index 96% rename from src/app/tools/drawTools/vtoolnormal.cpp rename to src/libs/vtools/tools/drawTools/vtoolnormal.cpp index 4c320433a..c4b0a3349 100644 --- a/src/app/tools/drawTools/vtoolnormal.cpp +++ b/src/libs/vtools/tools/drawTools/vtoolnormal.cpp @@ -27,9 +27,10 @@ *************************************************************************/ #include "vtoolnormal.h" -#include "../../libs/vpatterndb/calculator.h" +#include "../../../vpatterndb/calculator.h" +#include "../../../vpatterndb/vtranslatevars.h" #include "../../dialogs/tools/dialognormal.h" -#include "../../libs/vgeometry/vpointf.h" +#include "../../../vgeometry/vpointf.h" #include "../../visualization/vistoolnormal.h" const QString VToolNormal::ToolType = QStringLiteral("normal"); @@ -48,7 +49,7 @@ const QString VToolNormal::ToolType = QStringLiteral("normal"); * @param typeCreation way we create this tool. * @param parent parent object. */ -VToolNormal::VToolNormal(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, +VToolNormal::VToolNormal(VAbstractPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &lineColor, const QString &formula, const qreal &angle, const quint32 &firstPointId, const quint32 &secondPointId, const Source &typeCreation, QGraphicsItem *parent) @@ -85,7 +86,7 @@ void VToolNormal::setDialog() * @param doc dom document container. * @param data container with variables. */ -VToolNormal* VToolNormal::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data) +VToolNormal* VToolNormal::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { SCASSERT(dialog != nullptr); DialogNormal *dialogTool = qobject_cast(dialog); @@ -128,7 +129,8 @@ VToolNormal* VToolNormal::Create(DialogTool *dialog, VMainGraphicsScene *scene, VToolNormal* VToolNormal::Create(const quint32 _id, QString &formula, const quint32 &firstPointId, const quint32 &secondPointId, const QString &typeLine, const QString &lineColor, const QString &pointName, const qreal angle, const qreal &mx, const qreal &my, - VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, + VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data, + const Document &parse, const Source &typeCreation) { const QSharedPointer firstPoint = data->GeometricObject(firstPointId); diff --git a/src/app/tools/drawTools/vtoolnormal.h b/src/libs/vtools/tools/drawTools/vtoolnormal.h similarity index 89% rename from src/app/tools/drawTools/vtoolnormal.h rename to src/libs/vtools/tools/drawTools/vtoolnormal.h index f6ef36444..5a06293dd 100644 --- a/src/app/tools/drawTools/vtoolnormal.h +++ b/src/libs/vtools/tools/drawTools/vtoolnormal.h @@ -38,15 +38,17 @@ class VToolNormal : public VToolLinePoint { Q_OBJECT public: - VToolNormal(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &lineColor, + VToolNormal(VAbstractPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, + const QString &lineColor, const QString &formula, const qreal &angle, const quint32 &firstPointId, const quint32 &secondPointId, const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual void setDialog(); - static VToolNormal* Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); + static VToolNormal* Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolNormal* Create(const quint32 _id, QString &formula, const quint32 &firstPointId, const quint32 &secondPointId, const QString &typeLine, const QString &lineColor, const QString &pointName, const qreal angle, const qreal &mx, const qreal &my, - VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, + VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data, + const Document &parse, const Source &typeCreation); static QPointF FindPoint(const QPointF &firstPoint, const QPointF &secondPoint, const qreal &length, const qreal &angle = 0); diff --git a/src/app/tools/drawTools/vtoolpoint.cpp b/src/libs/vtools/tools/drawTools/vtoolpoint.cpp similarity index 99% rename from src/app/tools/drawTools/vtoolpoint.cpp rename to src/libs/vtools/tools/drawTools/vtoolpoint.cpp index d1c0a94bb..b96c82240 100644 --- a/src/app/tools/drawTools/vtoolpoint.cpp +++ b/src/libs/vtools/tools/drawTools/vtoolpoint.cpp @@ -46,7 +46,7 @@ const QString VToolPoint::TagName = QStringLiteral("point"); * @param id object id in container. * @param parent parent object. */ -VToolPoint::VToolPoint(VPattern *doc, VContainer *data, quint32 id, QGraphicsItem *parent) +VToolPoint::VToolPoint(VAbstractPattern *doc, VContainer *data, quint32 id, QGraphicsItem *parent) :VDrawTool(doc, data, id), QGraphicsEllipseItem(parent), radius(DefPointRadius), namePoint(nullptr), lineName(nullptr) { diff --git a/src/app/tools/drawTools/vtoolpoint.h b/src/libs/vtools/tools/drawTools/vtoolpoint.h similarity index 97% rename from src/app/tools/drawTools/vtoolpoint.h rename to src/libs/vtools/tools/drawTools/vtoolpoint.h index b3983f834..7817b134b 100644 --- a/src/app/tools/drawTools/vtoolpoint.h +++ b/src/libs/vtools/tools/drawTools/vtoolpoint.h @@ -42,7 +42,7 @@ class VToolPoint: public VDrawTool, public QGraphicsEllipseItem { Q_OBJECT public: - VToolPoint(VPattern *doc, VContainer *data, quint32 id, QGraphicsItem * parent = nullptr); + VToolPoint(VAbstractPattern *doc, VContainer *data, quint32 id, QGraphicsItem * parent = nullptr); virtual ~VToolPoint(); virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0); QString name() const; diff --git a/src/app/tools/drawTools/vtoolpointfromarcandtangent.cpp b/src/libs/vtools/tools/drawTools/vtoolpointfromarcandtangent.cpp similarity index 98% rename from src/app/tools/drawTools/vtoolpointfromarcandtangent.cpp rename to src/libs/vtools/tools/drawTools/vtoolpointfromarcandtangent.cpp index 937328390..47f6b1a0b 100644 --- a/src/app/tools/drawTools/vtoolpointfromarcandtangent.cpp +++ b/src/libs/vtools/tools/drawTools/vtoolpointfromarcandtangent.cpp @@ -35,7 +35,7 @@ const QString VToolPointFromArcAndTangent::ToolType = QStringLiteral("pointFromArcAndTangent"); //--------------------------------------------------------------------------------------------------------------------- -VToolPointFromArcAndTangent::VToolPointFromArcAndTangent(VPattern *doc, VContainer *data, const quint32 &id, +VToolPointFromArcAndTangent::VToolPointFromArcAndTangent(VAbstractPattern *doc, VContainer *data, const quint32 &id, quint32 arcId, quint32 tangentPointId, CrossCirclesPoint crossPoint, const Source &typeCreation, QGraphicsItem *parent) @@ -59,7 +59,7 @@ void VToolPointFromArcAndTangent::setDialog() //--------------------------------------------------------------------------------------------------------------------- VToolPointFromArcAndTangent *VToolPointFromArcAndTangent::Create(DialogTool *dialog, VMainGraphicsScene *scene, - VPattern *doc, VContainer *data) + VAbstractPattern *doc, VContainer *data) { SCASSERT(dialog != nullptr); DialogPointFromArcAndTangent *dialogTool = qobject_cast(dialog); @@ -83,7 +83,7 @@ VToolPointFromArcAndTangent *VToolPointFromArcAndTangent::Create(const quint32 _ quint32 arcId, quint32 tangentPointId, CrossCirclesPoint crossPoint, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, - VPattern *doc, VContainer *data, + VAbstractPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) { const VArc arc = *data->GeometricObject(arcId); diff --git a/src/app/tools/drawTools/vtoolpointfromarcandtangent.h b/src/libs/vtools/tools/drawTools/vtoolpointfromarcandtangent.h similarity index 93% rename from src/app/tools/drawTools/vtoolpointfromarcandtangent.h rename to src/libs/vtools/tools/drawTools/vtoolpointfromarcandtangent.h index 2d4744db6..228415933 100644 --- a/src/app/tools/drawTools/vtoolpointfromarcandtangent.h +++ b/src/libs/vtools/tools/drawTools/vtoolpointfromarcandtangent.h @@ -30,21 +30,20 @@ #define VTOOLPOINTFROMARCANDTANGENT_H #include "vtoolpoint.h" -#include "../../xml/vpattern.h" class VToolPointFromArcAndTangent : public VToolPoint { Q_OBJECT public: - VToolPointFromArcAndTangent(VPattern *doc, VContainer *data, const quint32 &id, quint32 arcId, + VToolPointFromArcAndTangent(VAbstractPattern *doc, VContainer *data, const quint32 &id, quint32 arcId, quint32 tangentPointId, CrossCirclesPoint crossPoint, const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual void setDialog(); - static VToolPointFromArcAndTangent *Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, + static VToolPointFromArcAndTangent *Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolPointFromArcAndTangent *Create(const quint32 _id, const QString &pointName, quint32 arcId, quint32 tangentPointId, CrossCirclesPoint crossPoint, const qreal &mx, - const qreal &my, VMainGraphicsScene *scene, VPattern *doc, + const qreal &my, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation); static QPointF FindPoint(const QPointF &p, const VArc *arc, const CrossCirclesPoint pType); static const QString ToolType; diff --git a/src/app/tools/drawTools/vtoolpointfromcircleandtangent.cpp b/src/libs/vtools/tools/drawTools/vtoolpointfromcircleandtangent.cpp similarity index 98% rename from src/app/tools/drawTools/vtoolpointfromcircleandtangent.cpp rename to src/libs/vtools/tools/drawTools/vtoolpointfromcircleandtangent.cpp index 350285d11..f14ddaffe 100644 --- a/src/app/tools/drawTools/vtoolpointfromcircleandtangent.cpp +++ b/src/libs/vtools/tools/drawTools/vtoolpointfromcircleandtangent.cpp @@ -36,7 +36,8 @@ const QString VToolPointFromCircleAndTangent::ToolType = QStringLiteral("pointFromCircleAndTangent"); //--------------------------------------------------------------------------------------------------------------------- -VToolPointFromCircleAndTangent::VToolPointFromCircleAndTangent(VPattern *doc, VContainer *data, const quint32 &id, +VToolPointFromCircleAndTangent::VToolPointFromCircleAndTangent(VAbstractPattern *doc, VContainer *data, + const quint32 &id, quint32 circleCenterId, const QString &circleRadius, quint32 tangentPointId, CrossCirclesPoint crossPoint, const Source &typeCreation, QGraphicsItem *parent) @@ -62,7 +63,7 @@ void VToolPointFromCircleAndTangent::setDialog() //--------------------------------------------------------------------------------------------------------------------- VToolPointFromCircleAndTangent *VToolPointFromCircleAndTangent::Create(DialogTool *dialog, VMainGraphicsScene *scene, - VPattern *doc, VContainer *data) + VAbstractPattern *doc, VContainer *data) { SCASSERT(dialog != nullptr); DialogPointFromCircleAndTangent *dialogTool = qobject_cast(dialog); @@ -88,7 +89,7 @@ VToolPointFromCircleAndTangent *VToolPointFromCircleAndTangent::Create(const qui quint32 tangentPointId, CrossCirclesPoint crossPoint, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, - VPattern *doc, VContainer *data, + VAbstractPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) { diff --git a/src/app/tools/drawTools/vtoolpointfromcircleandtangent.h b/src/libs/vtools/tools/drawTools/vtoolpointfromcircleandtangent.h similarity index 93% rename from src/app/tools/drawTools/vtoolpointfromcircleandtangent.h rename to src/libs/vtools/tools/drawTools/vtoolpointfromcircleandtangent.h index 7e084f1a8..ff0c64a09 100644 --- a/src/app/tools/drawTools/vtoolpointfromcircleandtangent.h +++ b/src/libs/vtools/tools/drawTools/vtoolpointfromcircleandtangent.h @@ -30,7 +30,6 @@ #define VTOOLPOINTFROMCIRCLEANDTANGENT_H #include "vtoolpoint.h" -#include "../../xml/vpattern.h" class VFormula; @@ -38,16 +37,16 @@ class VToolPointFromCircleAndTangent : public VToolPoint { Q_OBJECT public: - VToolPointFromCircleAndTangent(VPattern *doc, VContainer *data, const quint32 &id, quint32 circleCenterId, + VToolPointFromCircleAndTangent(VAbstractPattern *doc, VContainer *data, const quint32 &id, quint32 circleCenterId, const QString &circleRadius, quint32 tangentPointId, CrossCirclesPoint crossPoint, const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual void setDialog(); - static VToolPointFromCircleAndTangent *Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, + static VToolPointFromCircleAndTangent *Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolPointFromCircleAndTangent *Create(const quint32 _id, const QString &pointName, quint32 circleCenterId, QString &circleRadius, quint32 tangentPointId, CrossCirclesPoint crossPoint, const qreal &mx, const qreal &my, - VMainGraphicsScene *scene, VPattern *doc, VContainer *data, + VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation); static QPointF FindPoint(const QPointF &p, const QPointF ¢er, qreal radius, const CrossCirclesPoint crossPoint); static const QString ToolType; diff --git a/src/app/tools/drawTools/vtoolpointofcontact.cpp b/src/libs/vtools/tools/drawTools/vtoolpointofcontact.cpp similarity index 97% rename from src/app/tools/drawTools/vtoolpointofcontact.cpp rename to src/libs/vtools/tools/drawTools/vtoolpointofcontact.cpp index 42ac9f46f..c36b29287 100644 --- a/src/app/tools/drawTools/vtoolpointofcontact.cpp +++ b/src/libs/vtools/tools/drawTools/vtoolpointofcontact.cpp @@ -27,10 +27,11 @@ *************************************************************************/ #include "vtoolpointofcontact.h" -#include "../../libs/vpatterndb/calculator.h" +#include "../../../vpatterndb/calculator.h" +#include "../../../vpatterndb/vtranslatevars.h" #include "../../dialogs/tools/dialogpointofcontact.h" -#include "../../libs/vgeometry/vpointf.h" -#include "../../libs/vpatterndb/vformula.h" +#include "../../../vgeometry/vpointf.h" +#include "../../../vpatterndb/vformula.h" #include "../../visualization/vistoolpointofcontact.h" #include @@ -49,7 +50,7 @@ const QString VToolPointOfContact::ToolType = QStringLiteral("pointOfContact"); * @param typeCreation way we create this tool. * @param parent parent object. */ -VToolPointOfContact::VToolPointOfContact(VPattern *doc, VContainer *data, const quint32 &id, +VToolPointOfContact::VToolPointOfContact(VAbstractPattern *doc, VContainer *data, const quint32 &id, const QString &radius, const quint32 ¢er, const quint32 &firstPointId, const quint32 &secondPointId, const Source &typeCreation, QGraphicsItem *parent) @@ -143,7 +144,7 @@ QPointF VToolPointOfContact::FindPoint(const qreal &radius, const QPointF ¢e * @param doc dom document container. * @param data container with variables. */ -VToolPointOfContact* VToolPointOfContact::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, +VToolPointOfContact* VToolPointOfContact::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { SCASSERT(dialog != nullptr); @@ -184,7 +185,7 @@ VToolPointOfContact* VToolPointOfContact::Create(DialogTool *dialog, VMainGraphi VToolPointOfContact* VToolPointOfContact::Create(const quint32 _id, 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, + VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) { const QSharedPointer centerP = data->GeometricObject(center); diff --git a/src/app/tools/drawTools/vtoolpointofcontact.h b/src/libs/vtools/tools/drawTools/vtoolpointofcontact.h similarity index 79% rename from src/app/tools/drawTools/vtoolpointofcontact.h rename to src/libs/vtools/tools/drawTools/vtoolpointofcontact.h index 7c1215197..398425653 100644 --- a/src/app/tools/drawTools/vtoolpointofcontact.h +++ b/src/libs/vtools/tools/drawTools/vtoolpointofcontact.h @@ -40,18 +40,20 @@ class VToolPointOfContact : public VToolPoint { Q_OBJECT public: - VToolPointOfContact(VPattern *doc, VContainer *data, const quint32 &id, const QString &arcRadius, + VToolPointOfContact(VAbstractPattern *doc, VContainer *data, const quint32 &id, const QString &arcRadius, const quint32 ¢er, const quint32 &firstPointId, const quint32 &secondPointId, const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual void setDialog(); static QPointF FindPoint(const qreal &arcRadius, const QPointF ¢er, const QPointF &firstPoint, const QPointF &secondPoint); - static VToolPointOfContact* Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, - VContainer *data); - static VToolPointOfContact* Create(const quint32 _id, 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 &parse, const Source &typeCreation); + static VToolPointOfContact* Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, + VContainer *data); + static VToolPointOfContact* Create(const quint32 _id, QString &arcRadius, const quint32 ¢er, + const quint32 &firstPointId, const quint32 &secondPointId, + const QString &pointName, + const qreal &mx, const qreal &my, VMainGraphicsScene *scene, + VAbstractPattern *doc, + VContainer *data, const Document &parse, const Source &typeCreation); static const QString ToolType; virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::PointOfContact) }; diff --git a/src/app/tools/drawTools/vtoolpointofintersection.cpp b/src/libs/vtools/tools/drawTools/vtoolpointofintersection.cpp similarity index 96% rename from src/app/tools/drawTools/vtoolpointofintersection.cpp rename to src/libs/vtools/tools/drawTools/vtoolpointofintersection.cpp index b015df5d5..1f0c789d9 100644 --- a/src/app/tools/drawTools/vtoolpointofintersection.cpp +++ b/src/libs/vtools/tools/drawTools/vtoolpointofintersection.cpp @@ -44,7 +44,7 @@ const QString VToolPointOfIntersection::ToolType = QStringLiteral("pointOfInters * @param typeCreation way we create this tool. * @param parent parent object. */ -VToolPointOfIntersection::VToolPointOfIntersection(VPattern *doc, VContainer *data, const quint32 &id, +VToolPointOfIntersection::VToolPointOfIntersection(VAbstractPattern *doc, VContainer *data, const quint32 &id, const quint32 &firstPointId, const quint32 &secondPointId, const Source &typeCreation, QGraphicsItem *parent) :VToolPoint(doc, data, id, parent), firstPointId(firstPointId), secondPointId(secondPointId) @@ -76,7 +76,8 @@ void VToolPointOfIntersection::setDialog() * @param data container with variables. * @return the created tool */ -VToolPointOfIntersection *VToolPointOfIntersection::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, +VToolPointOfIntersection *VToolPointOfIntersection::Create(DialogTool *dialog, VMainGraphicsScene *scene, + VAbstractPattern *doc, VContainer *data) { SCASSERT(dialog != nullptr); @@ -114,7 +115,8 @@ VToolPointOfIntersection *VToolPointOfIntersection::Create(DialogTool *dialog, V VToolPointOfIntersection *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 &parse, + VAbstractPattern *doc, VContainer *data, + const Document &parse, const Source &typeCreation) { const QSharedPointer firstPoint = data->GeometricObject(firstPointId); diff --git a/src/app/tools/drawTools/vtoolpointofintersection.h b/src/libs/vtools/tools/drawTools/vtoolpointofintersection.h similarity index 93% rename from src/app/tools/drawTools/vtoolpointofintersection.h rename to src/libs/vtools/tools/drawTools/vtoolpointofintersection.h index af7999a0f..a8a99825d 100644 --- a/src/app/tools/drawTools/vtoolpointofintersection.h +++ b/src/libs/vtools/tools/drawTools/vtoolpointofintersection.h @@ -38,15 +38,15 @@ class VToolPointOfIntersection : public VToolPoint { Q_OBJECT public: - VToolPointOfIntersection(VPattern *doc, VContainer *data, const quint32 &id, const quint32 &firstPointId, + VToolPointOfIntersection(VAbstractPattern *doc, VContainer *data, const quint32 &id, const quint32 &firstPointId, const quint32 &secondPointId, const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual void setDialog(); - static VToolPointOfIntersection *Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, + static VToolPointOfIntersection *Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static 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, + VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation); static const QString ToolType; virtual int type() const {return Type;} diff --git a/src/app/tools/drawTools/vtoolpointofintersectionarcs.cpp b/src/libs/vtools/tools/drawTools/vtoolpointofintersectionarcs.cpp similarity index 98% rename from src/app/tools/drawTools/vtoolpointofintersectionarcs.cpp rename to src/libs/vtools/tools/drawTools/vtoolpointofintersectionarcs.cpp index f52a95248..c9dbc6f7e 100644 --- a/src/app/tools/drawTools/vtoolpointofintersectionarcs.cpp +++ b/src/libs/vtools/tools/drawTools/vtoolpointofintersectionarcs.cpp @@ -35,7 +35,7 @@ const QString VToolPointOfIntersectionArcs::ToolType = QStringLiteral("pointOfIntersectionArcs"); //--------------------------------------------------------------------------------------------------------------------- -VToolPointOfIntersectionArcs::VToolPointOfIntersectionArcs(VPattern *doc, VContainer *data, const quint32 &id, +VToolPointOfIntersectionArcs::VToolPointOfIntersectionArcs(VAbstractPattern *doc, VContainer *data, const quint32 &id, const quint32 &firstArcId, const quint32 &secondArcId, CrossCirclesPoint pType, const Source &typeCreation, QGraphicsItem *parent) @@ -59,7 +59,7 @@ void VToolPointOfIntersectionArcs::setDialog() //--------------------------------------------------------------------------------------------------------------------- VToolPointOfIntersectionArcs *VToolPointOfIntersectionArcs::Create(DialogTool *dialog, VMainGraphicsScene *scene, - VPattern *doc, VContainer *data) + VAbstractPattern *doc, VContainer *data) { SCASSERT(dialog != nullptr); DialogPointOfIntersectionArcs *dialogTool = qobject_cast(dialog); @@ -83,7 +83,7 @@ VToolPointOfIntersectionArcs *VToolPointOfIntersectionArcs::Create(const quint32 const quint32 &firstArcId, const quint32 &secondArcId, CrossCirclesPoint pType, const qreal &mx, const qreal &my, - VMainGraphicsScene *scene, VPattern *doc, + VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) { diff --git a/src/app/tools/drawTools/vtoolpointofintersectionarcs.h b/src/libs/vtools/tools/drawTools/vtoolpointofintersectionarcs.h similarity index 92% rename from src/app/tools/drawTools/vtoolpointofintersectionarcs.h rename to src/libs/vtools/tools/drawTools/vtoolpointofintersectionarcs.h index 67c233c0a..6f10f3c5d 100644 --- a/src/app/tools/drawTools/vtoolpointofintersectionarcs.h +++ b/src/libs/vtools/tools/drawTools/vtoolpointofintersectionarcs.h @@ -30,7 +30,6 @@ #define VTOOLPOINTOFINTERSECTIONARCS_H #include "vtoolpoint.h" -#include "../../xml/vpattern.h" class VArc; @@ -39,16 +38,16 @@ class VToolPointOfIntersectionArcs : public VToolPoint Q_OBJECT public: - VToolPointOfIntersectionArcs(VPattern *doc, VContainer *data, const quint32 &id, const quint32 &firstArcId, + VToolPointOfIntersectionArcs(VAbstractPattern *doc, VContainer *data, const quint32 &id, const quint32 &firstArcId, const quint32 &secondArcId, CrossCirclesPoint crossPoint, const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual void setDialog(); - static VToolPointOfIntersectionArcs *Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, + static VToolPointOfIntersectionArcs *Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolPointOfIntersectionArcs *Create(const quint32 _id, const QString &pointName, const quint32 &firstArcId, const quint32 &secondArcId, CrossCirclesPoint crossPoint, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, - VPattern *doc, VContainer *data, const Document &parse, + VAbstractPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation); static QPointF FindPoint(const VArc *arc1, const VArc *arc2, const CrossCirclesPoint crossPoint); static const QString ToolType; diff --git a/src/app/tools/drawTools/vtoolpointofintersectioncircles.cpp b/src/libs/vtools/tools/drawTools/vtoolpointofintersectioncircles.cpp similarity index 98% rename from src/app/tools/drawTools/vtoolpointofintersectioncircles.cpp rename to src/libs/vtools/tools/drawTools/vtoolpointofintersectioncircles.cpp index 5eb6833bf..a61aa7e31 100644 --- a/src/app/tools/drawTools/vtoolpointofintersectioncircles.cpp +++ b/src/libs/vtools/tools/drawTools/vtoolpointofintersectioncircles.cpp @@ -36,7 +36,8 @@ const QString VToolPointOfIntersectionCircles::ToolType = QStringLiteral("pointOfIntersectionCircles"); //--------------------------------------------------------------------------------------------------------------------- -VToolPointOfIntersectionCircles::VToolPointOfIntersectionCircles(VPattern *doc, VContainer *data, const quint32 &id, +VToolPointOfIntersectionCircles::VToolPointOfIntersectionCircles(VAbstractPattern *doc, VContainer *data, + const quint32 &id, quint32 firstCircleCenterId, quint32 secondCircleCenterId, const QString &firstCircleRadius, @@ -67,7 +68,7 @@ void VToolPointOfIntersectionCircles::setDialog() //--------------------------------------------------------------------------------------------------------------------- VToolPointOfIntersectionCircles *VToolPointOfIntersectionCircles::Create(DialogTool *dialog, VMainGraphicsScene *scene, - VPattern *doc, VContainer *data) + VAbstractPattern *doc, VContainer *data) { SCASSERT(dialog != nullptr); DialogPointOfIntersectionCircles *dialogTool = qobject_cast(dialog); @@ -96,7 +97,7 @@ VToolPointOfIntersectionCircles *VToolPointOfIntersectionCircles::Create(const q QString &secondCircleRadius, CrossCirclesPoint crossPoint, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, - VPattern *doc, VContainer *data, + VAbstractPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) { diff --git a/src/app/tools/drawTools/vtoolpointofintersectioncircles.h b/src/libs/vtools/tools/drawTools/vtoolpointofintersectioncircles.h similarity index 92% rename from src/app/tools/drawTools/vtoolpointofintersectioncircles.h rename to src/libs/vtools/tools/drawTools/vtoolpointofintersectioncircles.h index 57dd1b274..835b7339b 100644 --- a/src/app/tools/drawTools/vtoolpointofintersectioncircles.h +++ b/src/libs/vtools/tools/drawTools/vtoolpointofintersectioncircles.h @@ -30,7 +30,6 @@ #define VTOOLPOINTOFINTERSECTIONCIRCLES_H #include "vtoolpoint.h" -#include "../../xml/vpattern.h" class VFormula; @@ -38,20 +37,21 @@ class VToolPointOfIntersectionCircles : public VToolPoint { Q_OBJECT public: - VToolPointOfIntersectionCircles(VPattern *doc, VContainer *data, const quint32 &id, const + VToolPointOfIntersectionCircles(VAbstractPattern *doc, VContainer *data, const quint32 &id, const quint32 firstCircleCenterId, quint32 secondCircleCenterId, const QString &firstCircleRadius, const QString &secondCircleRadius, CrossCirclesPoint crossPoint, const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual void setDialog(); - static VToolPointOfIntersectionCircles *Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, + static VToolPointOfIntersectionCircles *Create(DialogTool *dialog, VMainGraphicsScene *scene, + VAbstractPattern *doc, VContainer *data); static VToolPointOfIntersectionCircles *Create(const quint32 _id, const QString &pointName, quint32 firstCircleCenterId, quint32 secondCircleCenterId, QString &firstCircleRadius, QString &secondCircleRadius, CrossCirclesPoint crossPoint, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, - VPattern *doc, VContainer *data, const Document &parse, + VAbstractPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation); static QPointF FindPoint(const QPointF &c1Point, const QPointF &c2Point, qreal c1Radius, qreal c2Radius, const CrossCirclesPoint crossPoint); diff --git a/src/app/tools/drawTools/vtoolshoulderpoint.cpp b/src/libs/vtools/tools/drawTools/vtoolshoulderpoint.cpp similarity index 97% rename from src/app/tools/drawTools/vtoolshoulderpoint.cpp rename to src/libs/vtools/tools/drawTools/vtoolshoulderpoint.cpp index baabaa3ef..e690b8512 100644 --- a/src/app/tools/drawTools/vtoolshoulderpoint.cpp +++ b/src/libs/vtools/tools/drawTools/vtoolshoulderpoint.cpp @@ -27,9 +27,10 @@ *************************************************************************/ #include "vtoolshoulderpoint.h" -#include "../../libs/vpatterndb/calculator.h" +#include "../../../vpatterndb/calculator.h" +#include "../../../vpatterndb/vtranslatevars.h" #include "../../dialogs/tools/dialogshoulderpoint.h" -#include "../../libs/vgeometry/vpointf.h" +#include "../../../vgeometry/vpointf.h" #include "../../visualization/vistoolshoulderpoint.h" const QString VToolShoulderPoint::ToolType = QStringLiteral("shoulder"); @@ -48,7 +49,8 @@ const QString VToolShoulderPoint::ToolType = QStringLiteral("shoulder"); * @param typeCreation way we create this tool. * @param parent parent object. */ -VToolShoulderPoint::VToolShoulderPoint(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, +VToolShoulderPoint::VToolShoulderPoint(VAbstractPattern *doc, VContainer *data, const quint32 &id, + const QString &typeLine, const QString &lineColor, const QString &formula, const quint32 &p1Line, const quint32 &p2Line, const quint32 &pShoulder, const Source &typeCreation, QGraphicsItem * parent) @@ -123,7 +125,7 @@ QPointF VToolShoulderPoint::FindPoint(const QPointF &p1Line, const QPointF &p2Li * @param data container with variables. * @return the created tool */ -VToolShoulderPoint* VToolShoulderPoint::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, +VToolShoulderPoint* VToolShoulderPoint::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { SCASSERT(dialog != nullptr); @@ -168,7 +170,7 @@ VToolShoulderPoint* VToolShoulderPoint::Create(DialogTool *dialog, VMainGraphics VToolShoulderPoint* VToolShoulderPoint::Create(const quint32 _id, QString &formula, const quint32 &p1Line, const quint32 &p2Line, const quint32 &pShoulder, const QString &typeLine, const QString &lineColor, const QString &pointName, const qreal &mx, - const qreal &my, VMainGraphicsScene *scene, VPattern *doc, + const qreal &my, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) { const QSharedPointer firstPoint = data->GeometricObject(p1Line); diff --git a/src/app/tools/drawTools/vtoolshoulderpoint.h b/src/libs/vtools/tools/drawTools/vtoolshoulderpoint.h similarity index 91% rename from src/app/tools/drawTools/vtoolshoulderpoint.h rename to src/libs/vtools/tools/drawTools/vtoolshoulderpoint.h index ab337cbc7..c9aaa817a 100644 --- a/src/app/tools/drawTools/vtoolshoulderpoint.h +++ b/src/libs/vtools/tools/drawTools/vtoolshoulderpoint.h @@ -39,17 +39,19 @@ class VToolShoulderPoint : public VToolLinePoint { Q_OBJECT public: - VToolShoulderPoint(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, + VToolShoulderPoint(VAbstractPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &lineColor, const QString &formula, const quint32 &p1Line, const quint32 &p2Line, const quint32 &pShoulder, const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual void setDialog(); static QPointF FindPoint(const QPointF &p1Line, const QPointF &p2Line, const QPointF &pShoulder, const qreal &length); - static VToolShoulderPoint* Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); + static VToolShoulderPoint* Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, + VContainer *data); static VToolShoulderPoint* Create(const quint32 _id, QString &formula, const quint32 &p1Line, const quint32 &p2Line, const quint32 &pShoulder, const QString &typeLine, const QString &lineColor, const QString &pointName, const qreal &mx, const qreal &my, - VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, + VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data, + const Document &parse, const Source &typeCreation); static const QString ToolType; virtual int type() const {return Type;} diff --git a/src/app/tools/drawTools/vtoolsinglepoint.cpp b/src/libs/vtools/tools/drawTools/vtoolsinglepoint.cpp similarity index 94% rename from src/app/tools/drawTools/vtoolsinglepoint.cpp rename to src/libs/vtools/tools/drawTools/vtoolsinglepoint.cpp index 0804cd307..8da862cfe 100644 --- a/src/app/tools/drawTools/vtoolsinglepoint.cpp +++ b/src/libs/vtools/tools/drawTools/vtoolsinglepoint.cpp @@ -28,12 +28,11 @@ #include "vtoolsinglepoint.h" #include "../../dialogs/tools/dialogsinglepoint.h" -#include "../../libs/vwidgets/vgraphicssimpletextitem.h" +#include "../../../vwidgets/vgraphicssimpletextitem.h" #include "../../undocommands/movespoint.h" #include "../../undocommands/addpatternpiece.h" #include "../../undocommands/deletepatternpiece.h" -#include "../../libs/vgeometry/vpointf.h" -#include "../../options.h" +#include "../../../vgeometry/vpointf.h" #include @@ -48,7 +47,7 @@ const QString VToolSinglePoint::ToolType = QStringLiteral("single"); * @param typeCreation way we create this tool. * @param parent parent object. */ -VToolSinglePoint::VToolSinglePoint (VPattern *doc, VContainer *data, quint32 id, const Source &typeCreation, +VToolSinglePoint::VToolSinglePoint (VAbstractPattern *doc, VContainer *data, quint32 id, const Source &typeCreation, const QString &namePP, const QString &mPath, QGraphicsItem * parent ) :VToolPoint(doc, data, id, parent), namePP(namePP), mPath(mPath) { @@ -102,19 +101,19 @@ void VToolSinglePoint::AddToFile() SaveOptions(sPoint, obj); //Create pattern piece structure - QDomElement patternPiece = doc->createElement(VPattern::TagDraw); + QDomElement patternPiece = doc->createElement(VAbstractPattern::TagDraw); doc->SetAttribute(patternPiece, AttrName, namePP); - QDomElement calcElement = doc->createElement(VPattern::TagCalculation); + QDomElement calcElement = doc->createElement(VAbstractPattern::TagCalculation); calcElement.appendChild(sPoint); patternPiece.appendChild(calcElement); - patternPiece.appendChild(doc->createElement(VPattern::TagModeling)); - patternPiece.appendChild(doc->createElement(VPattern::TagDetails)); + patternPiece.appendChild(doc->createElement(VAbstractPattern::TagModeling)); + patternPiece.appendChild(doc->createElement(VAbstractPattern::TagDetails)); AddPatternPiece *addPP = new AddPatternPiece(patternPiece, doc, namePP, mPath); - connect(addPP, &AddPatternPiece::ClearScene, doc, &VPattern::ClearScene); - connect(addPP, &AddPatternPiece::NeedFullParsing, doc, &VPattern::NeedFullParsing); + connect(addPP, &AddPatternPiece::ClearScene, doc, &VAbstractPattern::ClearScene); + connect(addPP, &AddPatternPiece::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing); qApp->getUndoStack()->push(addPP); } @@ -179,7 +178,7 @@ void VToolSinglePoint::DeleteTool(bool ask) } DeletePatternPiece *deletePP = new DeletePatternPiece(doc, nameActivDraw); - connect(deletePP, &DeletePatternPiece::NeedFullParsing, doc, &VPattern::NeedFullParsing); + connect(deletePP, &DeletePatternPiece::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing); qApp->getUndoStack()->push(deletePP); } } diff --git a/src/app/tools/drawTools/vtoolsinglepoint.h b/src/libs/vtools/tools/drawTools/vtoolsinglepoint.h similarity index 96% rename from src/app/tools/drawTools/vtoolsinglepoint.h rename to src/libs/vtools/tools/drawTools/vtoolsinglepoint.h index 76d189182..73289eefa 100644 --- a/src/app/tools/drawTools/vtoolsinglepoint.h +++ b/src/libs/vtools/tools/drawTools/vtoolsinglepoint.h @@ -39,7 +39,7 @@ class VToolSinglePoint : public VToolPoint { Q_OBJECT public: - VToolSinglePoint (VPattern *doc, VContainer *data, quint32 id, const Source &typeCreation, + VToolSinglePoint (VAbstractPattern *doc, VContainer *data, quint32 id, const Source &typeCreation, const QString &namePP, const QString &mPath, QGraphicsItem * parent = nullptr ); virtual ~VToolSinglePoint(); virtual void setDialog(); diff --git a/src/app/tools/drawTools/vtoolspline.cpp b/src/libs/vtools/tools/drawTools/vtoolspline.cpp similarity index 98% rename from src/app/tools/drawTools/vtoolspline.cpp rename to src/libs/vtools/tools/drawTools/vtoolspline.cpp index 8d9b1fba4..a14bcd301 100644 --- a/src/app/tools/drawTools/vtoolspline.cpp +++ b/src/libs/vtools/tools/drawTools/vtoolspline.cpp @@ -27,11 +27,10 @@ *************************************************************************/ #include "vtoolspline.h" -#include "../../libs/vgeometry/vspline.h" +#include "../../../vgeometry/vspline.h" #include "../../dialogs/tools/dialogspline.h" #include "../../undocommands/movespline.h" #include "../../visualization/vistoolspline.h" -#include "../../options.h" #if QT_VERSION < QT_VERSION_CHECK(5, 1, 0) # include "../../libs/vmisc/vmath.h" @@ -50,7 +49,8 @@ const QString VToolSpline::ToolType = QStringLiteral("simple"); * @param typeCreation way we create this tool. * @param parent parent object. */ -VToolSpline::VToolSpline(VPattern *doc, VContainer *data, quint32 id, const QString &color, const Source &typeCreation, +VToolSpline::VToolSpline(VAbstractPattern *doc, VContainer *data, quint32 id, const QString &color, + const Source &typeCreation, QGraphicsItem *parent) :VAbstractSpline(doc, data, id, parent), oldPosition() { @@ -126,7 +126,7 @@ void VToolSpline::setDialog() * @param data container with variables. * @return the created tool */ -VToolSpline* VToolSpline::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data) +VToolSpline* VToolSpline::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { SCASSERT(dialog != nullptr); DialogSpline *dialogTool = qobject_cast(dialog); @@ -169,7 +169,8 @@ VToolSpline* VToolSpline::Create(DialogTool *dialog, VMainGraphicsScene *scene, */ VToolSpline* 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, - const QString &color, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, + const QString &color, VMainGraphicsScene *scene, VAbstractPattern *doc, + VContainer *data, const Document &parse, const Source &typeCreation) { VPointF point1 = *data->GeometricObject(p1); diff --git a/src/app/tools/drawTools/vtoolspline.h b/src/libs/vtools/tools/drawTools/vtoolspline.h similarity index 92% rename from src/app/tools/drawTools/vtoolspline.h rename to src/libs/vtools/tools/drawTools/vtoolspline.h index e6684b8cb..7866a4208 100644 --- a/src/app/tools/drawTools/vtoolspline.h +++ b/src/libs/vtools/tools/drawTools/vtoolspline.h @@ -38,14 +38,15 @@ class VToolSpline:public VAbstractSpline { Q_OBJECT public: - VToolSpline (VPattern *doc, VContainer *data, quint32 id, const QString &color, const Source &typeCreation, + VToolSpline (VAbstractPattern *doc, VContainer *data, quint32 id, const QString &color, const Source &typeCreation, QGraphicsItem * parent = nullptr ); virtual ~VToolSpline(); virtual void setDialog(); - static VToolSpline *Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); + static VToolSpline *Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static 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, - const QString &color, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, + const QString &color, VMainGraphicsScene *scene, VAbstractPattern *doc, + VContainer *data, const Document &parse, const Source &typeCreation); static const QString ToolType; virtual int type() const {return Type;} diff --git a/src/app/tools/drawTools/vtoolsplinepath.cpp b/src/libs/vtools/tools/drawTools/vtoolsplinepath.cpp similarity index 98% rename from src/app/tools/drawTools/vtoolsplinepath.cpp rename to src/libs/vtools/tools/drawTools/vtoolsplinepath.cpp index e316f7a6e..9c54a5201 100644 --- a/src/app/tools/drawTools/vtoolsplinepath.cpp +++ b/src/libs/vtools/tools/drawTools/vtoolsplinepath.cpp @@ -48,7 +48,7 @@ const QString VToolSplinePath::ToolType = QStringLiteral("path"); * @param typeCreation way we create this tool. * @param parent parent object. */ -VToolSplinePath::VToolSplinePath(VPattern *doc, VContainer *data, quint32 id, const QString &color, +VToolSplinePath::VToolSplinePath(VAbstractPattern *doc, VContainer *data, quint32 id, const QString &color, const Source &typeCreation, QGraphicsItem *parent) :VAbstractSpline(doc, data, id, parent), oldPosition() { @@ -67,7 +67,7 @@ VToolSplinePath::VToolSplinePath(VPattern *doc, VContainer *data, quint32 id, co { VSpline spl = splPath->GetSpline(i); VControlPointSpline *controlPoint = new VControlPointSpline(i, SplinePointPosition::FirstPoint, spl.GetP2(), - spl.GetP1().toQPointF(), *data->GetPatternUnit(), + spl.GetP1().toQPointF(), *data->GetPatternUnit(), this); connect(controlPoint, &VControlPointSpline::ControlPointChangePosition, this, &VToolSplinePath::ControlPointChangePosition); @@ -120,7 +120,8 @@ void VToolSplinePath::setDialog() * @param doc dom document container. * @param data container with variables. */ -VToolSplinePath* VToolSplinePath::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data) +VToolSplinePath* VToolSplinePath::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, + VContainer *data) { SCASSERT(dialog != nullptr); DialogSplinePath *dialogTool = qobject_cast(dialog); @@ -152,7 +153,7 @@ VToolSplinePath* VToolSplinePath::Create(DialogTool *dialog, VMainGraphicsScene * @param typeCreation way we create this tool. */ VToolSplinePath* VToolSplinePath::Create(const quint32 _id, VSplinePath *path, const QString &color, - VMainGraphicsScene *scene, VPattern *doc, VContainer *data, + VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) { quint32 id = _id; diff --git a/src/app/tools/drawTools/vtoolsplinepath.h b/src/libs/vtools/tools/drawTools/vtoolsplinepath.h similarity index 89% rename from src/app/tools/drawTools/vtoolsplinepath.h rename to src/libs/vtools/tools/drawTools/vtoolsplinepath.h index feb1bbf82..b2fc2b9f7 100644 --- a/src/app/tools/drawTools/vtoolsplinepath.h +++ b/src/libs/vtools/tools/drawTools/vtoolsplinepath.h @@ -38,14 +38,17 @@ class VToolSplinePath:public VAbstractSpline { Q_OBJECT public: - VToolSplinePath(VPattern *doc, VContainer *data, quint32 id, const QString &color, const Source &typeCreation, + VToolSplinePath(VAbstractPattern *doc, VContainer *data, quint32 id, const QString &color, + const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual ~VToolSplinePath(); virtual void setDialog(); - static VToolSplinePath *Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); + static VToolSplinePath *Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, + VContainer *data); static VToolSplinePath *Create(const quint32 _id, VSplinePath *path, const QString &color, - VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, - const Source &typeCreation); + VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data, + const Document &parse, + const Source &typeCreation); static const QString ToolType; static void UpdatePathPoint(VAbstractPattern *doc, QDomNode& node, const VSplinePath &path); virtual int type() const {return Type;} diff --git a/src/app/tools/drawTools/vtooltriangle.cpp b/src/libs/vtools/tools/drawTools/vtooltriangle.cpp similarity index 98% rename from src/app/tools/drawTools/vtooltriangle.cpp rename to src/libs/vtools/tools/drawTools/vtooltriangle.cpp index 8517a5402..776f9023d 100644 --- a/src/app/tools/drawTools/vtooltriangle.cpp +++ b/src/libs/vtools/tools/drawTools/vtooltriangle.cpp @@ -47,7 +47,7 @@ const QString VToolTriangle::ToolType = QStringLiteral("triangle"); * @param typeCreation way we create this tool. * @param parent parent object. */ -VToolTriangle::VToolTriangle(VPattern *doc, VContainer *data, const quint32 &id, const quint32 &axisP1Id, +VToolTriangle::VToolTriangle(VAbstractPattern *doc, VContainer *data, const quint32 &id, const quint32 &axisP1Id, const quint32 &axisP2Id, const quint32 &firstPointId, const quint32 &secondPointId, const Source &typeCreation, QGraphicsItem *parent) :VToolPoint(doc, data, id, parent), axisP1Id(axisP1Id), axisP2Id(axisP2Id), firstPointId(firstPointId), @@ -82,7 +82,8 @@ void VToolTriangle::setDialog() * @param data container with variables. * @return the created tool */ -VToolTriangle* VToolTriangle::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data) +VToolTriangle* VToolTriangle::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, + VContainer *data) { SCASSERT(dialog != nullptr); DialogTriangle *dialogTool = qobject_cast(dialog); @@ -122,7 +123,7 @@ VToolTriangle* VToolTriangle::Create(DialogTool *dialog, VMainGraphicsScene *sce */ VToolTriangle* 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, + const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) { const QSharedPointer axisP1 = data->GeometricObject(axisP1Id); diff --git a/src/app/tools/drawTools/vtooltriangle.h b/src/libs/vtools/tools/drawTools/vtooltriangle.h similarity index 92% rename from src/app/tools/drawTools/vtooltriangle.h rename to src/libs/vtools/tools/drawTools/vtooltriangle.h index bafe855bb..74c655618 100644 --- a/src/app/tools/drawTools/vtooltriangle.h +++ b/src/libs/vtools/tools/drawTools/vtooltriangle.h @@ -39,14 +39,16 @@ class VToolTriangle : public VToolPoint { Q_OBJECT public: - VToolTriangle(VPattern *doc, VContainer *data, const quint32 &id, const quint32 &axisP1Id, const quint32 &axisP2Id, + VToolTriangle(VAbstractPattern *doc, VContainer *data, const quint32 &id, const quint32 &axisP1Id, + const quint32 &axisP2Id, const quint32 &firstPointId, const quint32 &secondPointId, const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual void setDialog(); - static VToolTriangle *Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); + static VToolTriangle *Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, + VContainer *data); static 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, + const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation); static QPointF FindPoint(const QPointF &axisP1, const QPointF &axisP2, const QPointF &firstPoint, const QPointF &secondPoint); diff --git a/src/app/tools/nodeDetails/nodedetails.h b/src/libs/vtools/tools/nodeDetails/nodedetails.h similarity index 100% rename from src/app/tools/nodeDetails/nodedetails.h rename to src/libs/vtools/tools/nodeDetails/nodedetails.h diff --git a/src/app/tools/nodeDetails/vabstractnode.cpp b/src/libs/vtools/tools/nodeDetails/vabstractnode.cpp similarity index 96% rename from src/app/tools/nodeDetails/vabstractnode.cpp rename to src/libs/vtools/tools/nodeDetails/vabstractnode.cpp index cd078feb6..ec316c4e3 100644 --- a/src/app/tools/nodeDetails/vabstractnode.cpp +++ b/src/libs/vtools/tools/nodeDetails/vabstractnode.cpp @@ -27,10 +27,9 @@ *************************************************************************/ #include "vabstractnode.h" -#include -#include "../../xml/vpattern.h" #include "../../undocommands/adddetnode.h" -#include "../../core/vapplication.h" + +#include const QString VAbstractNode::AttrIdObject = QStringLiteral("idObject"); const QString VAbstractNode::AttrIdTool = QStringLiteral("idTool"); @@ -45,7 +44,7 @@ const QString VAbstractNode::AttrIdTool = QStringLiteral("idTool"); * @param idTool id tool. * @param parent parent object. */ -VAbstractNode::VAbstractNode(VPattern *doc, VContainer *data, const quint32 &id, const quint32 &idNode, +VAbstractNode::VAbstractNode(VAbstractPattern *doc, VContainer *data, const quint32 &id, const quint32 &idNode, const quint32 &idTool, QObject *parent) : VAbstractTool(doc, data, id, parent), idNode(idNode), idTool(idTool), currentColor(Qt::black) { diff --git a/src/app/tools/nodeDetails/vabstractnode.h b/src/libs/vtools/tools/nodeDetails/vabstractnode.h similarity index 95% rename from src/app/tools/nodeDetails/vabstractnode.h rename to src/libs/vtools/tools/nodeDetails/vabstractnode.h index 49ec441ad..3a8dd9566 100644 --- a/src/app/tools/nodeDetails/vabstractnode.h +++ b/src/libs/vtools/tools/nodeDetails/vabstractnode.h @@ -40,7 +40,7 @@ class VAbstractNode : public VAbstractTool { Q_OBJECT public: - VAbstractNode(VPattern *doc, VContainer *data, const quint32 &id, const quint32 &idNode, + VAbstractNode(VAbstractPattern *doc, VContainer *data, const quint32 &id, const quint32 &idNode, const quint32 &idTool, QObject *parent = nullptr); virtual ~VAbstractNode() {} static const QString AttrIdObject; diff --git a/src/app/tools/nodeDetails/vnodearc.cpp b/src/libs/vtools/tools/nodeDetails/vnodearc.cpp similarity index 96% rename from src/app/tools/nodeDetails/vnodearc.cpp rename to src/libs/vtools/tools/nodeDetails/vnodearc.cpp index 0c760a23a..3bb868acb 100644 --- a/src/app/tools/nodeDetails/vnodearc.cpp +++ b/src/libs/vtools/tools/nodeDetails/vnodearc.cpp @@ -27,9 +27,7 @@ *************************************************************************/ #include "vnodearc.h" - -#include "../../core/vapplication.h" -#include "../../libs/vgeometry/varc.h" +#include "../../../vgeometry/varc.h" #include #include @@ -48,7 +46,7 @@ const QString VNodeArc::ToolType = QStringLiteral("modeling"); * @param qoParent QObject parent * @param parent parent object. */ -VNodeArc::VNodeArc(VPattern *doc, VContainer *data, quint32 id, quint32 idArc, const Source &typeCreation, +VNodeArc::VNodeArc(VAbstractPattern *doc, VContainer *data, quint32 id, quint32 idArc, const Source &typeCreation, const quint32 &idTool, QObject *qoParent, QGraphicsItem *parent) :VAbstractNode(doc, data, id, idArc, idTool, qoParent), QGraphicsPathItem(parent) { @@ -70,7 +68,7 @@ VNodeArc::VNodeArc(VPattern *doc, VContainer *data, quint32 id, quint32 idArc, c * @param idTool tool id. * @param parent QObject parent */ -void VNodeArc::Create(VPattern *doc, VContainer *data, quint32 id, quint32 idArc, const Document &parse, +void VNodeArc::Create(VAbstractPattern *doc, VContainer *data, quint32 id, quint32 idArc, const Document &parse, const Source &typeCreation, const quint32 &idTool, QObject *parent) { VAbstractTool::AddRecord(id, Tool::NodeArc, doc); diff --git a/src/app/tools/nodeDetails/vnodearc.h b/src/libs/vtools/tools/nodeDetails/vnodearc.h similarity index 90% rename from src/app/tools/nodeDetails/vnodearc.h rename to src/libs/vtools/tools/nodeDetails/vnodearc.h index 5f818a356..777454ccb 100644 --- a/src/app/tools/nodeDetails/vnodearc.h +++ b/src/libs/vtools/tools/nodeDetails/vnodearc.h @@ -31,7 +31,6 @@ #include "vabstractnode.h" #include -#include "../../xml/vpattern.h" /** * @brief The VNodeArc class arc detail node. @@ -40,10 +39,10 @@ class VNodeArc :public VAbstractNode, public QGraphicsPathItem { Q_OBJECT public: - VNodeArc(VPattern *doc, VContainer *data, quint32 id, quint32 idArc, const Source &typeCreation, + VNodeArc(VAbstractPattern *doc, VContainer *data, quint32 id, quint32 idArc, const Source &typeCreation, const quint32 &idTool = 0, QObject *qoParent = nullptr, QGraphicsItem * parent = nullptr); - static void Create(VPattern *doc, VContainer *data, quint32 id, quint32 idArc, const Document &parse, + static void Create(VAbstractPattern *doc, VContainer *data, quint32 id, quint32 idArc, const Document &parse, const Source &typeCreation, const quint32 &idTool = 0, QObject *parent = nullptr); static const QString TagName; static const QString ToolType; diff --git a/src/app/tools/nodeDetails/vnodepoint.cpp b/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp similarity index 97% rename from src/app/tools/nodeDetails/vnodepoint.cpp rename to src/libs/vtools/tools/nodeDetails/vnodepoint.cpp index b019f370d..18b0f38cb 100644 --- a/src/app/tools/nodeDetails/vnodepoint.cpp +++ b/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp @@ -27,10 +27,8 @@ *************************************************************************/ #include "vnodepoint.h" - -#include "../../core/vapplication.h" -#include "../../libs/vgeometry/vpointf.h" -#include "../../libs/vwidgets/vgraphicssimpletextitem.h" +#include "../../../vgeometry/vpointf.h" +#include "../../../vwidgets/vgraphicssimpletextitem.h" #include #include #include @@ -50,7 +48,7 @@ const QString VNodePoint::ToolType = QStringLiteral("modeling"); * @param qoParent QObject parent * @param parent parent object. */ -VNodePoint::VNodePoint(VPattern *doc, VContainer *data, quint32 id, quint32 idPoint, const Source &typeCreation, +VNodePoint::VNodePoint(VAbstractPattern *doc, VContainer *data, quint32 id, quint32 idPoint, const Source &typeCreation, const quint32 &idTool, QObject *qoParent, QGraphicsItem *parent) :VAbstractNode(doc, data, id, idPoint, idTool, qoParent), QGraphicsEllipseItem(parent), radius(0), namePoint(nullptr), lineName(nullptr) @@ -80,7 +78,7 @@ VNodePoint::VNodePoint(VPattern *doc, VContainer *data, quint32 id, quint32 idPo * @param idTool tool id. * @param parent QObject parent */ -void VNodePoint::Create(VPattern *doc, VContainer *data, quint32 id, quint32 idPoint, const Document &parse, +void VNodePoint::Create(VAbstractPattern *doc, VContainer *data, quint32 id, quint32 idPoint, const Document &parse, const Source &typeCreation, const quint32 &idTool, QObject *parent) { VAbstractTool::AddRecord(id, Tool::NodePoint, doc); diff --git a/src/app/tools/nodeDetails/vnodepoint.h b/src/libs/vtools/tools/nodeDetails/vnodepoint.h similarity index 92% rename from src/app/tools/nodeDetails/vnodepoint.h rename to src/libs/vtools/tools/nodeDetails/vnodepoint.h index 7414b7ef2..f6a3f4853 100644 --- a/src/app/tools/nodeDetails/vnodepoint.h +++ b/src/libs/vtools/tools/nodeDetails/vnodepoint.h @@ -30,7 +30,6 @@ #define VNODEPOINT_H #include "vabstractnode.h" -#include "../../xml/vpattern.h" #include class VPointF; @@ -46,10 +45,10 @@ class VNodePoint: public VAbstractNode, public QGraphicsEllipseItem Q_OBJECT public: - VNodePoint(VPattern *doc, VContainer *data, quint32 id, quint32 idPoint, const Source &typeCreation, + VNodePoint(VAbstractPattern *doc, VContainer *data, quint32 id, quint32 idPoint, const Source &typeCreation, const quint32 &idTool = 0, QObject *qoParent = nullptr, QGraphicsItem * parent = nullptr ); - static void Create(VPattern *doc, VContainer *data, quint32 id, quint32 idPoint, const Document &parse, + static void Create(VAbstractPattern *doc, VContainer *data, quint32 id, quint32 idPoint, const Document &parse, const Source &typeCreation, const quint32 &idTool = 0, QObject *parent = nullptr); static const QString TagName; static const QString ToolType; diff --git a/src/app/tools/nodeDetails/vnodespline.cpp b/src/libs/vtools/tools/nodeDetails/vnodespline.cpp similarity index 96% rename from src/app/tools/nodeDetails/vnodespline.cpp rename to src/libs/vtools/tools/nodeDetails/vnodespline.cpp index 8d2e52b59..388e08a8d 100644 --- a/src/app/tools/nodeDetails/vnodespline.cpp +++ b/src/libs/vtools/tools/nodeDetails/vnodespline.cpp @@ -27,9 +27,7 @@ *************************************************************************/ #include "vnodespline.h" - -#include "../../core/vapplication.h" -#include "../../libs/vgeometry/vspline.h" +#include "../../../vgeometry/vspline.h" #include #include @@ -48,7 +46,7 @@ const QString VNodeSpline::ToolType = QStringLiteral("modelingSpline"); * @param qoParent QObject parent. * @param parent QGraphicsItem parent. */ -VNodeSpline::VNodeSpline(VPattern *doc, VContainer *data, quint32 id, quint32 idSpline, +VNodeSpline::VNodeSpline(VAbstractPattern *doc, VContainer *data, quint32 id, quint32 idSpline, const Source &typeCreation, const quint32 &idTool, QObject *qoParent, QGraphicsItem * parent) :VAbstractNode(doc, data, id, idSpline, idTool, qoParent), QGraphicsPathItem(parent) @@ -71,7 +69,8 @@ VNodeSpline::VNodeSpline(VPattern *doc, VContainer *data, quint32 id, quint32 id * @param idTool id node. * @return pointer to node. */ -VNodeSpline *VNodeSpline::Create(VPattern *doc, VContainer *data, quint32 id, quint32 idSpline, const Document &parse, +VNodeSpline *VNodeSpline::Create(VAbstractPattern *doc, VContainer *data, quint32 id, quint32 idSpline, + const Document &parse, const Source &typeCreation, const quint32 &idTool, QObject *parent) { VAbstractTool::AddRecord(id, Tool::NodeSpline, doc); diff --git a/src/app/tools/nodeDetails/vnodespline.h b/src/libs/vtools/tools/nodeDetails/vnodespline.h similarity index 89% rename from src/app/tools/nodeDetails/vnodespline.h rename to src/libs/vtools/tools/nodeDetails/vnodespline.h index e4403ccdf..c65fce665 100644 --- a/src/app/tools/nodeDetails/vnodespline.h +++ b/src/libs/vtools/tools/nodeDetails/vnodespline.h @@ -31,7 +31,6 @@ #include "vabstractnode.h" #include -#include "../../xml/vpattern.h" /** * @brief The VNodeSpline class spline detail node. @@ -40,10 +39,11 @@ class VNodeSpline:public VAbstractNode, public QGraphicsPathItem { Q_OBJECT public: - VNodeSpline(VPattern *doc, VContainer *data, quint32 id, quint32 idSpline, const Source &typeCreation, + VNodeSpline(VAbstractPattern *doc, VContainer *data, quint32 id, quint32 idSpline, const Source &typeCreation, const quint32 &idTool = 0, QObject *qoParent = nullptr, QGraphicsItem * parent = nullptr); - static VNodeSpline *Create(VPattern *doc, VContainer *data, quint32 id, quint32 idSpline, const Document &parse, + static VNodeSpline *Create(VAbstractPattern *doc, VContainer *data, quint32 id, quint32 idSpline, + const Document &parse, const Source &typeCreation, const quint32 &idTool = 0, QObject *parent = nullptr); static const QString TagName; static const QString ToolType; diff --git a/src/app/tools/nodeDetails/vnodesplinepath.cpp b/src/libs/vtools/tools/nodeDetails/vnodesplinepath.cpp similarity index 96% rename from src/app/tools/nodeDetails/vnodesplinepath.cpp rename to src/libs/vtools/tools/nodeDetails/vnodesplinepath.cpp index 6614c09a0..814a3da9e 100644 --- a/src/app/tools/nodeDetails/vnodesplinepath.cpp +++ b/src/libs/vtools/tools/nodeDetails/vnodesplinepath.cpp @@ -28,8 +28,7 @@ #include "vnodesplinepath.h" -#include "../../core/vapplication.h" -#include "../../libs/vgeometry/vsplinepath.h" +#include "../../../vgeometry/vsplinepath.h" #include #include @@ -48,7 +47,7 @@ const QString VNodeSplinePath::ToolType = QStringLiteral("modelingPath"); * @param qoParent QObject parent. * @param parent parent object. */ -VNodeSplinePath::VNodeSplinePath(VPattern *doc, VContainer *data, quint32 id, quint32 idSpline, +VNodeSplinePath::VNodeSplinePath(VAbstractPattern *doc, VContainer *data, quint32 id, quint32 idSpline, const Source &typeCreation, const quint32 &idTool, QObject *qoParent, QGraphicsItem * parent) :VAbstractNode(doc, data, id, idSpline, idTool, qoParent), QGraphicsPathItem(parent) @@ -71,7 +70,8 @@ VNodeSplinePath::VNodeSplinePath(VPattern *doc, VContainer *data, quint32 id, qu * @param idTool tool id. * @param parent QObject parent. */ -void VNodeSplinePath::Create(VPattern *doc, VContainer *data, quint32 id, quint32 idSpline, const Document &parse, +void VNodeSplinePath::Create(VAbstractPattern *doc, VContainer *data, quint32 id, quint32 idSpline, + const Document &parse, const Source &typeCreation, const quint32 &idTool, QObject *parent) { VAbstractTool::AddRecord(id, Tool::NodeSplinePath, doc); diff --git a/src/app/tools/nodeDetails/vnodesplinepath.h b/src/libs/vtools/tools/nodeDetails/vnodesplinepath.h similarity index 90% rename from src/app/tools/nodeDetails/vnodesplinepath.h rename to src/libs/vtools/tools/nodeDetails/vnodesplinepath.h index 0871e1e46..0e0916839 100644 --- a/src/app/tools/nodeDetails/vnodesplinepath.h +++ b/src/libs/vtools/tools/nodeDetails/vnodesplinepath.h @@ -31,7 +31,6 @@ #include "vabstractnode.h" #include -#include "../../xml/vpattern.h" /** * @brief The VNodeSplinePath class spline path detail node. @@ -40,9 +39,9 @@ class VNodeSplinePath : public VAbstractNode, public QGraphicsPathItem { Q_OBJECT public: - VNodeSplinePath(VPattern *doc, VContainer *data, quint32 id, quint32 idSpline, const Source &typeCreation, + VNodeSplinePath(VAbstractPattern *doc, VContainer *data, quint32 id, quint32 idSpline, const Source &typeCreation, const quint32 &idTool = 0, QObject *qoParent = nullptr, QGraphicsItem * parent = nullptr); - static void Create(VPattern *doc, VContainer *data, quint32 id, quint32 idSpline, const Document &parse, + static void Create(VAbstractPattern *doc, VContainer *data, quint32 id, quint32 idSpline, const Document &parse, const Source &typeCreation, const quint32 &idTool = 0, QObject *parent = 0); static const QString TagName; static const QString ToolType; diff --git a/src/app/tools/tools.h b/src/libs/vtools/tools/tools.h similarity index 100% rename from src/app/tools/tools.h rename to src/libs/vtools/tools/tools.h diff --git a/src/app/tools/tools.pri b/src/libs/vtools/tools/tools.pri similarity index 100% rename from src/app/tools/tools.pri rename to src/libs/vtools/tools/tools.pri diff --git a/src/app/tools/vabstracttool.cpp b/src/libs/vtools/tools/vabstracttool.cpp similarity index 98% rename from src/app/tools/vabstracttool.cpp rename to src/libs/vtools/tools/vabstracttool.cpp index e0699cdba..036bc2b40 100644 --- a/src/app/tools/vabstracttool.cpp +++ b/src/libs/vtools/tools/vabstracttool.cpp @@ -27,18 +27,18 @@ *************************************************************************/ #include "vabstracttool.h" +#include "../../vpropertyexplorer/checkablemessagebox.h" +#include "../../vgeometry/vpointf.h" +#include "../../vwidgets/vmaingraphicsview.h" +#include "../../vmisc/vsettings.h" +#include "../undocommands/deltool.h" +#include "../undocommands/savetooloptions.h" + #include #include #include #include #include -#include "../../libs/vpropertyexplorer/checkablemessagebox.h" -#include "../undocommands/deltool.h" -#include "../core/vapplication.h" -#include "../libs/vgeometry/vpointf.h" -#include "../undocommands/savetooloptions.h" -#include "../libs/vwidgets/vmaingraphicsview.h" -#include "../libs/vmisc/vsettings.h" const QString VAbstractTool::AttrType = QStringLiteral("type"); const QString VAbstractTool::AttrMx = QStringLiteral("mx"); diff --git a/src/app/tools/vabstracttool.h b/src/libs/vtools/tools/vabstracttool.h similarity index 98% rename from src/app/tools/vabstracttool.h rename to src/libs/vtools/tools/vabstracttool.h index e2d029bab..52ce8fd1b 100644 --- a/src/app/tools/vabstracttool.h +++ b/src/libs/vtools/tools/vabstracttool.h @@ -30,9 +30,9 @@ #define VABSTRACTTOOL_H #include "vdatatool.h" -#include "../../libs/ifc/xml/vabstractpattern.h" -#include "../core/vapplication.h" -#include "../libs/vwidgets/vmaingraphicsscene.h" +#include "../../ifc/xml/vabstractpattern.h" +#include "../../vmisc/vabstractapplication.h" +#include "../../vwidgets/vmaingraphicsscene.h" #include "../visualization/visualization.h" class QDomElement; diff --git a/src/app/tools/vdatatool.cpp b/src/libs/vtools/tools/vdatatool.cpp similarity index 100% rename from src/app/tools/vdatatool.cpp rename to src/libs/vtools/tools/vdatatool.cpp diff --git a/src/app/tools/vdatatool.h b/src/libs/vtools/tools/vdatatool.h similarity index 98% rename from src/app/tools/vdatatool.h rename to src/libs/vtools/tools/vdatatool.h index de97a8ee6..a85ab2d41 100644 --- a/src/app/tools/vdatatool.h +++ b/src/libs/vtools/tools/vdatatool.h @@ -29,7 +29,7 @@ #ifndef VDATATOOL_H #define VDATATOOL_H -#include "../libs/vpatterndb/vcontainer.h" +#include "../../vpatterndb/vcontainer.h" #include "../vmisc/logging.h" Q_DECLARE_LOGGING_CATEGORY(vTool) diff --git a/src/app/tools/vtooldetail.cpp b/src/libs/vtools/tools/vtooldetail.cpp similarity index 97% rename from src/app/tools/vtooldetail.cpp rename to src/libs/vtools/tools/vtooldetail.cpp index a698b8b29..42c44ec8b 100644 --- a/src/app/tools/vtooldetail.cpp +++ b/src/libs/vtools/tools/vtooldetail.cpp @@ -28,20 +28,22 @@ #include "vtooldetail.h" #include "nodeDetails/nodedetails.h" -#include "../libs/vgeometry/varc.h" -#include "../libs/vgeometry/vsplinepath.h" -#include "../libs/vwidgets/vmaingraphicsscene.h" +#include "../../vgeometry/varc.h" +#include "../../vgeometry/vsplinepath.h" +#include "../../vwidgets/vmaingraphicsscene.h" #include "../dialogs/tools/dialogtool.h" #include "../dialogs/tools/dialogdetail.h" +#include "../undocommands/savedetailoptions.h" +#include "../undocommands/movedetail.h" +#include "../undocommands/adddet.h" +#include "../undocommands/deletedetail.h" + #include #include #include #include #include -#include "../undocommands/savedetailoptions.h" -#include "../undocommands/movedetail.h" -#include "../undocommands/adddet.h" -#include "../undocommands/deletedetail.h" + const QString VToolDetail::TagName = QStringLiteral("detail"); const QString VToolDetail::TagNode = QStringLiteral("node"); @@ -71,7 +73,7 @@ const QString VToolDetail::NodeSplinePath = QStringLiteral("NodeSplinePath"); * @param scene pointer to scene. * @param parent parent object */ -VToolDetail::VToolDetail(VPattern *doc, VContainer *data, const quint32 &id, const Source &typeCreation, +VToolDetail::VToolDetail(VAbstractPattern *doc, VContainer *data, const quint32 &id, const Source &typeCreation, VMainGraphicsScene *scene, QGraphicsItem *parent) :VAbstractTool(doc, data, id), QGraphicsPathItem(parent), dialog(nullptr), sceneDetails(scene) { @@ -140,7 +142,7 @@ void VToolDetail::setDialog() * @param doc dom document container. * @param data container with variables. */ -void VToolDetail::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data) +void VToolDetail::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { SCASSERT(dialog != nullptr); DialogDetail *dialogTool = qobject_cast(dialog); @@ -203,7 +205,7 @@ void VToolDetail::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern * @param parse parser file mode. * @param typeCreation way we create this tool. */ -void VToolDetail::Create(const quint32 &_id, const VDetail &newDetail, VMainGraphicsScene *scene, VPattern *doc, +void VToolDetail::Create(const quint32 &_id, const VDetail &newDetail, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) { quint32 id = _id; @@ -294,7 +296,7 @@ void VToolDetail::AddToFile() } AddDet *addDet = new AddDet(domElement, doc); - connect(addDet, &AddDet::NeedFullParsing, doc, &VPattern::NeedFullParsing); + connect(addDet, &AddDet::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing); qApp->getUndoStack()->push(addDet); } @@ -520,7 +522,7 @@ void VToolDetail::DeleteTool(bool ask) return; } /* If UnionDetails tool delete detail no need emit FullParsing.*/ - connect(delDet, &DeleteDetail::NeedFullParsing, doc, &VPattern::NeedFullParsing); + connect(delDet, &DeleteDetail::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing); } qApp->getUndoStack()->push(delDet); } diff --git a/src/app/tools/vtooldetail.h b/src/libs/vtools/tools/vtooldetail.h similarity index 94% rename from src/app/tools/vtooldetail.h rename to src/libs/vtools/tools/vtooldetail.h index 4105efd4f..4dce78bee 100644 --- a/src/app/tools/vtooldetail.h +++ b/src/libs/vtools/tools/vtooldetail.h @@ -31,7 +31,6 @@ #include "vabstracttool.h" #include -#include "../xml/vpattern.h" class VMainGraphicsScene; class DialogTool; @@ -43,7 +42,7 @@ class VToolDetail: public VAbstractTool, public QGraphicsPathItem { Q_OBJECT public: - VToolDetail(VPattern *doc, VContainer *data, const quint32 &id, const Source &typeCreation, + VToolDetail(VAbstractPattern *doc, VContainer *data, const quint32 &id, const Source &typeCreation, VMainGraphicsScene *scene, QGraphicsItem * parent = nullptr); ~VToolDetail(); @@ -63,9 +62,9 @@ public: return data->AddGObject(node); } - static void Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); + static void Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static void Create(const quint32 &_id, const VDetail &newDetail, VMainGraphicsScene *scene, - VPattern *doc, VContainer *data, const Document &parse, + VAbstractPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation); static const QString TagName; static const QString TagNode; diff --git a/src/app/tools/vtooluniondetails.cpp b/src/libs/vtools/tools/vtooluniondetails.cpp similarity index 98% rename from src/app/tools/vtooluniondetails.cpp rename to src/libs/vtools/tools/vtooluniondetails.cpp index 24b2e7d22..fbfdc0641 100644 --- a/src/app/tools/vtooluniondetails.cpp +++ b/src/libs/vtools/tools/vtooluniondetails.cpp @@ -29,9 +29,9 @@ #include "vtooluniondetails.h" #include "nodeDetails/nodedetails.h" #include "vtooldetail.h" -#include "../libs/vgeometry/vpointf.h" -#include "../libs/vgeometry/varc.h" -#include "../libs/vgeometry/vsplinepath.h" +#include "../../vgeometry/vpointf.h" +#include "../../vgeometry/varc.h" +#include "../../vgeometry/vsplinepath.h" #include "../dialogs/tools/dialoguniondetails.h" #include "../undocommands/adduniondetails.h" @@ -59,7 +59,7 @@ const QString VToolUnionDetails::NodeTypeModeling = QStringLiteral("Modeling"); * @param typeCreation way we create this tool. * @param parent parent object. */ -VToolUnionDetails::VToolUnionDetails(VPattern *doc, VContainer *data, const quint32 &id, const VDetail &d1, +VToolUnionDetails::VToolUnionDetails(VAbstractPattern *doc, VContainer *data, const quint32 &id, const VDetail &d1, const VDetail &d2, const quint32 &indexD1, const quint32 &indexD2, const Source &typeCreation, QObject *parent) :VAbstractTool(doc, data, id, parent), d1(d1), d2(d2), indexD1(indexD1), indexD2(indexD2) @@ -82,7 +82,7 @@ VToolUnionDetails::VToolUnionDetails(VPattern *doc, VContainer *data, const quin * @param pRotate point rotation. * @param angle angle rotation. */ -void VToolUnionDetails::AddToNewDetail(QObject *tool, VPattern *doc, VContainer *data, VDetail &newDetail, +void VToolUnionDetails::AddToNewDetail(QObject *tool, VAbstractPattern *doc, VContainer *data, VDetail &newDetail, const VDetail &det, const int &i, const quint32 &idTool, const qreal &dx, const qreal &dy, const quint32 &pRotate, const qreal &angle) { @@ -423,7 +423,7 @@ void VToolUnionDetails::ShowVisualization(bool show) * @param doc dom document container. * @param data container with variables. */ -VToolUnionDetails* VToolUnionDetails::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, +VToolUnionDetails* VToolUnionDetails::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { SCASSERT(dialog != nullptr); @@ -459,7 +459,7 @@ VToolUnionDetails* VToolUnionDetails::Create(DialogTool *dialog, VMainGraphicsSc */ VToolUnionDetails* 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, + const quint32 &indexD2, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) { VToolUnionDetails *unionDetails = 0; @@ -648,7 +648,7 @@ void VToolUnionDetails::FindIndexJ(const qint32 &pointsD2, const VDetail &d2, co * @param domElement tag in xml tree. * @return detail stored in file. */ -QVector VToolUnionDetails::GetDetailFromFile(VPattern *doc, const QDomElement &domElement) +QVector VToolUnionDetails::GetDetailFromFile(VAbstractPattern *doc, const QDomElement &domElement) { QVector vector; QDomNodeList detailList = domElement.childNodes(); @@ -811,6 +811,6 @@ QDomNode VToolUnionDetails::UpdateDetail(const QDomNode &domNode, const VDetail void VToolUnionDetails::AddToModeling(const QDomElement &domElement) { AddUnionDetails *addUnion = new AddUnionDetails(domElement, doc); - connect(addUnion, &AddUnionDetails::NeedFullParsing, doc, &VPattern::NeedFullParsing); + connect(addUnion, &AddUnionDetails::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing); qApp->getUndoStack()->push(addUnion); } diff --git a/src/app/tools/vtooluniondetails.h b/src/libs/vtools/tools/vtooluniondetails.h similarity index 89% rename from src/app/tools/vtooluniondetails.h rename to src/libs/vtools/tools/vtooluniondetails.h index 3062d508e..c6b1134e3 100644 --- a/src/app/tools/vtooluniondetails.h +++ b/src/libs/vtools/tools/vtooluniondetails.h @@ -30,7 +30,6 @@ #define VTOOLUNIONDETAILS_H #include "vabstracttool.h" -#include "../xml/vpattern.h" class VPointF; class VMainGraphicsScene; @@ -43,21 +42,23 @@ class VToolUnionDetails : public VAbstractTool { Q_OBJECT public: - VToolUnionDetails(VPattern *doc, VContainer *data, const quint32 &id, const VDetail &d1, const VDetail &d2, + VToolUnionDetails(VAbstractPattern *doc, VContainer *data, const quint32 &id, const VDetail &d1, const VDetail &d2, const quint32 &indexD1, const quint32 &indexD2, const Source &typeCreation, QObject *parent = nullptr); /** * @brief setDialog set dialog when user want change tool option. */ virtual void setDialog() {} - static VToolUnionDetails *Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); + static VToolUnionDetails *Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, + VContainer *data); static 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 &parse, + VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data, + const Document &parse, const Source &typeCreation); static void PointsOnEdge(const VDetail &d, const quint32 &index, VPointF &p1, VPointF &p2, VContainer *data); static void FindIndexJ(const qint32 &pointsD2, const VDetail &d2, const quint32 &indexD2, qint32 &j); - static QVector GetDetailFromFile(VPattern *doc, const QDomElement &domElement); + static QVector GetDetailFromFile(VAbstractPattern *doc, const QDomElement &domElement); static const QString TagName; static const QString ToolType; static const QString TagDetail; @@ -68,7 +69,7 @@ public: static const QString AttrNodeType; static const QString NodeTypeContour; static const QString NodeTypeModeling; - static void AddToNewDetail(QObject *tool, VPattern *doc, VContainer *data, VDetail &newDetail, + static void AddToNewDetail(QObject *tool, VAbstractPattern *doc, VContainer *data, VDetail &newDetail, const VDetail &det, const int &i, const quint32 &idTool, const qreal &dx = 0, const qreal &dy = 0, const quint32 &pRotate = 0, const qreal &angle = 0); static void UpdatePoints(const quint32 &idDetail, VContainer *data, const VDetail &det, const int &i, diff --git a/src/app/undocommands/adddet.cpp b/src/libs/vtools/undocommands/adddet.cpp similarity index 100% rename from src/app/undocommands/adddet.cpp rename to src/libs/vtools/undocommands/adddet.cpp diff --git a/src/app/undocommands/adddet.h b/src/libs/vtools/undocommands/adddet.h similarity index 100% rename from src/app/undocommands/adddet.h rename to src/libs/vtools/undocommands/adddet.h diff --git a/src/app/undocommands/adddetnode.cpp b/src/libs/vtools/undocommands/adddetnode.cpp similarity index 100% rename from src/app/undocommands/adddetnode.cpp rename to src/libs/vtools/undocommands/adddetnode.cpp diff --git a/src/app/undocommands/adddetnode.h b/src/libs/vtools/undocommands/adddetnode.h similarity index 100% rename from src/app/undocommands/adddetnode.h rename to src/libs/vtools/undocommands/adddetnode.h diff --git a/src/app/undocommands/addpatternpiece.cpp b/src/libs/vtools/undocommands/addpatternpiece.cpp similarity index 100% rename from src/app/undocommands/addpatternpiece.cpp rename to src/libs/vtools/undocommands/addpatternpiece.cpp diff --git a/src/app/undocommands/addpatternpiece.h b/src/libs/vtools/undocommands/addpatternpiece.h similarity index 100% rename from src/app/undocommands/addpatternpiece.h rename to src/libs/vtools/undocommands/addpatternpiece.h diff --git a/src/app/undocommands/addtocalc.cpp b/src/libs/vtools/undocommands/addtocalc.cpp similarity index 97% rename from src/app/undocommands/addtocalc.cpp rename to src/libs/vtools/undocommands/addtocalc.cpp index 1e7148ebf..2b1fe9bb9 100644 --- a/src/app/undocommands/addtocalc.cpp +++ b/src/libs/vtools/undocommands/addtocalc.cpp @@ -28,9 +28,8 @@ #include "addtocalc.h" #include "../tools/vabstracttool.h" -#include "../core/vapplication.h" -#include "../libs/vwidgets/vmaingraphicsscene.h" -#include "../libs/vwidgets/vmaingraphicsview.h" +#include "../../vwidgets/vmaingraphicsscene.h" +#include "../../vwidgets/vmaingraphicsview.h" //--------------------------------------------------------------------------------------------------------------------- AddToCalc::AddToCalc(const QDomElement &xml, VAbstractPattern *doc, QUndoCommand *parent) diff --git a/src/app/undocommands/addtocalc.h b/src/libs/vtools/undocommands/addtocalc.h similarity index 100% rename from src/app/undocommands/addtocalc.h rename to src/libs/vtools/undocommands/addtocalc.h diff --git a/src/app/undocommands/adduniondetails.cpp b/src/libs/vtools/undocommands/adduniondetails.cpp similarity index 100% rename from src/app/undocommands/adduniondetails.cpp rename to src/libs/vtools/undocommands/adduniondetails.cpp diff --git a/src/app/undocommands/adduniondetails.h b/src/libs/vtools/undocommands/adduniondetails.h similarity index 100% rename from src/app/undocommands/adduniondetails.h rename to src/libs/vtools/undocommands/adduniondetails.h diff --git a/src/app/undocommands/deletedetail.cpp b/src/libs/vtools/undocommands/deletedetail.cpp similarity index 98% rename from src/app/undocommands/deletedetail.cpp rename to src/libs/vtools/undocommands/deletedetail.cpp index 3cfc70ff0..fb26f0518 100644 --- a/src/app/undocommands/deletedetail.cpp +++ b/src/libs/vtools/undocommands/deletedetail.cpp @@ -48,7 +48,7 @@ DeleteDetail::DeleteDetail(VAbstractPattern *doc, quint32 id, QUndoCommand *pare else { // Better save id of previous detail instead of reference to node. - siblingId = doc->GetParametrUInt(previousDetail.toElement(), VPattern::AttrId, NULL_ID_STR); + siblingId = doc->GetParametrUInt(previousDetail.toElement(), VAbstractPattern::AttrId, NULL_ID_STR); } } else diff --git a/src/app/undocommands/deletedetail.h b/src/libs/vtools/undocommands/deletedetail.h similarity index 100% rename from src/app/undocommands/deletedetail.h rename to src/libs/vtools/undocommands/deletedetail.h diff --git a/src/app/undocommands/deletepatternpiece.cpp b/src/libs/vtools/undocommands/deletepatternpiece.cpp similarity index 100% rename from src/app/undocommands/deletepatternpiece.cpp rename to src/libs/vtools/undocommands/deletepatternpiece.cpp diff --git a/src/app/undocommands/deletepatternpiece.h b/src/libs/vtools/undocommands/deletepatternpiece.h similarity index 100% rename from src/app/undocommands/deletepatternpiece.h rename to src/libs/vtools/undocommands/deletepatternpiece.h diff --git a/src/app/undocommands/deltool.cpp b/src/libs/vtools/undocommands/deltool.cpp similarity index 100% rename from src/app/undocommands/deltool.cpp rename to src/libs/vtools/undocommands/deltool.cpp diff --git a/src/app/undocommands/deltool.h b/src/libs/vtools/undocommands/deltool.h similarity index 100% rename from src/app/undocommands/deltool.h rename to src/libs/vtools/undocommands/deltool.h diff --git a/src/app/undocommands/movedetail.cpp b/src/libs/vtools/undocommands/movedetail.cpp similarity index 99% rename from src/app/undocommands/movedetail.cpp rename to src/libs/vtools/undocommands/movedetail.cpp index 6fb508f91..cf6312f22 100644 --- a/src/app/undocommands/movedetail.cpp +++ b/src/libs/vtools/undocommands/movedetail.cpp @@ -27,10 +27,11 @@ *************************************************************************/ #include "movedetail.h" +#include "../tools/vabstracttool.h" +#include "../../vwidgets/vmaingraphicsview.h" + #include #include -#include "../tools/vabstracttool.h" -#include "../core/vapplication.h" //--------------------------------------------------------------------------------------------------------------------- MoveDetail::MoveDetail(VAbstractPattern *doc, const double &x, const double &y, const quint32 &id, diff --git a/src/app/undocommands/movedetail.h b/src/libs/vtools/undocommands/movedetail.h similarity index 100% rename from src/app/undocommands/movedetail.h rename to src/libs/vtools/undocommands/movedetail.h diff --git a/src/app/undocommands/movelabel.cpp b/src/libs/vtools/undocommands/movelabel.cpp similarity index 98% rename from src/app/undocommands/movelabel.cpp rename to src/libs/vtools/undocommands/movelabel.cpp index edb284a22..9c830a673 100644 --- a/src/app/undocommands/movelabel.cpp +++ b/src/libs/vtools/undocommands/movelabel.cpp @@ -27,10 +27,11 @@ *************************************************************************/ #include "movelabel.h" +#include "../tools/vabstracttool.h" +#include "../../vwidgets/vmaingraphicsview.h" + #include #include -#include "../tools/vabstracttool.h" -#include "../core/vapplication.h" //--------------------------------------------------------------------------------------------------------------------- MoveLabel::MoveLabel(VAbstractPattern *doc, const double &x, const double &y, const quint32 &id, QGraphicsScene *scene, diff --git a/src/app/undocommands/movelabel.h b/src/libs/vtools/undocommands/movelabel.h similarity index 100% rename from src/app/undocommands/movelabel.h rename to src/libs/vtools/undocommands/movelabel.h diff --git a/src/app/undocommands/movespline.cpp b/src/libs/vtools/undocommands/movespline.cpp similarity index 98% rename from src/app/undocommands/movespline.cpp rename to src/libs/vtools/undocommands/movespline.cpp index a09f0ed55..598a4db16 100644 --- a/src/app/undocommands/movespline.cpp +++ b/src/libs/vtools/undocommands/movespline.cpp @@ -28,6 +28,8 @@ #include "movespline.h" #include "../tools/vabstracttool.h" +#include "../../vwidgets/vmaingraphicsview.h" + #include #include diff --git a/src/app/undocommands/movespline.h b/src/libs/vtools/undocommands/movespline.h similarity index 98% rename from src/app/undocommands/movespline.h rename to src/libs/vtools/undocommands/movespline.h index afdbd6a00..236f3c41f 100644 --- a/src/app/undocommands/movespline.h +++ b/src/libs/vtools/undocommands/movespline.h @@ -30,7 +30,7 @@ #define MOVESPLINE_H #include "vundocommand.h" -#include "../libs/vgeometry/vspline.h" +#include "../../vgeometry/vspline.h" class QGraphicsScene; diff --git a/src/app/undocommands/movesplinepath.cpp b/src/libs/vtools/undocommands/movesplinepath.cpp similarity index 100% rename from src/app/undocommands/movesplinepath.cpp rename to src/libs/vtools/undocommands/movesplinepath.cpp diff --git a/src/app/undocommands/movesplinepath.h b/src/libs/vtools/undocommands/movesplinepath.h similarity index 98% rename from src/app/undocommands/movesplinepath.h rename to src/libs/vtools/undocommands/movesplinepath.h index 60571fc3d..91e51ef4c 100644 --- a/src/app/undocommands/movesplinepath.h +++ b/src/libs/vtools/undocommands/movesplinepath.h @@ -30,7 +30,7 @@ #define MOVESPLINEPATH_H #include "vundocommand.h" -#include "../libs/vgeometry/vsplinepath.h" +#include "../../vgeometry/vsplinepath.h" class QGraphicsScene; diff --git a/src/app/undocommands/movespoint.cpp b/src/libs/vtools/undocommands/movespoint.cpp similarity index 99% rename from src/app/undocommands/movespoint.cpp rename to src/libs/vtools/undocommands/movespoint.cpp index 53fbc93c6..56910e1d6 100644 --- a/src/app/undocommands/movespoint.cpp +++ b/src/libs/vtools/undocommands/movespoint.cpp @@ -27,10 +27,11 @@ *************************************************************************/ #include "movespoint.h" +#include "../tools/vabstracttool.h" +#include "../../vwidgets/vmaingraphicsview.h" + #include #include -#include "../tools/vabstracttool.h" -#include "../core/vapplication.h" //--------------------------------------------------------------------------------------------------------------------- MoveSPoint::MoveSPoint(VAbstractPattern *doc, const double &x, const double &y, const quint32 &id, diff --git a/src/app/undocommands/movespoint.h b/src/libs/vtools/undocommands/movespoint.h similarity index 100% rename from src/app/undocommands/movespoint.h rename to src/libs/vtools/undocommands/movespoint.h diff --git a/src/app/undocommands/renamepp.cpp b/src/libs/vtools/undocommands/renamepp.cpp similarity index 99% rename from src/app/undocommands/renamepp.cpp rename to src/libs/vtools/undocommands/renamepp.cpp index 3aee58ca4..97bcdf854 100644 --- a/src/app/undocommands/renamepp.cpp +++ b/src/libs/vtools/undocommands/renamepp.cpp @@ -29,7 +29,6 @@ #include "renamepp.h" #include -#include "../options.h" //--------------------------------------------------------------------------------------------------------------------- RenamePP::RenamePP(VAbstractPattern *doc, const QString &newPPname, QComboBox *combo, QUndoCommand *parent) diff --git a/src/app/undocommands/renamepp.h b/src/libs/vtools/undocommands/renamepp.h similarity index 100% rename from src/app/undocommands/renamepp.h rename to src/libs/vtools/undocommands/renamepp.h diff --git a/src/app/undocommands/savedetailoptions.cpp b/src/libs/vtools/undocommands/savedetailoptions.cpp similarity index 99% rename from src/app/undocommands/savedetailoptions.cpp rename to src/libs/vtools/undocommands/savedetailoptions.cpp index 2a9c7cf67..9924bc041 100644 --- a/src/app/undocommands/savedetailoptions.cpp +++ b/src/libs/vtools/undocommands/savedetailoptions.cpp @@ -28,6 +28,8 @@ #include "savedetailoptions.h" #include "../tools/nodeDetails/vabstractnode.h" +#include "../../vwidgets/vmaingraphicsview.h" + #include //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/undocommands/savedetailoptions.h b/src/libs/vtools/undocommands/savedetailoptions.h similarity index 100% rename from src/app/undocommands/savedetailoptions.h rename to src/libs/vtools/undocommands/savedetailoptions.h diff --git a/src/app/undocommands/savetooloptions.cpp b/src/libs/vtools/undocommands/savetooloptions.cpp similarity index 99% rename from src/app/undocommands/savetooloptions.cpp rename to src/libs/vtools/undocommands/savetooloptions.cpp index 99299c95d..aec8211b0 100644 --- a/src/app/undocommands/savetooloptions.cpp +++ b/src/libs/vtools/undocommands/savetooloptions.cpp @@ -27,7 +27,6 @@ *************************************************************************/ #include "savetooloptions.h" -#include "../options.h" //--------------------------------------------------------------------------------------------------------------------- SaveToolOptions::SaveToolOptions(const QDomElement &oldXml, const QDomElement &newXml, VAbstractPattern *doc, diff --git a/src/app/undocommands/savetooloptions.h b/src/libs/vtools/undocommands/savetooloptions.h similarity index 100% rename from src/app/undocommands/savetooloptions.h rename to src/libs/vtools/undocommands/savetooloptions.h diff --git a/src/app/undocommands/undocommands.pri b/src/libs/vtools/undocommands/undocommands.pri similarity index 100% rename from src/app/undocommands/undocommands.pri rename to src/libs/vtools/undocommands/undocommands.pri diff --git a/src/app/undocommands/vundocommand.cpp b/src/libs/vtools/undocommands/vundocommand.cpp similarity index 100% rename from src/app/undocommands/vundocommand.cpp rename to src/libs/vtools/undocommands/vundocommand.cpp diff --git a/src/app/undocommands/vundocommand.h b/src/libs/vtools/undocommands/vundocommand.h similarity index 97% rename from src/app/undocommands/vundocommand.h rename to src/libs/vtools/undocommands/vundocommand.h index 608f91dfe..09f9b533d 100644 --- a/src/app/undocommands/vundocommand.h +++ b/src/libs/vtools/undocommands/vundocommand.h @@ -32,8 +32,8 @@ #include #include -#include "../vmisc/logging.h" -#include "../libs/ifc/xml/vabstractpattern.h" +#include "../../vmisc/logging.h" +#include "../../ifc/xml/vabstractpattern.h" Q_DECLARE_LOGGING_CATEGORY(vUndo) diff --git a/src/app/visualization/visline.cpp b/src/libs/vtools/visualization/visline.cpp similarity index 100% rename from src/app/visualization/visline.cpp rename to src/libs/vtools/visualization/visline.cpp diff --git a/src/app/visualization/visline.h b/src/libs/vtools/visualization/visline.h similarity index 100% rename from src/app/visualization/visline.h rename to src/libs/vtools/visualization/visline.h diff --git a/src/app/visualization/vispath.cpp b/src/libs/vtools/visualization/vispath.cpp similarity index 100% rename from src/app/visualization/vispath.cpp rename to src/libs/vtools/visualization/vispath.cpp diff --git a/src/app/visualization/vispath.h b/src/libs/vtools/visualization/vispath.h similarity index 100% rename from src/app/visualization/vispath.h rename to src/libs/vtools/visualization/vispath.h diff --git a/src/app/visualization/vistoolalongline.cpp b/src/libs/vtools/visualization/vistoolalongline.cpp similarity index 97% rename from src/app/visualization/vistoolalongline.cpp rename to src/libs/vtools/visualization/vistoolalongline.cpp index 4c7cddbd9..3e8ae718b 100644 --- a/src/app/visualization/vistoolalongline.cpp +++ b/src/libs/vtools/visualization/vistoolalongline.cpp @@ -27,8 +27,8 @@ *************************************************************************/ #include "vistoolalongline.h" -#include "../libs/vpatterndb/vcontainer.h" -#include "../libs/vgeometry/vpointf.h" +#include "../../vpatterndb/vcontainer.h" +#include "../../vgeometry/vpointf.h" //--------------------------------------------------------------------------------------------------------------------- VisToolAlongLine::VisToolAlongLine(const VContainer *data, QGraphicsItem *parent) diff --git a/src/app/visualization/vistoolalongline.h b/src/libs/vtools/visualization/vistoolalongline.h similarity index 100% rename from src/app/visualization/vistoolalongline.h rename to src/libs/vtools/visualization/vistoolalongline.h diff --git a/src/app/visualization/vistoolarc.cpp b/src/libs/vtools/visualization/vistoolarc.cpp similarity index 96% rename from src/app/visualization/vistoolarc.cpp rename to src/libs/vtools/visualization/vistoolarc.cpp index cd3c2978b..4b319af2d 100644 --- a/src/app/visualization/vistoolarc.cpp +++ b/src/libs/vtools/visualization/vistoolarc.cpp @@ -27,9 +27,9 @@ *************************************************************************/ #include "vistoolarc.h" -#include "../libs/vgeometry/vpointf.h" -#include "../libs/vgeometry/varc.h" -#include "../libs/vpatterndb/vcontainer.h" +#include "../../vgeometry/vpointf.h" +#include "../../vgeometry/varc.h" +#include "../../vpatterndb/vcontainer.h" //--------------------------------------------------------------------------------------------------------------------- VisToolArc::VisToolArc(const VContainer *data, QGraphicsItem *parent) diff --git a/src/app/visualization/vistoolarc.h b/src/libs/vtools/visualization/vistoolarc.h similarity index 100% rename from src/app/visualization/vistoolarc.h rename to src/libs/vtools/visualization/vistoolarc.h diff --git a/src/app/visualization/vistoolarcwithlength.cpp b/src/libs/vtools/visualization/vistoolarcwithlength.cpp similarity index 96% rename from src/app/visualization/vistoolarcwithlength.cpp rename to src/libs/vtools/visualization/vistoolarcwithlength.cpp index 861e9266c..a86b5ce5a 100644 --- a/src/app/visualization/vistoolarcwithlength.cpp +++ b/src/libs/vtools/visualization/vistoolarcwithlength.cpp @@ -27,9 +27,9 @@ *************************************************************************/ #include "vistoolarcwithlength.h" -#include "../libs/vgeometry/vpointf.h" -#include "../libs/vgeometry/varc.h" -#include "../libs/vpatterndb/vcontainer.h" +#include "../../vgeometry/vpointf.h" +#include "../../vgeometry/varc.h" +#include "../../vpatterndb/vcontainer.h" //--------------------------------------------------------------------------------------------------------------------- VisToolArcWithLength::VisToolArcWithLength(const VContainer *data, QGraphicsItem *parent) diff --git a/src/app/visualization/vistoolarcwithlength.h b/src/libs/vtools/visualization/vistoolarcwithlength.h similarity index 100% rename from src/app/visualization/vistoolarcwithlength.h rename to src/libs/vtools/visualization/vistoolarcwithlength.h diff --git a/src/app/visualization/vistoolbisector.cpp b/src/libs/vtools/visualization/vistoolbisector.cpp similarity index 98% rename from src/app/visualization/vistoolbisector.cpp rename to src/libs/vtools/visualization/vistoolbisector.cpp index 3d69556da..750d00481 100644 --- a/src/app/visualization/vistoolbisector.cpp +++ b/src/libs/vtools/visualization/vistoolbisector.cpp @@ -27,8 +27,8 @@ *************************************************************************/ #include "vistoolbisector.h" -#include "../libs/vgeometry/vpointf.h" -#include "../libs/vpatterndb/vcontainer.h" +#include "../../vgeometry/vpointf.h" +#include "../../vpatterndb/vcontainer.h" #include "../tools/drawTools/vtoolbisector.h" //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/visualization/vistoolbisector.h b/src/libs/vtools/visualization/vistoolbisector.h similarity index 100% rename from src/app/visualization/vistoolbisector.h rename to src/libs/vtools/visualization/vistoolbisector.h diff --git a/src/app/visualization/vistoolcurveintersectaxis.cpp b/src/libs/vtools/visualization/vistoolcurveintersectaxis.cpp similarity index 98% rename from src/app/visualization/vistoolcurveintersectaxis.cpp rename to src/libs/vtools/visualization/vistoolcurveintersectaxis.cpp index e2e1d441d..7c09ea526 100644 --- a/src/app/visualization/vistoolcurveintersectaxis.cpp +++ b/src/libs/vtools/visualization/vistoolcurveintersectaxis.cpp @@ -27,8 +27,8 @@ *************************************************************************/ #include "vistoolcurveintersectaxis.h" -#include "../libs/vpatterndb/vcontainer.h" -#include "../libs/vgeometry/vpointf.h" +#include "../../vpatterndb/vcontainer.h" +#include "../../vgeometry/vpointf.h" #include "../tools/drawTools/vtoolcurveintersectaxis.h" //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/visualization/vistoolcurveintersectaxis.h b/src/libs/vtools/visualization/vistoolcurveintersectaxis.h similarity index 100% rename from src/app/visualization/vistoolcurveintersectaxis.h rename to src/libs/vtools/visualization/vistoolcurveintersectaxis.h diff --git a/src/app/visualization/vistoolcutarc.cpp b/src/libs/vtools/visualization/vistoolcutarc.cpp similarity index 97% rename from src/app/visualization/vistoolcutarc.cpp rename to src/libs/vtools/visualization/vistoolcutarc.cpp index 0ff22f56d..59e5bc50f 100644 --- a/src/app/visualization/vistoolcutarc.cpp +++ b/src/libs/vtools/visualization/vistoolcutarc.cpp @@ -27,8 +27,8 @@ *************************************************************************/ #include "vistoolcutarc.h" -#include "../libs/vgeometry/varc.h" -#include "../libs/vpatterndb/vcontainer.h" +#include "../../vgeometry/varc.h" +#include "../../vpatterndb/vcontainer.h" //--------------------------------------------------------------------------------------------------------------------- VisToolCutArc::VisToolCutArc(const VContainer *data, QGraphicsItem *parent) diff --git a/src/app/visualization/vistoolcutarc.h b/src/libs/vtools/visualization/vistoolcutarc.h similarity index 100% rename from src/app/visualization/vistoolcutarc.h rename to src/libs/vtools/visualization/vistoolcutarc.h diff --git a/src/app/visualization/vistoolcutspline.cpp b/src/libs/vtools/visualization/vistoolcutspline.cpp similarity index 97% rename from src/app/visualization/vistoolcutspline.cpp rename to src/libs/vtools/visualization/vistoolcutspline.cpp index 85b03db86..36cb6709b 100644 --- a/src/app/visualization/vistoolcutspline.cpp +++ b/src/libs/vtools/visualization/vistoolcutspline.cpp @@ -27,8 +27,8 @@ *************************************************************************/ #include "vistoolcutspline.h" -#include "../libs/vgeometry/vspline.h" -#include "../libs/vpatterndb/vcontainer.h" +#include "../../vgeometry/vspline.h" +#include "../../vpatterndb/vcontainer.h" //--------------------------------------------------------------------------------------------------------------------- VisToolCutSpline::VisToolCutSpline(const VContainer *data, QGraphicsItem *parent) diff --git a/src/app/visualization/vistoolcutspline.h b/src/libs/vtools/visualization/vistoolcutspline.h similarity index 100% rename from src/app/visualization/vistoolcutspline.h rename to src/libs/vtools/visualization/vistoolcutspline.h diff --git a/src/app/visualization/vistoolcutsplinepath.cpp b/src/libs/vtools/visualization/vistoolcutsplinepath.cpp similarity index 98% rename from src/app/visualization/vistoolcutsplinepath.cpp rename to src/libs/vtools/visualization/vistoolcutsplinepath.cpp index 85f8834ca..2f37f64ac 100644 --- a/src/app/visualization/vistoolcutsplinepath.cpp +++ b/src/libs/vtools/visualization/vistoolcutsplinepath.cpp @@ -27,8 +27,8 @@ *************************************************************************/ #include "vistoolcutsplinepath.h" -#include "../libs/vpatterndb/vcontainer.h" -#include "../libs/vgeometry/vsplinepath.h" +#include "../../vpatterndb/vcontainer.h" +#include "../../vgeometry/vsplinepath.h" //--------------------------------------------------------------------------------------------------------------------- VisToolCutSplinePath::VisToolCutSplinePath(const VContainer *data, QGraphicsItem *parent) diff --git a/src/app/visualization/vistoolcutsplinepath.h b/src/libs/vtools/visualization/vistoolcutsplinepath.h similarity index 100% rename from src/app/visualization/vistoolcutsplinepath.h rename to src/libs/vtools/visualization/vistoolcutsplinepath.h diff --git a/src/app/visualization/vistoolendline.cpp b/src/libs/vtools/visualization/vistoolendline.cpp similarity index 97% rename from src/app/visualization/vistoolendline.cpp rename to src/libs/vtools/visualization/vistoolendline.cpp index 0e57cdd56..a6afe5e21 100644 --- a/src/app/visualization/vistoolendline.cpp +++ b/src/libs/vtools/visualization/vistoolendline.cpp @@ -27,8 +27,8 @@ *************************************************************************/ #include "vistoolendline.h" -#include "../libs/vgeometry/vpointf.h" -#include "../libs/vpatterndb/vcontainer.h" +#include "../../vgeometry/vpointf.h" +#include "../../vpatterndb/vcontainer.h" #include "../tools/vabstracttool.h" #include diff --git a/src/app/visualization/vistoolendline.h b/src/libs/vtools/visualization/vistoolendline.h similarity index 100% rename from src/app/visualization/vistoolendline.h rename to src/libs/vtools/visualization/vistoolendline.h diff --git a/src/app/visualization/vistoolheight.cpp b/src/libs/vtools/visualization/vistoolheight.cpp similarity index 99% rename from src/app/visualization/vistoolheight.cpp rename to src/libs/vtools/visualization/vistoolheight.cpp index bac8acc4d..958afc25e 100644 --- a/src/app/visualization/vistoolheight.cpp +++ b/src/libs/vtools/visualization/vistoolheight.cpp @@ -27,7 +27,7 @@ *************************************************************************/ #include "vistoolheight.h" -#include "../libs/vgeometry/vpointf.h" +#include "../../vgeometry/vpointf.h" #include "../tools/drawTools/vtoolheight.h" //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/visualization/vistoolheight.h b/src/libs/vtools/visualization/vistoolheight.h similarity index 100% rename from src/app/visualization/vistoolheight.h rename to src/libs/vtools/visualization/vistoolheight.h diff --git a/src/app/visualization/vistoolline.cpp b/src/libs/vtools/visualization/vistoolline.cpp similarity index 97% rename from src/app/visualization/vistoolline.cpp rename to src/libs/vtools/visualization/vistoolline.cpp index 2d5ffa637..a0975fd47 100644 --- a/src/app/visualization/vistoolline.cpp +++ b/src/libs/vtools/visualization/vistoolline.cpp @@ -27,8 +27,8 @@ *************************************************************************/ #include "vistoolline.h" -#include "../libs/vpatterndb/vcontainer.h" -#include "../libs/vgeometry/vpointf.h" +#include "../../vpatterndb/vcontainer.h" +#include "../../vgeometry/vpointf.h" #include "../tools/drawTools/vdrawtool.h" //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/visualization/vistoolline.h b/src/libs/vtools/visualization/vistoolline.h similarity index 100% rename from src/app/visualization/vistoolline.h rename to src/libs/vtools/visualization/vistoolline.h diff --git a/src/app/visualization/vistoollineintersect.cpp b/src/libs/vtools/visualization/vistoollineintersect.cpp similarity index 98% rename from src/app/visualization/vistoollineintersect.cpp rename to src/libs/vtools/visualization/vistoollineintersect.cpp index 79ed075dd..2cc7ded59 100644 --- a/src/app/visualization/vistoollineintersect.cpp +++ b/src/libs/vtools/visualization/vistoollineintersect.cpp @@ -27,8 +27,8 @@ *************************************************************************/ #include "vistoollineintersect.h" -#include "../libs/vgeometry/vpointf.h" -#include "../libs/vpatterndb/vcontainer.h" +#include "../../vgeometry/vpointf.h" +#include "../../vpatterndb/vcontainer.h" //--------------------------------------------------------------------------------------------------------------------- VisToolLineIntersect::VisToolLineIntersect(const VContainer *data, QGraphicsItem *parent) diff --git a/src/app/visualization/vistoollineintersect.h b/src/libs/vtools/visualization/vistoollineintersect.h similarity index 100% rename from src/app/visualization/vistoollineintersect.h rename to src/libs/vtools/visualization/vistoollineintersect.h diff --git a/src/app/visualization/vistoollineintersectaxis.cpp b/src/libs/vtools/visualization/vistoollineintersectaxis.cpp similarity index 98% rename from src/app/visualization/vistoollineintersectaxis.cpp rename to src/libs/vtools/visualization/vistoollineintersectaxis.cpp index 17c6f1db8..fce1eb10c 100644 --- a/src/app/visualization/vistoollineintersectaxis.cpp +++ b/src/libs/vtools/visualization/vistoollineintersectaxis.cpp @@ -27,8 +27,8 @@ *************************************************************************/ #include "vistoollineintersectaxis.h" -#include "../libs/vpatterndb/vcontainer.h" -#include "../libs/vgeometry/vpointf.h" +#include "../../vpatterndb/vcontainer.h" +#include "../../vgeometry/vpointf.h" #include "../tools/drawTools/vtoollineintersectaxis.h" //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/visualization/vistoollineintersectaxis.h b/src/libs/vtools/visualization/vistoollineintersectaxis.h similarity index 100% rename from src/app/visualization/vistoollineintersectaxis.h rename to src/libs/vtools/visualization/vistoollineintersectaxis.h diff --git a/src/app/visualization/vistoolnormal.cpp b/src/libs/vtools/visualization/vistoolnormal.cpp similarity index 99% rename from src/app/visualization/vistoolnormal.cpp rename to src/libs/vtools/visualization/vistoolnormal.cpp index 17026fd0d..42d46ee59 100644 --- a/src/app/visualization/vistoolnormal.cpp +++ b/src/libs/vtools/visualization/vistoolnormal.cpp @@ -27,7 +27,7 @@ *************************************************************************/ #include "vistoolnormal.h" -#include "../libs/vgeometry/vpointf.h" +#include "../../vgeometry/vpointf.h" #include "../tools/drawTools/vtoolnormal.h" //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/visualization/vistoolnormal.h b/src/libs/vtools/visualization/vistoolnormal.h similarity index 100% rename from src/app/visualization/vistoolnormal.h rename to src/libs/vtools/visualization/vistoolnormal.h diff --git a/src/app/visualization/vistoolpointfromarcandtangent.cpp b/src/libs/vtools/visualization/vistoolpointfromarcandtangent.cpp similarity index 97% rename from src/app/visualization/vistoolpointfromarcandtangent.cpp rename to src/libs/vtools/visualization/vistoolpointfromarcandtangent.cpp index 08945dd6d..fac64f6a4 100644 --- a/src/app/visualization/vistoolpointfromarcandtangent.cpp +++ b/src/libs/vtools/visualization/vistoolpointfromarcandtangent.cpp @@ -27,10 +27,10 @@ *************************************************************************/ #include "vistoolpointfromarcandtangent.h" -#include "../libs/vpatterndb/vcontainer.h" +#include "../../vpatterndb/vcontainer.h" #include "../tools/drawTools/vtoolpointfromarcandtangent.h" -#include "../libs/vgeometry/vpointf.h" -#include "../libs/vgeometry/varc.h" +#include "../../vgeometry/vpointf.h" +#include "../../vgeometry/varc.h" //--------------------------------------------------------------------------------------------------------------------- VisToolPointFromArcAndTangent::VisToolPointFromArcAndTangent(const VContainer *data, QGraphicsItem *parent) diff --git a/src/app/visualization/vistoolpointfromarcandtangent.h b/src/libs/vtools/visualization/vistoolpointfromarcandtangent.h similarity index 98% rename from src/app/visualization/vistoolpointfromarcandtangent.h rename to src/libs/vtools/visualization/vistoolpointfromarcandtangent.h index 9d01ca781..69e6307dc 100644 --- a/src/app/visualization/vistoolpointfromarcandtangent.h +++ b/src/libs/vtools/visualization/vistoolpointfromarcandtangent.h @@ -30,7 +30,7 @@ #define VISTOOLPOINTFROMARCANDTANGENT_H #include "visline.h" -#include "../xml/vpattern.h" +#include "../ifc/xml/vabstractpattern.h" class VisToolPointFromArcAndTangent : public VisLine { diff --git a/src/app/visualization/vistoolpointfromcircleandtangent.cpp b/src/libs/vtools/visualization/vistoolpointfromcircleandtangent.cpp similarity index 98% rename from src/app/visualization/vistoolpointfromcircleandtangent.cpp rename to src/libs/vtools/visualization/vistoolpointfromcircleandtangent.cpp index cc06d0a57..fae856822 100644 --- a/src/app/visualization/vistoolpointfromcircleandtangent.cpp +++ b/src/libs/vtools/visualization/vistoolpointfromcircleandtangent.cpp @@ -27,9 +27,9 @@ *************************************************************************/ #include "vistoolpointfromcircleandtangent.h" -#include "../libs/vpatterndb/vcontainer.h" +#include "../../vpatterndb/vcontainer.h" #include "../tools/drawTools/vtoolpointfromcircleandtangent.h" -#include "../libs/vgeometry/vpointf.h" +#include "../../vgeometry/vpointf.h" //--------------------------------------------------------------------------------------------------------------------- VisToolPointFromCircleAndTangent::VisToolPointFromCircleAndTangent(const VContainer *data, QGraphicsItem *parent) diff --git a/src/app/visualization/vistoolpointfromcircleandtangent.h b/src/libs/vtools/visualization/vistoolpointfromcircleandtangent.h similarity index 98% rename from src/app/visualization/vistoolpointfromcircleandtangent.h rename to src/libs/vtools/visualization/vistoolpointfromcircleandtangent.h index 995bbf329..3d7ab68b4 100644 --- a/src/app/visualization/vistoolpointfromcircleandtangent.h +++ b/src/libs/vtools/visualization/vistoolpointfromcircleandtangent.h @@ -30,7 +30,7 @@ #define VISTOOLPOINTFROMCIRCLEANDTANGENT_H #include "visline.h" -#include "../xml/vpattern.h" +#include "../ifc/xml/vabstractpattern.h" class VisToolPointFromCircleAndTangent : public VisLine { diff --git a/src/app/visualization/vistoolpointofcontact.cpp b/src/libs/vtools/visualization/vistoolpointofcontact.cpp similarity index 99% rename from src/app/visualization/vistoolpointofcontact.cpp rename to src/libs/vtools/visualization/vistoolpointofcontact.cpp index 1a2116960..3e4a4a975 100644 --- a/src/app/visualization/vistoolpointofcontact.cpp +++ b/src/libs/vtools/visualization/vistoolpointofcontact.cpp @@ -27,7 +27,7 @@ *************************************************************************/ #include "vistoolpointofcontact.h" -#include "../libs/vgeometry/vpointf.h" +#include "../../vgeometry/vpointf.h" #include "../tools/drawTools/vtoolpointofcontact.h" //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/visualization/vistoolpointofcontact.h b/src/libs/vtools/visualization/vistoolpointofcontact.h similarity index 100% rename from src/app/visualization/vistoolpointofcontact.h rename to src/libs/vtools/visualization/vistoolpointofcontact.h diff --git a/src/app/visualization/vistoolpointofintersection.cpp b/src/libs/vtools/visualization/vistoolpointofintersection.cpp similarity index 97% rename from src/app/visualization/vistoolpointofintersection.cpp rename to src/libs/vtools/visualization/vistoolpointofintersection.cpp index a8f174a72..399ae674b 100644 --- a/src/app/visualization/vistoolpointofintersection.cpp +++ b/src/libs/vtools/visualization/vistoolpointofintersection.cpp @@ -27,8 +27,8 @@ *************************************************************************/ #include "vistoolpointofintersection.h" -#include "../libs/vgeometry/vpointf.h" -#include "../libs/vpatterndb/vcontainer.h" +#include "../../vgeometry/vpointf.h" +#include "../../vpatterndb/vcontainer.h" //--------------------------------------------------------------------------------------------------------------------- VisToolPointOfIntersection::VisToolPointOfIntersection(const VContainer *data, QGraphicsItem *parent) diff --git a/src/app/visualization/vistoolpointofintersection.h b/src/libs/vtools/visualization/vistoolpointofintersection.h similarity index 100% rename from src/app/visualization/vistoolpointofintersection.h rename to src/libs/vtools/visualization/vistoolpointofintersection.h diff --git a/src/app/visualization/vistoolpointofintersectionarcs.cpp b/src/libs/vtools/visualization/vistoolpointofintersectionarcs.cpp similarity index 96% rename from src/app/visualization/vistoolpointofintersectionarcs.cpp rename to src/libs/vtools/visualization/vistoolpointofintersectionarcs.cpp index 7a11d46e4..f1fe2d3c5 100644 --- a/src/app/visualization/vistoolpointofintersectionarcs.cpp +++ b/src/libs/vtools/visualization/vistoolpointofintersectionarcs.cpp @@ -27,13 +27,14 @@ *************************************************************************/ #include "vistoolpointofintersectionarcs.h" -#include "../libs/vgeometry/varc.h" -#include "../libs/vpatterndb/vcontainer.h" +#include "../../vgeometry/varc.h" +#include "../../vpatterndb/vcontainer.h" #include "../tools/drawTools/vtoolpointofintersectionarcs.h" //--------------------------------------------------------------------------------------------------------------------- VisToolPointOfIntersectionArcs::VisToolPointOfIntersectionArcs(const VContainer *data, QGraphicsItem *parent) - : VisLine(data, parent), arc1Id(NULL_ID), arc2Id(NULL_ID), crossPoint(CrossCirclesPoint::FirstPoint), point(nullptr), + : VisLine(data, parent), arc1Id(NULL_ID), arc2Id(NULL_ID), crossPoint(CrossCirclesPoint::FirstPoint), + point(nullptr), arc1Path(nullptr), arc2Path(nullptr) { arc1Path = InitItem(Qt::darkGreen, this); diff --git a/src/app/visualization/vistoolpointofintersectionarcs.h b/src/libs/vtools/visualization/vistoolpointofintersectionarcs.h similarity index 96% rename from src/app/visualization/vistoolpointofintersectionarcs.h rename to src/libs/vtools/visualization/vistoolpointofintersectionarcs.h index a9ead8ffe..8258a9159 100644 --- a/src/app/visualization/vistoolpointofintersectionarcs.h +++ b/src/libs/vtools/visualization/vistoolpointofintersectionarcs.h @@ -30,7 +30,7 @@ #define VISTOOLPOINTOFINTERSECTIONARCS_H #include "visline.h" -#include "../xml/vpattern.h" +#include "../ifc/xml/vabstractpattern.h" class VisToolPointOfIntersectionArcs : public VisLine { @@ -52,7 +52,7 @@ private: Q_DISABLE_COPY(VisToolPointOfIntersectionArcs) quint32 arc1Id; quint32 arc2Id; - CrossCirclesPoint crossPoint; + CrossCirclesPoint crossPoint; QGraphicsEllipseItem *point; QGraphicsPathItem *arc1Path; QGraphicsPathItem *arc2Path; diff --git a/src/app/visualization/vistoolpointofintersectioncircles.cpp b/src/libs/vtools/visualization/vistoolpointofintersectioncircles.cpp similarity index 98% rename from src/app/visualization/vistoolpointofintersectioncircles.cpp rename to src/libs/vtools/visualization/vistoolpointofintersectioncircles.cpp index 55dc336a1..24fb9cf02 100644 --- a/src/app/visualization/vistoolpointofintersectioncircles.cpp +++ b/src/libs/vtools/visualization/vistoolpointofintersectioncircles.cpp @@ -27,9 +27,9 @@ *************************************************************************/ #include "vistoolpointofintersectioncircles.h" -#include "../libs/vpatterndb/vcontainer.h" +#include "../../vpatterndb/vcontainer.h" #include "../tools/drawTools/vtoolpointofintersectioncircles.h" -#include "../libs/vgeometry/vpointf.h" +#include "../../vgeometry/vpointf.h" //--------------------------------------------------------------------------------------------------------------------- VisToolPointOfIntersectionCircles::VisToolPointOfIntersectionCircles(const VContainer *data, QGraphicsItem *parent) diff --git a/src/app/visualization/vistoolpointofintersectioncircles.h b/src/libs/vtools/visualization/vistoolpointofintersectioncircles.h similarity index 98% rename from src/app/visualization/vistoolpointofintersectioncircles.h rename to src/libs/vtools/visualization/vistoolpointofintersectioncircles.h index b6266d59c..77248a780 100644 --- a/src/app/visualization/vistoolpointofintersectioncircles.h +++ b/src/libs/vtools/visualization/vistoolpointofintersectioncircles.h @@ -30,7 +30,7 @@ #define VISTOOLPOINTOFINTERSECTIONCIRCLES_H #include "visline.h" -#include "../xml/vpattern.h" +#include "../ifc/xml/vabstractpattern.h" class VisToolPointOfIntersectionCircles : public VisLine { diff --git a/src/app/visualization/vistoolshoulderpoint.cpp b/src/libs/vtools/visualization/vistoolshoulderpoint.cpp similarity index 99% rename from src/app/visualization/vistoolshoulderpoint.cpp rename to src/libs/vtools/visualization/vistoolshoulderpoint.cpp index 19b87bff2..da2dd7493 100644 --- a/src/app/visualization/vistoolshoulderpoint.cpp +++ b/src/libs/vtools/visualization/vistoolshoulderpoint.cpp @@ -28,7 +28,7 @@ #include "vistoolshoulderpoint.h" #include "../tools/drawTools/vtoolshoulderpoint.h" -#include "../libs/vgeometry/vpointf.h" +#include "../../vgeometry/vpointf.h" //--------------------------------------------------------------------------------------------------------------------- VisToolShoulderPoint::VisToolShoulderPoint(const VContainer *data, QGraphicsItem *parent) diff --git a/src/app/visualization/vistoolshoulderpoint.h b/src/libs/vtools/visualization/vistoolshoulderpoint.h similarity index 100% rename from src/app/visualization/vistoolshoulderpoint.h rename to src/libs/vtools/visualization/vistoolshoulderpoint.h diff --git a/src/app/visualization/vistoolspline.cpp b/src/libs/vtools/visualization/vistoolspline.cpp similarity index 97% rename from src/app/visualization/vistoolspline.cpp rename to src/libs/vtools/visualization/vistoolspline.cpp index b9130d58b..f91ba51cb 100644 --- a/src/app/visualization/vistoolspline.cpp +++ b/src/libs/vtools/visualization/vistoolspline.cpp @@ -27,9 +27,9 @@ *************************************************************************/ #include "vistoolspline.h" -#include "../libs/vgeometry/vpointf.h" -#include "../libs/vgeometry/vspline.h" -#include "../libs/vpatterndb/vcontainer.h" +#include "../../vgeometry/vpointf.h" +#include "../../vgeometry/vspline.h" +#include "../../vpatterndb/vcontainer.h" const int EMPTY_ANGLE = -1; diff --git a/src/app/visualization/vistoolspline.h b/src/libs/vtools/visualization/vistoolspline.h similarity index 100% rename from src/app/visualization/vistoolspline.h rename to src/libs/vtools/visualization/vistoolspline.h diff --git a/src/app/visualization/vistoolsplinepath.cpp b/src/libs/vtools/visualization/vistoolsplinepath.cpp similarity index 100% rename from src/app/visualization/vistoolsplinepath.cpp rename to src/libs/vtools/visualization/vistoolsplinepath.cpp diff --git a/src/app/visualization/vistoolsplinepath.h b/src/libs/vtools/visualization/vistoolsplinepath.h similarity index 98% rename from src/app/visualization/vistoolsplinepath.h rename to src/libs/vtools/visualization/vistoolsplinepath.h index e30fdfa41..bc3f7079d 100644 --- a/src/app/visualization/vistoolsplinepath.h +++ b/src/libs/vtools/visualization/vistoolsplinepath.h @@ -30,7 +30,7 @@ #define VISTOOLSPLINEPATH_H #include "vispath.h" -#include "../libs/vgeometry/vsplinepath.h" +#include "../../vgeometry/vsplinepath.h" enum class Mode : char {Creation, Show}; diff --git a/src/app/visualization/vistooltriangle.cpp b/src/libs/vtools/visualization/vistooltriangle.cpp similarity index 98% rename from src/app/visualization/vistooltriangle.cpp rename to src/libs/vtools/visualization/vistooltriangle.cpp index 5177aabe9..76bbedefc 100644 --- a/src/app/visualization/vistooltriangle.cpp +++ b/src/libs/vtools/visualization/vistooltriangle.cpp @@ -27,8 +27,8 @@ *************************************************************************/ #include "vistooltriangle.h" -#include "../libs/vgeometry/vpointf.h" -#include "../libs/vpatterndb/vcontainer.h" +#include "../../vgeometry/vpointf.h" +#include "../../vpatterndb/vcontainer.h" #include "../tools/drawTools/vtooltriangle.h" #include diff --git a/src/app/visualization/vistooltriangle.h b/src/libs/vtools/visualization/vistooltriangle.h similarity index 100% rename from src/app/visualization/vistooltriangle.h rename to src/libs/vtools/visualization/vistooltriangle.h diff --git a/src/app/visualization/visualization.cpp b/src/libs/vtools/visualization/visualization.cpp similarity index 98% rename from src/app/visualization/visualization.cpp rename to src/libs/vtools/visualization/visualization.cpp index c7e8b9fa4..8fb348453 100644 --- a/src/app/visualization/visualization.cpp +++ b/src/libs/vtools/visualization/visualization.cpp @@ -28,7 +28,8 @@ #include "visualization.h" #include "../tools/drawTools/vdrawtool.h" -#include "../libs/vpatterndb/calculator.h" +#include "../../vpatterndb/calculator.h" +#include "../../vpatterndb/vtranslatevars.h" #include @@ -88,7 +89,7 @@ void Visualization::setMainColor(const QColor &value) //--------------------------------------------------------------------------------------------------------------------- void Visualization::SetFactor(qreal factor) { - VApplication::CheckFactor(this->factor, factor); + CheckFactor(this->factor, factor); RefreshGeometry(); } diff --git a/src/app/visualization/visualization.h b/src/libs/vtools/visualization/visualization.h similarity index 97% rename from src/app/visualization/visualization.h rename to src/libs/vtools/visualization/visualization.h index 4f03b4262..f540b3f78 100644 --- a/src/app/visualization/visualization.h +++ b/src/libs/vtools/visualization/visualization.h @@ -32,8 +32,8 @@ #include #include -#include "../core/vapplication.h" -#include "../libs/vwidgets/vmaingraphicsscene.h" +#include "../../vmisc/vabstractapplication.h" +#include "../../vwidgets/vmaingraphicsscene.h" #include "../vmisc/logging.h" #include "../../libs/vpatterndb/vcontainer.h" diff --git a/src/app/visualization/visualization.pri b/src/libs/vtools/visualization/visualization.pri similarity index 100% rename from src/app/visualization/visualization.pri rename to src/libs/vtools/visualization/visualization.pri diff --git a/src/libs/vtools/vtools.pri b/src/libs/vtools/vtools.pri new file mode 100644 index 000000000..5f57c5a14 --- /dev/null +++ b/src/libs/vtools/vtools.pri @@ -0,0 +1,13 @@ +include(dialogs/dialogs.pri) +include(tools/tools.pri) +include(visualization/visualization.pri) +include(undocommands/undocommands.pri) + +# ADD TO EACH PATH $$PWD VARIABLE!!!!!! +# This need for corect working file translations.pro + +HEADERS += \ + $$PWD/stable.h + +SOURCES += \ + $$PWD/stable.cpp diff --git a/src/libs/vtools/vtools.pro b/src/libs/vtools/vtools.pro new file mode 100644 index 000000000..daad44c23 --- /dev/null +++ b/src/libs/vtools/vtools.pro @@ -0,0 +1,106 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2015-06-16T18:05:56 +# +#------------------------------------------------- + +# File with common stuff for whole project +include(../../../Valentina.pri) + +QT += widgets xml + +# Name of the library +TARGET = vtools + +# We want create library +TEMPLATE = lib + +CONFIG += \ + staticlib \# Making static library + c++11 # We use C++11 standard + +# Use out-of-source builds (shadow builds) +CONFIG -= debug_and_release debug_and_release_target + +# Since Qt 5.4.0 the source code location is recorded only in debug builds. +# We need this information also in release builds. For this need define QT_MESSAGELOGCONTEXT. +DEFINES += QT_MESSAGELOGCONTEXT + +include(vtools.pri) + +# This is static library so no need in "make install" + +# directory for executable file +DESTDIR = bin + +# files created moc +MOC_DIR = moc + +# objecs files +OBJECTS_DIR = obj + +# Directory for files created rcc +#RCC_DIR = rcc + +# Directory for files created uic +UI_DIR = uic + +# Set using ccache. Function enable_ccache() defined in Valentina.pri. +$$enable_ccache() + +# Set precompiled headers. Function set_PCH() defined in Valentina.pri. +$$set_PCH() + +CONFIG(debug, debug|release){ + # Debug mode + unix { + #Turn on compilers warnings. + *-g++{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${UI_DIR}" \ + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ +# -isystem "$${OUT_PWD}/$${RCC_DIR}" \ + $$GCC_DEBUG_CXXFLAGS # See Valentina.pri for more details. + + noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer + # do nothing + } else { + #gcc’s 4.8.0 Address Sanitizer + #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ + QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_LFLAGS += -fsanitize=address + } + } + clang*{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$CLANG_DEBUG_CXXFLAGS # See Valentina.pri for more details. + } + } else { + *-g++{ + QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See Valentina.pri for more details. + } + } + +}else{ + # Release mode + DEFINES += V_NO_ASSERT + !unix:*-g++{ + QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll + } + + noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols + # do nothing + } else { + !macx:!win32-msvc*{ + # Turn on debug symbols in release mode on Unix systems. + # On Mac OS X temporarily disabled. TODO: find way how to strip binary file. + QMAKE_CXXFLAGS_RELEASE += -g -gdwarf-3 + QMAKE_CFLAGS_RELEASE += -g -gdwarf-3 + QMAKE_LFLAGS_RELEASE = + } + } +} diff --git a/src/libs/vwidgets/stable.h b/src/libs/vwidgets/stable.h index e19a85cee..67341a4a2 100644 --- a/src/libs/vwidgets/stable.h +++ b/src/libs/vwidgets/stable.h @@ -31,7 +31,7 @@ /* I like to include this pragma too, so the build log indicates if pre-compiled headers were in use. */ #ifndef __clang__ -#pragma message("Compiling precompiled headers for VPatternDB library.\n") +#pragma message("Compiling precompiled headers for VWidgets library.\n") #endif /* Add C includes here */ From c49d9a6fa01c0a09f999888942f1c42fae96187a Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 18 Jun 2015 21:35:00 +0300 Subject: [PATCH 22/22] Fixed paths to icon.qrc. --HG-- branch : feature --- src/libs/vtools/dialogs/support/dialogundo.ui | 4 ++-- .../vtools/dialogs/tools/dialogalongline.ui | 8 +++---- src/libs/vtools/dialogs/tools/dialogarc.ui | 16 ++++++------- .../dialogs/tools/dialogarcwithlength.ui | 16 ++++++------- .../vtools/dialogs/tools/dialogbisector.ui | 8 +++---- .../dialogs/tools/dialogcurveintersectaxis.ui | 8 +++---- src/libs/vtools/dialogs/tools/dialogcutarc.ui | 8 +++---- .../vtools/dialogs/tools/dialogcutspline.ui | 8 +++---- .../dialogs/tools/dialogcutsplinepath.ui | 8 +++---- src/libs/vtools/dialogs/tools/dialogdetail.ui | 4 ++-- .../vtools/dialogs/tools/dialogendline.ui | 12 +++++----- src/libs/vtools/dialogs/tools/dialogheight.ui | 4 ++-- src/libs/vtools/dialogs/tools/dialogline.ui | 4 ++-- .../dialogs/tools/dialoglineintersect.ui | 4 ++-- .../dialogs/tools/dialoglineintersectaxis.ui | 8 +++---- src/libs/vtools/dialogs/tools/dialognormal.ui | 24 +++++++++---------- .../tools/dialogpointfromarcandtangent.ui | 4 ++-- .../tools/dialogpointfromcircleandtangent.ui | 8 +++---- .../dialogs/tools/dialogpointofcontact.ui | 8 +++---- .../tools/dialogpointofintersection.ui | 4 ++-- .../tools/dialogpointofintersectionarcs.ui | 4 ++-- .../tools/dialogpointofintersectioncircles.ui | 12 +++++----- .../dialogs/tools/dialogshoulderpoint.ui | 8 +++---- .../vtools/dialogs/tools/dialogsinglepoint.ui | 4 ++-- src/libs/vtools/dialogs/tools/dialogspline.ui | 4 ++-- .../vtools/dialogs/tools/dialogsplinepath.ui | 4 ++-- .../vtools/dialogs/tools/dialogtriangle.ui | 4 ++-- .../dialogs/tools/dialoguniondetails.ui | 4 ++-- 28 files changed, 106 insertions(+), 106 deletions(-) diff --git a/src/libs/vtools/dialogs/support/dialogundo.ui b/src/libs/vtools/dialogs/support/dialogundo.ui index 21e4dcbad..b8011a668 100644 --- a/src/libs/vtools/dialogs/support/dialogundo.ui +++ b/src/libs/vtools/dialogs/support/dialogundo.ui @@ -29,7 +29,7 @@ Broken formula - + :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png @@ -78,7 +78,7 @@ - + diff --git a/src/libs/vtools/dialogs/tools/dialogalongline.ui b/src/libs/vtools/dialogs/tools/dialogalongline.ui index 1674c85a1..7cd62f81d 100644 --- a/src/libs/vtools/dialogs/tools/dialogalongline.ui +++ b/src/libs/vtools/dialogs/tools/dialogalongline.ui @@ -26,7 +26,7 @@ Point at distance along line - + :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png @@ -104,7 +104,7 @@ ... - + :/icon/24x24/fx.png:/icon/24x24/fx.png @@ -121,7 +121,7 @@ - :/icon/24x24/equal.png + :/icon/24x24/equal.png @@ -332,7 +332,7 @@ buttonBox - + diff --git a/src/libs/vtools/dialogs/tools/dialogarc.ui b/src/libs/vtools/dialogs/tools/dialogarc.ui index cbf075d3c..e109c121d 100644 --- a/src/libs/vtools/dialogs/tools/dialogarc.ui +++ b/src/libs/vtools/dialogs/tools/dialogarc.ui @@ -26,7 +26,7 @@ Arc - + :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png @@ -104,7 +104,7 @@ ... - + :/icon/24x24/fx.png:/icon/24x24/fx.png @@ -121,7 +121,7 @@ - :/icon/24x24/equal.png + :/icon/24x24/equal.png @@ -279,7 +279,7 @@ ... - + :/icon/24x24/fx.png:/icon/24x24/fx.png @@ -296,7 +296,7 @@ - :/icon/24x24/equal.png + :/icon/24x24/equal.png @@ -454,7 +454,7 @@ ... - + :/icon/24x24/fx.png:/icon/24x24/fx.png @@ -471,7 +471,7 @@ - :/icon/24x24/equal.png + :/icon/24x24/equal.png @@ -615,7 +615,7 @@ comboBoxColor - + diff --git a/src/libs/vtools/dialogs/tools/dialogarcwithlength.ui b/src/libs/vtools/dialogs/tools/dialogarcwithlength.ui index 7bf711e4d..160b93d91 100644 --- a/src/libs/vtools/dialogs/tools/dialogarcwithlength.ui +++ b/src/libs/vtools/dialogs/tools/dialogarcwithlength.ui @@ -14,7 +14,7 @@ Dialog - + :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png @@ -89,7 +89,7 @@ ... - + :/icon/24x24/fx.png:/icon/24x24/fx.png @@ -106,7 +106,7 @@ - :/icon/24x24/equal.png + :/icon/24x24/equal.png @@ -264,7 +264,7 @@ ... - + :/icon/24x24/fx.png:/icon/24x24/fx.png @@ -281,7 +281,7 @@ - :/icon/24x24/equal.png + :/icon/24x24/equal.png @@ -439,7 +439,7 @@ ... - + :/icon/24x24/fx.png:/icon/24x24/fx.png @@ -456,7 +456,7 @@ - :/icon/24x24/equal.png + :/icon/24x24/equal.png @@ -590,7 +590,7 @@ - + diff --git a/src/libs/vtools/dialogs/tools/dialogbisector.ui b/src/libs/vtools/dialogs/tools/dialogbisector.ui index 39c8fb9a0..5ada8d3ef 100644 --- a/src/libs/vtools/dialogs/tools/dialogbisector.ui +++ b/src/libs/vtools/dialogs/tools/dialogbisector.ui @@ -26,7 +26,7 @@ Point along bisector - + :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png @@ -101,7 +101,7 @@ ... - + :/icon/24x24/fx.png:/icon/24x24/fx.png @@ -118,7 +118,7 @@ - :/icon/24x24/equal.png + :/icon/24x24/equal.png @@ -356,7 +356,7 @@ buttonBox - + diff --git a/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.ui b/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.ui index 87233f23b..6ae91c45c 100644 --- a/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.ui +++ b/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.ui @@ -26,7 +26,7 @@ Point intersect curve and axis - + :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png @@ -101,7 +101,7 @@ ... - + :/icon/24x24/fx.png:/icon/24x24/fx.png @@ -118,7 +118,7 @@ - :/icon/24x24/equal.png + :/icon/24x24/equal.png @@ -342,7 +342,7 @@ buttonBox - + diff --git a/src/libs/vtools/dialogs/tools/dialogcutarc.ui b/src/libs/vtools/dialogs/tools/dialogcutarc.ui index 2928da2d7..ca11fcace 100644 --- a/src/libs/vtools/dialogs/tools/dialogcutarc.ui +++ b/src/libs/vtools/dialogs/tools/dialogcutarc.ui @@ -26,7 +26,7 @@ Segment an arc - + :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png @@ -101,7 +101,7 @@ ... - + :/icon/24x24/fx.png:/icon/24x24/fx.png @@ -118,7 +118,7 @@ - :/icon/24x24/equal.png + :/icon/24x24/equal.png @@ -278,7 +278,7 @@ buttonBox - + diff --git a/src/libs/vtools/dialogs/tools/dialogcutspline.ui b/src/libs/vtools/dialogs/tools/dialogcutspline.ui index 74792b668..c79f33944 100644 --- a/src/libs/vtools/dialogs/tools/dialogcutspline.ui +++ b/src/libs/vtools/dialogs/tools/dialogcutspline.ui @@ -26,7 +26,7 @@ Segmenting a simple curve - + :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png @@ -101,7 +101,7 @@ ... - + :/icon/24x24/fx.png:/icon/24x24/fx.png @@ -118,7 +118,7 @@ - :/icon/24x24/equal.png + :/icon/24x24/equal.png @@ -278,7 +278,7 @@ buttonBox - + diff --git a/src/libs/vtools/dialogs/tools/dialogcutsplinepath.ui b/src/libs/vtools/dialogs/tools/dialogcutsplinepath.ui index 5244a8555..df377dbb6 100644 --- a/src/libs/vtools/dialogs/tools/dialogcutsplinepath.ui +++ b/src/libs/vtools/dialogs/tools/dialogcutsplinepath.ui @@ -26,7 +26,7 @@ Segment a curved path - + :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png @@ -101,7 +101,7 @@ ... - + :/icon/24x24/fx.png:/icon/24x24/fx.png @@ -118,7 +118,7 @@ - :/icon/24x24/equal.png + :/icon/24x24/equal.png @@ -284,7 +284,7 @@ buttonBox - + diff --git a/src/libs/vtools/dialogs/tools/dialogdetail.ui b/src/libs/vtools/dialogs/tools/dialogdetail.ui index a21aa9f2e..84986db68 100644 --- a/src/libs/vtools/dialogs/tools/dialogdetail.ui +++ b/src/libs/vtools/dialogs/tools/dialogdetail.ui @@ -26,7 +26,7 @@ Seam allowance tool - + :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png @@ -341,7 +341,7 @@ buttonBox - + diff --git a/src/libs/vtools/dialogs/tools/dialogendline.ui b/src/libs/vtools/dialogs/tools/dialogendline.ui index 59e23a2b9..b5987b88b 100644 --- a/src/libs/vtools/dialogs/tools/dialogendline.ui +++ b/src/libs/vtools/dialogs/tools/dialogendline.ui @@ -32,7 +32,7 @@ Point at distance and angle - + :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png @@ -119,7 +119,7 @@ ... - + :/icon/24x24/fx.png:/icon/24x24/fx.png @@ -142,7 +142,7 @@ - :/icon/24x24/equal.png + :/icon/24x24/equal.png @@ -309,7 +309,7 @@ ... - + :/icon/24x24/fx.png:/icon/24x24/fx.png @@ -332,7 +332,7 @@ - :/icon/24x24/equal.png + :/icon/24x24/equal.png @@ -542,7 +542,7 @@ buttonBox - + diff --git a/src/libs/vtools/dialogs/tools/dialogheight.ui b/src/libs/vtools/dialogs/tools/dialogheight.ui index e5494b1ab..aafacec1a 100644 --- a/src/libs/vtools/dialogs/tools/dialogheight.ui +++ b/src/libs/vtools/dialogs/tools/dialogheight.ui @@ -26,7 +26,7 @@ Perpendicular point along line - + :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png @@ -179,7 +179,7 @@ buttonBox - + diff --git a/src/libs/vtools/dialogs/tools/dialogline.ui b/src/libs/vtools/dialogs/tools/dialogline.ui index db4c924e0..1c45f5ce1 100644 --- a/src/libs/vtools/dialogs/tools/dialogline.ui +++ b/src/libs/vtools/dialogs/tools/dialogline.ui @@ -29,7 +29,7 @@ Line between points - + :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png @@ -174,7 +174,7 @@ buttonBox - + diff --git a/src/libs/vtools/dialogs/tools/dialoglineintersect.ui b/src/libs/vtools/dialogs/tools/dialoglineintersect.ui index fb013cda4..648c72d67 100644 --- a/src/libs/vtools/dialogs/tools/dialoglineintersect.ui +++ b/src/libs/vtools/dialogs/tools/dialoglineintersect.ui @@ -26,7 +26,7 @@ Point at line intersection - + :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png @@ -148,7 +148,7 @@ buttonBox - + diff --git a/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.ui b/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.ui index 8026551fa..4de96771e 100644 --- a/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.ui +++ b/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.ui @@ -26,7 +26,7 @@ Point intersect line and axis - + :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png @@ -101,7 +101,7 @@ ... - + :/icon/24x24/fx.png:/icon/24x24/fx.png @@ -118,7 +118,7 @@ - :/icon/24x24/equal.png + :/icon/24x24/equal.png @@ -360,7 +360,7 @@ buttonBox - + diff --git a/src/libs/vtools/dialogs/tools/dialognormal.ui b/src/libs/vtools/dialogs/tools/dialognormal.ui index aad5d0f30..6f65732ac 100644 --- a/src/libs/vtools/dialogs/tools/dialognormal.ui +++ b/src/libs/vtools/dialogs/tools/dialognormal.ui @@ -26,7 +26,7 @@ Point along perpendicular - + :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png @@ -104,7 +104,7 @@ ... - + :/icon/24x24/fx.png:/icon/24x24/fx.png @@ -121,7 +121,7 @@ - :/icon/24x24/equal.png + :/icon/24x24/equal.png @@ -309,7 +309,7 @@ ... - + :/icon/32x32/arrowRight.png:/icon/32x32/arrowRight.png @@ -348,7 +348,7 @@ ... - + :/icon/32x32/arrowLeftUp.png:/icon/32x32/arrowLeftUp.png @@ -365,7 +365,7 @@ ... - + :/icon/32x32/arrowRightUp.png:/icon/32x32/arrowRightUp.png @@ -388,7 +388,7 @@ ... - + :/icon/32x32/arrowUp.png:/icon/32x32/arrowUp.png @@ -405,7 +405,7 @@ ... - + :/icon/32x32/arrowLeft.png:/icon/32x32/arrowLeft.png @@ -422,7 +422,7 @@ ... - + :/icon/32x32/arrowLeftDown.png:/icon/32x32/arrowLeftDown.png @@ -439,7 +439,7 @@ ... - + :/icon/32x32/arrowDown.png:/icon/32x32/arrowDown.png @@ -456,7 +456,7 @@ ... - + :/icon/32x32/arrowRightDown.png:/icon/32x32/arrowRightDown.png @@ -547,7 +547,7 @@ buttonBox - + diff --git a/src/libs/vtools/dialogs/tools/dialogpointfromarcandtangent.ui b/src/libs/vtools/dialogs/tools/dialogpointfromarcandtangent.ui index bf40054db..d6fe08701 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointfromarcandtangent.ui +++ b/src/libs/vtools/dialogs/tools/dialogpointfromarcandtangent.ui @@ -26,7 +26,7 @@ Dialog - + :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png @@ -134,7 +134,7 @@ - + diff --git a/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.ui b/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.ui index 50564e271..09023d980 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.ui +++ b/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.ui @@ -26,7 +26,7 @@ Dialog - + :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png @@ -101,7 +101,7 @@ ... - + :/icon/24x24/fx.png:/icon/24x24/fx.png @@ -118,7 +118,7 @@ - :/icon/24x24/equal.png + :/icon/24x24/equal.png @@ -312,7 +312,7 @@ - + diff --git a/src/libs/vtools/dialogs/tools/dialogpointofcontact.ui b/src/libs/vtools/dialogs/tools/dialogpointofcontact.ui index 5f8f69550..645527ba9 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofcontact.ui +++ b/src/libs/vtools/dialogs/tools/dialogpointofcontact.ui @@ -26,7 +26,7 @@ Point at intersection of arc and line - + :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png @@ -104,7 +104,7 @@ ... - + :/icon/24x24/fx.png:/icon/24x24/fx.png @@ -121,7 +121,7 @@ - :/icon/24x24/equal.png + :/icon/24x24/equal.png @@ -352,7 +352,7 @@ buttonBox - + diff --git a/src/libs/vtools/dialogs/tools/dialogpointofintersection.ui b/src/libs/vtools/dialogs/tools/dialogpointofintersection.ui index 6a7844388..504b4dfa8 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofintersection.ui +++ b/src/libs/vtools/dialogs/tools/dialogpointofintersection.ui @@ -26,7 +26,7 @@ Point from X and Y of two other points - + :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png @@ -122,7 +122,7 @@ buttonBox - + diff --git a/src/libs/vtools/dialogs/tools/dialogpointofintersectionarcs.ui b/src/libs/vtools/dialogs/tools/dialogpointofintersectionarcs.ui index f31d4cba7..47f1b1583 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofintersectionarcs.ui +++ b/src/libs/vtools/dialogs/tools/dialogpointofintersectionarcs.ui @@ -26,7 +26,7 @@ Dialog - + :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png @@ -116,7 +116,7 @@ - + diff --git a/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.ui b/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.ui index d2948009e..a60f00351 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.ui +++ b/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.ui @@ -26,7 +26,7 @@ Dialog - + :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png @@ -101,7 +101,7 @@ ... - + :/icon/24x24/fx.png:/icon/24x24/fx.png @@ -118,7 +118,7 @@ - :/icon/24x24/equal.png + :/icon/24x24/equal.png @@ -276,7 +276,7 @@ ... - + :/icon/24x24/fx.png:/icon/24x24/fx.png @@ -293,7 +293,7 @@ - :/icon/24x24/equal.png + :/icon/24x24/equal.png @@ -487,7 +487,7 @@ - + diff --git a/src/libs/vtools/dialogs/tools/dialogshoulderpoint.ui b/src/libs/vtools/dialogs/tools/dialogshoulderpoint.ui index 95fe903d4..27d24a8b5 100644 --- a/src/libs/vtools/dialogs/tools/dialogshoulderpoint.ui +++ b/src/libs/vtools/dialogs/tools/dialogshoulderpoint.ui @@ -26,7 +26,7 @@ Special point on shoulder - + :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png @@ -104,7 +104,7 @@ ... - + :/icon/24x24/fx.png:/icon/24x24/fx.png @@ -121,7 +121,7 @@ - :/icon/24x24/equal.png + :/icon/24x24/equal.png @@ -392,7 +392,7 @@ buttonBox - + diff --git a/src/libs/vtools/dialogs/tools/dialogsinglepoint.ui b/src/libs/vtools/dialogs/tools/dialogsinglepoint.ui index e31b7c17d..183fb8011 100644 --- a/src/libs/vtools/dialogs/tools/dialogsinglepoint.ui +++ b/src/libs/vtools/dialogs/tools/dialogsinglepoint.ui @@ -29,7 +29,7 @@ Single point - + :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png @@ -120,7 +120,7 @@ buttonBox - + diff --git a/src/libs/vtools/dialogs/tools/dialogspline.ui b/src/libs/vtools/dialogs/tools/dialogspline.ui index 9ca8fb73a..2642fd93b 100644 --- a/src/libs/vtools/dialogs/tools/dialogspline.ui +++ b/src/libs/vtools/dialogs/tools/dialogspline.ui @@ -26,7 +26,7 @@ Simple curve - + :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png @@ -243,7 +243,7 @@ buttonBox - + diff --git a/src/libs/vtools/dialogs/tools/dialogsplinepath.ui b/src/libs/vtools/dialogs/tools/dialogsplinepath.ui index 23d7876eb..1c2e0475d 100644 --- a/src/libs/vtools/dialogs/tools/dialogsplinepath.ui +++ b/src/libs/vtools/dialogs/tools/dialogsplinepath.ui @@ -26,7 +26,7 @@ Curved path - + :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png @@ -232,7 +232,7 @@ buttonBox - + diff --git a/src/libs/vtools/dialogs/tools/dialogtriangle.ui b/src/libs/vtools/dialogs/tools/dialogtriangle.ui index 18496b42d..04eaf7a29 100644 --- a/src/libs/vtools/dialogs/tools/dialogtriangle.ui +++ b/src/libs/vtools/dialogs/tools/dialogtriangle.ui @@ -26,7 +26,7 @@ Triangle tool - + :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png @@ -154,7 +154,7 @@ buttonBox - + diff --git a/src/libs/vtools/dialogs/tools/dialoguniondetails.ui b/src/libs/vtools/dialogs/tools/dialoguniondetails.ui index 1135140c7..ebdbb9039 100644 --- a/src/libs/vtools/dialogs/tools/dialoguniondetails.ui +++ b/src/libs/vtools/dialogs/tools/dialoguniondetails.ui @@ -29,7 +29,7 @@ Union tool - + :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png @@ -59,7 +59,7 @@ buttonBox - +