From f5b8a2c8111c85be0efcd1432923bdf1f13db8b2 Mon Sep 17 00:00:00 2001 From: Otmane Lahlou <otmane.lahlou@c-s.fr> Date: Wed, 1 Apr 2009 17:56:12 +0200 Subject: [PATCH] ENH : handle an offset in the pixelDescription Action Handler --- .../otbPixelDescriptionActionHandler.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Code/Visualization/otbPixelDescriptionActionHandler.h b/Code/Visualization/otbPixelDescriptionActionHandler.h index c525eeb816..5cf1626454 100644 --- a/Code/Visualization/otbPixelDescriptionActionHandler.h +++ b/Code/Visualization/otbPixelDescriptionActionHandler.h @@ -54,6 +54,7 @@ public: /** View typedef */ typedef TView ViewType; typedef typename ViewType::Pointer ViewPointerType; + typedef typename ViewType::OffsetType OffsetType; typedef typename ViewType::ImageWidgetPointerType WidgetPointerType; /** Handle widget event @@ -108,6 +109,9 @@ public: index[0]=static_cast<int>(imagePoint[0]); index[1]=static_cast<int>(imagePoint[1]); + //Add the offset + index += m_Offset; + // Communicate new index to model m_Model->UpdatePixelDescription(index); @@ -132,10 +136,16 @@ public: itkSetObjectMacro(View,ViewType); itkGetObjectMacro(View,ViewType); + /** Set/Get Offset */ + itkSetMacro(Offset,OffsetType); + itkGetMacro(Offset,OffsetType); + protected: /** Constructor */ PixelDescriptionActionHandler() : m_View(), m_Model() - {} + { + m_Offset.Fill(0); + } /** Destructor */ virtual ~PixelDescriptionActionHandler(){} @@ -148,7 +158,10 @@ protected: private: PixelDescriptionActionHandler(const Self&); // purposely not implemented void operator=(const Self&); // purposely not implemented - + + //Offset + OffsetType m_Offset; + // Pointer to the view ViewPointerType m_View; -- GitLab