Browse Source

Add ofxPiMapper::toggleLayerPanel

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

6
src/Application/Application.cpp

@ -564,5 +564,11 @@ void Application::deselect(){
}
}
void Application::toggleLayerPanel(){
if(getState() == ProjectionMappingMode::instance()){
ProjectionMappingMode::instance()->toggleLayerPanel();
}
}
} // namespace piMapper
} // namespace ofx

1
src/Application/Application.h

@ -139,6 +139,7 @@ class Application {
// Make it so that other parts of the application react to the change.
void undo();
void deselect();
void toggleLayerPanel();
void setPreset(unsigned int i);
void setNextPreset();

6
src/Application/Modes/ProjectionMappingMode.cpp

@ -49,6 +49,10 @@ void ProjectionMappingMode::draw(Application * app){
Gui::instance()->getSurfaceHighlightWidget().draw();
}
void ProjectionMappingMode::toggleLayerPanel(){
_bDrawLayerPanel = !_bDrawLayerPanel;
}
void ProjectionMappingMode::onKeyPressed(Application * app, ofKeyEventArgs & args){
switch(args.key){
@ -173,7 +177,7 @@ void ProjectionMappingMode::onKeyPressed(Application * app, ofKeyEventArgs & arg
break;
case 'l':
_bDrawLayerPanel = !_bDrawLayerPanel;
toggleLayerPanel();
break;
/*

3
src/Application/Modes/ProjectionMappingMode.h

@ -23,6 +23,9 @@ class ProjectionMappingMode : public ApplicationBaseMode {
void setup(Application * app);
void update(Application * app);
void draw(Application * app);
void toggleLayerPanel();
void onKeyPressed(Application * app, ofKeyEventArgs & args);
void onMousePressed(Application * app, ofMouseEventArgs & args);
void onMouseReleased(Application * app, ofMouseEventArgs & args);

4
src/ofxPiMapper.cpp

@ -260,3 +260,7 @@ ofx::piMapper::Mode ofxPiMapper::getMode(){
}
return ofx::piMapper::PRESENTATION_MODE;
}
void ofxPiMapper::toggleLayerPanel(){
_application.toggleLayerPanel();
}

3
src/ofxPiMapper.h

@ -36,6 +36,9 @@ class ofxPiMapper {
// Modes
void setMode(ofx::piMapper::Mode m);
ofx::piMapper::Mode getMode();
// Projection mapping mode only
void toggleLayerPanel();
// Project
void saveProject();

Loading…
Cancel
Save