From a5dc7adafa3d1a752d668007ec2abfa0a6d6b3ac Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Tue, 25 Apr 2017 14:10:35 +0200 Subject: [PATCH] Add ofxPiMapper::deselect() --- src/Application/Application.cpp | 6 ++++++ src/Application/Application.h | 2 ++ src/ofxPiMapper.cpp | 4 ++++ src/ofxPiMapper.h | 1 + 4 files changed, 13 insertions(+) diff --git a/src/Application/Application.cpp b/src/Application/Application.cpp index aa1813d..8cd10b1 100644 --- a/src/Application/Application.cpp +++ b/src/Application/Application.cpp @@ -541,5 +541,11 @@ void Application::undo(){ _cmdManager.undo(); } +void Application::deselect(){ + if(getSurfaceManager()->getSelectedSurface() != 0){ + getCmdManager()->exec(new DeselectSurfaceCmd(getSurfaceManager())); + } +} + } // namespace piMapper } // namespace ofx diff --git a/src/Application/Application.h b/src/Application/Application.h index 82528b7..db384af 100644 --- a/src/Application/Application.h +++ b/src/Application/Application.h @@ -36,6 +36,7 @@ #include "ToggleAnimatedSourceCmd.h" #include "SelNextTexCoordCmd.h" #include "SelPrevTexCoordCmd.h" +#include "DeselectSurfaceCmd.h" // Modes #include "ApplicationBaseMode.h" @@ -132,6 +133,7 @@ class Application { // TODO: Add moveVertex. // Make it so that other parts of the application react to the change. void undo(); + void deselect(); void setPreset(unsigned int i); void setNextPreset(); diff --git a/src/ofxPiMapper.cpp b/src/ofxPiMapper.cpp index e71be26..15c36c4 100644 --- a/src/ofxPiMapper.cpp +++ b/src/ofxPiMapper.cpp @@ -206,6 +206,10 @@ void ofxPiMapper::undo(){ _application.undo(); } +void ofxPiMapper::deselect(){ + _application.deselect(); +} + void ofxPiMapper::setMode(ofx::piMapper::Mode m){ if(m == ofx::piMapper::PRESENTATION_MODE){ _application.setPresentationMode(); diff --git a/src/ofxPiMapper.h b/src/ofxPiMapper.h index 460a76a..3c51134 100644 --- a/src/ofxPiMapper.h +++ b/src/ofxPiMapper.h @@ -29,6 +29,7 @@ class ofxPiMapper { void setInfoText(string text); void toggleInfo(); void undo(); + void deselect(); // Modes void setMode(ofx::piMapper::Mode m);