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) VTK_OVERRIDE;
51 
55  int GetDimension() VTK_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, int, 0, 1);
137  vtkGetMacro(AllowRandomGeneration, int);
138  vtkBooleanMacro(AllowRandomGeneration, int);
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]) VTK_OVERRIDE;
177 
191  double EvaluateScalar(double uvw[3], double Pt[3],
192  double Duvw[9]) VTK_OVERRIDE;
193 
194  protected:
196  ~vtkParametricRandomHills() VTK_OVERRIDE;
197 
198  // Variables
199  int NumberOfHills;
200  double HillXVariance;
201  double HillYVariance;
202  double HillAmplitude;
203  int RandomSeed;
204  double XVarianceScaleFactor;
205  double YVarianceScaleFactor;
206  double AmplitudeScaleFactor;
207  int AllowRandomGeneration;
208 
209  // These variables store the previous values of the above ones.
210  int previousNumberOfHills;
211  double previousHillXVariance;
212  double previousHillYVariance;
213  double previousHillAmplitude;
214  int previousRandomSeed;
215  double previousXVarianceScaleFactor;
216  double previousYVarianceScaleFactor;
217  double previousAmplitudeScaleFactor;
218  int previousAllowRandomGeneration;
219 
220  private:
221  vtkParametricRandomHills(const vtkParametricRandomHills&) VTK_DELETE_FUNCTION;
222  void operator=(const vtkParametricRandomHills&) VTK_DELETE_FUNCTION;
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
abstract interface for parametric functions
a simple class to control print indentation
Definition: vtkIndent.h:33
Park and Miller Sequence of pseudo random numbers.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...