IvfController.h

00001 //
00002 // Copyright 1999-2006 by Structural Mechanics, Lund University.
00003 //
00004 // This library is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Library General Public
00006 // License as published by the Free Software Foundation; either
00007 // version 2 of the License, or (at your option) any later version.
00008 //
00009 // This library is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // Library General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU Library General Public
00015 // License along with this library; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00017 // USA.
00018 //
00019 // Please report all bugs and problems to "ivf@byggmek.lth.se".
00020 //
00021 
00022 #ifndef _CIvfController_h_
00023 #define _CIvfController_h_
00024 
00025 #include <ivf/IvfBase.h>
00026 #include <ivf/IvfShape.h>
00027 #include <ivf/IvfLight.h>
00028 
00029 #include <ivfctl/IvfAction.h>
00030 
00031 #define IVF_ACTION_DEACTIVATE           0
00032 #define IVF_ACTION_ACTIVATE                     1
00033 #define IVF_ACTION_RESET                        2
00034 
00035 IvfSmartPointer(CIvfController);
00036 
00042 class IVFCTL_API CIvfController : public CIvfBase {
00043 private:
00044         CIvfShape* m_controlledShape;   
00045 
00046         bool m_active;
00047 
00048         double  m_initialPosition[3];
00049         double  m_initialScale[3];
00050         double  m_initialRotation[3];
00051         double  m_initialRotQuat[4];
00052 
00053         CIvfAction* m_endAction;
00054         CIvfAction* m_startAction;
00055 
00056         CIvfLight* m_light;
00057 public:
00059         CIvfController();
00060 
00062         virtual ~CIvfController();
00063 
00064         IvfClassInfo("CIvfController",CIvfBase);
00065 
00067         void activate();
00068 
00070         void deactivate();
00071 
00073         bool isActive();
00074 
00076         void reset();
00077 
00083         void update(double dt);
00084 
00090         void action(CIvfAction* action);
00091 
00093         void setShape(CIvfShape* shape);
00094 
00096         CIvfShape* getShape(); 
00097 
00099         void setLight(CIvfLight* light);
00100 
00102         CIvfLight* getLight();
00103 
00110         void setStartAction(CIvfAction* action);
00111 
00118         void setEndAction(CIvfAction* action);
00119 
00127         virtual void doUpdate(double dt);
00128         virtual void doReset();
00129         virtual void doAction(CIvfAction* action);
00130         virtual void doDeactivate();
00131         virtual void doActivate();
00132         virtual void doEndAction();
00133         virtual void doStartAction();
00134 };
00139 #endif 

Generated on Fri Sep 1 15:36:46 2006 for Interactive Visualisation Framework - Ivf++ by  doxygen 1.4.6-NO