VTK
vtkEncodedGradientEstimator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkEncodedGradientEstimator.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 =========================================================================*/
15 
33 #ifndef vtkEncodedGradientEstimator_h
34 #define vtkEncodedGradientEstimator_h
35 
36 #include "vtkRenderingVolumeModule.h" // For export macro
37 #include "vtkObject.h"
38 
39 class vtkImageData;
41 class vtkMultiThreader;
42 
44 {
45 public:
47  void PrintSelf( ostream& os, vtkIndent indent );
48 
50 
55  virtual void SetInputData(vtkImageData*);
56  vtkGetObjectMacro( InputData, vtkImageData );
58 
60 
61  vtkSetMacro( GradientMagnitudeScale, float );
62  vtkGetMacro( GradientMagnitudeScale, float );
63  vtkSetMacro( GradientMagnitudeBias, float );
64  vtkGetMacro( GradientMagnitudeBias, float );
66 
68 
70  vtkSetClampMacro( BoundsClip, int, 0, 1 );
71  vtkGetMacro( BoundsClip, int );
72  vtkBooleanMacro( BoundsClip, int );
74 
76 
79  vtkSetVector6Macro( Bounds, int );
80  vtkGetVectorMacro( Bounds, int, 6 );
82 
84  void Update( void );
85 
87  unsigned short *GetEncodedNormals( void );
88 
90 
91  int GetEncodedNormalIndex( vtkIdType xyz_index );
92  int GetEncodedNormalIndex( int x_index, int y_index, int z_index );
94 
96  unsigned char *GetGradientMagnitudes(void);
97 
99 
101  vtkSetClampMacro( NumberOfThreads, int, 1, VTK_MAX_THREADS );
102  vtkGetMacro( NumberOfThreads, int );
104 
106 
108  void SetDirectionEncoder( vtkDirectionEncoder *direnc );
109  vtkGetObjectMacro( DirectionEncoder, vtkDirectionEncoder );
111 
113 
117  vtkSetMacro( ComputeGradientMagnitudes, int );
118  vtkGetMacro( ComputeGradientMagnitudes, int );
119  vtkBooleanMacro( ComputeGradientMagnitudes, int );
121 
123 
127  vtkSetMacro( CylinderClip, int );
128  vtkGetMacro( CylinderClip, int );
129  vtkBooleanMacro( CylinderClip, int );
131 
133 
134  vtkGetMacro( LastUpdateTimeInSeconds, float );
135  vtkGetMacro( LastUpdateTimeInCPUSeconds, float );
137 
138  vtkGetMacro( UseCylinderClip, int );
139  int *GetCircleLimits() { return this->CircleLimits; };
140 
142 
148  void SetZeroNormalThreshold( float v );
149  vtkGetMacro( ZeroNormalThreshold, float );
151 
153 
155  vtkSetClampMacro( ZeroPad, int, 0, 1 );
156  vtkGetMacro( ZeroPad, int );
157  vtkBooleanMacro( ZeroPad, int );
159 
160 
161  // These variables should be protected but are being
162  // made public to be accessible to the templated function.
163  // We used to have the templated function as a friend, but
164  // this does not work with all compilers
165 
166  // The input scalar data on which the normals are computed
168 
169  // The encoded normals (2 bytes) and the size of the encoded normals
170  unsigned short *EncodedNormals;
171  int EncodedNormalsSize[3];
172 
173  // The magnitude of the gradient array and the size of this array
174  unsigned char *GradientMagnitudes;
175 
176  // The time at which the normals were last built
178 
179 //BTX
180  vtkGetVectorMacro( InputSize, int, 3 );
181  vtkGetVectorMacro( InputAspect, float, 3 );
182 //ETX
183 
184 protected:
187 
188  virtual void ReportReferences(vtkGarbageCollector*);
189 
190  // The number of threads to use when encoding normals
192 
194 
196 
197  virtual void UpdateNormals( void ) = 0;
198 
201 
204 
206 
211  void ComputeCircleLimits( int size );
212 
214  int Bounds[6];
215 
216  int InputSize[3];
217  float InputAspect[3];
218 
220 
221  int ZeroPad;
222 
223 private:
224  vtkEncodedGradientEstimator(const vtkEncodedGradientEstimator&); // Not implemented.
225  void operator=(const vtkEncodedGradientEstimator&); // Not implemented.
226 };
227 
228 
229 #endif
230 
abstract base class for most VTK objects
Definition: vtkObject.h:61
encode a direction into a one or two byte value
#define VTKRENDERINGVOLUME_EXPORT
A class for performing multithreaded execution.
record modification and/or execution time
Definition: vtkTimeStamp.h:34
#define VTK_MAX_THREADS
Definition: vtkConfigure.h:41
virtual void Update()
int vtkIdType
Definition: vtkType.h:247
Detect and break reference loops.
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual void ReportReferences(vtkGarbageCollector *)
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
Superclass for gradient estimation.