2 changed files with 47 additions and 0 deletions
@ -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
|
||||
|
|
@ -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…
Reference in new issue