2 changed files with 53 additions and 0 deletions
@ -0,0 +1,23 @@ |
|||||
|
#include "ClearSurfacesCmd.h" |
||||
|
|
||||
|
namespace ofx { |
||||
|
namespace piMapper { |
||||
|
|
||||
|
ClearSurfacesCmd::ClearSurfacesCmd(){ |
||||
|
_surfaces = SurfaceStack::instance()->getSurfaces(); |
||||
|
} |
||||
|
|
||||
|
void ClearSurfacesCmd::exec(){ |
||||
|
SurfaceStack::instance()->clear(); |
||||
|
} |
||||
|
|
||||
|
void ClearSurfacesCmd::undo(){ |
||||
|
ofLogNotice("ClearSurfacesCmd", "undo"); |
||||
|
for(unsigned int i = 0; i < _surfaces.size(); ++i){ |
||||
|
SurfaceStack::instance()->push_back(_surfaces[i]); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} // namespace piMapper
|
||||
|
} // namespace ofx
|
||||
|
|
@ -0,0 +1,30 @@ |
|||||
|
// SelSurfaceCmd
|
||||
|
// Provides with option to undo select surface operation.
|
||||
|
// Created by Krisjanis Rijnieks 2015-05-14
|
||||
|
|
||||
|
#pragma once |
||||
|
|
||||
|
#include "BaseCmd.h" |
||||
|
#include "BaseSurface.h" |
||||
|
#include "SurfaceStack.h" |
||||
|
#include "Gui.h" |
||||
|
|
||||
|
namespace ofx { |
||||
|
namespace piMapper { |
||||
|
|
||||
|
class ClearSurfacesCmd : public BaseUndoCmd { |
||||
|
|
||||
|
public: |
||||
|
ClearSurfacesCmd(); |
||||
|
void exec(); |
||||
|
void undo(); |
||||
|
|
||||
|
private: |
||||
|
// Here it would make sense to have another instance of SurfaceStack
|
||||
|
vector<BaseSurface *> _surfaces; |
||||
|
|
||||
|
}; |
||||
|
|
||||
|
} // namespace piMapper
|
||||
|
} // namespace ofx
|
||||
|
|
Loading…
Reference in new issue