VTK  9.2.6
vtkParametricRandomHills.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkParametricRandomHills.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
38 #ifndef vtkParametricRandomHills_h
39 #define vtkParametricRandomHills_h
40 
41 #include "vtkCommonComputationalGeometryModule.h" // For export macro
42 #include "vtkParametricFunction.h"
43 
44 class vtkDoubleArray;
46 
47 class VTKCOMMONCOMPUTATIONALGEOMETRY_EXPORT vtkParametricRandomHills : public vtkParametricFunction
48 {
49 
50 public:
52  void PrintSelf(ostream& os, vtkIndent indent) override;
53 
57  int GetDimension() override { return 2; }
58 
75  static vtkParametricRandomHills* New();
76 
78 
82  vtkSetMacro(NumberOfHills, int);
83  vtkGetMacro(NumberOfHills, int);
85 
87 
91  vtkSetMacro(HillXVariance, double);
92  vtkGetMacro(HillXVariance, double);
94 
96 
100  vtkSetMacro(HillYVariance, double);
101  vtkGetMacro(HillYVariance, double);
103 
105 
109  vtkSetMacro(HillAmplitude, double);
110  vtkGetMacro(HillAmplitude, double);
112 
114 
120  vtkSetMacro(RandomSeed, int);
121  vtkGetMacro(RandomSeed, int);
123 
125 
138  vtkSetClampMacro(AllowRandomGeneration, vtkTypeBool, 0, 1);
139  vtkGetMacro(AllowRandomGeneration, vtkTypeBool);
140  vtkBooleanMacro(AllowRandomGeneration, vtkTypeBool);
142 
144 
148  vtkSetMacro(XVarianceScaleFactor, double);
149  vtkGetMacro(XVarianceScaleFactor, double);
151 
153 
157  vtkSetMacro(YVarianceScaleFactor, double);
158  vtkGetMacro(YVarianceScaleFactor, double);
160 
162 
166  vtkSetMacro(AmplitudeScaleFactor, double);
167  vtkGetMacro(AmplitudeScaleFactor, double);
169 
178  void Evaluate(double uvw[3], double Pt[3], double Duvw[9]) override;
179 
193  double EvaluateScalar(double uvw[3], double Pt[3], double Duvw[9]) override;
194 
195 protected:
197  ~vtkParametricRandomHills() override;
198 
199  // Variables
209 
210  // These variables store the previous values of the above ones.
220 
221 private:
223  void operator=(const vtkParametricRandomHills&) = delete;
224 
228  void InitRNG(int RandomSeed);
229 
233  double Rand(void);
234 
238  vtkMinimalStandardRandomSequence* randomSequenceGenerator;
239 
246  void MakeTheHillData(void);
247 
251  bool ParametersChanged();
252 
256  void CopyParameters();
257 
259 
262  vtkDoubleArray* hillData;
264 };
265 
266 #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:69
abstract interface for parametric functions
a simple class to control print indentation
Definition: vtkIndent.h:39
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...