00001 /**************************************************************************** 00002 00003 This file is part of the GLC-lib library. 00004 Copyright (C) 2005-2008 Laurent Ribon (laumaya@users.sourceforge.net) 00005 http://glc-lib.sourceforge.net 00006 00007 GLC-lib is free software; you can redistribute it and/or modify 00008 it under the terms of the GNU Lesser General Public License as published by 00009 the Free Software Foundation; either version 3 of the License, or 00010 (at your option) any later version. 00011 00012 GLC-lib is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU Lesser General Public License for more details. 00016 00017 You should have received a copy of the GNU Lesser General Public License 00018 along with GLC-lib; if not, write to the Free Software 00019 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00020 00021 *****************************************************************************/ 00022 00024 00025 #ifndef GLC_INTERPOLATOR_H_ 00026 #define GLC_INTERPOLATOR_H_ 00027 00028 #include "glc_vector3d.h" 00029 #include "glc_matrix4x4.h" 00030 00031 #include "../glc_config.h" 00032 00033 // Types d'interpolation 00034 enum INTERPOL_TYPE 00035 { 00036 INTERPOL_LINEAIRE, 00037 INTERPOL_ANGULAIRE, 00038 INTERPOL_HOMOTETIE 00039 }; 00040 00043 00046 00047 class GLC_LIB_EXPORT GLC_Interpolator 00048 { 00049 00050 public: 00052 GLC_Interpolator(); 00053 00055 // Set Function 00057 public: 00059 void SetInterpolMat(int NbrPas, const GLC_Vector3d &VectDepart, const GLC_Vector3d &VectArrive 00060 , INTERPOL_TYPE Interpolation = INTERPOL_LINEAIRE); 00061 00063 void SetType(INTERPOL_TYPE Interpolation); 00064 00065 // Number of step 00066 void SetNbrPas(int NbrPas); 00067 00069 void SetVecteurs(const GLC_Vector3d &VectDepart, const GLC_Vector3d &VectArrive); 00070 00072 // Get Function 00074 public: 00076 inline GLC_Matrix4x4 GetInterpolMat(void) const 00077 {return m_InterpolMat;} 00078 00080 // Private services functions 00082 private: 00084 bool CalcInterpolMat(void); 00085 00087 bool CalcInterpolLineaireMat(void); 00088 00090 bool CalcInterpolAngulaireMat(void); 00091 00093 // Membres privés 00095 private: 00097 GLC_Point3d m_StartPoint; 00098 00100 GLC_Point3d m_EndPoint; 00101 00103 INTERPOL_TYPE m_InterpolType; 00104 00106 int m_StepCount; 00107 00109 GLC_Matrix4x4 m_InterpolMat; 00110 }; 00111 00112 #endif /*GLC_INTERPOLATOR_H_*/