2 changed files with 54 additions and 0 deletions
@ -0,0 +1,26 @@ |
|||||
|
#include "DeselectSurfaceCmd.h" |
||||
|
|
||||
|
namespace ofx { |
||||
|
namespace piMapper { |
||||
|
|
||||
|
DeselectSurfaceCmd::DeselectSurfaceCmd(SurfaceManager * sm){ |
||||
|
_surfaceManager = sm; |
||||
|
_surface = 0; |
||||
|
} |
||||
|
|
||||
|
void DeselectSurfaceCmd::exec(){ |
||||
|
ofLogNotice("DeselectSurfaceCmd", "exec"); |
||||
|
_surface = _surfaceManager->getSelectedSurface(); |
||||
|
_selectedVertexIndex = _surfaceManager->getSelectedVertexIndex(); |
||||
|
_surfaceManager->deselectSurface(); |
||||
|
} |
||||
|
|
||||
|
void DeselectSurfaceCmd::undo(){ |
||||
|
ofLogNotice("DeselectSurfaceCmd", "undo"); |
||||
|
_surfaceManager->selectSurface(_surface); |
||||
|
_surfaceManager->selectVertex(_selectedVertexIndex); |
||||
|
} |
||||
|
|
||||
|
} // namespace piMapper
|
||||
|
} // namespace ofx
|
||||
|
|
@ -0,0 +1,28 @@ |
|||||
|
#pragma once |
||||
|
|
||||
|
#include "SurfaceManager.h" |
||||
|
#include "BaseCmd.h" |
||||
|
#include "BaseSurface.h" |
||||
|
|
||||
|
class ofxPiMapper; |
||||
|
|
||||
|
namespace ofx { |
||||
|
namespace piMapper { |
||||
|
|
||||
|
class DeselectSurfaceCmd : public BaseUndoCmd { |
||||
|
|
||||
|
public: |
||||
|
DeselectSurfaceCmd(SurfaceManager * sm); |
||||
|
void exec(); |
||||
|
void undo(); |
||||
|
|
||||
|
private: |
||||
|
SurfaceManager * _surfaceManager; |
||||
|
BaseSurface * _surface; |
||||
|
int _selectedVertexIndex; |
||||
|
|
||||
|
}; |
||||
|
|
||||
|
} // namespace piMapper
|
||||
|
} // namespace ofx
|
||||
|
|
Loading…
Reference in new issue