00001 //Copyright 1999-2008 Catherine Pelachaud - c.pelachaud@iut.univ-paris8.fr 00002 // 00003 //This file is part of Greta. 00004 // 00005 //Greta is free software; you can redistribute it and/or modify 00006 //it under the terms of the GNU General Public License as published by 00007 //the Free Software Foundation; either version 2 of the License, or 00008 //(at your option) any later version. 00009 // 00010 //Greta is distributed in the hope that it will be useful, 00011 //but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 //GNU General Public License for more details. 00014 // 00015 //You should have received a copy of the GNU General Public License 00016 //along with Greta; if not, write to the Free Software 00017 //Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 00019 #pragma once 00020 #include "../SCOLBasic/SO3Std.h" 00021 #include "fap.h" 00022 00029 struct eyesdirection{ 00030 bool active; 00031 float v; 00032 float h; 00033 }; 00040 struct headdirection{ 00041 bool active; 00042 float v; 00043 float h; 00044 float t; 00045 }; 00046 00054 struct headmovement{ 00055 bool active; 00056 std::string type; 00057 float amplitude; 00058 float period; 00059 }; 00060 00068 #ifndef TCBPARAMS 00069 #define TCBPARAMS 00070 enum TCBParamType {Tension,Continuity,Bias}; 00071 #endif 00072 00073 class FAPFrame 00074 { 00075 public: 00083 FAPFrame*GetCorrespondingZeroFrame(); 00088 void CopyFrom(FAPFrame*origin); 00093 void MergeFrom(FAPFrame*origin); 00099 void MergeFAP(int num, int value); 00103 float probability; 00107 void Print(); 00113 int SetFAP(int num,int value,bool activate=true); 00118 int GetFAP(int num); 00119 int GetMask(int num) 00120 { 00121 return FAPs[num].active; 00122 }; 00128 int AddToFAP(int num,int value); 00132 FAPFrame(void); 00136 ~FAPFrame(void); 00140 FAP FAPs[NUMBER_OF_FAPS]; 00144 bool isKeyFrame; 00148 void ActivateAllFAPs(void); 00154 void DeactivateAll(void); 00158 void ResetAllToZero(); 00162 void ActivateAndSetAllFAPsTo(int v); 00166 void SaveToFile(FILE*f,int num); 00167 std::string WriteFAP(int num); 00168 void ReadFromBuffer(char*buffer); 00169 // float time; 00173 eyesdirection eyesdir; 00177 headdirection headdir; 00181 headmovement headmov; 00182 int framenumber; 00183 float TCBParam[3]; 00184 float GetTCBParam(TCBParamType which); 00185 void SetTCBParam(float T, float C, float B); 00186 void SetTension(float T); 00187 void SetContinuity(float C); 00188 void SetBias(float B); 00189 00190 int use_at; 00191 int use_before; 00192 int received_at; 00193 00194 std::string id; 00195 00196 bool operator<(FAPFrame& a); 00197 00198 std::string toString(); 00199 00200 FAPFrame clone(); 00201 00202 }; 00203 00204 typedef std::vector<FAPFrame> FAPFrameVector; 00205
1.6.3