dox/Rendering/vtkEncodedGradientEstimator.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00037 #ifndef __vtkEncodedGradientEstimator_h
00038 #define __vtkEncodedGradientEstimator_h
00039
00040 #include "vtkObject.h"
00041
00042 class vtkImageData;
00043 class vtkDirectionEncoder;
00044 class vtkMultiThreader;
00045
00046 class VTK_RENDERING_EXPORT vtkEncodedGradientEstimator : public vtkObject
00047 {
00048 public:
00049 vtkTypeRevisionMacro(vtkEncodedGradientEstimator,vtkObject);
00050 void PrintSelf( ostream& os, vtkIndent indent );
00051
00053
00054 virtual void SetInput(vtkImageData*);
00055 vtkGetObjectMacro( Input, vtkImageData );
00057
00059
00060 vtkSetMacro( GradientMagnitudeScale, float );
00061 vtkGetMacro( GradientMagnitudeScale, float );
00062 vtkSetMacro( GradientMagnitudeBias, float );
00063 vtkGetMacro( GradientMagnitudeBias, float );
00065
00067
00069 vtkSetClampMacro( BoundsClip, int, 0, 1 );
00070 vtkGetMacro( BoundsClip, int );
00071 vtkBooleanMacro( BoundsClip, int );
00073
00075
00078 vtkSetVector6Macro( Bounds, int );
00079 vtkGetVectorMacro( Bounds, int, 6 );
00081
00083 void Update( void );
00084
00086 unsigned short *GetEncodedNormals( void );
00087
00089
00090 int GetEncodedNormalIndex( int xyz_index );
00091 int GetEncodedNormalIndex( int x_index, int y_index, int z_index );
00093
00095 unsigned char *GetGradientMagnitudes(void);
00096
00098
00100 vtkSetClampMacro( NumberOfThreads, int, 1, VTK_MAX_THREADS );
00101 vtkGetMacro( NumberOfThreads, int );
00103
00105
00107 void SetDirectionEncoder( vtkDirectionEncoder *direnc );
00108 vtkGetObjectMacro( DirectionEncoder, vtkDirectionEncoder );
00110
00112
00116 vtkSetMacro( ComputeGradientMagnitudes, int );
00117 vtkGetMacro( ComputeGradientMagnitudes, int );
00118 vtkBooleanMacro( ComputeGradientMagnitudes, int );
00120
00122
00126 vtkSetMacro( CylinderClip, int );
00127 vtkGetMacro( CylinderClip, int );
00128 vtkBooleanMacro( CylinderClip, int );
00130
00132
00133 vtkGetMacro( LastUpdateTimeInSeconds, float );
00134 vtkGetMacro( LastUpdateTimeInCPUSeconds, float );
00136
00137 vtkGetMacro( UseCylinderClip, int );
00138 int *GetCircleLimits() { return this->CircleLimits; };
00139
00141
00147 void SetZeroNormalThreshold( float v );
00148 vtkGetMacro( ZeroNormalThreshold, float );
00150
00152
00154 vtkSetClampMacro( ZeroPad, int, 0, 1 );
00155 vtkGetMacro( ZeroPad, int );
00156 vtkBooleanMacro( ZeroPad, int );
00158
00159
00160
00161
00162
00163
00164
00165
00166 vtkImageData *Input;
00167
00168
00169 unsigned short *EncodedNormals;
00170 int EncodedNormalsSize[3];
00171
00172
00173 unsigned char *GradientMagnitudes;
00174
00175
00176 vtkTimeStamp BuildTime;
00177
00178
00179 vtkGetVectorMacro( InputSize, int, 3 );
00180 vtkGetVectorMacro( InputAspect, float, 3 );
00181
00182
00183 protected:
00184 vtkEncodedGradientEstimator();
00185 ~vtkEncodedGradientEstimator();
00186
00187
00188 int NumberOfThreads;
00189
00190 vtkMultiThreader *Threader;
00191
00192 vtkDirectionEncoder *DirectionEncoder;
00193
00194 virtual void UpdateNormals( void ) = 0;
00195
00196 float GradientMagnitudeScale;
00197 float GradientMagnitudeBias;
00198
00199 float LastUpdateTimeInSeconds;
00200 float LastUpdateTimeInCPUSeconds;
00201
00202 float ZeroNormalThreshold;
00203
00204 int CylinderClip;
00205 int *CircleLimits;
00206 int CircleLimitsSize;
00207 int UseCylinderClip;
00208 void ComputeCircleLimits( int size );
00209
00210 int BoundsClip;
00211 int Bounds[6];
00212
00213 int InputSize[3];
00214 float InputAspect[3];
00215
00216 int ComputeGradientMagnitudes;
00217
00218 int ZeroPad;
00219
00220 private:
00221 vtkEncodedGradientEstimator(const vtkEncodedGradientEstimator&);
00222 void operator=(const vtkEncodedGradientEstimator&);
00223 };
00224
00225
00226 #endif
00227