IvfCameraController.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 _CIvfCameraController_h_
00023 #define _CIvfCameraController_h_
00024 
00025 #include <ivfctl/IvfController.h>
00026 
00027 #include <ivf/IvfCamera.h>
00028 #include <ivfmath/IvfSpline3d.h>
00029 
00030 IvfSmartPointer(CIvfCameraController);
00031 
00038 class IVFCTL_API CIvfCameraController : public CIvfController {
00039 public:
00040         enum TEndAction {
00041                 EA_STOP,
00042                 EA_REVERSE,
00043                 EA_RESET,
00044                 EA_DEACTIVATE
00045         };
00046         enum TStartAction {
00047                 SA_STOP,
00048                 SA_REVERSE,
00049                 SA_RESET,
00050                 SA_DEACTIVATE
00051         };
00052 private:
00053         CIvfSpline3dPtr m_path;
00054         CIvfSpline3dPtr m_targetPath;
00055         
00056         double m_v0;
00057         double m_a0;
00058         double m_t0;
00059         double m_t;
00060         double m_v;
00061 
00062         double m_target_v0;
00063         double m_target_a0;
00064         double m_target_t0;
00065         double m_target_t;
00066         double m_target_v;
00067 
00068         bool m_useTargetPath;
00069 
00070         bool m_followPath;
00071 
00072         TEndAction m_endAction;
00073         TStartAction m_startAction;
00074 
00075         TEndAction m_targetEndAction;
00076         TStartAction m_targetStartAction;
00077 
00078         CIvfCameraPtr m_camera;
00079 public:
00081         CIvfCameraController();
00082 
00084         virtual ~CIvfCameraController();
00085 
00087         void setPath(CIvfSpline3d* spline);
00088 
00090         CIvfSpline3d* getPath();
00091 
00097         void setTargetPath(CIvfSpline3d* spline);
00098 
00100         CIvfSpline3d* getTargetPath();
00101         
00103         void setCamera(CIvfCamera* camera);
00104 
00106         CIvfCamera* getCamera();
00107 
00113         void setInitialPos(double t);
00114 
00120         void setInitialSpeed(double v);
00121 
00127         void setInitialAcceleration(double a);
00128 
00136         void setStartActionType(TStartAction action);
00137 
00145         void setEndActionType(TEndAction action);
00146 
00152         void setInitialTargetAcceleration(double a);
00153 
00159         void setInitialTargetSpeed(double v);
00160 
00166         void setInitialTargetPos(double t);
00167 
00169         void setUseTargetPath(bool flag);
00170 
00172         bool getUseTargetPath();
00173 
00181         void setFollowPath(bool flag);
00182 
00190         void setTargetEndActionType(TEndAction action);
00191 
00199         void setTargetStartActionType(TStartAction action);
00200 
00201         virtual void doUpdate(double dt);
00202         virtual void doReset();
00203 };
00204 
00205 #endif 

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