00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00020 #ifndef CMotion2DModel_h
00021 #define CMotion2DModel_h
00022
00023 #include <stdio.h>
00024 #include <string>
00025 #include <Motion2D.h>
00026
00027 using namespace std;
00028
00029 #if defined (WIN32)
00030 # if defined MOTION2D_DLL_EXPORTS
00031 # define MOTION2D_API __declspec( dllexport )
00032 # elif defined MOTION2D_DLL_IMPORTS
00033 # define MOTION2D_API __declspec( dllimport )
00034 # else
00035 # define MOTION2D_API
00036 # endif
00037 #else
00038 # define MOTION2D_API
00039 #endif
00040
00041
00042 class MOTION2D_API CMotion2DModel
00043 {
00044 public:
00048 enum {
00049 MDL_NMAX_COEF = 12
00050 };
00051
00052 public:
00053 CMotion2DModel();
00054 CMotion2DModel(const CMotion2DModel & model);
00055 ~CMotion2DModel();
00056
00057
00058 void setOrigin(double row, double col);
00059 void setIdModel(EIdModel id);
00060 void setIdModel(string id);
00061 void setVarLight(bool state, double parameter=0.0);
00062
00063 void setParameters(const double parameters[MDL_NMAX_COEF]);
00064
00065 bool compose(CMotion2DModel model);
00066 int getNParameters();
00067 int getDegre();
00068 void getParameters(double parameters[MDL_NMAX_COEF]);
00069 void reset();
00070 bool invert(CMotion2DModel &inv);
00071 string idToString();
00072 bool changeRepere(double row, double col);
00073 bool getDisplacement(double row, double col, double &d_row, double &d_col);
00074
00077 EIdModel getIdModel() { return id_model; };
00078 bool getVarLight();
00079 bool getVarLight(double & parameter);
00080 CMotion2DModel getModelLevel(int delta_level);
00089 void getOrigin(double &row, double &col) {row = li_c; col = co_c; };
00090
00129 double operator[](int n) {return theta[n];}
00130 void operator=(const CMotion2DModel &model);
00131
00132 private:
00133 double theta[MAXCOEFSMODEL];
00134 double li_c, co_c;
00135 bool var_light;
00136 EIdModel id_model;
00137 };
00138
00139 #endif