From e1251890160b671ff44f8c37ad4b50d503405eca Mon Sep 17 00:00:00 2001 From: Caroline Ruffel <caroline.ruffel@c-s.fr> Date: Wed, 19 Apr 2006 10:01:37 +0000 Subject: [PATCH] nomsg --- .../otbImageToLineSpatialObjectListFilter.h | 21 ++++++------ .../otbImageToLineSpatialObjectListFilter.txx | 32 ++++++++++++++----- 2 files changed, 35 insertions(+), 18 deletions(-) diff --git a/Code/Common/otbImageToLineSpatialObjectListFilter.h b/Code/Common/otbImageToLineSpatialObjectListFilter.h index 6bfe4dd25c..757a3b86c6 100755 --- a/Code/Common/otbImageToLineSpatialObjectListFilter.h +++ b/Code/Common/otbImageToLineSpatialObjectListFilter.h @@ -18,6 +18,7 @@ #include "itkProcessObject.h" #include "otbLineSpatialObjectList.h" +#include "itkLineSpatialObject.h" namespace otb { @@ -58,7 +59,7 @@ public: /** Some convenient typedefs. */ typedef LineSpatialObjectList LinesListType; - typedef LinesListType::LineType LineType; + typedef typename LinesListType::LineType LineType; /** Definition of the input and output images */ typedef typename InputImageType::PixelType InputPixelType; @@ -66,22 +67,22 @@ public: /** Definition of the size of the images. */ typedef typename InputImageType::SizeType SizeType; - - - /** Get the list of LineSpatialObject of this process object. */ - LinesListType & GetOutput(void); - - /** Get the input image */ + + + /** Set/Get the input image */ void SetInput(const InputImageType *image); const InputImageType * GetInput(void); - + + /** Set/Get the list of LineSpatialObject of this process object. */ + void SetOutput(const LinesListType *list); + LinesListType * GetOutput(void); + + protected: ImageToLineSpatialObjectListFilter(); virtual ~ImageToLineSpatialObjectListFilter() {} void PrintSelf(std::ostream& os, itk::Indent indent) const; - - LinesListType m_OutputLinesList; private: diff --git a/Code/Common/otbImageToLineSpatialObjectListFilter.txx b/Code/Common/otbImageToLineSpatialObjectListFilter.txx index 581161e366..2d180ba5e6 100755 --- a/Code/Common/otbImageToLineSpatialObjectListFilter.txx +++ b/Code/Common/otbImageToLineSpatialObjectListFilter.txx @@ -25,7 +25,10 @@ ImageToLineSpatialObjectListFilter<TInputImage>::ImageToLineSpatialObjectListFil { this->SetNumberOfRequiredInputs(1); this->SetNumberOfRequiredOutputs(1); - m_OutputLinesList.clear(); + + typename LinesListType::Pointer list = LinesListType::New(); + this->SetOutput( list ); + } template <class TInputImage> @@ -46,15 +49,28 @@ ImageToLineSpatialObjectListFilter<TInputImage> return static_cast<const InputImageType *> (this->itk::ProcessObject::GetInput(0) ); } - - -template<class TInputImage> -typename ImageToLineSpatialObjectListFilter<TInputImage>::LinesListType & -ImageToLineSpatialObjectListFilter<TInputImage>::GetOutput(void) -{ - return(m_OutputLinesList); + + +template <class TInputImage> +void +ImageToLineSpatialObjectListFilter<TInputImage> +::SetOutput(const LinesListType *list) + { + this->itk::ProcessObject::SetNthOutput(0, + const_cast< LinesListType * >( list ) ); + } + + +template <class TInputImage> +typename ImageToLineSpatialObjectListFilter<TInputImage>::LinesListType * +ImageToLineSpatialObjectListFilter<TInputImage> +::GetOutput(void) +{ + return static_cast<LinesListType *> + (this->itk::ProcessObject::GetOutput(0) ); } + /** * */ -- GitLab