VTK  9.3.1
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
30 #include "vtkParametricFunction.h"
31 
32 VTK_ABI_NAMESPACE_BEGIN
33 class vtkDoubleArray;
35 
36 class VTKCOMMONCOMPUTATIONALGEOMETRY_EXPORT vtkParametricRandomHills : public vtkParametricFunction
37 {
38 
39 public:
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
46  int GetDimension() override { return 2; }
47 
64  static vtkParametricRandomHills* New();
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 
184 protected:
186  ~vtkParametricRandomHills() override;
187 
188  // Variables
198 
199  // These variables store the previous values of the above ones.
209 
210 private:
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 
255 VTK_ABI_NAMESPACE_END
256 #endif
Generate a surface covered with randomly placed hills.
virtual double EvaluateScalar(double uvw[3], double Pt[3], double Duvw[9])=0
Calculate a user defined scalar using one or all of uvw, Pt, Duvw.
virtual void Evaluate(double uvw[3], double Pt[3], double Duvw[9])=0
Performs the mapping $f(uvw)->(Pt,Duvw)$f.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int GetDimension() override
Return the parametric dimension of the class.
dynamic, self-adjusting array of double
int vtkTypeBool
Definition: vtkABI.h:64
abstract interface for parametric functions
a simple class to control print indentation
Definition: vtkIndent.h:28
Park and Miller Sequence of pseudo random numbers.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...