OTB  9.0.0
Orfeo Toolbox
otbRandomPointSetSource.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 
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
otb::RandomPointSetSource::SeedType
GeneratorType::IntegerType SeedType
Definition: otbRandomPointSetSource.h:72
otb::RandomPointSetSource::m_NumberOfPoints
unsigned int m_NumberOfPoints
Definition: otbRandomPointSetSource.h:99
otb::RandomPointSetSource::GeneratorType
itk::Statistics::MersenneTwisterRandomVariateGenerator GeneratorType
Definition: otbRandomPointSetSource.h:70
otb::RandomPointSetSource::PointsContainerPointer
PointsContainerType::Pointer PointsContainerPointer
Definition: otbRandomPointSetSource.h:68
otb::RandomPointSetSource
This class generate a random point set.
Definition: otbRandomPointSetSource.h:47
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::RandomPointSetSource::Self
RandomPointSetSource Self
Definition: otbRandomPointSetSource.h:52
otb::RandomPointSetSource::SetSeed
void SetSeed(SeedType seed)
Definition: otbRandomPointSetSource.h:82
otb::RandomPointSetSource::~RandomPointSetSource
~RandomPointSetSource() override
Definition: otbRandomPointSetSource.h:89
otb::RandomPointSetSource::GeneratorPointerType
GeneratorType::Pointer GeneratorPointerType
Definition: otbRandomPointSetSource.h:71
otb::RandomPointSetSource::DataObjectPointer
itk::DataObject::Pointer DataObjectPointer
Definition: otbRandomPointSetSource.h:61
otb::PointSetSource
Base class for all process objects that output point set data.
Definition: otbPointSetSource.h:45
otb::RandomPointSetSource::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbRandomPointSetSource.h:54
otb::RandomPointSetSource::Superclass
PointSetSource< TOutputPointSet > Superclass
Definition: otbRandomPointSetSource.h:53
otbPointSetSource.h
otb::RandomPointSetSource::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbRandomPointSetSource.h:55
otb::RandomPointSetSource::OutputPointSetType
TOutputPointSet OutputPointSetType
Definition: otbRandomPointSetSource.h:65
otb::RandomPointSetSource::PointsContainerType
OutputPointSetType::PointsContainer PointsContainerType
Definition: otbRandomPointSetSource.h:67
otbRandomPointSetSource.hxx
otb::RandomPointSetSource::PointType
OutputPointSetType::PointType PointType
Definition: otbRandomPointSetSource.h:69
otb::RandomPointSetSource::m_Generator
GeneratorPointerType m_Generator
Definition: otbRandomPointSetSource.h:101
otb::RandomPointSetSource::m_MinPoint
PointType m_MinPoint
Definition: otbRandomPointSetSource.h:103
otb::RandomPointSetSource::m_MaxPoint
PointType m_MaxPoint
Definition: otbRandomPointSetSource.h:104
otb::RandomPointSetSource::OutputPointSetPointer
OutputPointSetType::Pointer OutputPointSetPointer
Definition: otbRandomPointSetSource.h:66