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=========================================================================*/
38#ifndef vtkParametricRandomHills_h
39#define vtkParametricRandomHills_h
40
41#include "vtkCommonComputationalGeometryModule.h" // For export macro
43
44class vtkDoubleArray;
46
47class VTKCOMMONCOMPUTATIONALGEOMETRY_EXPORT vtkParametricRandomHills : public vtkParametricFunction
48{
49
50public:
52 void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
53
57 int GetDimension() VTK_OVERRIDE {return 2;}
58
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,int,0,1);
139 vtkGetMacro(AllowRandomGeneration,int);
140 vtkBooleanMacro(AllowRandomGeneration,int);
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]) VTK_OVERRIDE;
179
193 double EvaluateScalar(double uvw[3], double Pt[3], double Duvw[9]) VTK_OVERRIDE;
194
195protected:
198
199 // Variables
200 int NumberOfHills;
201 double HillXVariance;
202 double HillYVariance;
203 double HillAmplitude;
204 int RandomSeed;
205 double XVarianceScaleFactor;
206 double YVarianceScaleFactor;
207 double AmplitudeScaleFactor;
208 int AllowRandomGeneration;
209
210 // These variables store the previous values of the above ones.
211 int previousNumberOfHills;
212 double previousHillXVariance;
213 double previousHillYVariance;
214 double previousHillAmplitude;
215 int previousRandomSeed;
216 double previousXVarianceScaleFactor;
217 double previousYVarianceScaleFactor;
218 double previousAmplitudeScaleFactor;
219 int previousAllowRandomGeneration;
220
221private:
222 vtkParametricRandomHills(const vtkParametricRandomHills&) VTK_DELETE_FUNCTION;
223 void operator=(const vtkParametricRandomHills&) VTK_DELETE_FUNCTION;
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;
263};
265
266#endif
dynamic, self-adjusting array of double
a simple class to control print indentation
Definition: vtkIndent.h:40
Park and Miller Sequence of pseudo random numbers.
abstract interface for parametric functions
Generate a surface covered with randomly placed hills.
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.
static vtkParametricRandomHills * New()
Construct a surface of random hills with the following parameters: MinimumU = -10,...
~vtkParametricRandomHills() override
void Evaluate(double uvw[3], double Pt[3], double Duvw[9]) override
Construct a terrain consisting of hills on a surface.
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.