VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkImageMandelbrotSource.h,v $ 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 =========================================================================*/ 00032 #ifndef __vtkImageMandelbrotSource_h 00033 #define __vtkImageMandelbrotSource_h 00034 00035 #include "vtkImageAlgorithm.h" 00036 00037 class VTK_IMAGING_EXPORT vtkImageMandelbrotSource : public vtkImageAlgorithm 00038 { 00039 public: 00040 static vtkImageMandelbrotSource *New(); 00041 vtkTypeRevisionMacro(vtkImageMandelbrotSource,vtkImageAlgorithm); 00042 void PrintSelf(ostream& os, vtkIndent indent); 00043 00045 00046 void SetWholeExtent(int extent[6]); 00047 void SetWholeExtent(int minX, int maxX, int minY, int maxY, 00048 int minZ, int maxZ); 00049 vtkGetVector6Macro(WholeExtent,int); 00051 00053 00055 vtkSetMacro(ConstantSize, int); 00056 vtkGetMacro(ConstantSize, int); 00057 vtkBooleanMacro(ConstantSize, int); 00059 00061 00064 void SetProjectionAxes(int x, int y, int z); 00065 void SetProjectionAxes(int a[3]) {this->SetProjectionAxes(a[0],a[1],a[2]);} 00066 vtkGetVector3Macro(ProjectionAxes, int); 00068 00070 00072 vtkSetVector4Macro(OriginCX, double); 00073 //void SetOriginCX(double cReal, double cImag, double xReal, double xImag); 00074 vtkGetVector4Macro(OriginCX, double); 00076 00078 00080 vtkSetVector4Macro(SampleCX, double); 00081 //void SetOriginCX(double cReal, double cImag, double xReal, double xImag); 00082 vtkGetVector4Macro(SampleCX, double); 00084 00086 00089 void SetSizeCX(double cReal, double cImag, double xReal, double xImag); 00090 double *GetSizeCX(); 00091 void GetSizeCX(double s[4]); 00093 00095 00096 vtkSetClampMacro(MaximumNumberOfIterations, unsigned short, 1, 5000); 00097 vtkGetMacro(MaximumNumberOfIterations, unsigned short); 00099 00101 00103 void Zoom(double factor); 00104 void Pan(double x, double y, double z); 00106 00109 void CopyOriginAndSample(vtkImageMandelbrotSource *source); 00110 00112 00113 vtkSetClampMacro(SubsampleRate, int, 1, VTK_LARGE_INTEGER); 00114 vtkGetMacro(SubsampleRate, int); 00116 00117 protected: 00118 vtkImageMandelbrotSource(); 00119 ~vtkImageMandelbrotSource(); 00120 00121 int ProjectionAxes[3]; 00122 00123 // WholeExtent in 3 space (after projection). 00124 int WholeExtent[6]; 00125 00126 // Complex constant/initial-value at origin. 00127 double OriginCX[4]; 00128 // Initial complex value at origin. 00129 double SampleCX[4]; 00130 unsigned short MaximumNumberOfIterations; 00131 00132 // A temporary vector that is computed as needed. 00133 // It is used to return a vector. 00134 double SizeCX[4]; 00135 00136 // A flag for keeping size constant (vs. keeping the spacing). 00137 int ConstantSize; 00138 00139 int SubsampleRate; 00140 00141 // see vtkAlgorithm for details 00142 virtual int RequestData(vtkInformation *request, 00143 vtkInformationVector** inputVector, 00144 vtkInformationVector* outputVector); 00145 00146 virtual int RequestInformation (vtkInformation *, 00147 vtkInformationVector**, 00148 vtkInformationVector *); 00149 double EvaluateSet(double p[4]); 00150 private: 00151 vtkImageMandelbrotSource(const vtkImageMandelbrotSource&); // Not implemented. 00152 void operator=(const vtkImageMandelbrotSource&); // Not implemented. 00153 }; 00154 00155 00156 #endif 00157 00158