25 #ifndef vtkFixedPointVolumeRayCastHelper_h
26 #define vtkFixedPointVolumeRayCastHelper_h
29 #define VTKKWRCHelper_GetCellScalarValues( DATA, SCALE, SHIFT ) \
30 A = static_cast<unsigned int >(SCALE*(*(DATA ) + SHIFT)); \
31 B = static_cast<unsigned int >(SCALE*(*(DATA+Binc) + SHIFT)); \
32 C = static_cast<unsigned int >(SCALE*(*(DATA+Cinc) + SHIFT)); \
33 D = static_cast<unsigned int >(SCALE*(*(DATA+Dinc) + SHIFT)); \
34 E = static_cast<unsigned int >(SCALE*(*(DATA+Einc) + SHIFT)); \
35 F = static_cast<unsigned int >(SCALE*(*(DATA+Finc) + SHIFT)); \
36 G = static_cast<unsigned int >(SCALE*(*(DATA+Ginc) + SHIFT)); \
37 H = static_cast<unsigned int >(SCALE*(*(DATA+Hinc) + SHIFT))
41 #define VTKKWRCHelper_GetCellScalarValuesSimple( DATA ) \
42 A = static_cast<unsigned int >(*(DATA )); \
43 B = static_cast<unsigned int >(*(DATA+Binc)); \
44 C = static_cast<unsigned int >(*(DATA+Cinc)); \
45 D = static_cast<unsigned int >(*(DATA+Dinc)); \
46 E = static_cast<unsigned int >(*(DATA+Einc)); \
47 F = static_cast<unsigned int >(*(DATA+Finc)); \
48 G = static_cast<unsigned int >(*(DATA+Ginc)); \
49 H = static_cast<unsigned int >(*(DATA+Hinc))
53 #define VTKKWRCHelper_GetCellMagnitudeValues( ABCD, EFGH ) \
54 mA = static_cast<unsigned int >(*(ABCD )); \
55 mB = static_cast<unsigned int >(*(ABCD+mBFinc)); \
56 mC = static_cast<unsigned int >(*(ABCD+mCGinc)); \
57 mD = static_cast<unsigned int >(*(ABCD+mDHinc)); \
58 mE = static_cast<unsigned int >(*(EFGH )); \
59 mF = static_cast<unsigned int >(*(EFGH+mBFinc)); \
60 mG = static_cast<unsigned int >(*(EFGH+mCGinc)); \
61 mH = static_cast<unsigned int >(*(EFGH+mDHinc))
65 #define VTKKWRCHelper_GetCellDirectionValues( ABCD, EFGH ) \
66 normalA = static_cast<unsigned int >(*(ABCD )); \
67 normalB = static_cast<unsigned int >(*(ABCD+dBFinc)); \
68 normalC = static_cast<unsigned int >(*(ABCD+dCGinc)); \
69 normalD = static_cast<unsigned int >(*(ABCD+dDHinc)); \
70 normalE = static_cast<unsigned int >(*(EFGH )); \
71 normalF = static_cast<unsigned int >(*(EFGH+dBFinc)); \
72 normalG = static_cast<unsigned int >(*(EFGH+dCGinc)); \
73 normalH = static_cast<unsigned int >(*(EFGH+dDHinc));
77 #define VTKKWRCHelper_GetCellComponentScalarValues( DATA, CIDX, SCALE, SHIFT ) \
78 A[CIDX] = static_cast<unsigned int >(SCALE*(*(DATA ) + SHIFT)); \
79 B[CIDX] = static_cast<unsigned int >(SCALE*(*(DATA+Binc) + SHIFT)); \
80 C[CIDX] = static_cast<unsigned int >(SCALE*(*(DATA+Cinc) + SHIFT)); \
81 D[CIDX] = static_cast<unsigned int >(SCALE*(*(DATA+Dinc) + SHIFT)); \
82 E[CIDX] = static_cast<unsigned int >(SCALE*(*(DATA+Einc) + SHIFT)); \
83 F[CIDX] = static_cast<unsigned int >(SCALE*(*(DATA+Finc) + SHIFT)); \
84 G[CIDX] = static_cast<unsigned int >(SCALE*(*(DATA+Ginc) + SHIFT)); \
85 H[CIDX] = static_cast<unsigned int >(SCALE*(*(DATA+Hinc) + SHIFT))
89 #define VTKKWRCHelper_GetCellComponentRawScalarValues( DATA, CIDX ) \
90 A[CIDX] = static_cast<unsigned int >((*(DATA ))); \
91 B[CIDX] = static_cast<unsigned int >((*(DATA+Binc))); \
92 C[CIDX] = static_cast<unsigned int >((*(DATA+Cinc))); \
93 D[CIDX] = static_cast<unsigned int >((*(DATA+Dinc))); \
94 E[CIDX] = static_cast<unsigned int >((*(DATA+Einc))); \
95 F[CIDX] = static_cast<unsigned int >((*(DATA+Finc))); \
96 G[CIDX] = static_cast<unsigned int >((*(DATA+Ginc))); \
97 H[CIDX] = static_cast<unsigned int >((*(DATA+Hinc)))
101 #define VTKKWRCHelper_GetCellComponentMagnitudeValues( ABCD, EFGH, CIDX ) \
102 mA[CIDX] = static_cast<unsigned int >(*(ABCD )); \
103 mB[CIDX] = static_cast<unsigned int >(*(ABCD+mBFinc)); \
104 mC[CIDX] = static_cast<unsigned int >(*(ABCD+mCGinc)); \
105 mD[CIDX] = static_cast<unsigned int >(*(ABCD+mDHinc)); \
106 mE[CIDX] = static_cast<unsigned int >(*(EFGH )); \
107 mF[CIDX] = static_cast<unsigned int >(*(EFGH+mBFinc)); \
108 mG[CIDX] = static_cast<unsigned int >(*(EFGH+mCGinc)); \
109 mH[CIDX] = static_cast<unsigned int >(*(EFGH+mDHinc))
113 #define VTKKWRCHelper_GetCellComponentDirectionValues( ABCD, EFGH, CIDX ) \
114 normalA[CIDX] = static_cast<unsigned int >(*(ABCD )); \
115 normalB[CIDX] = static_cast<unsigned int >(*(ABCD+dBFinc)); \
116 normalC[CIDX] = static_cast<unsigned int >(*(ABCD+dCGinc)); \
117 normalD[CIDX] = static_cast<unsigned int >(*(ABCD+dDHinc)); \
118 normalE[CIDX] = static_cast<unsigned int >(*(EFGH )); \
119 normalF[CIDX] = static_cast<unsigned int >(*(EFGH+dBFinc)); \
120 normalG[CIDX] = static_cast<unsigned int >(*(EFGH+dCGinc)); \
121 normalH[CIDX] = static_cast<unsigned int >(*(EFGH+dDHinc));
126 #define VTKKWRCHelper_ComputeWeights( POS ) \
127 w2X = (POS[0]&VTKKW_FP_MASK); \
128 w2Y = (POS[1]&VTKKW_FP_MASK); \
129 w2Z = (POS[2]&VTKKW_FP_MASK); \
131 w1X = ((~w2X)&VTKKW_FP_MASK); \
132 w1Y = ((~w2Y)&VTKKW_FP_MASK); \
133 w1Z = ((~w2Z)&VTKKW_FP_MASK); \
135 w1Xw1Y = (0x4000+(w1X*w1Y))>>VTKKW_FP_SHIFT; \
136 w2Xw1Y = (0x4000+(w2X*w1Y))>>VTKKW_FP_SHIFT; \
137 w1Xw2Y = (0x4000+(w1X*w2Y))>>VTKKW_FP_SHIFT; \
138 w2Xw2Y = (0x4000+(w2X*w2Y))>>VTKKW_FP_SHIFT; \
143 #define VTKKWRCHelper_InterpolateScalar( VAL ) \
145 (0x7fff + ((A*((0x4000 + w1Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \
146 (B*((0x4000 + w2Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \
147 (C*((0x4000 + w1Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \
148 (D*((0x4000 + w2Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \
149 (E*((0x4000 + w1Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \
150 (F*((0x4000 + w2Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \
151 (G*((0x4000 + w1Xw2Y*w2Z)>>VTKKW_FP_SHIFT)) + \
152 (H*((0x4000 + w2Xw2Y*w2Z)>>VTKKW_FP_SHIFT)))) >> VTKKW_FP_SHIFT;
156 #define VTKKWRCHelper_InterpolateMagnitude( VAL ) \
158 (0x7fff + ((mA*((0x4000 + w1Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \
159 (mB*((0x4000 + w2Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \
160 (mC*((0x4000 + w1Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \
161 (mD*((0x4000 + w2Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \
162 (mE*((0x4000 + w1Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \
163 (mF*((0x4000 + w2Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \
164 (mG*((0x4000 + w1Xw2Y*w2Z)>>VTKKW_FP_SHIFT)) + \
165 (mH*((0x4000 + w2Xw2Y*w2Z)>>VTKKW_FP_SHIFT)))) >> VTKKW_FP_SHIFT;
169 #define VTKKWRCHelper_InterpolateScalarComponent( VAL, CIDX, COMPONENTS ) \
170 for ( CIDX = 0; CIDX < COMPONENTS; CIDX++ ) \
173 (0x7fff + ((A[CIDX]*((0x4000 + w1Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \
174 (B[CIDX]*((0x4000 + w2Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \
175 (C[CIDX]*((0x4000 + w1Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \
176 (D[CIDX]*((0x4000 + w2Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \
177 (E[CIDX]*((0x4000 + w1Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \
178 (F[CIDX]*((0x4000 + w2Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \
179 (G[CIDX]*((0x4000 + w1Xw2Y*w2Z)>>VTKKW_FP_SHIFT)) + \
180 (H[CIDX]*((0x4000 + w2Xw2Y*w2Z)>>VTKKW_FP_SHIFT)))) >> VTKKW_FP_SHIFT; \
185 #define VTKKWRCHelper_InterpolateMagnitudeComponent( VAL, CIDX, COMPONENTS ) \
186 for ( CIDX = 0; CIDX < COMPONENTS; CIDX++ ) \
189 (0x7fff + ((mA[CIDX]*((0x4000 + w1Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \
190 (mB[CIDX]*((0x4000 + w2Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \
191 (mC[CIDX]*((0x4000 + w1Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \
192 (mD[CIDX]*((0x4000 + w2Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \
193 (mE[CIDX]*((0x4000 + w1Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \
194 (mF[CIDX]*((0x4000 + w2Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \
195 (mG[CIDX]*((0x4000 + w1Xw2Y*w2Z)>>VTKKW_FP_SHIFT)) + \
196 (mH[CIDX]*((0x4000 + w2Xw2Y*w2Z)>>VTKKW_FP_SHIFT)))) >> VTKKW_FP_SHIFT; \
201 #define VTKKWRCHelper_InterpolateShading( DTABLE, STABLE, COLOR ) \
202 unsigned int _tmpDColor[3]; \
203 unsigned int _tmpSColor[3]; \
206 (0x7fff + ((DTABLE[3*normalA] * ((0x4000 + w1Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \
207 (DTABLE[3*normalB] * ((0x4000 + w2Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \
208 (DTABLE[3*normalC] * ((0x4000 + w1Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \
209 (DTABLE[3*normalD] * ((0x4000 + w2Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \
210 (DTABLE[3*normalE] * ((0x4000 + w1Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \
211 (DTABLE[3*normalF] * ((0x4000 + w2Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \
212 (DTABLE[3*normalG] * ((0x4000 + w1Xw2Y*w2Z)>>VTKKW_FP_SHIFT)) + \
213 (DTABLE[3*normalH] * ((0x4000 + w2Xw2Y*w2Z)>>VTKKW_FP_SHIFT)))) >> VTKKW_FP_SHIFT; \
216 (0x7fff + ((DTABLE[3*normalA+1] * ((0x4000 + w1Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \
217 (DTABLE[3*normalB+1] * ((0x4000 + w2Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \
218 (DTABLE[3*normalC+1] * ((0x4000 + w1Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \
219 (DTABLE[3*normalD+1] * ((0x4000 + w2Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \
220 (DTABLE[3*normalE+1] * ((0x4000 + w1Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \
221 (DTABLE[3*normalF+1] * ((0x4000 + w2Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \
222 (DTABLE[3*normalG+1] * ((0x4000 + w1Xw2Y*w2Z)>>VTKKW_FP_SHIFT)) + \
223 (DTABLE[3*normalH+1] * ((0x4000 + w2Xw2Y*w2Z)>>VTKKW_FP_SHIFT)))) >> VTKKW_FP_SHIFT; \
226 (0x7fff + ((DTABLE[3*normalA+2] * ((0x4000 + w1Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \
227 (DTABLE[3*normalB+2] * ((0x4000 + w2Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \
228 (DTABLE[3*normalC+2] * ((0x4000 + w1Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \
229 (DTABLE[3*normalD+2] * ((0x4000 + w2Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \
230 (DTABLE[3*normalE+2] * ((0x4000 + w1Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \
231 (DTABLE[3*normalF+2] * ((0x4000 + w2Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \
232 (DTABLE[3*normalG+2] * ((0x4000 + w1Xw2Y*w2Z)>>VTKKW_FP_SHIFT)) + \
233 (DTABLE[3*normalH+2] * ((0x4000 + w2Xw2Y*w2Z)>>VTKKW_FP_SHIFT)))) >> VTKKW_FP_SHIFT; \
236 (0x7fff + ((STABLE[3*normalA] * ((0x4000 + w1Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \
237 (STABLE[3*normalB] * ((0x4000 + w2Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \
238 (STABLE[3*normalC] * ((0x4000 + w1Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \
239 (STABLE[3*normalD] * ((0x4000 + w2Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \
240 (STABLE[3*normalE] * ((0x4000 + w1Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \
241 (STABLE[3*normalF] * ((0x4000 + w2Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \
242 (STABLE[3*normalG] * ((0x4000 + w1Xw2Y*w2Z)>>VTKKW_FP_SHIFT)) + \
243 (STABLE[3*normalH] * ((0x4000 + w2Xw2Y*w2Z)>>VTKKW_FP_SHIFT)))) >> VTKKW_FP_SHIFT; \
246 (0x7fff + ((STABLE[3*normalA+1] * ((0x4000 + w1Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \
247 (STABLE[3*normalB+1] * ((0x4000 + w2Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \
248 (STABLE[3*normalC+1] * ((0x4000 + w1Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \
249 (STABLE[3*normalD+1] * ((0x4000 + w2Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \
250 (STABLE[3*normalE+1] * ((0x4000 + w1Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \
251 (STABLE[3*normalF+1] * ((0x4000 + w2Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \
252 (STABLE[3*normalG+1] * ((0x4000 + w1Xw2Y*w2Z)>>VTKKW_FP_SHIFT)) + \
253 (STABLE[3*normalH+1] * ((0x4000 + w2Xw2Y*w2Z)>>VTKKW_FP_SHIFT)))) >> VTKKW_FP_SHIFT; \
256 (0x7fff + ((STABLE[3*normalA+2] * ((0x4000 + w1Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \
257 (STABLE[3*normalB+2] * ((0x4000 + w2Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \
258 (STABLE[3*normalC+2] * ((0x4000 + w1Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \
259 (STABLE[3*normalD+2] * ((0x4000 + w2Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \
260 (STABLE[3*normalE+2] * ((0x4000 + w1Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \
261 (STABLE[3*normalF+2] * ((0x4000 + w2Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \
262 (STABLE[3*normalG+2] * ((0x4000 + w1Xw2Y*w2Z)>>VTKKW_FP_SHIFT)) + \
263 (STABLE[3*normalH+2] * ((0x4000 + w2Xw2Y*w2Z)>>VTKKW_FP_SHIFT)))) >> VTKKW_FP_SHIFT; \
266 COLOR[0] = static_cast<unsigned short>((_tmpDColor[0]*COLOR[0]+0x7fff)>>VTKKW_FP_SHIFT); \
267 COLOR[1] = static_cast<unsigned short>((_tmpDColor[1]*COLOR[1]+0x7fff)>>VTKKW_FP_SHIFT); \
268 COLOR[2] = static_cast<unsigned short>((_tmpDColor[2]*COLOR[2]+0x7fff)>>VTKKW_FP_SHIFT); \
269 COLOR[0] += (_tmpSColor[0]*COLOR[3] + 0x7fff)>>VTKKW_FP_SHIFT; \
270 COLOR[1] += (_tmpSColor[1]*COLOR[3] + 0x7fff)>>VTKKW_FP_SHIFT; \
271 COLOR[2] += (_tmpSColor[2]*COLOR[3] + 0x7fff)>>VTKKW_FP_SHIFT;
276 #define VTKKWRCHelper_InterpolateShadingComponent( DTABLE, STABLE, COLOR, CIDX ) \
277 unsigned int _tmpDColor[3]; \
278 unsigned int _tmpSColor[3]; \
281 (0x7fff + ((DTABLE[CIDX][3*normalA[CIDX]] * ((0x4000 + w1Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \
282 (DTABLE[CIDX][3*normalB[CIDX]] * ((0x4000 + w2Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \
283 (DTABLE[CIDX][3*normalC[CIDX]] * ((0x4000 + w1Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \
284 (DTABLE[CIDX][3*normalD[CIDX]] * ((0x4000 + w2Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \
285 (DTABLE[CIDX][3*normalE[CIDX]] * ((0x4000 + w1Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \
286 (DTABLE[CIDX][3*normalF[CIDX]] * ((0x4000 + w2Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \
287 (DTABLE[CIDX][3*normalG[CIDX]] * ((0x4000 + w1Xw2Y*w2Z)>>VTKKW_FP_SHIFT)) + \
288 (DTABLE[CIDX][3*normalH[CIDX]] * ((0x4000 + w2Xw2Y*w2Z)>>VTKKW_FP_SHIFT)))) >> VTKKW_FP_SHIFT; \
291 (0x7fff + ((DTABLE[CIDX][3*normalA[CIDX]+1] * ((0x4000 + w1Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \
292 (DTABLE[CIDX][3*normalB[CIDX]+1] * ((0x4000 + w2Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \
293 (DTABLE[CIDX][3*normalC[CIDX]+1] * ((0x4000 + w1Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \
294 (DTABLE[CIDX][3*normalD[CIDX]+1] * ((0x4000 + w2Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \
295 (DTABLE[CIDX][3*normalE[CIDX]+1] * ((0x4000 + w1Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \
296 (DTABLE[CIDX][3*normalF[CIDX]+1] * ((0x4000 + w2Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \
297 (DTABLE[CIDX][3*normalG[CIDX]+1] * ((0x4000 + w1Xw2Y*w2Z)>>VTKKW_FP_SHIFT)) + \
298 (DTABLE[CIDX][3*normalH[CIDX]+1] * ((0x4000 + w2Xw2Y*w2Z)>>VTKKW_FP_SHIFT)))) >> VTKKW_FP_SHIFT; \
301 (0x7fff + ((DTABLE[CIDX][3*normalA[CIDX]+2] * ((0x4000 + w1Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \
302 (DTABLE[CIDX][3*normalB[CIDX]+2] * ((0x4000 + w2Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \
303 (DTABLE[CIDX][3*normalC[CIDX]+2] * ((0x4000 + w1Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \
304 (DTABLE[CIDX][3*normalD[CIDX]+2] * ((0x4000 + w2Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \
305 (DTABLE[CIDX][3*normalE[CIDX]+2] * ((0x4000 + w1Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \
306 (DTABLE[CIDX][3*normalF[CIDX]+2] * ((0x4000 + w2Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \
307 (DTABLE[CIDX][3*normalG[CIDX]+2] * ((0x4000 + w1Xw2Y*w2Z)>>VTKKW_FP_SHIFT)) + \
308 (DTABLE[CIDX][3*normalH[CIDX]+2] * ((0x4000 + w2Xw2Y*w2Z)>>VTKKW_FP_SHIFT)))) >> VTKKW_FP_SHIFT; \
311 (0x7fff + ((STABLE[CIDX][3*normalA[CIDX]] * ((0x4000 + w1Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \
312 (STABLE[CIDX][3*normalB[CIDX]] * ((0x4000 + w2Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \
313 (STABLE[CIDX][3*normalC[CIDX]] * ((0x4000 + w1Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \
314 (STABLE[CIDX][3*normalD[CIDX]] * ((0x4000 + w2Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \
315 (STABLE[CIDX][3*normalE[CIDX]] * ((0x4000 + w1Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \
316 (STABLE[CIDX][3*normalF[CIDX]] * ((0x4000 + w2Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \
317 (STABLE[CIDX][3*normalG[CIDX]] * ((0x4000 + w1Xw2Y*w2Z)>>VTKKW_FP_SHIFT)) + \
318 (STABLE[CIDX][3*normalH[CIDX]] * ((0x4000 + w2Xw2Y*w2Z)>>VTKKW_FP_SHIFT)))) >> VTKKW_FP_SHIFT; \
321 (0x7fff + ((STABLE[CIDX][3*normalA[CIDX]+1] * ((0x4000 + w1Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \
322 (STABLE[CIDX][3*normalB[CIDX]+1] * ((0x4000 + w2Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \
323 (STABLE[CIDX][3*normalC[CIDX]+1] * ((0x4000 + w1Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \
324 (STABLE[CIDX][3*normalD[CIDX]+1] * ((0x4000 + w2Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \
325 (STABLE[CIDX][3*normalE[CIDX]+1] * ((0x4000 + w1Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \
326 (STABLE[CIDX][3*normalF[CIDX]+1] * ((0x4000 + w2Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \
327 (STABLE[CIDX][3*normalG[CIDX]+1] * ((0x4000 + w1Xw2Y*w2Z)>>VTKKW_FP_SHIFT)) + \
328 (STABLE[CIDX][3*normalH[CIDX]+1] * ((0x4000 + w2Xw2Y*w2Z)>>VTKKW_FP_SHIFT)))) >> VTKKW_FP_SHIFT; \
331 (0x7fff + ((STABLE[CIDX][3*normalA[CIDX]+2] * ((0x4000 + w1Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \
332 (STABLE[CIDX][3*normalB[CIDX]+2] * ((0x4000 + w2Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \
333 (STABLE[CIDX][3*normalC[CIDX]+2] * ((0x4000 + w1Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \
334 (STABLE[CIDX][3*normalD[CIDX]+2] * ((0x4000 + w2Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \
335 (STABLE[CIDX][3*normalE[CIDX]+2] * ((0x4000 + w1Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \
336 (STABLE[CIDX][3*normalF[CIDX]+2] * ((0x4000 + w2Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \
337 (STABLE[CIDX][3*normalG[CIDX]+2] * ((0x4000 + w1Xw2Y*w2Z)>>VTKKW_FP_SHIFT)) + \
338 (STABLE[CIDX][3*normalH[CIDX]+2] * ((0x4000 + w2Xw2Y*w2Z)>>VTKKW_FP_SHIFT)))) >> VTKKW_FP_SHIFT; \
341 COLOR[0] = static_cast<unsigned short>((_tmpDColor[0]*COLOR[0]+0x7fff)>>VTKKW_FP_SHIFT); \
342 COLOR[1] = static_cast<unsigned short>((_tmpDColor[1]*COLOR[1]+0x7fff)>>VTKKW_FP_SHIFT); \
343 COLOR[2] = static_cast<unsigned short>((_tmpDColor[2]*COLOR[2]+0x7fff)>>VTKKW_FP_SHIFT); \
344 COLOR[0] += (_tmpSColor[0]*COLOR[3] + 0x7fff)>>VTKKW_FP_SHIFT; \
345 COLOR[1] += (_tmpSColor[1]*COLOR[3] + 0x7fff)>>VTKKW_FP_SHIFT; \
346 COLOR[2] += (_tmpSColor[2]*COLOR[3] + 0x7fff)>>VTKKW_FP_SHIFT;
350 #define VTKKWRCHelper_LookupColorUS( COLORTABLE, SCALAROPACITYTABLE, IDX, COLOR ) \
351 COLOR[3] = SCALAROPACITYTABLE[IDX]; \
352 if ( !COLOR[3] ) {continue;} \
353 COLOR[0] = static_cast<unsigned short> \
354 ((COLORTABLE[3*IDX ]*COLOR[3] + 0x7fff)>>(VTKKW_FP_SHIFT)); \
355 COLOR[1] = static_cast<unsigned short> \
356 ((COLORTABLE[3*IDX+1]*COLOR[3] + 0x7fff)>>(VTKKW_FP_SHIFT)); \
357 COLOR[2] = static_cast<unsigned short> \
358 ((COLORTABLE[3*IDX+2]*COLOR[3] + 0x7fff)>>(VTKKW_FP_SHIFT));
362 #define VTKKWRCHelper_LookupColorMax( COLORTABLE, SCALAROPACITYTABLE, IDX, COLOR ) \
363 COLOR[3] = SCALAROPACITYTABLE[IDX]; \
364 COLOR[0] = static_cast<unsigned short> \
365 ((COLORTABLE[3*IDX ]*COLOR[3] + 0x7fff)>>(VTKKW_FP_SHIFT)); \
366 COLOR[1] = static_cast<unsigned short> \
367 ((COLORTABLE[3*IDX+1]*COLOR[3] + 0x7fff)>>(VTKKW_FP_SHIFT)); \
368 COLOR[2] = static_cast<unsigned short> \
369 ((COLORTABLE[3*IDX+2]*COLOR[3] + 0x7fff)>>(VTKKW_FP_SHIFT));
373 #define VTKKWRCHelper_LookupDependentColorUS( COLORTABLE, SCALAROPACITYTABLE, IDX, CMPS, COLOR ) \
375 unsigned short _alpha; \
379 _alpha = SCALAROPACITYTABLE[IDX[1]]; \
380 COLOR[0] = static_cast<unsigned short> \
381 ((COLORTABLE[3*IDX[0] ]*_alpha + 0x7fff)>>(VTKKW_FP_SHIFT)); \
382 COLOR[1] = static_cast<unsigned short> \
383 ((COLORTABLE[3*IDX[0]+1]*_alpha + 0x7fff)>>(VTKKW_FP_SHIFT)); \
384 COLOR[2] = static_cast<unsigned short> \
385 ((COLORTABLE[3*IDX[0]+2]*_alpha + 0x7fff)>>(VTKKW_FP_SHIFT)); \
389 _alpha = SCALAROPACITYTABLE[IDX[3]]; \
390 COLOR[0] = static_cast<unsigned short>((IDX[0]*_alpha + 0x7f)>>8 ); \
391 COLOR[1] = static_cast<unsigned short>((IDX[1]*_alpha + 0x7f)>>8 ); \
392 COLOR[2] = static_cast<unsigned short>((IDX[2]*_alpha + 0x7f)>>8 ); \
400 #define VTKKWRCHelper_LookupColorGOUS( CTABLE, SOTABLE, GOTABLE, IDX, IDX2, COLOR ) \
401 COLOR[3] = (SOTABLE[IDX] * GOTABLE[IDX2] + 0x7fff)>>VTKKW_FP_SHIFT; \
402 if ( !COLOR[3] ) {continue;} \
403 COLOR[0] = static_cast<unsigned short> \
404 ((CTABLE[3*IDX ]*COLOR[3] + 0x7fff)>>(VTKKW_FP_SHIFT)); \
405 COLOR[1] = static_cast<unsigned short> \
406 ((CTABLE[3*IDX+1]*COLOR[3] + 0x7fff)>>(VTKKW_FP_SHIFT)); \
407 COLOR[2] = static_cast<unsigned short> \
408 ((CTABLE[3*IDX+2]*COLOR[3] + 0x7fff)>>(VTKKW_FP_SHIFT));
412 #define VTKKWRCHelper_LookupShading( DTABLE, STABLE, NORMAL, COLOR ) \
413 COLOR[0] = static_cast<unsigned short>((DTABLE[3*NORMAL ]*COLOR[0]+0x7fff)>>VTKKW_FP_SHIFT); \
414 COLOR[1] = static_cast<unsigned short>((DTABLE[3*NORMAL+1]*COLOR[1]+0x7fff)>>VTKKW_FP_SHIFT); \
415 COLOR[2] = static_cast<unsigned short>((DTABLE[3*NORMAL+2]*COLOR[2]+0x7fff)>>VTKKW_FP_SHIFT); \
416 COLOR[0] += (STABLE[3*NORMAL ]*COLOR[3] + 0x7fff)>>VTKKW_FP_SHIFT; \
417 COLOR[1] += (STABLE[3*NORMAL+1]*COLOR[3] + 0x7fff)>>VTKKW_FP_SHIFT; \
418 COLOR[2] += (STABLE[3*NORMAL+2]*COLOR[3] + 0x7fff)>>VTKKW_FP_SHIFT;
423 #define VTKKWRCHelper_LookupAndCombineIndependentColorsUS( COLORTABLE, SOTABLE, \
425 COMPONENTS, COLOR ) \
426 unsigned int _tmp[4] = {0,0,0,0}; \
427 unsigned short _alpha[4] = {0,0,0,0}; \
428 unsigned int _totalAlpha = 0; \
430 {for ( int _idx = 0; _idx < COMPONENTS; _idx++ ) \
432 _alpha[_idx] = static_cast<unsigned short>(SOTABLE[_idx][SCALAR[_idx]]*WEIGHTS[_idx]); \
433 _totalAlpha += _alpha[_idx]; \
436 if ( !_totalAlpha ) {continue;} \
437 {for ( int _idx = 0; _idx < COMPONENTS; _idx++ ) \
439 if ( _alpha[_idx] ) \
441 _tmp[0] += static_cast<unsigned short>(((COLORTABLE[_idx][3*SCALAR[_idx] ])*_alpha[_idx] + 0x7fff)>>(VTKKW_FP_SHIFT)); \
442 _tmp[1] += static_cast<unsigned short>(((COLORTABLE[_idx][3*SCALAR[_idx]+1])*_alpha[_idx] + 0x7fff)>>(VTKKW_FP_SHIFT)); \
443 _tmp[2] += static_cast<unsigned short>(((COLORTABLE[_idx][3*SCALAR[_idx]+2])*_alpha[_idx] + 0x7fff)>>(VTKKW_FP_SHIFT)); \
444 _tmp[3] += ((_alpha[_idx]*_alpha[_idx])/_totalAlpha); \
447 if ( !_tmp[3] ) {continue;} \
448 COLOR[0] = (_tmp[0]>32767)?(32767):(_tmp[0]); \
449 COLOR[1] = (_tmp[1]>32767)?(32767):(_tmp[1]); \
450 COLOR[2] = (_tmp[2]>32767)?(32767):(_tmp[2]); \
451 COLOR[3] = (_tmp[3]>32767)?(32767):(_tmp[3]);
455 #define VTKKWRCHelper_LookupAndCombineIndependentColorsMax( COLORTABLE, SCALAROPACITYTABLE, \
456 IDX, WEIGHTS, CMPS, COLOR ) \
458 unsigned int _tmp[4] = {0,0,0,0}; \
459 for ( int _idx = 0; _idx < CMPS; _idx++ ) \
461 unsigned short _alpha = static_cast<unsigned short>(SCALAROPACITYTABLE[_idx][IDX[_idx]]*WEIGHTS[_idx]); \
462 _tmp[0] += static_cast<unsigned short>(((COLORTABLE[_idx][3*IDX[_idx] ])*_alpha + 0x7fff)>>(VTKKW_FP_SHIFT)); \
463 _tmp[1] += static_cast<unsigned short>(((COLORTABLE[_idx][3*IDX[_idx]+1])*_alpha + 0x7fff)>>(VTKKW_FP_SHIFT)); \
464 _tmp[2] += static_cast<unsigned short>(((COLORTABLE[_idx][3*IDX[_idx]+2])*_alpha + 0x7fff)>>(VTKKW_FP_SHIFT)); \
467 COLOR[0] = (_tmp[0]>32767)?(32767):(_tmp[0]); \
468 COLOR[1] = (_tmp[1]>32767)?(32767):(_tmp[1]); \
469 COLOR[2] = (_tmp[2]>32767)?(32767):(_tmp[2]); \
470 COLOR[3] = (_tmp[3]>32767)?(32767):(_tmp[3]); \
475 #define VTKKWRCHelper_LookupAndCombineIndependentColorsGOUS( COLORTABLE, SOTABLE, \
477 SCALAR, MAG, WEIGHTS, \
478 COMPONENTS, COLOR ) \
479 unsigned int _tmp[4] = {0,0,0,0}; \
480 unsigned short _alpha[4] = {0,0,0,0}; \
481 unsigned int _totalAlpha = 0; \
482 COMPONENTS = (COMPONENTS < 4) ? COMPONENTS : 4; \
483 {for ( int _idx = 0; _idx < COMPONENTS; _idx++ ) \
485 _alpha[_idx] = static_cast<unsigned short>(SOTABLE[_idx][SCALAR[_idx]]*WEIGHTS[_idx]); \
486 if ( _alpha[_idx] ) \
488 _alpha[_idx] = static_cast<unsigned short>((_alpha[_idx]*GOTABLE[_idx][MAG[_idx]] + 0x7fff)>>(VTKKW_FP_SHIFT)); \
489 _totalAlpha += _alpha[_idx]; \
493 if ( !_totalAlpha ) {continue;} \
494 {for ( int _idx = 0; _idx < COMPONENTS; _idx++ ) \
496 if ( _alpha[_idx] ) \
498 _tmp[0] += static_cast<unsigned short>(((COLORTABLE[_idx][3*SCALAR[_idx] ])*_alpha[_idx] + 0x7fff)>>(VTKKW_FP_SHIFT)); \
499 _tmp[1] += static_cast<unsigned short>(((COLORTABLE[_idx][3*SCALAR[_idx]+1])*_alpha[_idx] + 0x7fff)>>(VTKKW_FP_SHIFT)); \
500 _tmp[2] += static_cast<unsigned short>(((COLORTABLE[_idx][3*SCALAR[_idx]+2])*_alpha[_idx] + 0x7fff)>>(VTKKW_FP_SHIFT)); \
501 _tmp[3] += ((_alpha[_idx]*_alpha[_idx])/_totalAlpha); \
504 if ( !_tmp[3] ) {continue;}; \
505 COLOR[0] = (_tmp[0]>32767)?(32767):(_tmp[0]); \
506 COLOR[1] = (_tmp[1]>32767)?(32767):(_tmp[1]); \
507 COLOR[2] = (_tmp[2]>32767)?(32767):(_tmp[2]); \
508 COLOR[3] = (_tmp[3]>32767)?(32767):(_tmp[3]);
512 #define VTKKWRCHelper_LookupAndCombineIndependentColorsShadeUS( COLORTABLE, SOTABLE, \
514 SCALAR, NORMAL, WEIGHTS, \
515 COMPONENTS, COLOR ) \
516 unsigned int _tmp[4] = {0,0,0,0}; \
517 unsigned int _tmpC[3]; \
518 unsigned short _alpha[4] = {0,0,0,0}; \
519 unsigned int _totalAlpha = 0; \
521 {for ( int _idx = 0; _idx < COMPONENTS; _idx++ ) \
523 _alpha[_idx] = static_cast<unsigned short>(SOTABLE[_idx][SCALAR[_idx]]*WEIGHTS[_idx]); \
524 _totalAlpha += _alpha[_idx]; \
527 if ( !_totalAlpha ) {continue;} \
528 {for ( int _idx = 0; _idx < COMPONENTS; _idx++ ) \
530 if ( _alpha[_idx] ) \
532 _tmpC[0] = static_cast<unsigned short>(((COLORTABLE[_idx][3*SCALAR[_idx] ])*_alpha[_idx] + 0x7fff)>>(VTKKW_FP_SHIFT)); \
533 _tmpC[1] = static_cast<unsigned short>(((COLORTABLE[_idx][3*SCALAR[_idx]+1])*_alpha[_idx] + 0x7fff)>>(VTKKW_FP_SHIFT)); \
534 _tmpC[2] = static_cast<unsigned short>(((COLORTABLE[_idx][3*SCALAR[_idx]+2])*_alpha[_idx] + 0x7fff)>>(VTKKW_FP_SHIFT)); \
535 _tmpC[0] = static_cast<unsigned short>((DTABLE[_idx][3*NORMAL[_idx] ]*_tmpC[0]+0x7fff)>>VTKKW_FP_SHIFT); \
536 _tmpC[1] = static_cast<unsigned short>((DTABLE[_idx][3*NORMAL[_idx]+1]*_tmpC[1]+0x7fff)>>VTKKW_FP_SHIFT); \
537 _tmpC[2] = static_cast<unsigned short>((DTABLE[_idx][3*NORMAL[_idx]+2]*_tmpC[2]+0x7fff)>>VTKKW_FP_SHIFT); \
538 _tmpC[0] += (STABLE[_idx][3*NORMAL[_idx] ]*_alpha[_idx] + 0x7fff)>>VTKKW_FP_SHIFT; \
539 _tmpC[1] += (STABLE[_idx][3*NORMAL[_idx]+1]*_alpha[_idx] + 0x7fff)>>VTKKW_FP_SHIFT; \
540 _tmpC[2] += (STABLE[_idx][3*NORMAL[_idx]+2]*_alpha[_idx] + 0x7fff)>>VTKKW_FP_SHIFT; \
541 _tmp[0] += _tmpC[0]; \
542 _tmp[1] += _tmpC[1]; \
543 _tmp[2] += _tmpC[2]; \
544 _tmp[3] += ((_alpha[_idx]*_alpha[_idx])/_totalAlpha); \
547 if ( !_tmp[3] ) {continue;} \
549 COLOR[0] = (_tmp[0]>32767)?(32767):(_tmp[0]); \
550 COLOR[1] = (_tmp[1]>32767)?(32767):(_tmp[1]); \
551 COLOR[2] = (_tmp[2]>32767)?(32767):(_tmp[2]); \
552 COLOR[3] = (_tmp[3]>32767)?(32767):(_tmp[3]);
556 #define VTKKWRCHelper_LookupAndCombineIndependentColorsInterpolateShadeUS( COLORTABLE, SOTABLE, \
559 COMPONENTS, COLOR ) \
560 unsigned int _tmp[4] = {0,0,0,0}; \
561 unsigned int _tmpC[4]; \
562 unsigned short _alpha[4] = {0,0,0,0}; \
563 unsigned int _totalAlpha = 0; \
565 {for ( int _idx = 0; _idx < COMPONENTS; _idx++ ) \
567 _alpha[_idx] = static_cast<unsigned short>(SOTABLE[_idx][SCALAR[_idx]]*WEIGHTS[_idx]); \
568 _totalAlpha += _alpha[_idx]; \
571 if ( !_totalAlpha ) {continue;} \
572 {for ( int _idx = 0; _idx < COMPONENTS; _idx++ ) \
574 if ( _alpha[_idx] ) \
576 _tmpC[0] = static_cast<unsigned short>(((COLORTABLE[_idx][3*SCALAR[_idx] ])*_alpha[_idx] + 0x7fff)>>(VTKKW_FP_SHIFT)); \
577 _tmpC[1] = static_cast<unsigned short>(((COLORTABLE[_idx][3*SCALAR[_idx]+1])*_alpha[_idx] + 0x7fff)>>(VTKKW_FP_SHIFT)); \
578 _tmpC[2] = static_cast<unsigned short>(((COLORTABLE[_idx][3*SCALAR[_idx]+2])*_alpha[_idx] + 0x7fff)>>(VTKKW_FP_SHIFT)); \
579 _tmpC[3] = _alpha[_idx]; \
580 VTKKWRCHelper_InterpolateShadingComponent( DTABLE, STABLE, _tmpC, _idx ); \
581 _tmp[0] += _tmpC[0]; \
582 _tmp[1] += _tmpC[1]; \
583 _tmp[2] += _tmpC[2]; \
584 _tmp[3] += ((_alpha[_idx]*_alpha[_idx])/_totalAlpha); \
587 if (!_tmp[3]) {continue;} \
588 COLOR[0] = (_tmp[0]>32767)?(32767):(_tmp[0]); \
589 COLOR[1] = (_tmp[1]>32767)?(32767):(_tmp[1]); \
590 COLOR[2] = (_tmp[2]>32767)?(32767):(_tmp[2]); \
591 COLOR[3] = (_tmp[3]>32767)?(32767):(_tmp[3]);
595 #define VTKKWRCHelper_CompositeColorAndCheckEarlyTermination( COLOR, TMP, REMAININGOPACITY ) \
596 COLOR[0] += (TMP[0]*REMAININGOPACITY+0x7fff)>>VTKKW_FP_SHIFT; \
597 COLOR[1] += (TMP[1]*REMAININGOPACITY+0x7fff)>>VTKKW_FP_SHIFT; \
598 COLOR[2] += (TMP[2]*REMAININGOPACITY+0x7fff)>>VTKKW_FP_SHIFT; \
599 REMAININGOPACITY = (REMAININGOPACITY*((~(TMP[3])&VTKKW_FP_MASK))+0x7fff)>>VTKKW_FP_SHIFT; \
600 if ( REMAININGOPACITY < 0xff ) \
607 #define VTKKWRCHelper_LookupAndCombineIndependentColorsGOShadeUS( COLORTABLE, SOTABLE, GOTABLE, \
609 SCALAR, MAG, NORMAL, WEIGHTS, \
610 COMPONENTS, COLOR ) \
611 unsigned int _tmp[4] = {0,0,0,0}; \
612 unsigned int _tmpC[3]; \
613 unsigned short _alpha[4] = {0,0,0,0}; \
614 unsigned int _totalAlpha = 0; \
616 {for ( int _idx = 0; _idx < COMPONENTS; _idx++ ) \
618 _alpha[_idx] = static_cast<unsigned short>(SOTABLE[_idx][SCALAR[_idx]]*WEIGHTS[_idx]); \
619 if ( _alpha[_idx] ) \
621 _alpha[_idx] = static_cast<unsigned short>((_alpha[_idx]*GOTABLE[_idx][MAG[_idx]] + 0x7fff)>>(VTKKW_FP_SHIFT)); \
622 _totalAlpha += _alpha[_idx]; \
626 if ( !_totalAlpha ) {continue;} \
628 {for ( int _idx = 0; _idx < COMPONENTS; _idx++ ) \
630 if ( _alpha[_idx] ) \
632 _tmpC[0] = static_cast<unsigned short>(((COLORTABLE[_idx][3*SCALAR[_idx] ])*_alpha[_idx] + 0x7fff)>>(VTKKW_FP_SHIFT)); \
633 _tmpC[1] = static_cast<unsigned short>(((COLORTABLE[_idx][3*SCALAR[_idx]+1])*_alpha[_idx] + 0x7fff)>>(VTKKW_FP_SHIFT)); \
634 _tmpC[2] = static_cast<unsigned short>(((COLORTABLE[_idx][3*SCALAR[_idx]+2])*_alpha[_idx] + 0x7fff)>>(VTKKW_FP_SHIFT)); \
635 _tmpC[0] = static_cast<unsigned short>((DTABLE[_idx][3*NORMAL[_idx] ]*_tmpC[0]+0x7fff)>>VTKKW_FP_SHIFT); \
636 _tmpC[1] = static_cast<unsigned short>((DTABLE[_idx][3*NORMAL[_idx]+1]*_tmpC[1]+0x7fff)>>VTKKW_FP_SHIFT); \
637 _tmpC[2] = static_cast<unsigned short>((DTABLE[_idx][3*NORMAL[_idx]+2]*_tmpC[2]+0x7fff)>>VTKKW_FP_SHIFT); \
638 _tmpC[0] += (STABLE[_idx][3*NORMAL[_idx] ]*_alpha[_idx] + 0x7fff)>>VTKKW_FP_SHIFT; \
639 _tmpC[1] += (STABLE[_idx][3*NORMAL[_idx]+1]*_alpha[_idx] + 0x7fff)>>VTKKW_FP_SHIFT; \
640 _tmpC[2] += (STABLE[_idx][3*NORMAL[_idx]+2]*_alpha[_idx] + 0x7fff)>>VTKKW_FP_SHIFT; \
641 _tmp[0] += _tmpC[0]; \
642 _tmp[1] += _tmpC[1]; \
643 _tmp[2] += _tmpC[2]; \
644 _tmp[3] += ((_alpha[_idx]*_alpha[_idx])/_totalAlpha); \
647 if ( !_tmp[3] ) {continue;} \
648 COLOR[0] = (_tmp[0]>32767)?(32767):(_tmp[0]); \
649 COLOR[1] = (_tmp[1]>32767)?(32767):(_tmp[1]); \
650 COLOR[2] = (_tmp[2]>32767)?(32767):(_tmp[2]); \
651 COLOR[3] = (_tmp[3]>32767)?(32767):(_tmp[3]);
655 #define VTKKWRCHelper_LookupAndCombineIndependentColorsGOInterpolateShadeUS( COLORTABLE, SOTABLE, GOTABLE, \
657 SCALAR, MAG, WEIGHTS, \
658 COMPONENTS, COLOR ) \
659 unsigned int _tmp[4] = {0,0,0,0}; \
660 unsigned int _tmpC[4]; \
661 unsigned short _alpha[4] = {0,0,0,0}; \
662 unsigned int _totalAlpha = 0; \
664 {for ( int _idx = 0; _idx < COMPONENTS; _idx++ ) \
666 _alpha[_idx] = static_cast<unsigned short>(SOTABLE[_idx][SCALAR[_idx]]*WEIGHTS[_idx]); \
667 if ( _alpha[_idx] ) \
669 _alpha[_idx] = static_cast<unsigned short>((_alpha[_idx]*GOTABLE[_idx][MAG[_idx]] + 0x7fff)>>(VTKKW_FP_SHIFT)); \
670 _totalAlpha += _alpha[_idx]; \
674 if ( !_totalAlpha ) {continue;} \
675 {for ( int _idx = 0; _idx < COMPONENTS; _idx++ ) \
677 if ( _alpha[_idx] ) \
679 _tmpC[0] = static_cast<unsigned short>(((COLORTABLE[_idx][3*SCALAR[_idx] ])*_alpha[_idx] + 0x7fff)>>(VTKKW_FP_SHIFT)); \
680 _tmpC[1] = static_cast<unsigned short>(((COLORTABLE[_idx][3*SCALAR[_idx]+1])*_alpha[_idx] + 0x7fff)>>(VTKKW_FP_SHIFT)); \
681 _tmpC[2] = static_cast<unsigned short>(((COLORTABLE[_idx][3*SCALAR[_idx]+2])*_alpha[_idx] + 0x7fff)>>(VTKKW_FP_SHIFT)); \
682 _tmpC[3] = _alpha[_idx]; \
683 VTKKWRCHelper_InterpolateShadingComponent( DTABLE, STABLE, _tmpC, _idx ); \
684 _tmp[0] += _tmpC[0]; \
685 _tmp[1] += _tmpC[1]; \
686 _tmp[2] += _tmpC[2]; \
687 _tmp[3] += ((_alpha[_idx]*_alpha[_idx])/_totalAlpha); \
690 if ( !_tmp[3] ) {continue;} \
691 COLOR[0] = (_tmp[0]>32767)?(32767):(_tmp[0]); \
692 COLOR[1] = (_tmp[1]>32767)?(32767):(_tmp[1]); \
693 COLOR[2] = (_tmp[2]>32767)?(32767):(_tmp[2]); \
694 COLOR[3] = (_tmp[3]>32767)?(32767):(_tmp[3]);
699 #define VTKKWRCHelper_SetPixelColor( IMAGEPTR, COLOR, REMAININGOPACITY ) \
700 IMAGEPTR[0] = (COLOR[0]>32767)?(32767):(COLOR[0]); \
701 IMAGEPTR[1] = (COLOR[1]>32767)?(32767):(COLOR[1]); \
702 IMAGEPTR[2] = (COLOR[2]>32767)?(32767):(COLOR[2]); \
703 unsigned int tmpAlpha = (~REMAININGOPACITY)&VTKKW_FP_MASK; \
704 IMAGEPTR[3] = (tmpAlpha>32767)?(32767):(tmpAlpha);
708 #define VTKKWRCHelper_MoveToNextSampleNN() \
709 if ( k < numSteps-1 ) \
711 mapper->FixedPointIncrement( pos, dir ); \
712 mapper->ShiftVectorDown( pos, spos ); \
713 dptr = data + spos[0]*inc[0] + spos[1]*inc[1] + spos[2]*inc[2]; \
718 #define VTKKWRCHelper_MoveToNextSampleGONN() \
719 if ( k < numSteps-1 ) \
721 mapper->FixedPointIncrement( pos, dir ); \
722 mapper->ShiftVectorDown( pos, spos ); \
723 dptr = data + spos[0]*inc[0] + spos[1]*inc[1] + spos[2]*inc[2]; \
724 magPtr = gradientMag[spos[2]] + spos[0]*mInc[0] + spos[1]*mInc[1]; \
729 #define VTKKWRCHelper_MoveToNextSampleShadeNN() \
730 if ( k < numSteps-1 ) \
732 mapper->FixedPointIncrement( pos, dir ); \
733 mapper->ShiftVectorDown( pos, spos ); \
734 dptr = data + spos[0]*inc[0] + spos[1]*inc[1] + spos[2]*inc[2]; \
735 dirPtr = gradientDir[spos[2]] + spos[0]*dInc[0] + spos[1]*dInc[1]; \
740 #define VTKKWRCHelper_MoveToNextSampleGOShadeNN() \
741 if ( k < numSteps-1 ) \
743 mapper->FixedPointIncrement( pos, dir ); \
744 mapper->ShiftVectorDown( pos, spos ); \
745 dptr = data + spos[0]*inc[0] + spos[1]*inc[1] + spos[2]*inc[2]; \
746 magPtr = gradientMag[spos[2]] + spos[0]*mInc[0] + spos[1]*mInc[1]; \
747 dirPtr = gradientDir[spos[2]] + spos[0]*dInc[0] + spos[1]*dInc[1]; \
752 #define VTKKWRCHelper_InitializeVariables() \
754 unsigned short *imagePtr; \
756 int imageInUseSize[2]; \
757 int imageMemorySize[2]; \
758 int imageViewportSize[2]; \
759 int imageOrigin[2]; \
764 mapper->GetRayCastImage()->GetImageInUseSize(imageInUseSize); \
765 mapper->GetRayCastImage()->GetImageMemorySize(imageMemorySize); \
766 mapper->GetRayCastImage()->GetImageViewportSize(imageViewportSize); \
767 mapper->GetRayCastImage()->GetImageOrigin(imageOrigin); \
768 mapper->GetInput()->GetDimensions(dim); \
769 mapper->GetTableShift( shift ); \
770 mapper->GetTableScale( scale ); \
772 int *rowBounds = mapper->GetRowBounds(); \
773 unsigned short *image = mapper->GetRayCastImage()->GetImage(); \
774 vtkRenderWindow *renWin = mapper->GetRenderWindow(); \
775 int components = mapper->GetInput()->GetNumberOfScalarComponents(); \
776 int cropping = (mapper->GetCropping() && \
777 mapper->GetCroppingRegionFlags() != 0x2000 ); \
779 components = (components < 4) ? components : 4; \
780 unsigned short *colorTable[4]; \
781 unsigned short *scalarOpacityTable[4]; \
784 for ( c = 0; c < 4; c++ ) \
786 colorTable[c] = mapper->GetColorTable(c); \
787 (void)(colorTable[c]); \
788 scalarOpacityTable[c] = mapper->GetScalarOpacityTable(c); \
792 inc[0] = components; \
793 inc[1] = inc[0]*dim[0]; \
794 inc[2] = inc[1]*dim[1];
798 #define VTKKWRCHelper_InitializeWeights() \
799 float weights[4] = {}; \
800 weights[0] = vol->GetProperty()->GetComponentWeight(0); \
801 weights[1] = vol->GetProperty()->GetComponentWeight(1); \
802 weights[2] = vol->GetProperty()->GetComponentWeight(2); \
803 weights[3] = vol->GetProperty()->GetComponentWeight(3);
807 #define VTKKWRCHelper_InitializeVariablesGO() \
808 unsigned short *gradientOpacityTable[4]; \
809 for ( c = 0; c < 4; c++ ) \
811 gradientOpacityTable[c] = mapper->GetGradientOpacityTable(c); \
813 unsigned char **gradientMag = mapper->GetGradientMagnitude(); \
816 if ( vol->GetProperty()->GetIndependentComponents() ) \
825 mInc[1] = mInc[0]*dim[0]; \
826 mInc[2] = mInc[1]*dim[1]; \
831 #define VTKKWRCHelper_InitializeVariablesShade() \
832 unsigned short *diffuseShadingTable[4]; \
833 unsigned short *specularShadingTable[4]; \
834 for ( c = 0; c < 4; c++ ) \
836 diffuseShadingTable[c] = mapper->GetDiffuseShadingTable(c); \
837 specularShadingTable[c] = mapper->GetSpecularShadingTable(c); \
839 unsigned short **gradientDir = mapper->GetGradientNormal(); \
841 if ( vol->GetProperty()->GetIndependentComponents() ) \
850 dInc[1] = dInc[0]*dim[0]; \
851 dInc[2] = dInc[1]*dim[1]; \
856 #define VTKKWRCHelper_InitializeTrilinVariables() \
857 vtkIdType Binc = components; \
858 vtkIdType Cinc = Binc*dim[0]; \
859 vtkIdType Dinc = Cinc + Binc; \
860 vtkIdType Einc = Cinc*dim[1]; \
861 vtkIdType Finc = Einc + Binc; \
862 vtkIdType Ginc = Einc + Cinc; \
863 vtkIdType Hinc = Ginc + Binc;
867 #define VTKKWRCHelper_InitializeTrilinVariablesGO() \
868 vtkIdType magOffset; \
869 if ( vol->GetProperty()->GetIndependentComponents() ) \
871 magOffset = components; \
878 vtkIdType mBFinc = magOffset; \
879 vtkIdType mCGinc = dim[0]*magOffset; \
880 vtkIdType mDHinc = dim[0]*magOffset + magOffset;
884 #define VTKKWRCHelper_InitializeTrilinVariablesShade() \
885 vtkIdType dirOffset; \
886 if ( vol->GetProperty()->GetIndependentComponents() ) \
888 dirOffset = components; \
895 vtkIdType dBFinc = dirOffset; \
896 vtkIdType dCGinc = dim[0]*dirOffset; \
897 vtkIdType dDHinc = dim[0]*dirOffset + dirOffset;
901 #define VTKKWRCHelper_OuterInitialization() \
902 if ( j%threadCount != threadID ) \
908 if ( renWin->CheckAbortStatus() ) \
913 else if ( renWin->GetAbortRender() ) \
917 imagePtr = image + 4*(j*imageMemorySize[0] + rowBounds[j*2]);
922 #define VTKKWRCHelper_InnerInitialization() \
923 unsigned int numSteps; \
924 unsigned int pos[3]; \
925 unsigned int dir[3]; \
926 mapper->ComputeRayInfo( i, j, pos, dir, &numSteps ); \
927 if ( numSteps == 0 ) \
936 unsigned int spos[3]; \
941 #define VTKKWRCHelper_InitializeMIPOneNN() \
942 mapper->ShiftVectorDown( pos, spos ); \
943 T *dptr = data + spos[0]*inc[0] + spos[1]*inc[1] + spos[2]*inc[2]; \
944 T maxValue = *(dptr);
948 #define VTKKWRCHelper_InitializeMIPMultiNN() \
949 mapper->ShiftVectorDown( pos, spos ); \
950 T *dptr = data + spos[0]*inc[0] + spos[1]*inc[1] + spos[2]*inc[2]; \
951 T maxValue[4] = {}; \
952 for ( c = 0; c < components; c++ ) \
954 maxValue[c] = *(dptr+c); \
959 #define VTKKWRCHelper_InitializeMIPOneTrilin() \
961 unsigned int oldSPos[3]; \
963 oldSPos[0] = (pos[0] >> VTKKW_FP_SHIFT) + 1; \
967 unsigned int w1X, w1Y, w1Z; \
968 unsigned int w2X, w2Y, w2Z; \
969 unsigned int w1Xw1Y, w2Xw1Y, w1Xw2Y, w2Xw2Y; \
971 unsigned short maxValue=0; \
972 unsigned short val; \
973 unsigned int A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;
977 #define VTKKWRCHelper_InitializeMIPMultiTrilin() \
979 unsigned int oldSPos[3]; \
981 oldSPos[0] = (pos[0] >> VTKKW_FP_SHIFT) + 1; \
985 unsigned int w1X, w1Y, w1Z; \
986 unsigned int w2X, w2Y, w2Z; \
987 unsigned int w1Xw1Y, w2Xw1Y, w1Xw2Y, w2Xw2Y; \
989 unsigned short maxValue[4] = {}; \
990 unsigned short val[4] = {}; \
991 unsigned int A[4] = {}, B[4] = {}, C[4] = {}, D[4] = {}, \
992 E[4] = {}, F[4] = {}, G[4] = {}, H[4] = {};
996 #define VTKKWRCHelper_InitializeCompositeGONN() \
997 unsigned char *magPtr = gradientMag[spos[2]] + spos[0]*mInc[0] + spos[1]*mInc[1];
1001 #define VTKKWRCHelper_InitializeCompositeShadeNN() \
1002 unsigned short *dirPtr = gradientDir[spos[2]] + spos[0]*dInc[0] + spos[1]*dInc[1];
1006 #define VTKKWRCHelper_InitializeCompositeOneNN() \
1007 mapper->ShiftVectorDown( pos, spos ); \
1008 T *dptr = data + spos[0]*inc[0] + spos[1]*inc[1] + spos[2]*inc[2]; \
1009 unsigned int color[3] = {0,0,0}; \
1010 unsigned short remainingOpacity = 0x7fff; \
1011 unsigned short tmp[4];
1015 #define VTKKWRCHelper_InitializeCompositeMultiNN() \
1016 mapper->ShiftVectorDown( pos, spos ); \
1017 T *dptr = data + spos[0]*inc[0] + spos[1]*inc[1] + spos[2]*inc[2]; \
1018 unsigned int color[3] = {0,0,0}; \
1019 unsigned int remainingOpacity = 0x7fff; \
1020 unsigned short tmp[4] = {}; \
1021 unsigned short val[4] = {};
1025 #define VTKKWRCHelper_InitializeCompositeOneTrilin() \
1027 unsigned int oldSPos[3]; \
1029 oldSPos[0] = (pos[0] >> VTKKW_FP_SHIFT) + 1; \
1033 unsigned int w1X, w1Y, w1Z; \
1034 unsigned int w2X, w2Y, w2Z; \
1035 unsigned int w1Xw1Y, w2Xw1Y, w1Xw2Y, w2Xw2Y; \
1037 unsigned short val; \
1038 unsigned int A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0; \
1040 unsigned int color[3] = {0,0,0}; \
1041 unsigned short remainingOpacity = 0x7fff; \
1042 unsigned short tmp[4];
1046 #define VTKKWRCHelper_InitializeCompositeOneGOTrilin() \
1047 unsigned char *magPtrABCD = 0, *magPtrEFGH = 0; \
1048 unsigned short mag; \
1049 unsigned int mA=0,mB=0,mC=0,mD=0,mE=0,mF=0,mG=0,mH=0;
1053 #define VTKKWRCHelper_InitializeCompositeOneShadeTrilin() \
1054 unsigned short *dirPtrABCD = 0, *dirPtrEFGH = 0; \
1055 unsigned int normalA=0,normalB=0,normalC=0,normalD=0; \
1056 unsigned int normalE=0,normalF=0,normalG=0,normalH=0;
1060 #define VTKKWRCHelper_InitializeCompositeMultiTrilin() \
1062 unsigned int oldSPos[3]; \
1064 oldSPos[0] = (pos[0] >> VTKKW_FP_SHIFT) + 1; \
1068 unsigned int w1X, w1Y, w1Z; \
1069 unsigned int w2X, w2Y, w2Z; \
1070 unsigned int w1Xw1Y, w2Xw1Y, w1Xw2Y, w2Xw2Y; \
1072 unsigned short val[4] = {0, 0, 0, 0}; \
1073 unsigned int A[4] = {0, 0, 0, 0}; \
1074 unsigned int B[4] = {0, 0, 0, 0}; \
1075 unsigned int C[4] = {0, 0, 0, 0}; \
1076 unsigned int D[4] = {0, 0, 0, 0}; \
1077 unsigned int E[4] = {0, 0, 0, 0}; \
1078 unsigned int F[4] = {0, 0, 0, 0}; \
1079 unsigned int G[4] = {0, 0, 0, 0}; \
1080 unsigned int H[4] = {0, 0, 0, 0}; \
1082 unsigned int color[3] = {0,0,0}; \
1083 unsigned short remainingOpacity = 0x7fff; \
1084 unsigned short tmp[4];
1088 #define VTKKWRCHelper_InitializeCompositeMultiGOTrilin() \
1089 unsigned char *magPtrABCD = 0, *magPtrEFGH = 0; \
1090 unsigned short mag[4] = {}; \
1091 unsigned int mA[4] = {}, mB[4] = {}, mC[4] = {}, \
1092 mD[4] = {}, mE[4] = {}, mF[4] = {}, \
1093 mG[4] = {}, mH[4] = {};
1097 #define VTKKWRCHelper_InitializeCompositeMultiShadeTrilin() \
1098 unsigned short *dirPtrABCD = 0, *dirPtrEFGH = 0; \
1099 unsigned int normalA[4],normalB[4],normalC[4],normalD[4]; \
1100 unsigned int normalE[4],normalF[4],normalG[4],normalH[4];
1104 #define VTKKWRCHelper_InitializationAndLoopStartNN() \
1105 VTKKWRCHelper_InitializeVariables(); \
1106 for ( j = 0; j < imageInUseSize[1]; j++ ) \
1108 VTKKWRCHelper_OuterInitialization(); \
1109 for ( i = rowBounds[j*2]; i <= rowBounds[j*2+1]; i++ ) \
1111 VTKKWRCHelper_InnerInitialization();
1115 #define VTKKWRCHelper_InitializationAndLoopStartGONN() \
1116 VTKKWRCHelper_InitializeVariables(); \
1117 VTKKWRCHelper_InitializeVariablesGO(); \
1118 for ( j = 0; j < imageInUseSize[1]; j++ ) \
1120 VTKKWRCHelper_OuterInitialization(); \
1121 for ( i = rowBounds[j*2]; i <= rowBounds[j*2+1]; i++ ) \
1123 VTKKWRCHelper_InnerInitialization();
1127 #define VTKKWRCHelper_InitializationAndLoopStartShadeNN() \
1128 VTKKWRCHelper_InitializeVariables(); \
1129 VTKKWRCHelper_InitializeVariablesShade(); \
1130 for ( j = 0; j < imageInUseSize[1]; j++ ) \
1132 VTKKWRCHelper_OuterInitialization(); \
1133 for ( i = rowBounds[j*2]; i <= rowBounds[j*2+1]; i++ ) \
1135 VTKKWRCHelper_InnerInitialization();
1139 #define VTKKWRCHelper_InitializationAndLoopStartGOShadeNN() \
1140 VTKKWRCHelper_InitializeVariables(); \
1141 VTKKWRCHelper_InitializeVariablesGO(); \
1142 VTKKWRCHelper_InitializeVariablesShade(); \
1143 for ( j = 0; j < imageInUseSize[1]; j++ ) \
1145 VTKKWRCHelper_OuterInitialization(); \
1146 for ( i = rowBounds[j*2]; i <= rowBounds[j*2+1]; i++ ) \
1148 VTKKWRCHelper_InnerInitialization();
1152 #define VTKKWRCHelper_InitializationAndLoopStartTrilin() \
1153 VTKKWRCHelper_InitializeVariables(); \
1154 VTKKWRCHelper_InitializeTrilinVariables(); \
1155 for ( j = 0; j < imageInUseSize[1]; j++ ) \
1157 VTKKWRCHelper_OuterInitialization(); \
1158 for ( i = rowBounds[j*2]; i <= rowBounds[j*2+1]; i++ ) \
1160 VTKKWRCHelper_InnerInitialization();
1164 #define VTKKWRCHelper_InitializationAndLoopStartGOTrilin() \
1165 VTKKWRCHelper_InitializeVariables(); \
1166 VTKKWRCHelper_InitializeVariablesGO(); \
1167 VTKKWRCHelper_InitializeTrilinVariables(); \
1168 VTKKWRCHelper_InitializeTrilinVariablesGO(); \
1169 for ( j = 0; j < imageInUseSize[1]; j++ ) \
1171 VTKKWRCHelper_OuterInitialization(); \
1172 for ( i = rowBounds[j*2]; i <= rowBounds[j*2+1]; i++ ) \
1174 VTKKWRCHelper_InnerInitialization();
1178 #define VTKKWRCHelper_InitializationAndLoopStartShadeTrilin() \
1179 VTKKWRCHelper_InitializeVariables(); \
1180 VTKKWRCHelper_InitializeVariablesShade(); \
1181 VTKKWRCHelper_InitializeTrilinVariables(); \
1182 VTKKWRCHelper_InitializeTrilinVariablesShade(); \
1183 for ( j = 0; j < imageInUseSize[1]; j++ ) \
1185 VTKKWRCHelper_OuterInitialization(); \
1186 for ( i = rowBounds[j*2]; i <= rowBounds[j*2+1]; i++ ) \
1188 VTKKWRCHelper_InnerInitialization();
1192 #define VTKKWRCHelper_InitializationAndLoopStartGOShadeTrilin() \
1193 VTKKWRCHelper_InitializeVariables(); \
1194 VTKKWRCHelper_InitializeVariablesShade(); \
1195 VTKKWRCHelper_InitializeVariablesGO(); \
1196 VTKKWRCHelper_InitializeTrilinVariables(); \
1197 VTKKWRCHelper_InitializeTrilinVariablesShade(); \
1198 VTKKWRCHelper_InitializeTrilinVariablesGO(); \
1199 for ( j = 0; j < imageInUseSize[1]; j++ ) \
1201 VTKKWRCHelper_OuterInitialization(); \
1202 for ( i = rowBounds[j*2]; i <= rowBounds[j*2+1]; i++ ) \
1204 VTKKWRCHelper_InnerInitialization();
1208 #define VTKKWRCHelper_IncrementAndLoopEnd() \
1211 if ( (j/threadCount)%8 == 7 && threadID == 0) \
1214 fargs[0] = static_cast<double>(j)/static_cast<float>(imageInUseSize[1]-1); \
1215 mapper->InvokeEvent( vtkCommand::VolumeMapperRenderProgressEvent, fargs ); \
1221 #define VTKKWRCHelper_CroppingCheckTrilin( POS ) \
1224 if ( mapper->CheckIfCropped( POS ) ) \
1232 #define VTKKWRCHelper_CroppingCheckNN( POS ) \
1235 if ( mapper->CheckIfCropped( POS ) ) \
1243 #define VTKKWRCHelper_SpaceLeapSetup() \
1244 unsigned int mmpos[3]; \
1245 mmpos[0] = (pos[0] >> VTKKW_FPMM_SHIFT) + 1; \
1252 #define VTKKWRCHelper_SpaceLeapSetupMulti() \
1253 unsigned int mmpos[3]; \
1254 mmpos[0] = (pos[0] >> VTKKW_FPMM_SHIFT) + 1; \
1257 int mmvalid[4] = {0,0,0,0};
1262 #define VTKKWRCHelper_SpaceLeapCheck() \
1263 if ( pos[0] >> VTKKW_FPMM_SHIFT != mmpos[0] || \
1264 pos[1] >> VTKKW_FPMM_SHIFT != mmpos[1] || \
1265 pos[2] >> VTKKW_FPMM_SHIFT != mmpos[2] ) \
1267 mmpos[0] = pos[0] >> VTKKW_FPMM_SHIFT; \
1268 mmpos[1] = pos[1] >> VTKKW_FPMM_SHIFT; \
1269 mmpos[2] = pos[2] >> VTKKW_FPMM_SHIFT; \
1270 mmvalid = mapper->CheckMinMaxVolumeFlag( mmpos, 0 ); \
1280 #define VTKKWRCHelper_MIPSpaceLeapCheck( MAXIDX, MAXIDXDEF, FLIP ) \
1281 if ( pos[0] >> VTKKW_FPMM_SHIFT != mmpos[0] || \
1282 pos[1] >> VTKKW_FPMM_SHIFT != mmpos[1] || \
1283 pos[2] >> VTKKW_FPMM_SHIFT != mmpos[2] ) \
1285 mmpos[0] = pos[0] >> VTKKW_FPMM_SHIFT; \
1286 mmpos[1] = pos[1] >> VTKKW_FPMM_SHIFT; \
1287 mmpos[2] = pos[2] >> VTKKW_FPMM_SHIFT; \
1288 mmvalid = (MAXIDXDEF)? \
1289 (mapper->CheckMIPMinMaxVolumeFlag( mmpos, 0, MAXIDX, FLIP )):(1); \
1300 #define VTKKWRCHelper_MIPSpaceLeapPopulateMulti( MAXIDX, FLIP ) \
1301 if ( pos[0] >> VTKKW_FPMM_SHIFT != mmpos[0] || \
1302 pos[1] >> VTKKW_FPMM_SHIFT != mmpos[1] || \
1303 pos[2] >> VTKKW_FPMM_SHIFT != mmpos[2] ) \
1305 mmpos[0] = pos[0] >> VTKKW_FPMM_SHIFT; \
1306 mmpos[1] = pos[1] >> VTKKW_FPMM_SHIFT; \
1307 mmpos[2] = pos[2] >> VTKKW_FPMM_SHIFT; \
1308 for ( c = 0; c < components; c++ ) \
1310 mmvalid[c] = mapper->CheckMIPMinMaxVolumeFlag( mmpos, c, MAXIDX[c], FLIP ); \
1316 #define VTKKWRCHelper_MIPSpaceLeapCheckMulti( COMP, FLIP ) mmvalid[COMP]
represents a volume (data & properties) in a rendered scene
abstract base class for most VTK objects
#define VTKRENDERINGVOLUME_EXPORT
An abstract helper that generates images for the volume ray cast mapper.
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
A fixed point mapper for volumes.
virtual void GenerateImage(int, int, vtkVolume *, vtkFixedPointVolumeRayCastMapper *)