CScaleNodeCommand: Make use of override where applicable

This commit is contained in:
Lioncash 2020-06-28 05:39:40 -04:00
parent fc2d48df87
commit 8c4e16d51e
2 changed files with 11 additions and 13 deletions

View File

@ -3,16 +3,13 @@
#include "Editor/INodeEditor.h" #include "Editor/INodeEditor.h"
CScaleNodeCommand::CScaleNodeCommand() CScaleNodeCommand::CScaleNodeCommand()
: IUndoCommand("Scale"), : IUndoCommand("Scale")
mpEditor(nullptr),
mCommandEnded(false)
{ {
} }
CScaleNodeCommand::CScaleNodeCommand(INodeEditor *pEditor, const QList<CSceneNode*>& rkNodes, bool UsePivot, const CVector3f& rkPivot, const CVector3f& rkDelta) CScaleNodeCommand::CScaleNodeCommand(INodeEditor *pEditor, const QList<CSceneNode*>& rkNodes, bool UsePivot, const CVector3f& rkPivot, const CVector3f& rkDelta)
: IUndoCommand("Scale"), : IUndoCommand("Scale"),
mpEditor(pEditor), mpEditor(pEditor)
mCommandEnded(false)
{ {
mNodeList.reserve(rkNodes.size()); mNodeList.reserve(rkNodes.size());

View File

@ -18,18 +18,19 @@ class CScaleNodeCommand : public IUndoCommand
CVector3f NewScale; CVector3f NewScale;
}; };
QList<SNodeScale> mNodeList; QList<SNodeScale> mNodeList;
INodeEditor *mpEditor; INodeEditor *mpEditor = nullptr;
bool mCommandEnded; bool mCommandEnded = false;
public: public:
CScaleNodeCommand(); CScaleNodeCommand();
CScaleNodeCommand(INodeEditor *pEditor, const QList<CSceneNode*>& rkNodes, bool UsePivot, const CVector3f& rkPivot, const CVector3f& rkDelta); CScaleNodeCommand(INodeEditor *pEditor, const QList<CSceneNode*>& rkNodes, bool UsePivot, const CVector3f& rkPivot, const CVector3f& rkDelta);
~CScaleNodeCommand(); ~CScaleNodeCommand() override;
int id() const;
bool mergeWith(const QUndoCommand *pkOther); int id() const override;
void undo(); bool mergeWith(const QUndoCommand *pkOther) override;
void redo(); void undo() override;
bool AffectsCleanState() const { return true; } void redo() override;
bool AffectsCleanState() const override { return true; }
static CScaleNodeCommand* End(); static CScaleNodeCommand* End();
}; };