OTB  10.0.0
Orfeo Toolbox
otbRandomPointSetSource.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 
22 #ifndef otbRandomPointSetSource_h
23 #define otbRandomPointSetSource_h
24 
25 #include "otbPointSetSource.h"
26 #include "itkMersenneTwisterRandomVariateGenerator.h"
27 
28 namespace otb
29 {
30 
46 template <class TOutputPointSet>
47 class ITK_EXPORT RandomPointSetSource : public PointSetSource<TOutputPointSet>
48 {
49 
50 public:
54  typedef itk::SmartPointer<Self> Pointer;
55  typedef itk::SmartPointer<const Self> ConstPointer;
56 
58  itkNewMacro(Self);
59 
62 
64  typedef itk::DataObject::Pointer DataObjectPointer;
65  typedef TOutputPointSet OutputPointSetType;
66  typedef typename OutputPointSetType::Pointer OutputPointSetPointer;
67  typedef typename OutputPointSetType::PointsContainer PointsContainerType;
68  typedef typename PointsContainerType::Pointer PointsContainerPointer;
69  typedef typename OutputPointSetType::PointType PointType;
70  typedef itk::Statistics::MersenneTwisterRandomVariateGenerator GeneratorType;
71  typedef GeneratorType::Pointer GeneratorPointerType;
72  typedef GeneratorType::IntegerType SeedType;
73 
74  itkSetMacro(NumberOfPoints, unsigned int);
75  itkGetMacro(NumberOfPoints, unsigned int);
76 
77  itkSetMacro(MinPoint, PointType);
78  itkGetMacro(MinPoint, PointType);
79  itkSetMacro(MaxPoint, PointType);
80  itkGetMacro(MaxPoint, PointType);
81 
82  void SetSeed(SeedType seed)
83  {
84  m_Generator->SetSeed(seed);
85  }
86 
87 protected:
90  {
91  }
92 
93  void GenerateData(void) override;
94 
95 private:
96  RandomPointSetSource(const Self&) = delete;
97  void operator=(const Self&) = delete;
98 
99  unsigned int m_NumberOfPoints;
100 
102 
105 };
106 }
107 
108 #ifndef OTB_MANUAL_INSTANTIATION
110 #endif
111 
112 #endif
Base class for all process objects that output point set data.
This class generate a random point set.
OutputPointSetType::PointType PointType
itk::Statistics::MersenneTwisterRandomVariateGenerator GeneratorType
void operator=(const Self &)=delete
PointSetSource< TOutputPointSet > Superclass
OutputPointSetType::PointsContainer PointsContainerType
GeneratorType::Pointer GeneratorPointerType
itk::DataObject::Pointer DataObjectPointer
GeneratorType::IntegerType SeedType
PointsContainerType::Pointer PointsContainerPointer
OutputPointSetType::Pointer OutputPointSetPointer
itk::SmartPointer< Self > Pointer
itk::SmartPointer< const Self > ConstPointer
RandomPointSetSource(const Self &)=delete
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.