Orfeo Toolbox  3.16
otbListSampleToListSampleFilter.txx
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ORFEO Toolbox
4  Language: C++
5  Date: $Date$
6  Version: $Revision$
7 
8 
9  Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
10  See OTBCopyright.txt for details.
11 
12 
13  This software is distributed WITHOUT ANY WARRANTY; without even
14  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  PURPOSE. See the above copyright notices for more information.
16 
17 =========================================================================*/
18 #ifndef __otbListSampleToListSample_txx
19 #define __otbListSampleToListSample_txx
20 
22 #include "itkProgressReporter.h"
23 
24 namespace otb {
25 namespace Statistics {
26 
27 template < class TInputSampleList, class TOutputSampleList >
30 {
31  this->SetNumberOfRequiredInputs(1);
32 }
33 
34 template < class TInputSampleList, class TOutputSampleList >
35 void
38 {
39  typename InputSampleListObjectType::Pointer inputPtr = InputSampleListObjectType::New();
40  inputPtr->Set(input);
41  this->SetInput(inputPtr);
42 }
43 
44 template < class TInputSampleList, class TOutputSampleList >
45 void
48 {
49  // Process object is not const-correct so the const_cast is required here
51  const_cast< InputSampleListObjectType* >( inputPtr ) );
52 }
53 
54 template < class TInputSampleList, class TOutputSampleList >
56 ::InputSampleListObjectType *
58 ::GetInput() const
59 {
60  if (this->GetNumberOfInputs() < 1)
61  {
62  return 0;
63  }
64 
65  return static_cast<const InputSampleListObjectType * >
66  (this->itk::ProcessObject::GetInput(0) );
67 }
68 
69 template < class TInputSampleList, class TOutputSampleList >
71 ::InputSampleListType *
74 {
75  if (this->GetNumberOfInputs() < 1)
76  {
77  return 0;
78  }
79 
80  typename InputSampleListObjectType::Pointer dataObjectPointer = static_cast<const InputSampleListObjectType * >
81  (this->itk::ProcessObject::GetInput(0) );
82  return dataObjectPointer->Get();
83 }
84 
85 template < class TInputSampleList, class TOutputSampleList >
86 void
88 ::PrintSelf(std::ostream& os, itk::Indent indent) const
89 {
90  // Call superclass implementation
91  Superclass::PrintSelf(os, indent);
92 }
93 
94 } // End namespace Statistics
95 } // End namespace otb
96 
97 #endif

Generated at Sun Feb 3 2013 00:34:50 for Orfeo Toolbox with doxygen 1.8.1.1