VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkImageMandelbrotSource.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 =========================================================================*/ 00035 #ifndef __vtkImageMandelbrotSource_h 00036 #define __vtkImageMandelbrotSource_h 00037 00038 #include "vtkImageAlgorithm.h" 00039 00040 class VTK_IMAGING_EXPORT vtkImageMandelbrotSource : public vtkImageAlgorithm 00041 { 00042 public: 00043 static vtkImageMandelbrotSource *New(); 00044 vtkTypeMacro(vtkImageMandelbrotSource,vtkImageAlgorithm); 00045 void PrintSelf(ostream& os, vtkIndent indent); 00046 00048 00049 void SetWholeExtent(int extent[6]); 00050 void SetWholeExtent(int minX, int maxX, int minY, int maxY, 00051 int minZ, int maxZ); 00052 vtkGetVector6Macro(WholeExtent,int); 00054 00056 00058 vtkSetMacro(ConstantSize, int); 00059 vtkGetMacro(ConstantSize, int); 00060 vtkBooleanMacro(ConstantSize, int); 00062 00064 00067 void SetProjectionAxes(int x, int y, int z); 00068 void SetProjectionAxes(int a[3]) {this->SetProjectionAxes(a[0],a[1],a[2]);} 00069 vtkGetVector3Macro(ProjectionAxes, int); 00071 00073 00075 vtkSetVector4Macro(OriginCX, double); 00076 //void SetOriginCX(double cReal, double cImag, double xReal, double xImag); 00077 vtkGetVector4Macro(OriginCX, double); 00079 00081 00083 vtkSetVector4Macro(SampleCX, double); 00084 //void SetOriginCX(double cReal, double cImag, double xReal, double xImag); 00085 vtkGetVector4Macro(SampleCX, double); 00087 00089 00092 void SetSizeCX(double cReal, double cImag, double xReal, double xImag); 00093 double *GetSizeCX(); 00094 void GetSizeCX(double s[4]); 00096 00098 00099 vtkSetClampMacro(MaximumNumberOfIterations, unsigned short, 00100 static_cast<unsigned short>(1), 00101 static_cast<unsigned short>(5000)); 00102 vtkGetMacro(MaximumNumberOfIterations, unsigned short); 00104 00106 00108 void Zoom(double factor); 00109 void Pan(double x, double y, double z); 00111 00114 void CopyOriginAndSample(vtkImageMandelbrotSource *source); 00115 00117 00118 vtkSetClampMacro(SubsampleRate, int, 1, VTK_LARGE_INTEGER); 00119 vtkGetMacro(SubsampleRate, int); 00121 00122 protected: 00123 vtkImageMandelbrotSource(); 00124 ~vtkImageMandelbrotSource(); 00125 00126 int ProjectionAxes[3]; 00127 00128 // WholeExtent in 3 space (after projection). 00129 int WholeExtent[6]; 00130 00131 // Complex constant/initial-value at origin. 00132 double OriginCX[4]; 00133 // Initial complex value at origin. 00134 double SampleCX[4]; 00135 unsigned short MaximumNumberOfIterations; 00136 00137 // A temporary vector that is computed as needed. 00138 // It is used to return a vector. 00139 double SizeCX[4]; 00140 00141 // A flag for keeping size constant (vs. keeping the spacing). 00142 int ConstantSize; 00143 00144 int SubsampleRate; 00145 00146 // see vtkAlgorithm for details 00147 virtual int RequestData(vtkInformation *request, 00148 vtkInformationVector** inputVector, 00149 vtkInformationVector* outputVector); 00150 00151 virtual int RequestInformation (vtkInformation *, 00152 vtkInformationVector**, 00153 vtkInformationVector *); 00154 double EvaluateSet(double p[4]); 00155 private: 00156 vtkImageMandelbrotSource(const vtkImageMandelbrotSource&); // Not implemented. 00157 void operator=(const vtkImageMandelbrotSource&); // Not implemented. 00158 }; 00159 00160 00161 #endif 00162 00163