glc_interpolator.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 
00003  This file is part of the GLC-lib library.
00004  Copyright (C) 2005-2008 Laurent Ribon (laumaya@users.sourceforge.net)
00005  Version 2.0.0 Beta 1, packaged on April 2010.
00006 
00007  http://glc-lib.sourceforge.net
00008 
00009  GLC-lib is free software; you can redistribute 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 2 of the License, or
00012  (at your option) any later version.
00013 
00014  GLC-lib 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 GLC-lib; if not, write to the Free Software
00021  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00022 
00023 *****************************************************************************/
00024 
00026 
00027 #ifndef GLC_INTERPOLATOR_H_
00028 #define GLC_INTERPOLATOR_H_
00029 
00030 #include "glc_vector3d.h"
00031 #include "glc_matrix4x4.h"
00032 
00033 #include "../glc_config.h"
00034 
00035 // Types d'interpolation
00036 enum INTERPOL_TYPE
00037 {
00038         INTERPOL_LINEAIRE,
00039         INTERPOL_ANGULAIRE,
00040         INTERPOL_HOMOTETIE
00041 };
00042 
00045 
00048 
00049 class GLC_LIB_EXPORT GLC_Interpolator
00050 {
00051 
00053 // Construction
00055 public:
00056         // Contructeur par défaut Interpolation Linéaire
00057         GLC_Interpolator();
00058 
00060 // Fonctions Set
00062 public:
00063         // Défini la matrice d'interpolation
00064         void SetInterpolMat(int NbrPas, const GLC_Vector3d &VectDepart, const GLC_Vector3d &VectArrive
00065                 , INTERPOL_TYPE Interpolation = INTERPOL_LINEAIRE);
00066         // Type d'interpolation
00067         void SetType(INTERPOL_TYPE Interpolation);
00068         // Nombre de pas
00069         void SetNbrPas(int NbrPas);
00070         // Vecteur d'arrivée et de depart
00071         void SetVecteurs(const GLC_Vector3d &VectDepart, const GLC_Vector3d &VectArrive);
00072 
00074 // Fonctions Get
00076 public:
00077         // Retourne la matrice d'interpolation
00078         GLC_Matrix4x4 GetInterpolMat(void) const
00079         {
00080                 return m_InterpolMat;
00081         }
00082 
00084 // Fonctions de Service privée
00086 private:
00087         // Calcul La matrice d'interpolation
00088         bool CalcInterpolMat(void);
00089 
00090         // Calcul la matrice d'interpolation linéaire
00091         bool CalcInterpolLineaireMat(void);
00092 
00093         // Calcul la matrice d'interpolation angulaire
00094         bool CalcInterpolAngulaireMat(void);
00095 
00097 // Membres privés
00099 private:
00100         // Vecteur de départ
00101         GLC_Vector3d m_VectDepart;
00102         // Vecteur d'arriver
00103         GLC_Vector3d m_VectArrive;
00104 
00105         // Type d'interpolation courante
00106         INTERPOL_TYPE m_InterpolType;
00107 
00108         // Nombre de pas d'interpolation
00109         int m_nNbrPas;
00110 
00111         // Matrice d'interpolation
00112         GLC_Matrix4x4 m_InterpolMat;
00113 };
00114 
00115 #endif /*GLC_INTERPOLATOR_H_*/

SourceForge.net Logo

©2005 Laurent Ribon