OTB  9.0.0
Orfeo Toolbox
otbUnaryFunctorObjectListBooleanFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2022 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 otbUnaryFunctorObjectListBooleanFilter_h
22 #define otbUnaryFunctorObjectListBooleanFilter_h
23 
25 
26 namespace otb
27 {
28 
40 template <class TInputList, class TOutputList, class TFunction>
41 class ITK_EXPORT UnaryFunctorObjectListBooleanFilter : public otb::ObjectListToObjectListFilter<TInputList, TOutputList>
42 {
43 public:
47  typedef itk::SmartPointer<Self> Pointer;
48  typedef itk::SmartPointer<const Self> ConstPointer;
49 
51  itkNewMacro(Self);
52 
55 
57  typedef TFunction FunctorType;
58  typedef TInputList InputListType;
59  typedef TOutputList OutputListType;
60  typedef typename TInputList::ConstPointer InputListPointer;
61  typedef typename TOutputList::Pointer OutputListPointer;
62  typedef typename TInputList::ConstIterator InputListIterator;
63  typedef typename TOutputList::ConstIterator OutputListIterator;
64 
70  {
71  return m_Functor;
72  }
73  const FunctorType& GetFunctor() const
74  {
75  return m_Functor;
76  }
78 
85  void SetFunctor(const FunctorType& functor)
86  {
87  if (m_Functor != functor)
88  {
89  m_Functor = functor;
90  this->Modified();
91  }
92  }
94 
95 protected:
98  {
99  }
100 
103  void AfterThreadedGenerateData() override;
104 
107  void ThreadedGenerateData(unsigned int startIndex, unsigned int stopIndex, itk::ThreadIdType threadId) override;
108 
111  {
113  };
114 
117 private:
118  UnaryFunctorObjectListBooleanFilter(const Self&) = delete;
119  void operator=(const Self&) = delete;
120 
122 };
123 
124 } // end namespace otb
125 
126 #ifndef OTB_MANUAL_INSTANTIATION
128 #endif
129 
130 #endif
otbObjectListToObjectListFilter.h
otb::ObjectListSource::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbObjectListSource.h:53
otb::UnaryFunctorObjectListBooleanFilter::OutputListIterator
TOutputList::ConstIterator OutputListIterator
Definition: otbUnaryFunctorObjectListBooleanFilter.h:63
otbUnaryFunctorObjectListBooleanFilter.hxx
otb::UnaryFunctorObjectListBooleanFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbUnaryFunctorObjectListBooleanFilter.h:47
otb::UnaryFunctorObjectListBooleanFilter::~UnaryFunctorObjectListBooleanFilter
~UnaryFunctorObjectListBooleanFilter() override
Definition: otbUnaryFunctorObjectListBooleanFilter.h:97
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::UnaryFunctorObjectListBooleanFilter::GetFunctor
FunctorType & GetFunctor()
Definition: otbUnaryFunctorObjectListBooleanFilter.h:69
otb::UnaryFunctorObjectListBooleanFilter::m_Functor
FunctorType m_Functor
Definition: otbUnaryFunctorObjectListBooleanFilter.h:121
otb::UnaryFunctorObjectListBooleanFilter::SetFunctor
void SetFunctor(const FunctorType &functor)
Definition: otbUnaryFunctorObjectListBooleanFilter.h:85
otb::UnaryFunctorObjectListBooleanFilter
Filter an ObjectList and keep elements according to the functor value.
Definition: otbUnaryFunctorObjectListBooleanFilter.h:41
otb::UnaryFunctorObjectListBooleanFilter::ThreadStruct
Definition: otbUnaryFunctorObjectListBooleanFilter.h:110
otb::UnaryFunctorObjectListBooleanFilter::InputListPointer
TInputList::ConstPointer InputListPointer
Definition: otbUnaryFunctorObjectListBooleanFilter.h:60
otb::UnaryFunctorObjectListBooleanFilter::FunctorType
TFunction FunctorType
Definition: otbUnaryFunctorObjectListBooleanFilter.h:54
otb::UnaryFunctorObjectListBooleanFilter::Self
UnaryFunctorObjectListBooleanFilter Self
Definition: otbUnaryFunctorObjectListBooleanFilter.h:45
otb::UnaryFunctorObjectListBooleanFilter::GetFunctor
const FunctorType & GetFunctor() const
Definition: otbUnaryFunctorObjectListBooleanFilter.h:73
otb::ObjectListToObjectListFilter
Base class for filters that take an ObjectList as input and produce an ObjectList as output.
Definition: otbObjectListToObjectListFilter.h:46
otb::ObjectListSource
Base class for all process objects that output ObjectList data.
Definition: otbObjectListSource.h:47
otb::UnaryFunctorObjectListBooleanFilter::ThreadStruct::Filter
Pointer Filter
Definition: otbUnaryFunctorObjectListBooleanFilter.h:112
otb::UnaryFunctorObjectListBooleanFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbUnaryFunctorObjectListBooleanFilter.h:48
otb::UnaryFunctorObjectListBooleanFilter::InputListIterator
TInputList::ConstIterator InputListIterator
Definition: otbUnaryFunctorObjectListBooleanFilter.h:62
otb::UnaryFunctorObjectListBooleanFilter::Superclass
otb::ObjectListToObjectListFilter< TInputList, TOutputList > Superclass
Definition: otbUnaryFunctorObjectListBooleanFilter.h:46
otb::UnaryFunctorObjectListBooleanFilter::OutputListType
TOutputList OutputListType
Definition: otbUnaryFunctorObjectListBooleanFilter.h:59
otb::UnaryFunctorObjectListBooleanFilter::OutputListPointer
TOutputList::Pointer OutputListPointer
Definition: otbUnaryFunctorObjectListBooleanFilter.h:61
otb::UnaryFunctorObjectListBooleanFilter::InputListType
TInputList InputListType
Definition: otbUnaryFunctorObjectListBooleanFilter.h:58