vtkUnstructuredGridVolumeRayCastMapper.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00043 #ifndef __vtkUnstructuredGridVolumeRayCastMapper_h
00044 #define __vtkUnstructuredGridVolumeRayCastMapper_h
00045
00046 #include "vtkUnstructuredGridVolumeMapper.h"
00047
00048 class vtkMultiThreader;
00049 class vtkRenderer;
00050 class vtkTimerLog;
00051 class vtkVolume;
00052 class vtkUnstructuredGridVolumeRayCastFunction;
00053 class vtkUnstructuredGridVolumeRayCastIterator;
00054 class vtkUnstructuredGridVolumeRayIntegrator;
00055 class vtkRayCastImageDisplayHelper;
00056
00057 class VTK_RENDERING_EXPORT vtkUnstructuredGridVolumeRayCastMapper : public vtkUnstructuredGridVolumeMapper
00058 {
00059 public:
00060 static vtkUnstructuredGridVolumeRayCastMapper *New();
00061 vtkTypeRevisionMacro(vtkUnstructuredGridVolumeRayCastMapper,vtkUnstructuredGridVolumeMapper);
00062 void PrintSelf( ostream& os, vtkIndent indent );
00063
00065
00068 vtkSetClampMacro( ImageSampleDistance, float, 0.1f, 100.0f );
00069 vtkGetMacro( ImageSampleDistance, float );
00071
00073
00075 vtkSetClampMacro( MinimumImageSampleDistance, float, 0.1f, 100.0f );
00076 vtkGetMacro( MinimumImageSampleDistance, float );
00078
00080
00082 vtkSetClampMacro( MaximumImageSampleDistance, float, 0.1f, 100.0f );
00083 vtkGetMacro( MaximumImageSampleDistance, float );
00085
00087
00090 vtkSetClampMacro( AutoAdjustSampleDistances, int, 0, 1 );
00091 vtkGetMacro( AutoAdjustSampleDistances, int );
00092 vtkBooleanMacro( AutoAdjustSampleDistances, int );
00094
00096
00098 void SetNumberOfThreads( int num );
00099 vtkGetMacro( NumberOfThreads, int );
00101
00103
00105 vtkSetClampMacro( IntermixIntersectingGeometry, int, 0, 1 );
00106 vtkGetMacro( IntermixIntersectingGeometry, int );
00107 vtkBooleanMacro( IntermixIntersectingGeometry, int );
00109
00111
00112 virtual void SetRayCastFunction(vtkUnstructuredGridVolumeRayCastFunction *f);
00113 vtkGetObjectMacro(RayCastFunction, vtkUnstructuredGridVolumeRayCastFunction);
00115
00117
00118 virtual void SetRayIntegrator(vtkUnstructuredGridVolumeRayIntegrator *ri);
00119 vtkGetObjectMacro(RayIntegrator, vtkUnstructuredGridVolumeRayIntegrator);
00121
00122
00125 void Render( vtkRenderer *, vtkVolume * );
00126
00131 void ReleaseGraphicsResources(vtkWindow *);
00132
00133 vtkGetVectorMacro( ImageInUseSize, int, 2 );
00134 vtkGetVectorMacro( ImageOrigin, int, 2 );
00135 vtkGetVectorMacro( ImageViewportSize, int , 2 );
00136
00137
00138
00139 void CastRays( int threadID, int threadCount );
00140
00141 protected:
00142 vtkUnstructuredGridVolumeRayCastMapper();
00143 ~vtkUnstructuredGridVolumeRayCastMapper();
00144
00145 float ImageSampleDistance;
00146 float MinimumImageSampleDistance;
00147 float MaximumImageSampleDistance;
00148 int AutoAdjustSampleDistances;
00149
00150 vtkMultiThreader *Threader;
00151 int NumberOfThreads;
00152
00153 vtkRayCastImageDisplayHelper *ImageDisplayHelper;
00154
00155
00156 int ImageViewportSize[2];
00157
00158
00159
00160
00161
00162 int ImageMemorySize[2];
00163
00164
00165
00166
00167
00168 int ImageInUseSize[2];
00169
00170
00171
00172 int ImageOrigin[2];
00173
00174
00175 unsigned char *Image;
00176
00177 float *RenderTimeTable;
00178 vtkVolume **RenderVolumeTable;
00179 vtkRenderer **RenderRendererTable;
00180 int RenderTableSize;
00181 int RenderTableEntries;
00182
00183 void StoreRenderTime( vtkRenderer *ren, vtkVolume *vol, float t );
00184 float RetrieveRenderTime( vtkRenderer *ren, vtkVolume *vol );
00185
00186 int IntermixIntersectingGeometry;
00187
00188 float *ZBuffer;
00189 int ZBufferSize[2];
00190 int ZBufferOrigin[2];
00191
00192
00193
00194
00195 double GetZBufferValue( int x, int y );
00196
00197 double GetMinimumBoundsDepth( vtkRenderer *ren,
00198 vtkVolume *vol );
00199
00200 vtkUnstructuredGridVolumeRayCastFunction *RayCastFunction;
00201 vtkUnstructuredGridVolumeRayCastIterator **RayCastIterators;
00202 vtkUnstructuredGridVolumeRayIntegrator *RayIntegrator;
00203
00204 vtkVolume *CurrentVolume;
00205 vtkRenderer *CurrentRenderer;
00206
00207
00208 private:
00209 vtkUnstructuredGridVolumeRayCastMapper(const vtkUnstructuredGridVolumeRayCastMapper&);
00210 void operator=(const vtkUnstructuredGridVolumeRayCastMapper&);
00211 };
00212
00213 #endif
00214