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 "vtkImagingSourcesModule.h" // For export macro 00039 #include "vtkImageAlgorithm.h" 00040 00041 class VTKIMAGINGSOURCES_EXPORT vtkImageMandelbrotSource : public vtkImageAlgorithm 00042 { 00043 public: 00044 static vtkImageMandelbrotSource *New(); 00045 vtkTypeMacro(vtkImageMandelbrotSource,vtkImageAlgorithm); 00046 void PrintSelf(ostream& os, vtkIndent indent); 00047 00049 00050 void SetWholeExtent(int extent[6]); 00051 void SetWholeExtent(int minX, int maxX, int minY, int maxY, 00052 int minZ, int maxZ); 00053 vtkGetVector6Macro(WholeExtent,int); 00055 00057 00059 vtkSetMacro(ConstantSize, int); 00060 vtkGetMacro(ConstantSize, int); 00061 vtkBooleanMacro(ConstantSize, int); 00063 00065 00068 void SetProjectionAxes(int x, int y, int z); 00069 void SetProjectionAxes(int a[3]) {this->SetProjectionAxes(a[0],a[1],a[2]);} 00070 vtkGetVector3Macro(ProjectionAxes, int); 00072 00074 00076 vtkSetVector4Macro(OriginCX, double); 00077 //void SetOriginCX(double cReal, double cImag, double xReal, double xImag); 00078 vtkGetVector4Macro(OriginCX, double); 00080 00082 00084 vtkSetVector4Macro(SampleCX, double); 00085 //void SetOriginCX(double cReal, double cImag, double xReal, double xImag); 00086 vtkGetVector4Macro(SampleCX, double); 00088 00090 00093 void SetSizeCX(double cReal, double cImag, double xReal, double xImag); 00094 double *GetSizeCX(); 00095 void GetSizeCX(double s[4]); 00097 00099 00100 vtkSetClampMacro(MaximumNumberOfIterations, unsigned short, 00101 static_cast<unsigned short>(1), 00102 static_cast<unsigned short>(5000)); 00103 vtkGetMacro(MaximumNumberOfIterations, unsigned short); 00105 00107 00109 void Zoom(double factor); 00110 void Pan(double x, double y, double z); 00112 00115 void CopyOriginAndSample(vtkImageMandelbrotSource *source); 00116 00118 00119 vtkSetClampMacro(SubsampleRate, int, 1, VTK_INT_MAX); 00120 vtkGetMacro(SubsampleRate, int); 00122 00123 protected: 00124 vtkImageMandelbrotSource(); 00125 ~vtkImageMandelbrotSource(); 00126 00127 int ProjectionAxes[3]; 00128 00129 // WholeExtent in 3 space (after projection). 00130 int WholeExtent[6]; 00131 00132 // Complex constant/initial-value at origin. 00133 double OriginCX[4]; 00134 // Initial complex value at origin. 00135 double SampleCX[4]; 00136 unsigned short MaximumNumberOfIterations; 00137 00138 // A temporary vector that is computed as needed. 00139 // It is used to return a vector. 00140 double SizeCX[4]; 00141 00142 // A flag for keeping size constant (vs. keeping the spacing). 00143 int ConstantSize; 00144 00145 int SubsampleRate; 00146 00147 // see vtkAlgorithm for details 00148 virtual int RequestData(vtkInformation *request, 00149 vtkInformationVector** inputVector, 00150 vtkInformationVector* outputVector); 00151 00152 virtual int RequestInformation (vtkInformation *, 00153 vtkInformationVector**, 00154 vtkInformationVector *); 00155 double EvaluateSet(double p[4]); 00156 private: 00157 vtkImageMandelbrotSource(const vtkImageMandelbrotSource&); // Not implemented. 00158 void operator=(const vtkImageMandelbrotSource&); // Not implemented. 00159 }; 00160 00161 00162 #endif 00163 00164