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 piMapper
} // namespace ofx } // namespace ofx

1
src/Application/Application.h

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

7
src/Application/Modes/ProjectionMappingMode.cpp

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

4
src/ofxPiMapper.cpp

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

1
src/ofxPiMapper.h

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

Loading…
Cancel
Save