From 29a099bd7d3baf4fac7dd6784ffb3292932cc0ca Mon Sep 17 00:00:00 2001
From: Cyrille Valladeau <cyrille.valladeau@c-s.fr>
Date: Wed, 20 Jan 2010 14:51:40 +0100
Subject: [PATCH] REVERT : back to the last change in imageList (taht should
 have correct monterverdi bug 134 but that leads to a bigger pb)

---
 Code/Common/otbImageList.h   |  1 +
 Code/Common/otbImageList.txx | 32 +++++++++++++++++++++++++++++++-
 2 files changed, 32 insertions(+), 1 deletion(-)
 mode change 100755 => 100644 Code/Common/otbImageList.h
 mode change 100755 => 100644 Code/Common/otbImageList.txx

diff --git a/Code/Common/otbImageList.h b/Code/Common/otbImageList.h
old mode 100755
new mode 100644
index 287eb4e75e..6b46f9a8c1
--- a/Code/Common/otbImageList.h
+++ b/Code/Common/otbImageList.h
@@ -59,6 +59,7 @@ public:
    * Update images in the list.
    */
   virtual void UpdateOutputInformation(void);
+  virtual void PropagateRequestedRegion(void) throw (itk::InvalidRequestedRegionError);
   virtual void UpdateOutputData(void);
 
 
diff --git a/Code/Common/otbImageList.txx b/Code/Common/otbImageList.txx
old mode 100755
new mode 100644
index 6beb48ec47..c83357d594
--- a/Code/Common/otbImageList.txx
+++ b/Code/Common/otbImageList.txx
@@ -29,7 +29,6 @@ ImageList<TImage>
 ::UpdateOutputData()
 {
   Superclass::UpdateOutputData();
-
   for (ConstIterator it = this->Begin(); it!=this->End();++it)
   {
     if (it.Get()->GetUpdateMTime() < it.Get()->GetPipelineMTime()
@@ -44,6 +43,37 @@ ImageList<TImage>
   }
 }
 
+template <class TImage>
+void
+ImageList<TImage>
+::PropagateRequestedRegion() throw (itk::InvalidRequestedRegionError)
+{
+  Superclass::PropagateRequestedRegion();
+  for (ConstIterator it = this->Begin(); it!=this->End();++it)
+  {
+    if (it.Get()->GetUpdateMTime() < it.Get()->GetPipelineMTime()
+        || it.Get()->GetDataReleased()
+        || it.Get()->RequestedRegionIsOutsideOfTheBufferedRegion())
+    {
+      if (it.Get()->GetSource())
+      {
+        it.Get()->GetSource()->PropagateRequestedRegion(it.Get());
+      }
+    }
+
+    // Check that the requested region lies within the largest possible region
+    if ( ! it.Get()->VerifyRequestedRegion() )
+    {
+      // invalid requested region, throw an exception
+      itk::InvalidRequestedRegionError e(__FILE__, __LINE__);
+      e.SetLocation(ITK_LOCATION);
+      e.SetDataObject(it.Get());
+      e.SetDescription("Requested region is (at least partially) outside the largest possible region.");
+
+      throw e;
+    }
+  }
+}
 
 template <class TImage>
 void
-- 
GitLab