VTK
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 =========================================================================*/
35 #ifndef vtkParametricRandomHills_h
36 #define vtkParametricRandomHills_h
37 
38 #include "vtkCommonComputationalGeometryModule.h" // For export macro
39 #include "vtkParametricFunction.h"
40 
41 class vtkDoubleArray;
43 
44 class VTKCOMMONCOMPUTATIONALGEOMETRY_EXPORT vtkParametricRandomHills :
46 {
47 
48  public:
50  void PrintSelf(ostream& os, vtkIndent indent) override;
51 
55  int GetDimension() override {return 2;}
56 
73  static vtkParametricRandomHills *New();
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],
192  double Duvw[9]) override;
193 
194  protected:
196  ~vtkParametricRandomHills() override;
197 
198  // Variables
208 
209  // These variables store the previous values of the above ones.
219 
220  private:
222  void operator=(const vtkParametricRandomHills&) = delete;
223 
227  void InitRNG(int RandomSeed);
228 
232  double Rand(void);
233 
237  vtkMinimalStandardRandomSequence *randomSequenceGenerator;
238 
245  void MakeTheHillData(void);
246 
250  bool ParametersChanged();
251 
255  void CopyParameters();
256 
258 
261  vtkDoubleArray *hillData;
262 };
264 
265 #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:33
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...