OTB  9.0.0
Orfeo Toolbox
otbSamplerBase.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 otbSamplerBase_h
22 #define otbSamplerBase_h
23 
24 #include "itkObject.h"
25 #include "itkObjectFactory.h"
26 
27 namespace otb
28 {
29 
37 class ITK_EXPORT SamplerBase : public itk::Object
38 {
39 public:
40  typedef SamplerBase Self;
41  typedef itk::Object Superclass;
42  typedef itk::SmartPointer<Self> Pointer;
43  typedef itk::SmartPointer<const Self> ConstPointer;
44 
46  itkTypeMacro(SamplerBase, itk::Object);
47 
51  virtual void Reset(void);
52 
55  void SetNumberOfElements(unsigned long needed, unsigned long total);
56 
59  void SetRate(double rate, unsigned long total = 0UL);
60 
62  itkGetMacro(Rate, double);
63 
65  itkGetMacro(TotalElements, unsigned long);
66 
68  itkGetMacro(NeededElements, unsigned long);
69 
71  itkGetMacro(ChosenElements, unsigned long);
72 
74  itkGetMacro(ProcessedElements, unsigned long);
75 
76 protected:
78  SamplerBase();
79 
81  ~SamplerBase() override
82  {
83  }
84 
86  unsigned long m_ChosenElements;
87 
89  unsigned long m_ProcessedElements;
90 
91 private:
92  // Not implemented
93  SamplerBase(const Self&);
94  void operator=(const Self&);
95 
97  unsigned long m_TotalElements;
98 
100  unsigned long m_NeededElements;
101 
103  double m_Rate;
104 };
105 
106 } // namespace otb
107 #endif
otb::SamplerBase::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbSamplerBase.h:42
otb::SamplerBase::Superclass
itk::Object Superclass
Definition: otbSamplerBase.h:41
otb::SamplerBase::~SamplerBase
~SamplerBase() override
Definition: otbSamplerBase.h:81
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::SamplerBase::m_TotalElements
unsigned long m_TotalElements
Definition: otbSamplerBase.h:97
otb::SamplerBase
This is a base class for sampling methods.
Definition: otbSamplerBase.h:37
otb::SamplerBase::m_NeededElements
unsigned long m_NeededElements
Definition: otbSamplerBase.h:100
otb::SamplerBase::Self
SamplerBase Self
Definition: otbSamplerBase.h:40
otb::SamplerBase::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbSamplerBase.h:43
otb::SamplerBase::m_Rate
double m_Rate
Definition: otbSamplerBase.h:103
otb::SamplerBase::m_ChosenElements
unsigned long m_ChosenElements
Definition: otbSamplerBase.h:86
otb::SamplerBase::m_ProcessedElements
unsigned long m_ProcessedElements
Definition: otbSamplerBase.h:89