ofxPiMapper fixed for C++17 & oF 12.0
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.
 
 

27 lines
607 B

#include "AddGridRowCmd.h"
namespace ofx {
namespace piMapper {
AddGridRowCmd::AddGridRowCmd(GridWarpSurface * s){
_surface = s;
}
void AddGridRowCmd::exec(){
// TODO: Figure out nice math to not loose existing vertex positions
_vertices = _surface->getVertices();
_texCoords = _surface->getTexCoords();
_surface->setGridRows(_surface->getGridRows() + 1);
}
void AddGridRowCmd::undo(){
ofLogNotice("AddGridRowCmd", "undo");
_surface->setGridRows(_surface->getGridRows() - 1);
_surface->setVertices(_vertices);
_surface->setTexCoords(_texCoords);
}
} // namespace piMapper
} // namespace ofx