00001 /****************************************************************************** 00002 * SOFA, Simulation Open-Framework Architecture, version 1.0 beta 3 * 00003 * (c) 2006-2008 MGH, INRIA, USTL, UJF, CNRS * 00004 * * 00005 * This library is free software; you can redistribute it and/or modify it * 00006 * under the terms of the GNU Lesser General Public License as published by * 00007 * the Free Software Foundation; either version 2.1 of the License, or (at * 00008 * your option) any later version. * 00009 * * 00010 * This library is distributed in the hope that it will be useful, but WITHOUT * 00011 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * 00012 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * 00013 * for more details. * 00014 * * 00015 * You should have received a copy of the GNU Lesser General Public License * 00016 * along with this library; if not, write to the Free Software Foundation, * 00017 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 00018 ******************************************************************************* 00019 * SOFA :: Modules * 00020 * * 00021 * Authors: The SOFA Team and external contributors (see Authors.txt) * 00022 * * 00023 * Contact information: contact@sofa-framework.org * 00024 ******************************************************************************/ 00025 // 00026 // C++ Interface: Controller 00027 // 00028 // Description: 00029 // 00030 // 00031 // Author: Pierre-Jean Bensoussan, Digital Trainers (2008) 00032 // 00033 // Copyright: See COPYING file that comes with this distribution 00034 // 00035 // 00036 00037 #ifndef SOFA_COMPONENT_CONTROLLER_CONTROLLER_H 00038 #define SOFA_COMPONENT_CONTROLLER_CONTROLLER_H 00039 00040 #include <sofa/core/componentmodel/behavior/BaseController.h> 00041 00042 namespace sofa 00043 { 00044 namespace core 00045 { 00046 namespace objectmodel 00047 { 00048 00049 class Event; 00050 class MouseEvent; 00051 class OmniEvent; 00052 class KeypressedEvent; 00053 class KeyreleasedEvent; 00054 class JoystickEvent; 00055 00056 } 00057 } 00058 } 00059 00060 namespace sofa 00061 { 00062 00063 namespace component 00064 { 00065 00066 namespace controller 00067 { 00068 00075 class Controller : public virtual core::componentmodel::behavior::BaseController 00076 { 00077 00078 public: 00082 Controller(); 00083 00087 virtual void onMouseEvent(core::objectmodel::MouseEvent *){}; 00088 00092 virtual void onOmniEvent(core::objectmodel::OmniEvent *){}; 00093 00097 virtual void onKeyPressedEvent(core::objectmodel::KeypressedEvent *){}; 00098 00102 virtual void onKeyReleasedEvent(core::objectmodel::KeyreleasedEvent *){}; 00103 00107 virtual void onJoystickEvent(core::objectmodel::JoystickEvent *){}; 00108 00112 virtual void onBeginAnimationStep(void){}; 00113 00117 virtual void onEndAnimationStep(void){}; 00118 00119 protected: 00120 00121 Data< bool > handleEventTriggersUpdate; 00122 00123 private: 00124 00125 void handleEvent(core::objectmodel::Event *); 00126 }; 00127 00128 } // namespace controller 00129 00130 } // namespace component 00131 00132 } // namespace sofa 00133 00134 #endif // SOFA_COMPONENT_CONTROLLER_CONTROLLER_H
1.5.7.1