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
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) VTK_OVERRIDE;
53 
57  int GetDimension() VTK_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,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 
195 protected:
197  ~vtkParametricRandomHills() VTK_OVERRIDE;
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 
221 private:
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
vtkMinimalStandardRandomSequence
Park and Miller Sequence of pseudo random numbers.
Definition: vtkMinimalStandardRandomSequence.h:47
vtkParametricFunction::Evaluate
virtual void Evaluate(double uvw[3], double Pt[3], double Duvw[9])=0
Performs the mapping $f(uvw)->(Pt,Duvw)$f.
vtkParametricFunction::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkParametricRandomHills
Generate a surface covered with randomly placed hills.
Definition: vtkParametricRandomHills.h:47
vtkParametricFunction
abstract interface for parametric functions
Definition: vtkParametricFunction.h:62
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkParametricFunction.h
vtkParametricFunction::EvaluateScalar
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.
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:41
vtkParametricRandomHills::GetDimension
int GetDimension() override
Return the parametric dimension of the class.
Definition: vtkParametricRandomHills.h:57