VTK
dox/Common/ComputationalGeometry/vtkParametricRandomHills.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkParametricRandomHills.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00033 #ifndef __vtkParametricRandomHills_h
00034 #define __vtkParametricRandomHills_h
00035 
00036 #include "vtkCommonComputationalGeometryModule.h" // For export macro
00037 #include "vtkParametricFunction.h"
00038 
00039 class vtkDoubleArray;
00040 
00041 class VTKCOMMONCOMPUTATIONALGEOMETRY_EXPORT vtkParametricRandomHills : public vtkParametricFunction
00042 {
00043 
00044 public:
00045   vtkTypeMacro(vtkParametricRandomHills,vtkParametricFunction);
00046   void PrintSelf(ostream& os, vtkIndent indent);
00047 
00049   virtual int GetDimension() {return 2;}
00050 
00059   static vtkParametricRandomHills *New();
00060 
00062 
00063   vtkSetMacro(NumberOfHills,int);
00064   vtkGetMacro(NumberOfHills,int);
00066 
00068 
00069   vtkSetMacro(HillXVariance,double);
00070   vtkGetMacro(HillXVariance,double);
00072 
00074 
00075   vtkSetMacro(HillYVariance,double);
00076   vtkGetMacro(HillYVariance,double);
00078 
00080 
00081   vtkSetMacro(HillAmplitude,double);
00082   vtkGetMacro(HillAmplitude,double);
00084 
00086 
00089   vtkSetMacro(RandomSeed,int);
00090   vtkGetMacro(RandomSeed,int);
00092 
00094 
00098   vtkSetMacro(AllowRandomGeneration,int);
00099   vtkGetMacro(AllowRandomGeneration,int);
00100   vtkBooleanMacro(AllowRandomGeneration,int);
00102 
00104 
00106   vtkSetMacro(XVarianceScaleFactor,double);
00107   vtkGetMacro(XVarianceScaleFactor,double);
00109 
00111 
00113   vtkSetMacro(YVarianceScaleFactor,double);
00114   vtkGetMacro(YVarianceScaleFactor,double);
00116 
00118 
00119   vtkSetMacro(AmplitudeScaleFactor,double);
00120   vtkGetMacro(AmplitudeScaleFactor,double);
00122 
00128   void GenerateTheHills( void );
00129 
00138   virtual void Evaluate(double uvw[3], double Pt[3], double Duvw[9]);
00139 
00148   virtual double EvaluateScalar(double uvw[3], double Pt[3], double Duvw[9]);
00149 
00150 protected:
00151   vtkParametricRandomHills();
00152   ~vtkParametricRandomHills();
00153 
00154   // Variables
00155   int NumberOfHills;
00156   double HillXVariance;
00157   double HillYVariance;
00158   double HillAmplitude;
00159   int RandomSeed;
00160   double XVarianceScaleFactor;
00161   double YVarianceScaleFactor;
00162   double AmplitudeScaleFactor;
00163   int AllowRandomGeneration;
00164 
00165 private:
00166   vtkParametricRandomHills(const vtkParametricRandomHills&);  // Not implemented.
00167   void operator=(const vtkParametricRandomHills&);  // Not implemented.
00168 
00170   void InitSeed ( int RandomSeed );
00171 
00173   double Rand ( void );
00174 
00176 
00177   vtkDoubleArray * hillData;
00178 };
00180 
00181 #endif