From 2e14b53face5546a43c1b42147e0170bb084ec95 Mon Sep 17 00:00:00 2001
From: Julien Michel <julien.michel@orfeo-toolbox.org>
Date: Mon, 23 Mar 2009 14:14:04 +0100
Subject: [PATCH] ENH: Inverting GlComponent rendering order

---
 Code/Visualization/otbImageWidget.h   | 2 +-
 Code/Visualization/otbImageWidget.txx | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Code/Visualization/otbImageWidget.h b/Code/Visualization/otbImageWidget.h
index e7549075a3..7cc1d1b3db 100644
--- a/Code/Visualization/otbImageWidget.h
+++ b/Code/Visualization/otbImageWidget.h
@@ -72,7 +72,7 @@ public:
   typedef typename GlComponentType::PointType           PointType;
   typedef ObjectList<GlComponentType>                   GlComponentListType;
   typedef typename GlComponentListType::Pointer         GlComponentListPointerType;
-  typedef typename GlComponentListType::Iterator        GlComponentIteratorType;
+  typedef typename GlComponentListType::ReverseIterator GlComponentIteratorType;
 
   /** Reads the OpenGl buffer from an image pointer
    *  \param image The image pointer,
diff --git a/Code/Visualization/otbImageWidget.txx b/Code/Visualization/otbImageWidget.txx
index a75816b1e0..0ef83f58f3 100644
--- a/Code/Visualization/otbImageWidget.txx
+++ b/Code/Visualization/otbImageWidget.txx
@@ -231,8 +231,8 @@ ImageWidget<TInputImage>
     }
 
   // Render additionnal GlComponents
-  for(GlComponentIteratorType it = m_GlComponents->Begin();
-      it!=m_GlComponents->End();++it)
+  for(GlComponentIteratorType it = m_GlComponents->ReverseBegin();
+      it!=m_GlComponents->ReverseEnd();++it)
     {
     if(it.Get()->GetVisible())
       {
-- 
GitLab