VTK  9.3.20240327
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
125 #ifndef vtkParametricRandomHills_h
126 #define vtkParametricRandomHills_h
127 
128 #include "vtkCommonComputationalGeometryModule.h" // For export macro
129 #include "vtkParametricFunction.h"
130 
131 VTK_ABI_NAMESPACE_BEGIN
132 class vtkDoubleArray;
134 
135 class VTKCOMMONCOMPUTATIONALGEOMETRY_EXPORT vtkParametricRandomHills : public vtkParametricFunction
136 {
137 
138 public:
140  void PrintSelf(ostream& os, vtkIndent indent) override;
141 
145  int GetDimension() override { return 2; }
146 
164 
166 
170  vtkSetMacro(NumberOfHills, int);
171  vtkGetMacro(NumberOfHills, int);
173 
175 
179  vtkSetMacro(HillXVariance, double);
180  vtkGetMacro(HillXVariance, double);
182 
184 
188  vtkSetMacro(HillYVariance, double);
189  vtkGetMacro(HillYVariance, double);
191 
193 
197  vtkSetMacro(HillAmplitude, double);
198  vtkGetMacro(HillAmplitude, double);
200 
202 
208  vtkSetMacro(RandomSeed, int);
209  vtkGetMacro(RandomSeed, int);
211 
213 
226  vtkSetClampMacro(AllowRandomGeneration, vtkTypeBool, 0, 1);
227  vtkGetMacro(AllowRandomGeneration, vtkTypeBool);
228  vtkBooleanMacro(AllowRandomGeneration, vtkTypeBool);
230 
232 
236  vtkSetMacro(XVarianceScaleFactor, double);
237  vtkGetMacro(XVarianceScaleFactor, double);
239 
241 
245  vtkSetMacro(YVarianceScaleFactor, double);
246  vtkGetMacro(YVarianceScaleFactor, double);
248 
250 
254  vtkSetMacro(AmplitudeScaleFactor, double);
255  vtkGetMacro(AmplitudeScaleFactor, double);
257 
266  void Evaluate(double uvw[3], double Pt[3], double Duvw[9]) override;
267 
281  double EvaluateScalar(double uvw[3], double Pt[3], double Duvw[9]) override;
282 
283 protected:
286 
287  // Variables
297 
298  // These variables store the previous values of the above ones.
308 
309 private:
311  void operator=(const vtkParametricRandomHills&) = delete;
312 
316  void InitRNG(int RandomSeed);
317 
321  double Rand();
322 
326  vtkMinimalStandardRandomSequence* randomSequenceGenerator;
327 
334  void MakeTheHillData();
335 
339  bool ParametersChanged();
340 
344  void CopyParameters();
345 
347 
350  vtkDoubleArray* hillData;
352 };
353 
354 VTK_ABI_NAMESPACE_END
355 #endif
dynamic, self-adjusting array of double
a simple class to control print indentation
Definition: vtkIndent.h:108
Park and Miller Sequence of pseudo random numbers.
abstract interface for parametric functions
Generate a surface covered with randomly placed hills.
static vtkParametricRandomHills * New()
Construct a surface of random hills with the following parameters: MinimumU = -10,...
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.
~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