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 =========================================================================*/
30 #ifndef vtkImageMandelbrotSource_h
31 #define vtkImageMandelbrotSource_h
32 
33 #include "vtkImageAlgorithm.h"
34 #include "vtkImagingSourcesModule.h" // For export macro
35 
36 class VTKIMAGINGSOURCES_EXPORT vtkImageMandelbrotSource : public vtkImageAlgorithm
37 {
38 public:
39  static vtkImageMandelbrotSource* New();
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
44 
47  void SetWholeExtent(int extent[6]);
48  void SetWholeExtent(int minX, int maxX, int minY, int maxY, int minZ, int maxZ);
49  vtkGetVector6Macro(WholeExtent, int);
51 
53 
58  vtkSetMacro(ConstantSize, vtkTypeBool);
59  vtkGetMacro(ConstantSize, vtkTypeBool);
60  vtkBooleanMacro(ConstantSize, vtkTypeBool);
62 
64 
69  void SetProjectionAxes(int x, int y, int z);
70  void SetProjectionAxes(int a[3]) { this->SetProjectionAxes(a[0], a[1], a[2]); }
71  vtkGetVector3Macro(ProjectionAxes, int);
73 
75 
79  vtkSetVector4Macro(OriginCX, double);
80  // void SetOriginCX(double cReal, double cImag, double xReal, double xImag);
81  vtkGetVector4Macro(OriginCX, double);
83 
85 
89  vtkSetVector4Macro(SampleCX, double);
90  // void SetOriginCX(double cReal, double cImag, double xReal, double xImag);
91  vtkGetVector4Macro(SampleCX, double);
93 
95 
101  void SetSizeCX(double cReal, double cImag, double xReal, double xImag);
102  double* GetSizeCX() VTK_SIZEHINT(4);
103  void GetSizeCX(double s[4]);
105 
107 
110  vtkSetClampMacro(MaximumNumberOfIterations, unsigned short, static_cast<unsigned short>(1),
111  static_cast<unsigned short>(5000));
112  vtkGetMacro(MaximumNumberOfIterations, unsigned short);
114 
116 
120  void Zoom(double factor);
121  void Pan(double x, double y, double z);
123 
128  void CopyOriginAndSample(vtkImageMandelbrotSource* source);
129 
131 
134  vtkSetClampMacro(SubsampleRate, int, 1, VTK_INT_MAX);
135  vtkGetMacro(SubsampleRate, int);
137 
138 protected:
140  ~vtkImageMandelbrotSource() override;
141 
142  int ProjectionAxes[3];
143 
144  // WholeExtent in 3 space (after projection).
145  int WholeExtent[6];
146 
147  // Complex constant/initial-value at origin.
148  double OriginCX[4];
149  // Initial complex value at origin.
150  double SampleCX[4];
151  unsigned short MaximumNumberOfIterations;
152 
153  // A temporary vector that is computed as needed.
154  // It is used to return a vector.
155  double SizeCX[4];
156 
157  // A flag for keeping size constant (vs. keeping the spacing).
158  vtkTypeBool ConstantSize;
159 
160  int SubsampleRate;
161 
162  // see vtkAlgorithm for details
163  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
164  vtkInformationVector* outputVector) override;
165 
166  int RequestInformation(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
167  double EvaluateSet(double p[4]);
168 
169 private:
171  void operator=(const vtkImageMandelbrotSource&) = delete;
172 };
173 
174 #endif
VTK_INT_MAX
#define VTK_INT_MAX
Definition: vtkType.h:155
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkImageAlgorithm.h
vtkImageAlgorithm
Generic algorithm superclass for image algs.
Definition: vtkImageAlgorithm.h:37
vtkImageMandelbrotSource::SetProjectionAxes
void SetProjectionAxes(int a[3])
Definition: vtkImageMandelbrotSource.h:70
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:45
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:64
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()
source
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
Definition: vtkBoostGraphAdapter.h:959
vtkX3D::extent
Definition: vtkX3D.h:351
vtkImageMandelbrotSource
Mandelbrot image.
Definition: vtkImageMandelbrotSource.h:36
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69