Browse Source

Add ofxPiMapper::duplicateSurface()

master
Krisjanis Rijnieks 8 years ago
parent
commit
b3bc344ed7
  1. 9
      src/Application/Application.cpp
  2. 1
      src/Application/Application.h
  3. 7
      src/Application/Modes/ProjectionMappingMode.cpp
  4. 4
      src/ofxPiMapper.cpp
  5. 1
      src/ofxPiMapper.h

9
src/Application/Application.cpp

@ -345,5 +345,14 @@ void Application::moveLayerDown(){
}
}
void Application::duplicateSurface(){
if(getSurfaceManager()->getSelectedSurface() != 0){
getCmdManager()->exec(
new DuplicateSurfaceCmd(
getSurfaceManager()->getSelectedSurface(),
getSurfaceManager()));
}
}
} // namespace piMapper
} // namespace ofx

1
src/Application/Application.h

@ -77,6 +77,7 @@ class Application : public KeyListener {
void setSourceMode();
void moveLayerUp();
void moveLayerDown();
void duplicateSurface();
void setPreset(unsigned int i);
void setNextPreset();

7
src/Application/Modes/ProjectionMappingMode.cpp

@ -221,12 +221,7 @@ void ProjectionMappingMode::onKeyPressed(Application * app, ofKeyEventArgs & arg
break;
case 'd':
if(app->getSurfaceManager()->getSelectedSurface() != 0){
app->getCmdManager()->exec(
new DuplicateSurfaceCmd(
app->getSurfaceManager()->getSelectedSurface(),
app->getSurfaceManager()));
}
app->duplicateSurface();
break;
case '0': // Move selected surface up the layer stack

4
src/ofxPiMapper.cpp

@ -91,6 +91,10 @@ void ofxPiMapper::selectPrevSurface(){
_application.getState()->selectPrevSurface(&_application);
}
void ofxPiMapper::duplicateSurface(){
_application.duplicateSurface();
}
void ofxPiMapper::selectNextVertex(){
_application.getState()->selectNextVertex(&_application);
}

1
src/ofxPiMapper.h

@ -49,6 +49,7 @@ class ofxPiMapper {
void selectSurface(int i);
void selectNextSurface();
void selectPrevSurface();
void duplicateSurface();
void selectNextVertex();
void selectPrevVertex();
void moveLayerUp();

Loading…
Cancel
Save