OTB  6.7.0
Orfeo Toolbox
otbSamplerBase.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2019 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;
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 
84  unsigned long m_ChosenElements;
85 
87  unsigned long m_ProcessedElements;
88 
89 private:
90  // Not implemented
91  SamplerBase(const Self&);
92  void operator=(const Self&);
93 
95  unsigned long m_TotalElements;
96 
98  unsigned long m_NeededElements;
99 
101  double m_Rate;
102 };
103 
104 } // namespace otb
105 #endif
unsigned long m_TotalElements
itk::Object Superclass
itk::SmartPointer< const Self > ConstPointer
~SamplerBase() override
itk::SmartPointer< Self > Pointer
unsigned long m_ChosenElements
unsigned long m_ProcessedElements
unsigned long m_NeededElements
SamplerBase Self
This is a base class for sampling methods.