OTB  10.0.0
Orfeo Toolbox
otbSamplerBase.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 otbSamplerBase_h
22 #define otbSamplerBase_h
23 
24 #include "itkObject.h"
25 #include "itkObjectFactory.h"
26 #include "OTBStatisticsExport.h"
27 
28 namespace otb
29 {
30 
38 class OTBStatistics_EXPORT SamplerBase : public itk::Object
39 {
40 public:
41  typedef SamplerBase Self;
42  typedef itk::Object Superclass;
43  typedef itk::SmartPointer<Self> Pointer;
44  typedef itk::SmartPointer<const Self> ConstPointer;
45 
47  itkTypeMacro(SamplerBase, itk::Object);
48 
52  virtual void Reset(void);
53 
56  void SetNumberOfElements(unsigned long needed, unsigned long total);
57 
60  void SetRate(double rate, unsigned long total = 0UL);
61 
63  itkGetMacro(Rate, double);
64 
66  itkGetMacro(TotalElements, unsigned long);
67 
69  itkGetMacro(NeededElements, unsigned long);
70 
72  itkGetMacro(ChosenElements, unsigned long);
73 
75  itkGetMacro(ProcessedElements, unsigned long);
76 
77 protected:
80 
82  ~SamplerBase() override
83  {
84  }
85 
87  unsigned long m_ChosenElements;
88 
90  unsigned long m_ProcessedElements;
91 
92 private:
93  // Not implemented
94  SamplerBase(const Self&);
95  void operator=(const Self&);
96 
98  unsigned long m_TotalElements;
99 
101  unsigned long m_NeededElements;
102 
104  double m_Rate;
105 };
106 
107 } // namespace otb
108 #endif
This is a base class for sampling methods.
void SetNumberOfElements(unsigned long needed, unsigned long total)
void SetRate(double rate, unsigned long total=0UL)
virtual void Reset(void)
unsigned long m_TotalElements
SamplerBase(const Self &)
unsigned long m_NeededElements
unsigned long m_ProcessedElements
itk::SmartPointer< Self > Pointer
itk::Object Superclass
void operator=(const Self &)
unsigned long m_ChosenElements
~SamplerBase() override
SamplerBase Self
itk::SmartPointer< const Self > ConstPointer
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.