Index: trunk/lib/FlairFilter/src/ButterworthLowPass.cpp
===================================================================
--- trunk/lib/FlairFilter/src/ButterworthLowPass.cpp	(revision 161)
+++ trunk/lib/FlairFilter/src/ButterworthLowPass.cpp	(revision 162)
@@ -31,7 +31,7 @@
 ButterworthLowPass::ButterworthLowPass(const IODevice *parent,
                                        const LayoutPosition *position,
-                                       string name, int order)
+                                       string name, uint32_t order,uint32_t nbRow,uint32_t nbCol)
     : IODevice(parent, name) {
-  pimpl_ = new ButterworthLowPass_impl(this, position, name, order);
+  pimpl_ = new ButterworthLowPass_impl(this, position, name, order,nbRow,nbCol);
   AddDataToLog(pimpl_->output);
   
@@ -40,7 +40,7 @@
 
 ButterworthLowPass::ButterworthLowPass(const gui::LayoutPosition *position,
-                                       string name, int order)
+                                       string name, uint32_t order,uint32_t nbRow,uint32_t nbCol)
     : IODevice(position->getLayout(), name) {
-  pimpl_ = new ButterworthLowPass_impl(this, position, name, order);
+  pimpl_ = new ButterworthLowPass_impl(this, position, name, order,nbRow,nbCol);
   AddDataToLog(pimpl_->output);
 }
Index: trunk/lib/FlairFilter/src/ButterworthLowPass.h
===================================================================
--- trunk/lib/FlairFilter/src/ButterworthLowPass.h	(revision 161)
+++ trunk/lib/FlairFilter/src/ButterworthLowPass.h	(revision 162)
@@ -48,8 +48,10 @@
   * \param name name
   * \param order order of the filter
+  * \param nbRow number of rows of input/output
+  * \param nbCol number of cols of input/output
   */
   ButterworthLowPass(const IODevice *parent,
                      const gui::LayoutPosition *position, std::string name,
-                     int order);
+                     uint32_t order,uint32_t nbRow=1,uint32_t nbCol=1);
 
   /*!
@@ -65,7 +67,9 @@
   * \param name name
   * \param order order of the filter
+  * \param nbRow number of rows of input/output
+  * \param nbCol number of cols of input/output
   */
   ButterworthLowPass(const gui::LayoutPosition *position, std::string name,
-                     int order);
+                     uint32_t order,uint32_t nbRow,uint32_t nbCol);
 
   /*!
Index: trunk/lib/FlairFilter/src/ButterworthLowPass_impl.cpp
===================================================================
--- trunk/lib/FlairFilter/src/ButterworthLowPass_impl.cpp	(revision 161)
+++ trunk/lib/FlairFilter/src/ButterworthLowPass_impl.cpp	(revision 162)
@@ -31,5 +31,5 @@
 ButterworthLowPass_impl::ButterworthLowPass_impl(ButterworthLowPass *self,
                                                  const LayoutPosition *position,
-                                                 string name, int order) {
+                                                 string name, uint32_t order,uint32_t nbRow,uint32_t nbCol) {
   // init UI
   GroupBox *reglages_groupbox = new GroupBox(position, name);
@@ -39,32 +39,46 @@
                              " Hz", 0, 10000, 0.1, 2, 1);
 
-  cvmatrix_descriptor *desc = new cvmatrix_descriptor(1, 1);
-  desc->SetElementName(0, 0, "output");
+  cvmatrix_descriptor *desc = new cvmatrix_descriptor(nbRow, nbCol);
+  //desc->SetElementName(0, 0, "output");
   output = new cvmatrix(self, desc, floatType, name);
   delete desc;
 
-  f = new PoleFilter(order);
-
-  if (T->Value() != 0) {
-    f->setup(1. / T->Value(), cutoff->Value());
+  f=(PoleFilter**)malloc(sizeof(PoleFilter*)*nbRow*nbCol);
+  
+  for(uint32_t i=0;i<nbRow;i++) {
+    for(uint32_t j=0;j<nbCol;j++) {
+      f[i*nbCol+j] = new PoleFilter(order);
+      if (T->Value() != 0) {
+        f[i*nbCol+j]->setup(1. / T->Value(), cutoff->Value());
+      }
+      f[i*nbCol+j]->reset();
+    }
   }
-  
-  f->reset();
 
   first_update = true;
   this->order=order;
+  this->nbRow=nbRow;
+  this->nbCol=nbCol;
 }
 
-ButterworthLowPass_impl::~ButterworthLowPass_impl() { delete f; }
+ButterworthLowPass_impl::~ButterworthLowPass_impl() { 
+  for(uint32_t i=0;i<nbRow;i++) {
+    for(uint32_t j=0;j<nbCol;j++) {
+     delete f[i*nbCol+j];
+    }
+  }
+  free(f);
+}
 
 void ButterworthLowPass_impl::UpdateFrom(const io_data *data) {
-  float result;
   cvmatrix *input = (cvmatrix *)data;
   float delta_t;
   
-  if (T->ValueChanged()) {
-    if (T->Value() != 0) {
-      f->setup(1. / T->Value(), cutoff->Value());
-      settingsChanged(input->Value(0, 0));
+  if (T->ValueChanged() && T->Value() != 0) {
+    for(uint32_t i=0;i<nbRow;i++) {
+      for(uint32_t j=0;j<nbCol;j++) {
+        f[i*nbCol+j]->setup(1. / T->Value(), cutoff->Value());
+        settingsChanged(f[i*nbCol+j],input->Value(i, j));
+      }
     }
   }
@@ -72,5 +86,9 @@
   if (T->Value() == 0) {
     delta_t = (float)(data->DataTime() - previous_time) / 1000000000.;
-    f->setup(1. / delta_t, cutoff->Value());
+    for(uint32_t i=0;i<nbRow;i++) {
+      for(uint32_t j=0;j<nbCol;j++) {
+        f[i*nbCol+j]->setup(1. / delta_t, cutoff->Value());
+      }
+    }
   } else {
     delta_t=T->Value();
@@ -82,6 +100,10 @@
 
   if (cutoff->ValueChanged()) {
-    f->setup(1. / delta_t, cutoff->Value());
-    settingsChanged(input->ValueNoMutex(0, 0));
+    for(uint32_t i=0;i<nbRow;i++) {
+      for(uint32_t j=0;j<nbCol;j++) {
+        f[i*nbCol+j]->setup(1. / delta_t, cutoff->Value());
+        settingsChanged(f[i*nbCol+j],input->ValueNoMutex(i, j));
+      }
+    }
   }
 
@@ -89,6 +111,10 @@
     first_update = false;
   } else {
-    result = f->filter(input->ValueNoMutex(0, 0));
-    output->SetValueNoMutex(0, 0, result);
+    for(uint32_t i=0;i<nbRow;i++) {
+      for(uint32_t j=0;j<nbCol;j++) {
+        float result = f[i*nbCol+j]->filter(input->ValueNoMutex(i, j));
+        output->SetValueNoMutex(i, j, result);
+      }
+    }
   }
 
@@ -101,5 +127,5 @@
 
 //ne gere pas les oscillations (s'arrete des qu'une valeure est bonne a 5%)
-void ButterworthLowPass_impl::settingsChanged(float inputValue) {
+void ButterworthLowPass_impl::settingsChanged(PoleFilter*f,float inputValue) {
   float result=f->filter(inputValue);
   
Index: trunk/lib/FlairFilter/src/unexported/ButterworthLowPass_impl.h
===================================================================
--- trunk/lib/FlairFilter/src/unexported/ButterworthLowPass_impl.h	(revision 161)
+++ trunk/lib/FlairFilter/src/unexported/ButterworthLowPass_impl.h	(revision 162)
@@ -122,5 +122,5 @@
   ButterworthLowPass_impl(flair::filter::ButterworthLowPass *self,
                           const flair::gui::LayoutPosition *position,
-                          std::string name, int order);
+                          std::string name, uint32_t order,uint32_t nbRow,uint32_t nbCol);
   ~ButterworthLowPass_impl();
   void UpdateFrom(const flair::core::io_data *data);
@@ -128,10 +128,11 @@
 
 private:
-  void settingsChanged(float inputValue);
+  void settingsChanged(PoleFilter*f,float inputValue);
   flair::gui::DoubleSpinBox *cutoff, *T;
-  PoleFilter *f;
+  PoleFilter **f;
   bool first_update;
   flair::core::Time previous_time;
-  int order;
+  uint32_t order;
+  uint32_t nbRow, nbCol;
 };
 
Index: trunk/lib/FlairSimulator/src/Gui_impl.cpp
===================================================================
--- trunk/lib/FlairSimulator/src/Gui_impl.cpp	(revision 161)
+++ trunk/lib/FlairSimulator/src/Gui_impl.cpp	(revision 162)
@@ -131,5 +131,5 @@
 Gui_impl::~Gui_impl() {
   // printf("del Gui_impl\n");
-  device->drop();
+  //device->drop();
 
   delete receiver;
@@ -209,6 +209,5 @@
 
   while (device->run()) {
-    if (dbtFile_r != NULL) // rejeu
-    {
+    if (dbtFile_r != NULL) {// rejeu
       takeScreenshot(); // on enregistre l'image precedente
       road_time_t time;
@@ -258,7 +257,5 @@
                  }
                  device->setWindowCaption(L"toto");*/
-
-    if (dbtFile_r == NULL) // mode normal
-    {
+    if (dbtFile_r == NULL) {// mode normal
       for (size_t i = 0; i < models.size(); i++) {
         models.at(i)->pimpl_->CheckCollision();
Index: trunk/lib/FlairSimulator/src/SimuCameraGL.cpp
===================================================================
--- trunk/lib/FlairSimulator/src/SimuCameraGL.cpp	(revision 161)
+++ trunk/lib/FlairSimulator/src/SimuCameraGL.cpp	(revision 162)
@@ -111,4 +111,6 @@
     free(buffer);
   }
+  camera->removeAnimator(this);
+  camera->drop();
 }
 
Index: trunk/lib/FlairSimulator/src/Simulator_impl.cpp
===================================================================
--- trunk/lib/FlairSimulator/src/Simulator_impl.cpp	(revision 161)
+++ trunk/lib/FlairSimulator/src/Simulator_impl.cpp	(revision 162)
@@ -21,4 +21,5 @@
 #include "Gui.h"
 #include "Gui_impl.h"
+#include <ISceneManager.h>
 #endif
 #include "Model.h"
@@ -46,4 +47,7 @@
     models.at(i)->pimpl_->SafeStop();
     models.at(i)->pimpl_->Join();
+#ifdef GL
+    getGui()->getSceneManager()->getRootSceneNode()->removeChild(models.at(i)->pimpl_);
+#endif
     delete models.at(i);
   }
