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; \
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 unsigned short *colorTable[4]; \
780 unsigned short *scalarOpacityTable[4]; \
783 for ( c = 0; c < 4; c++ ) \
785 colorTable[c] = mapper->GetColorTable(c); \
786 (void)(colorTable[c]); \
787 scalarOpacityTable[c] = mapper->GetScalarOpacityTable(c); \
791 inc[0] = components; \
792 inc[1] = inc[0]*dim[0]; \
793 inc[2] = inc[1]*dim[1];
797 #define VTKKWRCHelper_InitializeWeights() \
799 weights[0] = vol->GetProperty()->GetComponentWeight(0); \
800 weights[1] = vol->GetProperty()->GetComponentWeight(1); \
801 weights[2] = vol->GetProperty()->GetComponentWeight(2); \
802 weights[3] = vol->GetProperty()->GetComponentWeight(3);
806 #define VTKKWRCHelper_InitializeVariablesGO() \
807 unsigned short *gradientOpacityTable[4]; \
808 for ( c = 0; c < 4; c++ ) \
810 gradientOpacityTable[c] = mapper->GetGradientOpacityTable(c); \
812 unsigned char **gradientMag = mapper->GetGradientMagnitude(); \
815 if ( vol->GetProperty()->GetIndependentComponents() ) \
824 mInc[1] = mInc[0]*dim[0]; \
825 mInc[2] = mInc[1]*dim[1]; \
830 #define VTKKWRCHelper_InitializeVariablesShade() \
831 unsigned short *diffuseShadingTable[4]; \
832 unsigned short *specularShadingTable[4]; \
833 for ( c = 0; c < 4; c++ ) \
835 diffuseShadingTable[c] = mapper->GetDiffuseShadingTable(c); \
836 specularShadingTable[c] = mapper->GetSpecularShadingTable(c); \
838 unsigned short **gradientDir = mapper->GetGradientNormal(); \
840 if ( vol->GetProperty()->GetIndependentComponents() ) \
849 dInc[1] = dInc[0]*dim[0]; \
850 dInc[2] = dInc[1]*dim[1]; \
855 #define VTKKWRCHelper_InitializeTrilinVariables() \
856 vtkIdType Binc = components; \
857 vtkIdType Cinc = Binc*dim[0]; \
858 vtkIdType Dinc = Cinc + Binc; \
859 vtkIdType Einc = Cinc*dim[1]; \
860 vtkIdType Finc = Einc + Binc; \
861 vtkIdType Ginc = Einc + Cinc; \
862 vtkIdType Hinc = Ginc + Binc;
866 #define VTKKWRCHelper_InitializeTrilinVariablesGO() \
867 vtkIdType magOffset; \
868 if ( vol->GetProperty()->GetIndependentComponents() ) \
870 magOffset = components; \
877 vtkIdType mBFinc = magOffset; \
878 vtkIdType mCGinc = dim[0]*magOffset; \
879 vtkIdType mDHinc = dim[0]*magOffset + magOffset;
883 #define VTKKWRCHelper_InitializeTrilinVariablesShade() \
884 vtkIdType dirOffset; \
885 if ( vol->GetProperty()->GetIndependentComponents() ) \
887 dirOffset = components; \
894 vtkIdType dBFinc = dirOffset; \
895 vtkIdType dCGinc = dim[0]*dirOffset; \
896 vtkIdType dDHinc = dim[0]*dirOffset + dirOffset;
900 #define VTKKWRCHelper_OuterInitialization() \
901 if ( j%threadCount != threadID ) \
907 if ( renWin->CheckAbortStatus() ) \
912 else if ( renWin->GetAbortRender() ) \
916 imagePtr = image + 4*(j*imageMemorySize[0] + rowBounds[j*2]);
921 #define VTKKWRCHelper_InnerInitialization() \
922 unsigned int numSteps; \
923 unsigned int pos[3]; \
924 unsigned int dir[3]; \
925 mapper->ComputeRayInfo( i, j, pos, dir, &numSteps ); \
926 if ( numSteps == 0 ) \
935 unsigned int spos[3]; \
940 #define VTKKWRCHelper_InitializeMIPOneNN() \
941 mapper->ShiftVectorDown( pos, spos ); \
942 T *dptr = data + spos[0]*inc[0] + spos[1]*inc[1] + spos[2]*inc[2]; \
943 T maxValue = *(dptr);
947 #define VTKKWRCHelper_InitializeMIPMultiNN() \
948 mapper->ShiftVectorDown( pos, spos ); \
949 T *dptr = data + spos[0]*inc[0] + spos[1]*inc[1] + spos[2]*inc[2]; \
951 for ( c = 0; c < components; c++ ) \
953 maxValue[c] = *(dptr+c); \
958 #define VTKKWRCHelper_InitializeMIPOneTrilin() \
960 unsigned int oldSPos[3]; \
962 oldSPos[0] = (pos[0] >> VTKKW_FP_SHIFT) + 1; \
966 unsigned int w1X, w1Y, w1Z; \
967 unsigned int w2X, w2Y, w2Z; \
968 unsigned int w1Xw1Y, w2Xw1Y, w1Xw2Y, w2Xw2Y; \
970 unsigned short maxValue=0; \
971 unsigned short val; \
972 unsigned int A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;
976 #define VTKKWRCHelper_InitializeMIPMultiTrilin() \
978 unsigned int oldSPos[3]; \
980 oldSPos[0] = (pos[0] >> VTKKW_FP_SHIFT) + 1; \
984 unsigned int w1X, w1Y, w1Z; \
985 unsigned int w2X, w2Y, w2Z; \
986 unsigned int w1Xw1Y, w2Xw1Y, w1Xw2Y, w2Xw2Y; \
988 unsigned short maxValue[4]; \
989 unsigned short val[4]; \
990 unsigned int A[4],B[4],C[4],D[4],E[4],F[4],G[4],H[4];
994 #define VTKKWRCHelper_InitializeCompositeGONN() \
995 unsigned char *magPtr = gradientMag[spos[2]] + spos[0]*mInc[0] + spos[1]*mInc[1];
999 #define VTKKWRCHelper_InitializeCompositeShadeNN() \
1000 unsigned short *dirPtr = gradientDir[spos[2]] + spos[0]*dInc[0] + spos[1]*dInc[1];
1004 #define VTKKWRCHelper_InitializeCompositeOneNN() \
1005 mapper->ShiftVectorDown( pos, spos ); \
1006 T *dptr = data + spos[0]*inc[0] + spos[1]*inc[1] + spos[2]*inc[2]; \
1007 unsigned int color[3] = {0,0,0}; \
1008 unsigned short remainingOpacity = 0x7fff; \
1009 unsigned short tmp[4];
1013 #define VTKKWRCHelper_InitializeCompositeMultiNN() \
1014 mapper->ShiftVectorDown( pos, spos ); \
1015 T *dptr = data + spos[0]*inc[0] + spos[1]*inc[1] + spos[2]*inc[2]; \
1016 unsigned int color[3] = {0,0,0}; \
1017 unsigned int remainingOpacity = 0x7fff; \
1018 unsigned short tmp[4]; \
1019 unsigned short val[4];
1023 #define VTKKWRCHelper_InitializeCompositeOneTrilin() \
1025 unsigned int oldSPos[3]; \
1027 oldSPos[0] = (pos[0] >> VTKKW_FP_SHIFT) + 1; \
1031 unsigned int w1X, w1Y, w1Z; \
1032 unsigned int w2X, w2Y, w2Z; \
1033 unsigned int w1Xw1Y, w2Xw1Y, w1Xw2Y, w2Xw2Y; \
1035 unsigned short val; \
1036 unsigned int A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0; \
1038 unsigned int color[3] = {0,0,0}; \
1039 unsigned short remainingOpacity = 0x7fff; \
1040 unsigned short tmp[4];
1044 #define VTKKWRCHelper_InitializeCompositeOneGOTrilin() \
1045 unsigned char *magPtrABCD = 0, *magPtrEFGH = 0; \
1046 unsigned short mag; \
1047 unsigned int mA=0,mB=0,mC=0,mD=0,mE=0,mF=0,mG=0,mH=0;
1051 #define VTKKWRCHelper_InitializeCompositeOneShadeTrilin() \
1052 unsigned short *dirPtrABCD = 0, *dirPtrEFGH = 0; \
1053 unsigned int normalA=0,normalB=0,normalC=0,normalD=0; \
1054 unsigned int normalE=0,normalF=0,normalG=0,normalH=0;
1058 #define VTKKWRCHelper_InitializeCompositeMultiTrilin() \
1060 unsigned int oldSPos[3]; \
1062 oldSPos[0] = (pos[0] >> VTKKW_FP_SHIFT) + 1; \
1066 unsigned int w1X, w1Y, w1Z; \
1067 unsigned int w2X, w2Y, w2Z; \
1068 unsigned int w1Xw1Y, w2Xw1Y, w1Xw2Y, w2Xw2Y; \
1070 unsigned short val[4]; \
1071 unsigned int A[4] = {0,0,0,0}; \
1072 unsigned int B[4] = {0,0,0,0}; \
1073 unsigned int C[4] = {0,0,0,0}; \
1074 unsigned int D[4] = {0,0,0,0}; \
1075 unsigned int E[4] = {0,0,0,0}; \
1076 unsigned int F[4] = {0,0,0,0}; \
1077 unsigned int G[4] = {0,0,0,0}; \
1078 unsigned int H[4] = {0,0,0,0}; \
1080 unsigned int color[3] = {0,0,0}; \
1081 unsigned short remainingOpacity = 0x7fff; \
1082 unsigned short tmp[4];
1086 #define VTKKWRCHelper_InitializeCompositeMultiGOTrilin() \
1087 unsigned char *magPtrABCD = 0, *magPtrEFGH = 0; \
1088 unsigned short mag[4]; \
1089 unsigned int mA[4],mB[4],mC[4],mD[4],mE[4],mF[4],mG[4],mH[4];
1093 #define VTKKWRCHelper_InitializeCompositeMultiShadeTrilin() \
1094 unsigned short *dirPtrABCD = 0, *dirPtrEFGH = 0; \
1095 unsigned int normalA[4],normalB[4],normalC[4],normalD[4]; \
1096 unsigned int normalE[4],normalF[4],normalG[4],normalH[4];
1100 #define VTKKWRCHelper_InitializationAndLoopStartNN() \
1101 VTKKWRCHelper_InitializeVariables(); \
1102 for ( j = 0; j < imageInUseSize[1]; j++ ) \
1104 VTKKWRCHelper_OuterInitialization(); \
1105 for ( i = rowBounds[j*2]; i <= rowBounds[j*2+1]; i++ ) \
1107 VTKKWRCHelper_InnerInitialization();
1111 #define VTKKWRCHelper_InitializationAndLoopStartGONN() \
1112 VTKKWRCHelper_InitializeVariables(); \
1113 VTKKWRCHelper_InitializeVariablesGO(); \
1114 for ( j = 0; j < imageInUseSize[1]; j++ ) \
1116 VTKKWRCHelper_OuterInitialization(); \
1117 for ( i = rowBounds[j*2]; i <= rowBounds[j*2+1]; i++ ) \
1119 VTKKWRCHelper_InnerInitialization();
1123 #define VTKKWRCHelper_InitializationAndLoopStartShadeNN() \
1124 VTKKWRCHelper_InitializeVariables(); \
1125 VTKKWRCHelper_InitializeVariablesShade(); \
1126 for ( j = 0; j < imageInUseSize[1]; j++ ) \
1128 VTKKWRCHelper_OuterInitialization(); \
1129 for ( i = rowBounds[j*2]; i <= rowBounds[j*2+1]; i++ ) \
1131 VTKKWRCHelper_InnerInitialization();
1135 #define VTKKWRCHelper_InitializationAndLoopStartGOShadeNN() \
1136 VTKKWRCHelper_InitializeVariables(); \
1137 VTKKWRCHelper_InitializeVariablesGO(); \
1138 VTKKWRCHelper_InitializeVariablesShade(); \
1139 for ( j = 0; j < imageInUseSize[1]; j++ ) \
1141 VTKKWRCHelper_OuterInitialization(); \
1142 for ( i = rowBounds[j*2]; i <= rowBounds[j*2+1]; i++ ) \
1144 VTKKWRCHelper_InnerInitialization();
1148 #define VTKKWRCHelper_InitializationAndLoopStartTrilin() \
1149 VTKKWRCHelper_InitializeVariables(); \
1150 VTKKWRCHelper_InitializeTrilinVariables(); \
1151 for ( j = 0; j < imageInUseSize[1]; j++ ) \
1153 VTKKWRCHelper_OuterInitialization(); \
1154 for ( i = rowBounds[j*2]; i <= rowBounds[j*2+1]; i++ ) \
1156 VTKKWRCHelper_InnerInitialization();
1160 #define VTKKWRCHelper_InitializationAndLoopStartGOTrilin() \
1161 VTKKWRCHelper_InitializeVariables(); \
1162 VTKKWRCHelper_InitializeVariablesGO(); \
1163 VTKKWRCHelper_InitializeTrilinVariables(); \
1164 VTKKWRCHelper_InitializeTrilinVariablesGO(); \
1165 for ( j = 0; j < imageInUseSize[1]; j++ ) \
1167 VTKKWRCHelper_OuterInitialization(); \
1168 for ( i = rowBounds[j*2]; i <= rowBounds[j*2+1]; i++ ) \
1170 VTKKWRCHelper_InnerInitialization();
1174 #define VTKKWRCHelper_InitializationAndLoopStartShadeTrilin() \
1175 VTKKWRCHelper_InitializeVariables(); \
1176 VTKKWRCHelper_InitializeVariablesShade(); \
1177 VTKKWRCHelper_InitializeTrilinVariables(); \
1178 VTKKWRCHelper_InitializeTrilinVariablesShade(); \
1179 for ( j = 0; j < imageInUseSize[1]; j++ ) \
1181 VTKKWRCHelper_OuterInitialization(); \
1182 for ( i = rowBounds[j*2]; i <= rowBounds[j*2+1]; i++ ) \
1184 VTKKWRCHelper_InnerInitialization();
1188 #define VTKKWRCHelper_InitializationAndLoopStartGOShadeTrilin() \
1189 VTKKWRCHelper_InitializeVariables(); \
1190 VTKKWRCHelper_InitializeVariablesShade(); \
1191 VTKKWRCHelper_InitializeVariablesGO(); \
1192 VTKKWRCHelper_InitializeTrilinVariables(); \
1193 VTKKWRCHelper_InitializeTrilinVariablesShade(); \
1194 VTKKWRCHelper_InitializeTrilinVariablesGO(); \
1195 for ( j = 0; j < imageInUseSize[1]; j++ ) \
1197 VTKKWRCHelper_OuterInitialization(); \
1198 for ( i = rowBounds[j*2]; i <= rowBounds[j*2+1]; i++ ) \
1200 VTKKWRCHelper_InnerInitialization();
1204 #define VTKKWRCHelper_IncrementAndLoopEnd() \
1207 if ( (j/threadCount)%8 == 7 && threadID == 0) \
1210 fargs[0] = static_cast<double>(j)/static_cast<float>(imageInUseSize[1]-1); \
1211 mapper->InvokeEvent( vtkCommand::VolumeMapperRenderProgressEvent, fargs ); \
1217 #define VTKKWRCHelper_CroppingCheckTrilin( POS ) \
1220 if ( mapper->CheckIfCropped( POS ) ) \
1228 #define VTKKWRCHelper_CroppingCheckNN( POS ) \
1231 if ( mapper->CheckIfCropped( POS ) ) \
1239 #define VTKKWRCHelper_SpaceLeapSetup() \
1240 unsigned int mmpos[3]; \
1241 mmpos[0] = (pos[0] >> VTKKW_FPMM_SHIFT) + 1; \
1248 #define VTKKWRCHelper_SpaceLeapSetupMulti() \
1249 unsigned int mmpos[3]; \
1250 mmpos[0] = (pos[0] >> VTKKW_FPMM_SHIFT) + 1; \
1253 int mmvalid[4] = {0,0,0,0};
1258 #define VTKKWRCHelper_SpaceLeapCheck() \
1259 if ( pos[0] >> VTKKW_FPMM_SHIFT != mmpos[0] || \
1260 pos[1] >> VTKKW_FPMM_SHIFT != mmpos[1] || \
1261 pos[2] >> VTKKW_FPMM_SHIFT != mmpos[2] ) \
1263 mmpos[0] = pos[0] >> VTKKW_FPMM_SHIFT; \
1264 mmpos[1] = pos[1] >> VTKKW_FPMM_SHIFT; \
1265 mmpos[2] = pos[2] >> VTKKW_FPMM_SHIFT; \
1266 mmvalid = mapper->CheckMinMaxVolumeFlag( mmpos, 0 ); \
1276 #define VTKKWRCHelper_MIPSpaceLeapCheck( MAXIDX, MAXIDXDEF, FLIP ) \
1277 if ( pos[0] >> VTKKW_FPMM_SHIFT != mmpos[0] || \
1278 pos[1] >> VTKKW_FPMM_SHIFT != mmpos[1] || \
1279 pos[2] >> VTKKW_FPMM_SHIFT != mmpos[2] ) \
1281 mmpos[0] = pos[0] >> VTKKW_FPMM_SHIFT; \
1282 mmpos[1] = pos[1] >> VTKKW_FPMM_SHIFT; \
1283 mmpos[2] = pos[2] >> VTKKW_FPMM_SHIFT; \
1284 mmvalid = (MAXIDXDEF)? \
1285 (mapper->CheckMIPMinMaxVolumeFlag( mmpos, 0, MAXIDX, FLIP )):(1); \
1296 #define VTKKWRCHelper_MIPSpaceLeapPopulateMulti( MAXIDX, FLIP ) \
1297 if ( pos[0] >> VTKKW_FPMM_SHIFT != mmpos[0] || \
1298 pos[1] >> VTKKW_FPMM_SHIFT != mmpos[1] || \
1299 pos[2] >> VTKKW_FPMM_SHIFT != mmpos[2] ) \
1301 mmpos[0] = pos[0] >> VTKKW_FPMM_SHIFT; \
1302 mmpos[1] = pos[1] >> VTKKW_FPMM_SHIFT; \
1303 mmpos[2] = pos[2] >> VTKKW_FPMM_SHIFT; \
1304 for ( c = 0; c < components; c++ ) \
1306 mmvalid[c] = mapper->CheckMIPMinMaxVolumeFlag( mmpos, c, MAXIDX[c], FLIP ); \
1312 #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 *)