SWE
/import/home/rettenbs/src/SWE/src/opengl/controller.h
00001 #ifndef CONTROLLER_H
00002 #define CONTROLLER_H
00003 // =====================================================================
00004 // This file is part of SWE_CUDA (see file SWE_Block.cu for details).
00005 // 
00006 // Copyright (C) 2010,2011 Tobias Schnabel
00007 // Copyright (C) 2012      Sebastian Rettenberger
00008 // 
00009 // SWE_CUDA is free software: you can redristribute it and/or modify
00010 // it under the terms of the GNU General Public License as published by
00011 // the Free Software Foundation, either version 3 of the License, or
00012 // (at your option) any later version.
00013 //
00014 // SWE_CUDA is distributed in the hope that it will be useful,
00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 // GNU General Public License for more details.
00018 //
00019 // You should have received a copy of the GNU General Public License
00020 // along with SWE_CUDA.  If not, see <http://www.gnu.org/licenses/>.
00021 // =====================================================================
00022 #include <SDL/SDL.h>
00023 #include "simulation.h"
00024 #include "visualization.h"
00025 
00027 #define SCENARIO_COUNT 7
00028 
00029 class Controller {
00030 public:
00031         Controller(Simulation* sim, Visualization* vis);
00032         
00033         virtual ~Controller();
00034 
00035         // Process new events
00036         bool handleEvents();
00037 
00038         // Return if window is enabled
00039         bool hasFocus();
00040         // Return if program is paused
00041         bool isPaused();
00042 private:
00043         // Internal functions
00044         bool isActive;
00045         bool done;
00046         bool paused;
00047         bool allowStep;
00048 
00049         // References to other classes
00050         Simulation* simulation;
00051         Visualization* visualization;
00052         
00054         SWE_Scenario *scenarios[SCENARIO_COUNT];
00055         SWE_VisInfo *visInfos[SCENARIO_COUNT];
00056 
00057         // Handle keyboard events
00058         bool handleKeyPress( SDL_keysym *keysym);
00059 };
00060 
00061 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends