Orfeo ToolBox  4.2
Orfeo ToolBox is not a black box
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
37 ::SetInput( const InputSampleListType * inputPtr )
38 {
39  // Process object is not const-correct so the const_cast is required here
40  this->itk::ProcessObject::SetNthInput(0,
41  const_cast< InputSampleListType* >( inputPtr ) );
42 }
43 
44 template < class TInputSampleList, class TOutputSampleList >
46 ::InputSampleListType *
48 ::GetInput() const
49 {
50  if (this->GetNumberOfInputs() < 1)
51  {
52  return 0;
53  }
54 
55  return static_cast<const InputSampleListType * >
56  (this->itk::ProcessObject::GetInput(0) );
57 }
58 
59 template < class TInputSampleList, class TOutputSampleList >
60 void
62 ::PrintSelf(std::ostream& os, itk::Indent indent) const
63 {
64  // Call superclass implementation
65  Superclass::PrintSelf(os, indent);
66 }
67 
68 } // End namespace Statistics
69 } // End namespace otb
70 
71 #endif
This class is a base class for fitlers using ListSample as input and returning ListSample.
void SetInput(const InputSampleListType *inputPtr)
void PrintSelf(std::ostream &os, itk::Indent indent) const