VTK
vtkImageMandelbrotSource.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageMandelbrotSource.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
36 #ifndef vtkImageMandelbrotSource_h
37 #define vtkImageMandelbrotSource_h
38 
39 #include "vtkImagingSourcesModule.h" // For export macro
40 #include "vtkImageAlgorithm.h"
41 
42 class VTKIMAGINGSOURCES_EXPORT vtkImageMandelbrotSource : public vtkImageAlgorithm
43 {
44 public:
45  static vtkImageMandelbrotSource *New();
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
50 
53  void SetWholeExtent(int extent[6]);
54  void SetWholeExtent(int minX, int maxX, int minY, int maxY,
55  int minZ, int maxZ);
56  vtkGetVector6Macro(WholeExtent,int);
58 
60 
65  vtkSetMacro(ConstantSize, vtkTypeBool);
66  vtkGetMacro(ConstantSize, vtkTypeBool);
67  vtkBooleanMacro(ConstantSize, vtkTypeBool);
69 
71 
76  void SetProjectionAxes(int x, int y, int z);
77  void SetProjectionAxes(int a[3]) {this->SetProjectionAxes(a[0],a[1],a[2]);}
78  vtkGetVector3Macro(ProjectionAxes, int);
80 
82 
86  vtkSetVector4Macro(OriginCX, double);
87  //void SetOriginCX(double cReal, double cImag, double xReal, double xImag);
88  vtkGetVector4Macro(OriginCX, double);
90 
92 
96  vtkSetVector4Macro(SampleCX, double);
97  //void SetOriginCX(double cReal, double cImag, double xReal, double xImag);
98  vtkGetVector4Macro(SampleCX, double);
100 
102 
108  void SetSizeCX(double cReal, double cImag, double xReal, double xImag);
109  double *GetSizeCX() VTK_SIZEHINT(4);
110  void GetSizeCX(double s[4]);
112 
114 
117  vtkSetClampMacro(MaximumNumberOfIterations, unsigned short,
118  static_cast<unsigned short>(1),
119  static_cast<unsigned short>(5000));
120  vtkGetMacro(MaximumNumberOfIterations, unsigned short);
122 
124 
128  void Zoom(double factor);
129  void Pan(double x, double y, double z);
131 
136  void CopyOriginAndSample(vtkImageMandelbrotSource *source);
137 
139 
142  vtkSetClampMacro(SubsampleRate, int, 1, VTK_INT_MAX);
143  vtkGetMacro(SubsampleRate, int);
145 
146 protected:
148  ~vtkImageMandelbrotSource() override;
149 
150  int ProjectionAxes[3];
151 
152  // WholeExtent in 3 space (after projection).
153  int WholeExtent[6];
154 
155  // Complex constant/initial-value at origin.
156  double OriginCX[4];
157  // Initial complex value at origin.
158  double SampleCX[4];
159  unsigned short MaximumNumberOfIterations;
160 
161  // A temporary vector that is computed as needed.
162  // It is used to return a vector.
163  double SizeCX[4];
164 
165  // A flag for keeping size constant (vs. keeping the spacing).
166  vtkTypeBool ConstantSize;
167 
168  int SubsampleRate;
169 
170  // see vtkAlgorithm for details
171  int RequestData(vtkInformation *request,
172  vtkInformationVector** inputVector,
173  vtkInformationVector* outputVector) override;
174 
175  int RequestInformation (vtkInformation *,
177  vtkInformationVector *) override;
178  double EvaluateSet(double p[4]);
179 private:
181  void operator=(const vtkImageMandelbrotSource&) = delete;
182 };
183 
184 
185 #endif
186 
187 
VTK_INT_MAX
#define VTK_INT_MAX
Definition: vtkType.h:159
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkImageAlgorithm.h
vtkImageAlgorithm
Generic algorithm superclass for image algs.
Definition: vtkImageAlgorithm.h:40
source
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
Definition: vtkBoostGraphAdapter.h:825
vtkImageMandelbrotSource::SetProjectionAxes
void SetProjectionAxes(int a[3])
Definition: vtkImageMandelbrotSource.h:77
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:42
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkImageAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkAlgorithm::New
static vtkAlgorithm * New()
vtkX3D::extent
Definition: vtkX3D.h:345
vtkImageMandelbrotSource
Mandelbrot image.
Definition: vtkImageMandelbrotSource.h:42
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69