From bfde34c8823961b8a42367c910933d3528dc3848 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 13 Sep 2016 11:47:33 +0300 Subject: [PATCH] Rename RotationMoveLabel class. --HG-- branch : feature --- .../drawTools/operation/vabstractoperation.cpp | 6 +++--- ...ionmovelabel.cpp => operationmovelabel.cpp} | 18 +++++++++--------- ...otationmovelabel.h => operationmovelabel.h} | 18 +++++++++--------- src/libs/vtools/undocommands/undocommands.pri | 8 ++++---- 4 files changed, 25 insertions(+), 25 deletions(-) rename src/libs/vtools/undocommands/label/{rotationmovelabel.cpp => operationmovelabel.cpp} (89%) rename src/libs/vtools/undocommands/label/{rotationmovelabel.h => operationmovelabel.h} (83%) diff --git a/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp b/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp index 0a032c3a8..6396bfe0b 100644 --- a/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp +++ b/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp @@ -27,7 +27,7 @@ *************************************************************************/ #include "vabstractoperation.h" -#include "../../../undocommands/label/rotationmovelabel.h" +#include "../../../undocommands/label/operationmovelabel.h" #include "../vgeometry/vpointf.h" const QString VAbstractOperation::TagItem = QStringLiteral("item"); @@ -419,8 +419,8 @@ void VAbstractOperation::RefreshDataInFile() void VAbstractOperation::UpdateNamePosition(quint32 id) { const QSharedPointer point = VAbstractTool::data.GeometricObject(id); - auto moveLabel = new RotationMoveLabel(this->id, doc, point->mx(), point->my(), id); - connect(moveLabel, &RotationMoveLabel::ChangePosition, this, &VAbstractOperation::DoChangePosition); + auto moveLabel = new OperationMoveLabel(this->id, doc, point->mx(), point->my(), id); + connect(moveLabel, &OperationMoveLabel::ChangePosition, this, &VAbstractOperation::DoChangePosition); qApp->getUndoStack()->push(moveLabel); } diff --git a/src/libs/vtools/undocommands/label/rotationmovelabel.cpp b/src/libs/vtools/undocommands/label/operationmovelabel.cpp similarity index 89% rename from src/libs/vtools/undocommands/label/rotationmovelabel.cpp rename to src/libs/vtools/undocommands/label/operationmovelabel.cpp index 89b2994e8..d83066110 100644 --- a/src/libs/vtools/undocommands/label/rotationmovelabel.cpp +++ b/src/libs/vtools/undocommands/label/operationmovelabel.cpp @@ -26,7 +26,7 @@ ** *************************************************************************/ -#include "rotationmovelabel.h" +#include "operationmovelabel.h" #include #include @@ -43,8 +43,8 @@ class QUndoCommand; //--------------------------------------------------------------------------------------------------------------------- -RotationMoveLabel::RotationMoveLabel(quint32 idTool, VAbstractPattern *doc, double x, double y, quint32 idPoint, - QUndoCommand *parent) +OperationMoveLabel::OperationMoveLabel(quint32 idTool, VAbstractPattern *doc, double x, double y, quint32 idPoint, + QUndoCommand *parent) : MoveAbstractLabel(doc, idPoint, x, y, parent), m_idTool(idTool) { @@ -69,14 +69,14 @@ RotationMoveLabel::RotationMoveLabel(quint32 idTool, VAbstractPattern *doc, doub } //--------------------------------------------------------------------------------------------------------------------- -RotationMoveLabel::~RotationMoveLabel() +OperationMoveLabel::~OperationMoveLabel() { } //--------------------------------------------------------------------------------------------------------------------- -bool RotationMoveLabel::mergeWith(const QUndoCommand *command) +bool OperationMoveLabel::mergeWith(const QUndoCommand *command) { - const RotationMoveLabel *moveCommand = static_cast(command); + const OperationMoveLabel *moveCommand = static_cast(command); SCASSERT(moveCommand != nullptr); if (moveCommand->GetToolId() != m_idTool && moveCommand->GetPointId() != nodeId) @@ -93,13 +93,13 @@ bool RotationMoveLabel::mergeWith(const QUndoCommand *command) } //--------------------------------------------------------------------------------------------------------------------- -int RotationMoveLabel::id() const +int OperationMoveLabel::id() const { return static_cast(UndoCommand::RotationMoveLabel); } //--------------------------------------------------------------------------------------------------------------------- -void RotationMoveLabel::Do(double mx, double my) +void OperationMoveLabel::Do(double mx, double my) { qCDebug(vUndo, "New mx %f", mx); qCDebug(vUndo, "New my %f", my); @@ -118,7 +118,7 @@ void RotationMoveLabel::Do(double mx, double my) } //--------------------------------------------------------------------------------------------------------------------- -QDomElement RotationMoveLabel::GetDestinationObject(quint32 idTool, quint32 idPoint) const +QDomElement OperationMoveLabel::GetDestinationObject(quint32 idTool, quint32 idPoint) const { const QDomElement tool = doc->elementById(idTool); if (tool.isElement()) diff --git a/src/libs/vtools/undocommands/label/rotationmovelabel.h b/src/libs/vtools/undocommands/label/operationmovelabel.h similarity index 83% rename from src/libs/vtools/undocommands/label/rotationmovelabel.h rename to src/libs/vtools/undocommands/label/operationmovelabel.h index 5308ddd02..b88f57f5b 100644 --- a/src/libs/vtools/undocommands/label/rotationmovelabel.h +++ b/src/libs/vtools/undocommands/label/operationmovelabel.h @@ -1,6 +1,6 @@ /************************************************************************ ** - ** @file moverotationlabel.h + ** @file operationmovelabel.h ** @author Roman Telezhynskyi ** @date 13 5, 2016 ** @@ -26,8 +26,8 @@ ** *************************************************************************/ -#ifndef ROTATIONMOVELABEL_H -#define ROTATIONMOVELABEL_H +#ifndef OPERATIONMOVELABEL_H +#define OPERATIONMOVELABEL_H #include #include @@ -42,13 +42,13 @@ class QDomElement; class QUndoCommand; class VAbstractPattern; -class RotationMoveLabel : public MoveAbstractLabel +class OperationMoveLabel : public MoveAbstractLabel { Q_OBJECT public: - RotationMoveLabel(quint32 idTool, VAbstractPattern *doc, double x, double y, quint32 idPoint, + OperationMoveLabel(quint32 idTool, VAbstractPattern *doc, double x, double y, quint32 idPoint, QUndoCommand *parent = nullptr); - virtual ~RotationMoveLabel(); + virtual ~OperationMoveLabel(); virtual bool mergeWith(const QUndoCommand *command) Q_DECL_OVERRIDE; virtual int id() const Q_DECL_OVERRIDE; @@ -57,16 +57,16 @@ public: protected: virtual void Do(double mx, double my) Q_DECL_OVERRIDE; private: - Q_DISABLE_COPY(RotationMoveLabel) + Q_DISABLE_COPY(OperationMoveLabel) quint32 m_idTool; QDomElement GetDestinationObject(quint32 idTool, quint32 idPoint) const; }; //--------------------------------------------------------------------------------------------------------------------- -inline quint32 RotationMoveLabel::GetToolId() const +inline quint32 OperationMoveLabel::GetToolId() const { return m_idTool; } -#endif // ROTATIONMOVELABEL_H +#endif // OPERATIONMOVELABEL_H diff --git a/src/libs/vtools/undocommands/undocommands.pri b/src/libs/vtools/undocommands/undocommands.pri index 39a455dc1..216944bb2 100644 --- a/src/libs/vtools/undocommands/undocommands.pri +++ b/src/libs/vtools/undocommands/undocommands.pri @@ -21,9 +21,9 @@ HEADERS += \ $$PWD/label/movedoublelabel.h \ $$PWD/addgroup.h \ $$PWD/delgroup.h \ - $$PWD/label/rotationmovelabel.h \ $$PWD/label/moveabstractlabel.h \ - $$PWD/toggledetailinlayout.h + $$PWD/toggledetailinlayout.h \ + $$PWD/label/operationmovelabel.h SOURCES += \ $$PWD/addtocalc.cpp \ @@ -45,6 +45,6 @@ SOURCES += \ $$PWD/label/movedoublelabel.cpp \ $$PWD/addgroup.cpp \ $$PWD/delgroup.cpp \ - $$PWD/label/rotationmovelabel.cpp \ $$PWD/label/moveabstractlabel.cpp \ - $$PWD/toggledetailinlayout.cpp + $$PWD/toggledetailinlayout.cpp \ + $$PWD/label/operationmovelabel.cpp