Browse Source

Add `MvSelectionCmd`

master
Krisjanis Rijnieks 9 years ago
parent
commit
104c13f979
  1. 23
      src/Commands/MvSelectionCmd.cpp
  2. 24
      src/Commands/MvSelectionCmd.h

23
src/Commands/MvSelectionCmd.cpp

@ -0,0 +1,23 @@
#include "MvSelectionCmd.h"
namespace ofx {
namespace piMapper {
MvSelectionCmd::MvSelectionCmd(SurfaceManager * sm, ofVec2f moveBy){
_surfaceManager = sm;
_movedBy = moveBy;
}
void MvSelectionCmd::exec(){
ofLogNotice("MvSelectionCmd", "exec");
_surfaceManager->moveSelectionBy(_movedBy);
}
void MvSelectionCmd::undo(){
ofLogNotice("MvSelectionCmd", "undo");
_surfaceManager->moveSelectionBy(-_movedBy);
}
} // namespace piMapper
} // namespace ofx

24
src/Commands/MvSelectionCmd.h

@ -0,0 +1,24 @@
#pragma once
#include "BaseCmd.h"
#include "SurfaceManager.h"
namespace ofx {
namespace piMapper {
class MvSelectionCmd : public BaseUndoCmd {
public:
MvSelectionCmd(SurfaceManager * sm, ofVec2f moveBy);
void exec();
void undo();
private:
SurfaceManager * _surfaceManager;
ofVec2f _movedBy;
};
} // namespace piMapper
} // namespace ofx
Loading…
Cancel
Save