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 "vtkObject.h"
37 
38 class vtkImageData;
40 class vtkMultiThreader;
41 
43 {
44 public:
46  void PrintSelf( ostream& os, vtkIndent indent );
47 
49 
50  virtual void SetInput(vtkImageData*);
51  vtkGetObjectMacro( Input, vtkImageData );
53 
55 
56  vtkSetMacro( GradientMagnitudeScale, float );
57  vtkGetMacro( GradientMagnitudeScale, float );
58  vtkSetMacro( GradientMagnitudeBias, float );
59  vtkGetMacro( GradientMagnitudeBias, float );
61 
63 
65  vtkSetClampMacro( BoundsClip, int, 0, 1 );
66  vtkGetMacro( BoundsClip, int );
67  vtkBooleanMacro( BoundsClip, int );
69 
71 
74  vtkSetVector6Macro( Bounds, int );
75  vtkGetVectorMacro( Bounds, int, 6 );
77 
79  void Update( void );
80 
82  unsigned short *GetEncodedNormals( void );
83 
85 
86  int GetEncodedNormalIndex( int xyz_index );
87  int GetEncodedNormalIndex( int x_index, int y_index, int z_index );
89 
91  unsigned char *GetGradientMagnitudes(void);
92 
94 
96  vtkSetClampMacro( NumberOfThreads, int, 1, VTK_MAX_THREADS );
97  vtkGetMacro( NumberOfThreads, int );
99 
101 
103  void SetDirectionEncoder( vtkDirectionEncoder *direnc );
104  vtkGetObjectMacro( DirectionEncoder, vtkDirectionEncoder );
106 
108 
112  vtkSetMacro( ComputeGradientMagnitudes, int );
113  vtkGetMacro( ComputeGradientMagnitudes, int );
114  vtkBooleanMacro( ComputeGradientMagnitudes, int );
116 
118 
122  vtkSetMacro( CylinderClip, int );
123  vtkGetMacro( CylinderClip, int );
124  vtkBooleanMacro( CylinderClip, int );
126 
128 
129  vtkGetMacro( LastUpdateTimeInSeconds, float );
130  vtkGetMacro( LastUpdateTimeInCPUSeconds, float );
132 
133  vtkGetMacro( UseCylinderClip, int );
134  int *GetCircleLimits() { return this->CircleLimits; };
135 
137 
143  void SetZeroNormalThreshold( float v );
144  vtkGetMacro( ZeroNormalThreshold, float );
146 
148 
150  vtkSetClampMacro( ZeroPad, int, 0, 1 );
151  vtkGetMacro( ZeroPad, int );
152  vtkBooleanMacro( ZeroPad, int );
154 
155 
156  // These variables should be protected but are being
157  // made public to be accessible to the templated function.
158  // We used to have the templated function as a friend, but
159  // this does not work with all compilers
160 
161  // The input scalar data on which the normals are computed
163 
164  // The encoded normals (2 bytes) and the size of the encoded normals
165  unsigned short *EncodedNormals;
166  int EncodedNormalsSize[3];
167 
168  // The magnitude of the gradient array and the size of this array
169  unsigned char *GradientMagnitudes;
170 
171  // The time at which the normals were last built
173 
174 //BTX
175  vtkGetVectorMacro( InputSize, int, 3 );
176  vtkGetVectorMacro( InputAspect, float, 3 );
177 //ETX
178 
179 protected:
182 
183  virtual void ReportReferences(vtkGarbageCollector*);
184 
185  // The number of threads to use when encoding normals
187 
189 
191 
192  virtual void UpdateNormals( void ) = 0;
193 
196 
199 
201 
206  void ComputeCircleLimits( int size );
207 
209  int Bounds[6];
210 
211  int InputSize[3];
212  float InputAspect[3];
213 
215 
216  int ZeroPad;
217 
218 private:
219  vtkEncodedGradientEstimator(const vtkEncodedGradientEstimator&); // Not implemented.
220  void operator=(const vtkEncodedGradientEstimator&); // Not implemented.
221 };
222 
223 
224 #endif
225 
abstract base class for most VTK objects
Definition: vtkObject.h:60
encode a direction into a one or two byte value
A class for performing multithreaded execution.
record modification and/or execution time
Definition: vtkTimeStamp.h:33
#define VTK_VOLUMERENDERING_EXPORT
Detect and break reference loops.
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:37
virtual void ReportReferences(vtkGarbageCollector *)
topologically and geometrically regular array of data
Definition: vtkImageData.h:43
Superclass for gradient estimation.