You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
750 B
32 lines
750 B
#include "RmSurfaceCmd.h"
|
|
|
|
namespace ofx {
|
|
namespace piMapper {
|
|
|
|
RmSurfaceCmd::RmSurfaceCmd(SurfaceManager * sm, int i){
|
|
_surfaceManager = sm;
|
|
_surface = 0;
|
|
_surfaceIndex = i;
|
|
}
|
|
|
|
void RmSurfaceCmd::exec(){
|
|
// Store the surface, this implies that the surfaceManager's
|
|
// removeSelectedSurface does not destroy the surface.
|
|
// The owner is being changed.
|
|
_surface = _surfaceManager->getSurface(_surfaceIndex);
|
|
_surfaceManager->removeSurface(_surfaceIndex);
|
|
}
|
|
|
|
void RmSurfaceCmd::undo(){
|
|
ofLogNotice("RmSurfaceCmd", "undo");
|
|
if(_surface == 0){
|
|
ofLogError("RmSurfaceCmd", "No surface stored");
|
|
}
|
|
_surfaceManager->addSurface(_surface);
|
|
_surfaceManager->selectSurface(_surface);
|
|
_surface = 0;
|
|
}
|
|
|
|
} // namespace piMapper
|
|
} // namespace ofx
|
|
|
|
|