From a1f43634035fd97ac32dafe9c6e527b3de27ce1d Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Mon, 15 Aug 2016 21:47:54 +0200 Subject: [PATCH] Implement `MvLayerUpCmd` and `MvLayerDnCmd` into `ProectionMappingState` --- src/Application/ProjectionMappingState.cpp | 28 ++++++++++++++++++++++ src/Application/ProjectionMappingState.h | 2 ++ 2 files changed, 30 insertions(+) diff --git a/src/Application/ProjectionMappingState.cpp b/src/Application/ProjectionMappingState.cpp index 3a39048..ef49fe8 100644 --- a/src/Application/ProjectionMappingState.cpp +++ b/src/Application/ProjectionMappingState.cpp @@ -241,6 +241,34 @@ void ProjectionMappingState::onKeyPressed(Application * app, ofKeyEventArgs & ar } break; + case '0': // Move selected surface up the layer stack + if(app->getSurfaceManager()->getSelectedSurface() != 0){ + if(app->getSurfaceManager()->getSelectedSurface() == + SurfaceStack::instance()->at(SurfaceStack::instance()->size() - 1)){ + return; + } + + app->getCmdManager()->exec( + new MvLayerUpCmd( + app->getSurfaceManager()->getSelectedSurface()) + ); + } + break; + + case '9': // Move selected surface down the layer stack + if(app->getSurfaceManager()->getSelectedSurface() != 0){ + if(app->getSurfaceManager()->getSelectedSurface() == + SurfaceStack::instance()->at(0)){ + return; + } + + app->getCmdManager()->exec( + new MvLayerDnCmd( + app->getSurfaceManager()->getSelectedSurface()) + ); + } + break; + default: break; } diff --git a/src/Application/ProjectionMappingState.h b/src/Application/ProjectionMappingState.h index 8c0e840..c01ac74 100644 --- a/src/Application/ProjectionMappingState.h +++ b/src/Application/ProjectionMappingState.h @@ -23,6 +23,8 @@ #include "SetNextSourceCmd.h" #include "DuplicateSurfaceCmd.h" #include "ToggleAnimatedSourceCmd.h" +#include "MvLayerUpCmd.h" +#include "MvLayerDnCmd.h" #include "SurfaceType.h" #include "Gui.h"