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
35#ifndef vtkParametricRandomHills_h
36#define vtkParametricRandomHills_h
37
38#include "vtkCommonComputationalGeometryModule.h" // For export macro
40
41VTK_ABI_NAMESPACE_BEGIN
42class vtkDoubleArray;
44
45class VTKCOMMONCOMPUTATIONALGEOMETRY_EXPORT vtkParametricRandomHills : public vtkParametricFunction
46{
47
48public:
50 void PrintSelf(ostream& os, vtkIndent indent) override;
51
55 int GetDimension() override { return 2; }
56
74
76
80 vtkSetMacro(NumberOfHills, int);
81 vtkGetMacro(NumberOfHills, int);
83
85
89 vtkSetMacro(HillXVariance, double);
90 vtkGetMacro(HillXVariance, double);
92
94
98 vtkSetMacro(HillYVariance, double);
99 vtkGetMacro(HillYVariance, double);
101
103
107 vtkSetMacro(HillAmplitude, double);
108 vtkGetMacro(HillAmplitude, double);
110
112
118 vtkSetMacro(RandomSeed, int);
119 vtkGetMacro(RandomSeed, int);
121
123
136 vtkSetClampMacro(AllowRandomGeneration, vtkTypeBool, 0, 1);
137 vtkGetMacro(AllowRandomGeneration, vtkTypeBool);
138 vtkBooleanMacro(AllowRandomGeneration, vtkTypeBool);
140
142
146 vtkSetMacro(XVarianceScaleFactor, double);
147 vtkGetMacro(XVarianceScaleFactor, double);
149
151
155 vtkSetMacro(YVarianceScaleFactor, double);
156 vtkGetMacro(YVarianceScaleFactor, double);
158
160
164 vtkSetMacro(AmplitudeScaleFactor, double);
165 vtkGetMacro(AmplitudeScaleFactor, double);
167
176 void Evaluate(double uvw[3], double Pt[3], double Duvw[9]) override;
177
191 double EvaluateScalar(double uvw[3], double Pt[3], double Duvw[9]) override;
192
193protected:
196
197 // Variables
207
208 // These variables store the previous values of the above ones.
218
219private:
221 void operator=(const vtkParametricRandomHills&) = delete;
222
226 void InitRNG(int RandomSeed);
227
231 double Rand();
232
236 vtkMinimalStandardRandomSequence* randomSequenceGenerator;
237
244 void MakeTheHillData();
245
249 bool ParametersChanged();
250
254 void CopyParameters();
255
257
260 vtkDoubleArray* hillData;
262};
263
264VTK_ABI_NAMESPACE_END
265#endif
dynamic, self-adjusting array of double
a simple class to control print indentation
Definition vtkIndent.h:38
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