Browse Source

Add ofxPiMapper::setNextSource()

master
Krisjanis Rijnieks 8 years ago
parent
commit
b6bbf5526b
  1. 11
      src/Application/Application.cpp
  2. 1
      src/Application/Application.h
  3. 9
      src/Application/Modes/ProjectionMappingMode.cpp
  4. 9
      src/Application/Modes/TextureMappingMode.cpp
  5. 4
      src/ofxPiMapper.cpp
  6. 3
      src/ofxPiMapper.h

11
src/Application/Application.cpp

@ -358,5 +358,16 @@ void Application::duplicateSurface(){
}
}
void Application::setNextSource(){
if(getSurfaceManager()->getSelectedSurface() != 0){
getCmdManager()->exec(
new SetNextSourceCmd(
getSurfaceManager()->getSelectedSurface(),
&Gui::instance()->getSourcesEditorWidget()));
}else{
getCmdManager()->exec(new SelNextSurfaceCmd(getSurfaceManager()));
}
}
} // namespace piMapper
} // namespace ofx

1
src/Application/Application.h

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

9
src/Application/Modes/ProjectionMappingMode.cpp

@ -210,14 +210,7 @@ void ProjectionMappingMode::onKeyPressed(Application * app, ofKeyEventArgs & arg
break;
case OF_KEY_TAB:
if(app->getSurfaceManager()->getSelectedSurface() != 0){
app->getCmdManager()->exec(
new SetNextSourceCmd(
app->getSurfaceManager()->getSelectedSurface(),
&Gui::instance()->getSourcesEditorWidget()));
}else{
app->getCmdManager()->exec(new SelNextSurfaceCmd(app->getSurfaceManager()));
}
app->setNextSource();
break;
case 'd':

9
src/Application/Modes/TextureMappingMode.cpp

@ -130,14 +130,7 @@ void TextureMappingMode::onKeyPressed(Application * app, ofKeyEventArgs & args){
break;
case OF_KEY_TAB:
if(app->getSurfaceManager()->getSelectedSurface() != 0){
app->getCmdManager()->exec(
new SetNextSourceCmd(
app->getSurfaceManager()->getSelectedSurface(),
&Gui::instance()->getSourcesEditorWidget()));
}else{
app->getCmdManager()->exec(new SelNextSurfaceCmd(app->getSurfaceManager()));
}
app->setNextSource();
break;
case '0': // Next draw mode

4
src/ofxPiMapper.cpp

@ -134,6 +134,10 @@ void ofxPiMapper::eraseSurface(int i){
}
}
void ofxPiMapper::setNextSource(){
_application.setNextSource();
}
void ofxPiMapper::saveProject(){
_application.saveProject();
}

3
src/ofxPiMapper.h

@ -59,6 +59,9 @@ class ofxPiMapper {
void moveSelection(ofVec2f by);
void createSurface(ofx::piMapper::SurfaceType type);
void eraseSurface(int i);
// Sources, selected surface
void setNextSource();
private:
ofx::piMapper::Application _application;

Loading…
Cancel
Save