OTB  10.0.0
Orfeo Toolbox
otbUnaryFunctorObjectListBooleanFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2024 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:
119  void operator=(const Self&) = delete;
120 
122 };
123 
124 } // end namespace otb
125 
126 #ifndef OTB_MANUAL_INSTANTIATION
128 #endif
129 
130 #endif
Base class for all process objects that output ObjectList data.
itk::SmartPointer< Self > Pointer
Base class for filters that take an ObjectList as input and produce an ObjectList as output.
Filter an ObjectList and keep elements according to the functor value.
void operator=(const Self &)=delete
otb::ObjectListToObjectListFilter< TInputList, TOutputList > Superclass
UnaryFunctorObjectListBooleanFilter(const Self &)=delete
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.