Rename RotationMoveLabel class.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2016-09-13 11:47:33 +03:00
parent 9bb88afaa5
commit bfde34c882
4 changed files with 25 additions and 25 deletions

View file

@ -27,7 +27,7 @@
*************************************************************************/ *************************************************************************/
#include "vabstractoperation.h" #include "vabstractoperation.h"
#include "../../../undocommands/label/rotationmovelabel.h" #include "../../../undocommands/label/operationmovelabel.h"
#include "../vgeometry/vpointf.h" #include "../vgeometry/vpointf.h"
const QString VAbstractOperation::TagItem = QStringLiteral("item"); const QString VAbstractOperation::TagItem = QStringLiteral("item");
@ -419,8 +419,8 @@ void VAbstractOperation::RefreshDataInFile()
void VAbstractOperation::UpdateNamePosition(quint32 id) void VAbstractOperation::UpdateNamePosition(quint32 id)
{ {
const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(id); const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(id);
auto moveLabel = new RotationMoveLabel(this->id, doc, point->mx(), point->my(), id); auto moveLabel = new OperationMoveLabel(this->id, doc, point->mx(), point->my(), id);
connect(moveLabel, &RotationMoveLabel::ChangePosition, this, &VAbstractOperation::DoChangePosition); connect(moveLabel, &OperationMoveLabel::ChangePosition, this, &VAbstractOperation::DoChangePosition);
qApp->getUndoStack()->push(moveLabel); qApp->getUndoStack()->push(moveLabel);
} }

View file

@ -26,7 +26,7 @@
** **
*************************************************************************/ *************************************************************************/
#include "rotationmovelabel.h" #include "operationmovelabel.h"
#include <QDomNode> #include <QDomNode>
#include <QDomNodeList> #include <QDomNodeList>
@ -43,8 +43,8 @@
class QUndoCommand; class QUndoCommand;
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
RotationMoveLabel::RotationMoveLabel(quint32 idTool, VAbstractPattern *doc, double x, double y, quint32 idPoint, OperationMoveLabel::OperationMoveLabel(quint32 idTool, VAbstractPattern *doc, double x, double y, quint32 idPoint,
QUndoCommand *parent) QUndoCommand *parent)
: MoveAbstractLabel(doc, idPoint, x, y, parent), : MoveAbstractLabel(doc, idPoint, x, y, parent),
m_idTool(idTool) 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<const RotationMoveLabel *>(command); const OperationMoveLabel *moveCommand = static_cast<const OperationMoveLabel *>(command);
SCASSERT(moveCommand != nullptr); SCASSERT(moveCommand != nullptr);
if (moveCommand->GetToolId() != m_idTool && moveCommand->GetPointId() != nodeId) 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<int>(UndoCommand::RotationMoveLabel); return static_cast<int>(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 mx %f", mx);
qCDebug(vUndo, "New my %f", my); 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); const QDomElement tool = doc->elementById(idTool);
if (tool.isElement()) if (tool.isElement())

View file

@ -1,6 +1,6 @@
/************************************************************************ /************************************************************************
** **
** @file moverotationlabel.h ** @file operationmovelabel.h
** @author Roman Telezhynskyi <dismine(at)gmail.com> ** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date 13 5, 2016 ** @date 13 5, 2016
** **
@ -26,8 +26,8 @@
** **
*************************************************************************/ *************************************************************************/
#ifndef ROTATIONMOVELABEL_H #ifndef OPERATIONMOVELABEL_H
#define ROTATIONMOVELABEL_H #define OPERATIONMOVELABEL_H
#include <qcompilerdetection.h> #include <qcompilerdetection.h>
#include <QDomElement> #include <QDomElement>
@ -42,13 +42,13 @@ class QDomElement;
class QUndoCommand; class QUndoCommand;
class VAbstractPattern; class VAbstractPattern;
class RotationMoveLabel : public MoveAbstractLabel class OperationMoveLabel : public MoveAbstractLabel
{ {
Q_OBJECT Q_OBJECT
public: 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); QUndoCommand *parent = nullptr);
virtual ~RotationMoveLabel(); virtual ~OperationMoveLabel();
virtual bool mergeWith(const QUndoCommand *command) Q_DECL_OVERRIDE; virtual bool mergeWith(const QUndoCommand *command) Q_DECL_OVERRIDE;
virtual int id() const Q_DECL_OVERRIDE; virtual int id() const Q_DECL_OVERRIDE;
@ -57,16 +57,16 @@ public:
protected: protected:
virtual void Do(double mx, double my) Q_DECL_OVERRIDE; virtual void Do(double mx, double my) Q_DECL_OVERRIDE;
private: private:
Q_DISABLE_COPY(RotationMoveLabel) Q_DISABLE_COPY(OperationMoveLabel)
quint32 m_idTool; quint32 m_idTool;
QDomElement GetDestinationObject(quint32 idTool, quint32 idPoint) const; QDomElement GetDestinationObject(quint32 idTool, quint32 idPoint) const;
}; };
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
inline quint32 RotationMoveLabel::GetToolId() const inline quint32 OperationMoveLabel::GetToolId() const
{ {
return m_idTool; return m_idTool;
} }
#endif // ROTATIONMOVELABEL_H #endif // OPERATIONMOVELABEL_H

View file

@ -21,9 +21,9 @@ HEADERS += \
$$PWD/label/movedoublelabel.h \ $$PWD/label/movedoublelabel.h \
$$PWD/addgroup.h \ $$PWD/addgroup.h \
$$PWD/delgroup.h \ $$PWD/delgroup.h \
$$PWD/label/rotationmovelabel.h \
$$PWD/label/moveabstractlabel.h \ $$PWD/label/moveabstractlabel.h \
$$PWD/toggledetailinlayout.h $$PWD/toggledetailinlayout.h \
$$PWD/label/operationmovelabel.h
SOURCES += \ SOURCES += \
$$PWD/addtocalc.cpp \ $$PWD/addtocalc.cpp \
@ -45,6 +45,6 @@ SOURCES += \
$$PWD/label/movedoublelabel.cpp \ $$PWD/label/movedoublelabel.cpp \
$$PWD/addgroup.cpp \ $$PWD/addgroup.cpp \
$$PWD/delgroup.cpp \ $$PWD/delgroup.cpp \
$$PWD/label/rotationmovelabel.cpp \
$$PWD/label/moveabstractlabel.cpp \ $$PWD/label/moveabstractlabel.cpp \
$$PWD/toggledetailinlayout.cpp $$PWD/toggledetailinlayout.cpp \
$$PWD/label/operationmovelabel.cpp