VTK  9.3.0
vtkParametricRandomHills.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
26#ifndef vtkParametricRandomHills_h
27#define vtkParametricRandomHills_h
28
29#include "vtkCommonComputationalGeometryModule.h" // For export macro
31
32VTK_ABI_NAMESPACE_BEGIN
33class vtkDoubleArray;
35
36class VTKCOMMONCOMPUTATIONALGEOMETRY_EXPORT vtkParametricRandomHills : public vtkParametricFunction
37{
38
39public:
41 void PrintSelf(ostream& os, vtkIndent indent) override;
42
46 int GetDimension() override { return 2; }
47
65
67
71 vtkSetMacro(NumberOfHills, int);
72 vtkGetMacro(NumberOfHills, int);
74
76
80 vtkSetMacro(HillXVariance, double);
81 vtkGetMacro(HillXVariance, double);
83
85
89 vtkSetMacro(HillYVariance, double);
90 vtkGetMacro(HillYVariance, double);
92
94
98 vtkSetMacro(HillAmplitude, double);
99 vtkGetMacro(HillAmplitude, double);
101
103
109 vtkSetMacro(RandomSeed, int);
110 vtkGetMacro(RandomSeed, int);
112
114
127 vtkSetClampMacro(AllowRandomGeneration, vtkTypeBool, 0, 1);
128 vtkGetMacro(AllowRandomGeneration, vtkTypeBool);
129 vtkBooleanMacro(AllowRandomGeneration, vtkTypeBool);
131
133
137 vtkSetMacro(XVarianceScaleFactor, double);
138 vtkGetMacro(XVarianceScaleFactor, double);
140
142
146 vtkSetMacro(YVarianceScaleFactor, double);
147 vtkGetMacro(YVarianceScaleFactor, double);
149
151
155 vtkSetMacro(AmplitudeScaleFactor, double);
156 vtkGetMacro(AmplitudeScaleFactor, double);
158
167 void Evaluate(double uvw[3], double Pt[3], double Duvw[9]) override;
168
182 double EvaluateScalar(double uvw[3], double Pt[3], double Duvw[9]) override;
183
184protected:
187
188 // Variables
198
199 // These variables store the previous values of the above ones.
209
210private:
212 void operator=(const vtkParametricRandomHills&) = delete;
213
217 void InitRNG(int RandomSeed);
218
222 double Rand();
223
227 vtkMinimalStandardRandomSequence* randomSequenceGenerator;
228
235 void MakeTheHillData();
236
240 bool ParametersChanged();
241
245 void CopyParameters();
246
248
251 vtkDoubleArray* hillData;
253};
254
255VTK_ABI_NAMESPACE_END
256#endif
dynamic, self-adjusting array of double
a simple class to control print indentation
Definition vtkIndent.h:29
Park and Miller Sequence of pseudo random numbers.
abstract interface for parametric functions
Generate a surface covered with randomly placed hills.
int GetDimension() override
Return the parametric dimension of the class.
double EvaluateScalar(double uvw[3], double Pt[3], double Duvw[9]) override
Calculate a user defined scalar using one or all of uvw, Pt, Duvw.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkParametricRandomHills * New()
Construct a surface of random hills with the following parameters: MinimumU = -10,...
~vtkParametricRandomHills() override
void Evaluate(double uvw[3], double Pt[3], double Duvw[9]) override
Construct a terrain consisting of hills on a surface.
int vtkTypeBool
Definition vtkABI.h:64