VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/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 =========================================================================*/
00037 #ifndef vtkParametricRandomHills_h
00038 #define vtkParametricRandomHills_h
00039 
00040 #include "vtkCommonComputationalGeometryModule.h" // For export macro
00041 #include "vtkParametricFunction.h"
00042 
00043 class vtkDoubleArray;
00044 class vtkMinimalStandardRandomSequence;
00045 
00046 class VTKCOMMONCOMPUTATIONALGEOMETRY_EXPORT vtkParametricRandomHills : public vtkParametricFunction
00047 {
00048 
00049 public:
00050   vtkTypeMacro(vtkParametricRandomHills,vtkParametricFunction);
00051   void PrintSelf(ostream& os, vtkIndent indent);
00052 
00054   virtual int GetDimension() {return 2;}
00055 
00064   static vtkParametricRandomHills *New();
00065 
00067 
00068   vtkSetMacro(NumberOfHills,int);
00069   vtkGetMacro(NumberOfHills,int);
00071 
00073 
00074   vtkSetMacro(HillXVariance,double);
00075   vtkGetMacro(HillXVariance,double);
00077 
00079 
00080   vtkSetMacro(HillYVariance,double);
00081   vtkGetMacro(HillYVariance,double);
00083 
00085 
00086   vtkSetMacro(HillAmplitude,double);
00087   vtkGetMacro(HillAmplitude,double);
00089 
00091 
00094   vtkSetMacro(RandomSeed,int);
00095   vtkGetMacro(RandomSeed,int);
00097 
00099 
00107   vtkSetClampMacro(AllowRandomGeneration,int,0,1);
00108   vtkGetMacro(AllowRandomGeneration,int);
00109   vtkBooleanMacro(AllowRandomGeneration,int);
00111 
00113 
00115   vtkSetMacro(XVarianceScaleFactor,double);
00116   vtkGetMacro(XVarianceScaleFactor,double);
00118 
00120 
00122   vtkSetMacro(YVarianceScaleFactor,double);
00123   vtkGetMacro(YVarianceScaleFactor,double);
00125 
00127 
00128   vtkSetMacro(AmplitudeScaleFactor,double);
00129   vtkGetMacro(AmplitudeScaleFactor,double);
00131 
00137   VTK_LEGACY(void GenerateTheHills(void));
00138 
00144   virtual void Evaluate(double uvw[3], double Pt[3], double Duvw[9]);
00145 
00154   virtual double EvaluateScalar(double uvw[3], double Pt[3], double Duvw[9]);
00155 
00156 protected:
00157   vtkParametricRandomHills();
00158   ~vtkParametricRandomHills();
00159 
00160   // Variables
00161   int NumberOfHills;
00162   double HillXVariance;
00163   double HillYVariance;
00164   double HillAmplitude;
00165   int RandomSeed;
00166   double XVarianceScaleFactor;
00167   double YVarianceScaleFactor;
00168   double AmplitudeScaleFactor;
00169   int AllowRandomGeneration;
00170 
00171   // These variables store the previous values of the above ones.
00172   int previousNumberOfHills;
00173   double previousHillXVariance;
00174   double previousHillYVariance;
00175   double previousHillAmplitude;
00176   int previousRandomSeed;
00177   double previousXVarianceScaleFactor;
00178   double previousYVarianceScaleFactor;
00179   double previousAmplitudeScaleFactor;
00180   int previousAllowRandomGeneration;
00181 
00182 private:
00183   vtkParametricRandomHills(const vtkParametricRandomHills&);  // Not implemented.
00184   void operator=(const vtkParametricRandomHills&);  // Not implemented.
00185 
00187   void InitRNG ( int RandomSeed );
00188 
00190   double Rand ( void );
00191 
00193   vtkMinimalStandardRandomSequence *randomSequenceGenerator;
00194 
00199   void MakeTheHillData( void );
00200 
00202   bool ParametersChanged();
00203 
00205   void CopyParameters();
00206 
00208 
00209   vtkDoubleArray *hillData;
00210 };
00212 
00213 #endif