Skip to content
Snippets Groups Projects
Commit f5b8a2c8 authored by Otmane Lahlou's avatar Otmane Lahlou
Browse files

ENH : handle an offset in the pixelDescription Action Handler

parent d268739b
No related branches found
No related tags found
No related merge requests found
...@@ -54,6 +54,7 @@ public: ...@@ -54,6 +54,7 @@ public:
/** View typedef */ /** View typedef */
typedef TView ViewType; typedef TView ViewType;
typedef typename ViewType::Pointer ViewPointerType; typedef typename ViewType::Pointer ViewPointerType;
typedef typename ViewType::OffsetType OffsetType;
typedef typename ViewType::ImageWidgetPointerType WidgetPointerType; typedef typename ViewType::ImageWidgetPointerType WidgetPointerType;
/** Handle widget event /** Handle widget event
...@@ -108,6 +109,9 @@ public: ...@@ -108,6 +109,9 @@ public:
index[0]=static_cast<int>(imagePoint[0]); index[0]=static_cast<int>(imagePoint[0]);
index[1]=static_cast<int>(imagePoint[1]); index[1]=static_cast<int>(imagePoint[1]);
//Add the offset
index += m_Offset;
// Communicate new index to model // Communicate new index to model
m_Model->UpdatePixelDescription(index); m_Model->UpdatePixelDescription(index);
...@@ -132,10 +136,16 @@ public: ...@@ -132,10 +136,16 @@ public:
itkSetObjectMacro(View,ViewType); itkSetObjectMacro(View,ViewType);
itkGetObjectMacro(View,ViewType); itkGetObjectMacro(View,ViewType);
/** Set/Get Offset */
itkSetMacro(Offset,OffsetType);
itkGetMacro(Offset,OffsetType);
protected: protected:
/** Constructor */ /** Constructor */
PixelDescriptionActionHandler() : m_View(), m_Model() PixelDescriptionActionHandler() : m_View(), m_Model()
{} {
m_Offset.Fill(0);
}
/** Destructor */ /** Destructor */
virtual ~PixelDescriptionActionHandler(){} virtual ~PixelDescriptionActionHandler(){}
...@@ -148,7 +158,10 @@ protected: ...@@ -148,7 +158,10 @@ protected:
private: private:
PixelDescriptionActionHandler(const Self&); // purposely not implemented PixelDescriptionActionHandler(const Self&); // purposely not implemented
void operator=(const Self&); // purposely not implemented void operator=(const Self&); // purposely not implemented
//Offset
OffsetType m_Offset;
// Pointer to the view // Pointer to the view
ViewPointerType m_View; ViewPointerType m_View;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment