00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00034
#ifndef __vtkVolumeRayCastFunction_h
00035
#define __vtkVolumeRayCastFunction_h
00036
00037
#include "vtkObject.h"
00038
00039
class vtkRenderer;
00040
class vtkVolume;
00041
class vtkVolumeRayCastMapper;
00042
00043
00044
00045
00046 typedef struct
00047
{
00048
00049 float Color[4];
00050 float ScalarValue;
00051
00052
00053 float TransformedStart[4];
00054 float TransformedEnd[4];
00055 float TransformedDirection[4];
00056 float TransformedIncrement[3];
00057
00058
00059
00060 int NumberOfStepsToTake;
00061
00062
00063
00064 int NumberOfStepsTaken;
00065
00066 }
vtkVolumeRayCastDynamicInfo;
00067
00068
00069
00070 typedef struct
00071
{
00072
00073 vtkVolume *Volume;
00074
00075
00076 vtkRenderer *Renderer;
00077
00078
00079 float WorldToVoxelsMatrix[16];
00080 float VoxelsToWorldMatrix[16];
00081 float ViewToVoxelsMatrix[16];
00082
00083 float *ClippingPlane;
00084 int NumberOfClippingPlanes;
00085
00086
00087
00088 float CameraThickness;
00089
00090
00091
00092 int ScalarDataType;
00093 void *ScalarDataPointer;
00094 int DataIncrement[3];
00095 int DataSize[3];
00096 float DataSpacing[3];
00097 float DataOrigin[3];
00098
00099
00100 int Shading;
00101 int ColorChannels;
00102 float Color[3];
00103 int InterpolationType;
00104
00105
00106
00107 float *RedDiffuseShadingTable;
00108 float *GreenDiffuseShadingTable;
00109 float *BlueDiffuseShadingTable;
00110 float *RedSpecularShadingTable;
00111 float *GreenSpecularShadingTable;
00112 float *BlueSpecularShadingTable;
00113
00114
00115 unsigned short *EncodedNormals;
00116 unsigned char *GradientMagnitudes;
00117
00118
00119 int ImageInUseSize[2];
00120 int ImageMemorySize[2];
00121 int ImageViewportSize[2];
00122 int ImageOrigin[2];
00123 unsigned char *Image;
00124
00125 int *RowBounds;
00126
00127
00128
00129
00130
00131
00132 int MIPFunction;
00133 int MaximizeOpacity;
00134 }
vtkVolumeRayCastStaticInfo;
00135
00136 class VTK_RENDERING_EXPORT vtkVolumeRayCastFunction :
public vtkObject
00137 {
00138
public:
00139 vtkTypeRevisionMacro(vtkVolumeRayCastFunction,
vtkObject);
00140
virtual void PrintSelf(ostream& os,
vtkIndent indent);
00141
00143
00148
void FunctionInitialize(
vtkRenderer *ren,
00149
vtkVolume *vol,
00150
vtkVolumeRayCastStaticInfo *staticInfo );
00152
00153
virtual void CastRay(
vtkVolumeRayCastDynamicInfo *dynamicInfo,
00154
vtkVolumeRayCastStaticInfo *staticInfo )=0;
00155
00156
00159
virtual float GetZeroOpacityThreshold(
vtkVolume *vol )=0;
00160
00161
protected:
00162 vtkVolumeRayCastFunction() {};
00163 ~vtkVolumeRayCastFunction() {};
00164
00166
00168
virtual void SpecificFunctionInitialize(
vtkRenderer *ren,
00169
vtkVolume *vol,
00170
vtkVolumeRayCastStaticInfo *staticInfo,
00171
vtkVolumeRayCastMapper *mapper )=0;
00173
00174
private:
00175 vtkVolumeRayCastFunction(
const vtkVolumeRayCastFunction&);
00176
void operator=(
const vtkVolumeRayCastFunction&);
00177 };
00178
00179
#endif