2 changed files with 50 additions and 0 deletions
@ -0,0 +1,23 @@ |
|||||
|
#include "SelVertexCmd.h" |
||||
|
|
||||
|
namespace ofx { |
||||
|
namespace piMapper { |
||||
|
|
||||
|
SelVertexCmd::SelVertexCmd(SurfaceManager * sm, int i){ |
||||
|
_surfaceManager = sm; |
||||
|
_newVertexIndex = i; |
||||
|
} |
||||
|
|
||||
|
void SelVertexCmd::exec(){ |
||||
|
_prevVertexIndex = _surfaceManager->getSelectedVertexIndex(); |
||||
|
_surfaceManager->selectVertex(_newVertexIndex); |
||||
|
} |
||||
|
|
||||
|
void SelVertexCmd::undo(){ |
||||
|
ofLogNotice("SelVertexCmd", "undo"); |
||||
|
_surfaceManager->selectVertex(_prevVertexIndex); |
||||
|
} |
||||
|
|
||||
|
} // namespace piMapper
|
||||
|
} // namespace ofx
|
||||
|
|
@ -0,0 +1,27 @@ |
|||||
|
#pragma once |
||||
|
|
||||
|
#include "BaseCmd.h" |
||||
|
#include "SurfaceManager.h" |
||||
|
|
||||
|
class ofxPiMapper; |
||||
|
|
||||
|
namespace ofx { |
||||
|
namespace piMapper { |
||||
|
|
||||
|
class SelVertexCmd : public BaseUndoCmd { |
||||
|
|
||||
|
public: |
||||
|
SelVertexCmd(SurfaceManager * sm, int i); |
||||
|
void exec(); |
||||
|
void undo(); |
||||
|
|
||||
|
private: |
||||
|
SurfaceManager * _surfaceManager; |
||||
|
int _newVertexIndex; |
||||
|
int _prevVertexIndex; |
||||
|
|
||||
|
}; |
||||
|
|
||||
|
} // namespace piMapper
|
||||
|
} // namespace ofx
|
||||
|
|
Loading…
Reference in new issue