OTB  6.1.0
Orfeo Toolbox
otbListSampleToListSampleFilter.txx
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
3  *
4  * This file is part of Orfeo Toolbox
5  *
6  * https://www.orfeo-toolbox.org/
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #ifndef otbListSampleToListSample_txx
22 #define otbListSampleToListSample_txx
23 
25 #include "itkProgressReporter.h"
26 
27 namespace otb {
28 namespace Statistics {
29 
30 template < class TInputSampleList, class TOutputSampleList >
33 {
34  this->SetNumberOfRequiredInputs(1);
35 }
36 
37 template < class TInputSampleList, class TOutputSampleList >
38 void
40 ::SetInput( const InputSampleListType * inputPtr )
41 {
42  // Process object is not const-correct so the const_cast is required here
44  const_cast< InputSampleListType* >( inputPtr ) );
45 }
46 
47 template < class TInputSampleList, class TOutputSampleList >
49 ::InputSampleListType *
51 ::GetInput() const
52 {
53  if (this->GetNumberOfInputs() < 1)
54  {
55  return ITK_NULLPTR;
56  }
57 
58  return static_cast<const InputSampleListType * >
59  (this->itk::ProcessObject::GetInput(0) );
60 }
61 
62 template < class TInputSampleList, class TOutputSampleList >
63 void
65 ::PrintSelf(std::ostream& os, itk::Indent indent) const
66 {
67  // Call superclass implementation
68  Superclass::PrintSelf(os, indent);
69 }
70 
71 } // End namespace Statistics
72 } // End namespace otb
73 
74 #endif
void PrintSelf(std::ostream &os, itk::Indent indent) const ITK_OVERRIDE
DataObject * GetInput(const DataObjectIdentifierType &key)
This class is a base class for filters using ListSample as input and returning ListSample.
void SetInput(const InputSampleListType *inputPtr)
virtual void SetNthInput(DataObjectPointerArraySizeType num, DataObject *input)