Browse Source

Integrate `TogglePerspectiveCmd` into `ProjectionMappingState`

By hitting `p` while in the projection mapping editor, selected surface toggles perspective on and off
master
Krisjanis Rijnieks 10 years ago
parent
commit
6c4748e458
  1. 14
      src/Application/ProjectionMappingState.cpp
  2. 1
      src/Application/ProjectionMappingState.h

14
src/Application/ProjectionMappingState.cpp

@ -37,6 +37,20 @@ void ProjectionMappingState::onKeyPressed(Application * app, ofKeyEventArgs & ar
app->getOfxPiMapper()->getCmdManager()->exec(
new RmSurfaceCmd(app->getOfxPiMapper()));
break;
case 'p':
if(app->getOfxPiMapper()->getSurfaceManager()->getSelectedSurface() == 0){
break;
}
if(app->getOfxPiMapper()->getSurfaceManager()->getSelectedSurface()->getType() ==
SurfaceType::QUAD_SURFACE){
app->getOfxPiMapper()->getCmdManager()->exec(
new TogglePerspectiveCmd(
(QuadSurface *)app->getOfxPiMapper()->getSurfaceManager()->getSelectedSurface() ) );
}
break;
default:
break;

1
src/Application/ProjectionMappingState.h

@ -5,6 +5,7 @@
#include "ofLog.h"
#include "ofGraphics.h"
#include "AddSurfaceCmd.h"
#include "TogglePerspectiveCmd.h"
#include "SurfaceType.h"
namespace ofx {

Loading…
Cancel
Save