From 541b5f88cc7f638180aec8181afbd34586b26ad0 Mon Sep 17 00:00:00 2001
From: Otmane Lahlou <otmane.lahlou@c-s.fr>
Date: Fri, 15 Feb 2013 17:12:44 +0100
Subject: [PATCH] ENH: add methods to get the Quicklookmodel

---
 Code/Common/mvdAbstractImageModel.cxx | 20 +++++++++++++++++++-
 Code/Common/mvdAbstractImageModel.h   |  7 +++++++
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/Code/Common/mvdAbstractImageModel.cxx b/Code/Common/mvdAbstractImageModel.cxx
index 6f044a3786..ddd1971a90 100644
--- a/Code/Common/mvdAbstractImageModel.cxx
+++ b/Code/Common/mvdAbstractImageModel.cxx
@@ -38,7 +38,7 @@
 
 //
 // Monteverdi includes (sorted by alphabetic order)
-#include "mvdHistogramModel.h"
+#include "mvdQuicklookModel.h"
 
 namespace mvd
 {
@@ -69,6 +69,23 @@ AbstractImageModel
 {
 }
 
+
+/*****************************************************************************/
+const QuicklookModel*
+AbstractImageModel
+::GetQuicklookModel() const
+{
+  return findChild< const QuicklookModel* >();
+}
+
+/*****************************************************************************/
+QuicklookModel*
+AbstractImageModel
+::GetQuicklookModel()
+{
+  return findChild< QuicklookModel* >();
+}
+
 /*******************************************************************************/
 QStringList
 AbstractImageModel
@@ -145,6 +162,7 @@ AbstractImageModel
 ::virtual_BuildModel()
 {
   newChildModel< HistogramModel >();
+  newChildModel< QuicklookModel >();
 }
 
 /*******************************************************************************/
diff --git a/Code/Common/mvdAbstractImageModel.h b/Code/Common/mvdAbstractImageModel.h
index 9fd86dd277..1d6fdab484 100644
--- a/Code/Common/mvdAbstractImageModel.h
+++ b/Code/Common/mvdAbstractImageModel.h
@@ -63,6 +63,7 @@ namespace mvd
 //
 // Internal classes pre-declaration.
 class HistogramModel;
+class QuicklookModel;
 
 /*****************************************************************************/
 /* CLASS DEFINITION SECTION                                                  */
@@ -105,6 +106,12 @@ public:
    */
   QStringList GetBandNames( bool enhanced =false ) const;
 
+  /** */
+  const QuicklookModel* GetQuicklookModel() const;
+
+  /** */
+  QuicklookModel* GetQuicklookModel();
+
   /**
    * Get the number of available LOD.
    */
-- 
GitLab