2 changed files with 51 additions and 0 deletions
@ -0,0 +1,24 @@ |
|||||
|
#include "TogglePerspectiveCmd.h" |
||||
|
|
||||
|
namespace ofx { |
||||
|
namespace piMapper { |
||||
|
|
||||
|
TogglePerspectiveCmd::TogglePerspectiveCmd(QuadSurface * surface){ |
||||
|
_surface = surface; |
||||
|
} |
||||
|
|
||||
|
void TogglePerspectiveCmd::exec(){ |
||||
|
ofLogNotice("TogglePerspectiveCmd", "exec"); |
||||
|
_perspectiveBeforeExec = _surface->getPerspectiveWarping(); |
||||
|
_surface->setPerspectiveWarping(!_perspectiveBeforeExec); |
||||
|
} |
||||
|
|
||||
|
void TogglePerspectiveCmd::undo(){ |
||||
|
ofLogNotice("TogglePerspectiveCmd", "undo"); |
||||
|
_surface->setPerspectiveWarping(_perspectiveBeforeExec); |
||||
|
_surface = 0; |
||||
|
} |
||||
|
|
||||
|
} // namespace piMapper
|
||||
|
} // namespace ofx
|
||||
|
|
@ -0,0 +1,27 @@ |
|||||
|
#pragma once |
||||
|
|
||||
|
#include "BaseCmd.h" |
||||
|
#include "QuadSurface.h" |
||||
|
#include "SourcesEditor.h" |
||||
|
|
||||
|
namespace ofx { |
||||
|
namespace piMapper { |
||||
|
|
||||
|
class SourcesEditor; |
||||
|
|
||||
|
class TogglePerspectiveCmd : public BaseUndoCmd { |
||||
|
|
||||
|
public: |
||||
|
TogglePerspectiveCmd(QuadSurface * surface); |
||||
|
void exec(); |
||||
|
void undo(); |
||||
|
|
||||
|
private: |
||||
|
QuadSurface * _surface; |
||||
|
bool _perspectiveBeforeExec; |
||||
|
|
||||
|
}; |
||||
|
|
||||
|
} // namespace piMapper
|
||||
|
} // namespace ofx
|
||||
|
|
Loading…
Reference in new issue