Rename RotationMoveLabel class.
--HG-- branch : feature
This commit is contained in:
parent
9bb88afaa5
commit
bfde34c882
|
@ -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<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(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);
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
**
|
||||
*************************************************************************/
|
||||
|
||||
#include "rotationmovelabel.h"
|
||||
#include "operationmovelabel.h"
|
||||
|
||||
#include <QDomNode>
|
||||
#include <QDomNodeList>
|
||||
|
@ -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<const RotationMoveLabel *>(command);
|
||||
const OperationMoveLabel *moveCommand = static_cast<const OperationMoveLabel *>(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<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 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())
|
|
@ -1,6 +1,6 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file moverotationlabel.h
|
||||
** @file operationmovelabel.h
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date 13 5, 2016
|
||||
**
|
||||
|
@ -26,8 +26,8 @@
|
|||
**
|
||||
*************************************************************************/
|
||||
|
||||
#ifndef ROTATIONMOVELABEL_H
|
||||
#define ROTATIONMOVELABEL_H
|
||||
#ifndef OPERATIONMOVELABEL_H
|
||||
#define OPERATIONMOVELABEL_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
#include <QDomElement>
|
||||
|
@ -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
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user