26#ifndef vtkFixedPointVolumeRayCastHelper_h
27#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))
39#define VTKKWRCHelper_GetCellScalarValuesSimple(DATA) \
40 A = static_cast<unsigned int>(*(DATA)); \
41 B = static_cast<unsigned int>(*(DATA + Binc)); \
42 C = static_cast<unsigned int>(*(DATA + Cinc)); \
43 D = static_cast<unsigned int>(*(DATA + Dinc)); \
44 E = static_cast<unsigned int>(*(DATA + Einc)); \
45 F = static_cast<unsigned int>(*(DATA + Finc)); \
46 G = static_cast<unsigned int>(*(DATA + Ginc)); \
47 H = static_cast<unsigned int>(*(DATA + Hinc))
49#define VTKKWRCHelper_GetCellMagnitudeValues(ABCD, EFGH) \
50 mA = static_cast<unsigned int>(*(ABCD)); \
51 mB = static_cast<unsigned int>(*(ABCD + mBFinc)); \
52 mC = static_cast<unsigned int>(*(ABCD + mCGinc)); \
53 mD = static_cast<unsigned int>(*(ABCD + mDHinc)); \
54 mE = static_cast<unsigned int>(*(EFGH)); \
55 mF = static_cast<unsigned int>(*(EFGH + mBFinc)); \
56 mG = static_cast<unsigned int>(*(EFGH + mCGinc)); \
57 mH = static_cast<unsigned int>(*(EFGH + mDHinc))
59#define VTKKWRCHelper_GetCellDirectionValues(ABCD, EFGH) \
60 normalA = static_cast<unsigned int>(*(ABCD)); \
61 normalB = static_cast<unsigned int>(*(ABCD + dBFinc)); \
62 normalC = static_cast<unsigned int>(*(ABCD + dCGinc)); \
63 normalD = static_cast<unsigned int>(*(ABCD + dDHinc)); \
64 normalE = static_cast<unsigned int>(*(EFGH)); \
65 normalF = static_cast<unsigned int>(*(EFGH + dBFinc)); \
66 normalG = static_cast<unsigned int>(*(EFGH + dCGinc)); \
67 normalH = static_cast<unsigned int>(*(EFGH + dDHinc));
69#define VTKKWRCHelper_GetCellComponentScalarValues(DATA, CIDX, SCALE, SHIFT) \
70 A[CIDX] = static_cast<unsigned int>(SCALE * (*(DATA) + SHIFT)); \
71 B[CIDX] = static_cast<unsigned int>(SCALE * (*(DATA + Binc) + SHIFT)); \
72 C[CIDX] = static_cast<unsigned int>(SCALE * (*(DATA + Cinc) + SHIFT)); \
73 D[CIDX] = static_cast<unsigned int>(SCALE * (*(DATA + Dinc) + SHIFT)); \
74 E[CIDX] = static_cast<unsigned int>(SCALE * (*(DATA + Einc) + SHIFT)); \
75 F[CIDX] = static_cast<unsigned int>(SCALE * (*(DATA + Finc) + SHIFT)); \
76 G[CIDX] = static_cast<unsigned int>(SCALE * (*(DATA + Ginc) + SHIFT)); \
77 H[CIDX] = static_cast<unsigned int>(SCALE * (*(DATA + Hinc) + SHIFT))
79#define VTKKWRCHelper_GetCellComponentRawScalarValues(DATA, CIDX) \
80 A[CIDX] = static_cast<unsigned int>((*(DATA))); \
81 B[CIDX] = static_cast<unsigned int>((*(DATA + Binc))); \
82 C[CIDX] = static_cast<unsigned int>((*(DATA + Cinc))); \
83 D[CIDX] = static_cast<unsigned int>((*(DATA + Dinc))); \
84 E[CIDX] = static_cast<unsigned int>((*(DATA + Einc))); \
85 F[CIDX] = static_cast<unsigned int>((*(DATA + Finc))); \
86 G[CIDX] = static_cast<unsigned int>((*(DATA + Ginc))); \
87 H[CIDX] = static_cast<unsigned int>((*(DATA + Hinc)))
89#define VTKKWRCHelper_GetCellComponentMagnitudeValues(ABCD, EFGH, CIDX) \
90 mA[CIDX] = static_cast<unsigned int>(*(ABCD)); \
91 mB[CIDX] = static_cast<unsigned int>(*(ABCD + mBFinc)); \
92 mC[CIDX] = static_cast<unsigned int>(*(ABCD + mCGinc)); \
93 mD[CIDX] = static_cast<unsigned int>(*(ABCD + mDHinc)); \
94 mE[CIDX] = static_cast<unsigned int>(*(EFGH)); \
95 mF[CIDX] = static_cast<unsigned int>(*(EFGH + mBFinc)); \
96 mG[CIDX] = static_cast<unsigned int>(*(EFGH + mCGinc)); \
97 mH[CIDX] = static_cast<unsigned int>(*(EFGH + mDHinc))
99#define VTKKWRCHelper_GetCellComponentDirectionValues(ABCD, EFGH, CIDX) \
100 normalA[CIDX] = static_cast<unsigned int>(*(ABCD)); \
101 normalB[CIDX] = static_cast<unsigned int>(*(ABCD + dBFinc)); \
102 normalC[CIDX] = static_cast<unsigned int>(*(ABCD + dCGinc)); \
103 normalD[CIDX] = static_cast<unsigned int>(*(ABCD + dDHinc)); \
104 normalE[CIDX] = static_cast<unsigned int>(*(EFGH)); \
105 normalF[CIDX] = static_cast<unsigned int>(*(EFGH + dBFinc)); \
106 normalG[CIDX] = static_cast<unsigned int>(*(EFGH + dCGinc)); \
107 normalH[CIDX] = static_cast<unsigned int>(*(EFGH + dDHinc));
109#define VTKKWRCHelper_ComputeWeights(POS) \
110 w2X = (POS[0] & VTKKW_FP_MASK); \
111 w2Y = (POS[1] & VTKKW_FP_MASK); \
112 w2Z = (POS[2] & VTKKW_FP_MASK); \
114 w1X = ((~w2X) & VTKKW_FP_MASK); \
115 w1Y = ((~w2Y) & VTKKW_FP_MASK); \
116 w1Z = ((~w2Z) & VTKKW_FP_MASK); \
118 w1Xw1Y = (0x4000 + (w1X * w1Y)) >> VTKKW_FP_SHIFT; \
119 w2Xw1Y = (0x4000 + (w2X * w1Y)) >> VTKKW_FP_SHIFT; \
120 w1Xw2Y = (0x4000 + (w1X * w2Y)) >> VTKKW_FP_SHIFT; \
121 w2Xw2Y = (0x4000 + (w2X * w2Y)) >> VTKKW_FP_SHIFT;
123#define VTKKWRCHelper_InterpolateScalar(VAL) \
125 ((A * ((0x4000 + w1Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
126 (B * ((0x4000 + w2Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
127 (C * ((0x4000 + w1Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
128 (D * ((0x4000 + w2Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
129 (E * ((0x4000 + w1Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
130 (F * ((0x4000 + w2Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
131 (G * ((0x4000 + w1Xw2Y * w2Z) >> VTKKW_FP_SHIFT)) + \
132 (H * ((0x4000 + w2Xw2Y * w2Z) >> VTKKW_FP_SHIFT)))) >> \
135#define VTKKWRCHelper_InterpolateMagnitude(VAL) \
137 ((mA * ((0x4000 + w1Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
138 (mB * ((0x4000 + w2Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
139 (mC * ((0x4000 + w1Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
140 (mD * ((0x4000 + w2Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
141 (mE * ((0x4000 + w1Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
142 (mF * ((0x4000 + w2Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
143 (mG * ((0x4000 + w1Xw2Y * w2Z) >> VTKKW_FP_SHIFT)) + \
144 (mH * ((0x4000 + w2Xw2Y * w2Z) >> VTKKW_FP_SHIFT)))) >> \
147#define VTKKWRCHelper_InterpolateScalarComponent(VAL, CIDX, COMPONENTS) \
148 for (CIDX = 0; CIDX < COMPONENTS; CIDX++) \
150 VAL[CIDX] = (0x7fff + \
151 ((A[CIDX] * ((0x4000 + w1Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
152 (B[CIDX] * ((0x4000 + w2Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
153 (C[CIDX] * ((0x4000 + w1Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
154 (D[CIDX] * ((0x4000 + w2Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
155 (E[CIDX] * ((0x4000 + w1Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
156 (F[CIDX] * ((0x4000 + w2Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
157 (G[CIDX] * ((0x4000 + w1Xw2Y * w2Z) >> VTKKW_FP_SHIFT)) + \
158 (H[CIDX] * ((0x4000 + w2Xw2Y * w2Z) >> VTKKW_FP_SHIFT)))) >> \
162#define VTKKWRCHelper_InterpolateMagnitudeComponent(VAL, CIDX, COMPONENTS) \
163 for (CIDX = 0; CIDX < COMPONENTS; CIDX++) \
165 VAL[CIDX] = (0x7fff + \
166 ((mA[CIDX] * ((0x4000 + w1Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
167 (mB[CIDX] * ((0x4000 + w2Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
168 (mC[CIDX] * ((0x4000 + w1Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
169 (mD[CIDX] * ((0x4000 + w2Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
170 (mE[CIDX] * ((0x4000 + w1Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
171 (mF[CIDX] * ((0x4000 + w2Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
172 (mG[CIDX] * ((0x4000 + w1Xw2Y * w2Z) >> VTKKW_FP_SHIFT)) + \
173 (mH[CIDX] * ((0x4000 + w2Xw2Y * w2Z) >> VTKKW_FP_SHIFT)))) >> \
177#define VTKKWRCHelper_InterpolateShading(DTABLE, STABLE, COLOR) \
178 unsigned int _tmpDColor[3]; \
179 unsigned int _tmpSColor[3]; \
181 _tmpDColor[0] = (0x7fff + \
182 ((DTABLE[3 * normalA] * ((0x4000 + w1Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
183 (DTABLE[3 * normalB] * ((0x4000 + w2Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
184 (DTABLE[3 * normalC] * ((0x4000 + w1Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
185 (DTABLE[3 * normalD] * ((0x4000 + w2Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
186 (DTABLE[3 * normalE] * ((0x4000 + w1Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
187 (DTABLE[3 * normalF] * ((0x4000 + w2Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
188 (DTABLE[3 * normalG] * ((0x4000 + w1Xw2Y * w2Z) >> VTKKW_FP_SHIFT)) + \
189 (DTABLE[3 * normalH] * ((0x4000 + w2Xw2Y * w2Z) >> VTKKW_FP_SHIFT)))) >> \
192 _tmpDColor[1] = (0x7fff + \
193 ((DTABLE[3 * normalA + 1] * ((0x4000 + w1Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
194 (DTABLE[3 * normalB + 1] * ((0x4000 + w2Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
195 (DTABLE[3 * normalC + 1] * ((0x4000 + w1Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
196 (DTABLE[3 * normalD + 1] * ((0x4000 + w2Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
197 (DTABLE[3 * normalE + 1] * ((0x4000 + w1Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
198 (DTABLE[3 * normalF + 1] * ((0x4000 + w2Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
199 (DTABLE[3 * normalG + 1] * ((0x4000 + w1Xw2Y * w2Z) >> VTKKW_FP_SHIFT)) + \
200 (DTABLE[3 * normalH + 1] * ((0x4000 + w2Xw2Y * w2Z) >> VTKKW_FP_SHIFT)))) >> \
203 _tmpDColor[2] = (0x7fff + \
204 ((DTABLE[3 * normalA + 2] * ((0x4000 + w1Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
205 (DTABLE[3 * normalB + 2] * ((0x4000 + w2Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
206 (DTABLE[3 * normalC + 2] * ((0x4000 + w1Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
207 (DTABLE[3 * normalD + 2] * ((0x4000 + w2Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
208 (DTABLE[3 * normalE + 2] * ((0x4000 + w1Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
209 (DTABLE[3 * normalF + 2] * ((0x4000 + w2Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
210 (DTABLE[3 * normalG + 2] * ((0x4000 + w1Xw2Y * w2Z) >> VTKKW_FP_SHIFT)) + \
211 (DTABLE[3 * normalH + 2] * ((0x4000 + w2Xw2Y * w2Z) >> VTKKW_FP_SHIFT)))) >> \
214 _tmpSColor[0] = (0x7fff + \
215 ((STABLE[3 * normalA] * ((0x4000 + w1Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
216 (STABLE[3 * normalB] * ((0x4000 + w2Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
217 (STABLE[3 * normalC] * ((0x4000 + w1Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
218 (STABLE[3 * normalD] * ((0x4000 + w2Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
219 (STABLE[3 * normalE] * ((0x4000 + w1Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
220 (STABLE[3 * normalF] * ((0x4000 + w2Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
221 (STABLE[3 * normalG] * ((0x4000 + w1Xw2Y * w2Z) >> VTKKW_FP_SHIFT)) + \
222 (STABLE[3 * normalH] * ((0x4000 + w2Xw2Y * w2Z) >> VTKKW_FP_SHIFT)))) >> \
225 _tmpSColor[1] = (0x7fff + \
226 ((STABLE[3 * normalA + 1] * ((0x4000 + w1Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
227 (STABLE[3 * normalB + 1] * ((0x4000 + w2Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
228 (STABLE[3 * normalC + 1] * ((0x4000 + w1Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
229 (STABLE[3 * normalD + 1] * ((0x4000 + w2Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
230 (STABLE[3 * normalE + 1] * ((0x4000 + w1Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
231 (STABLE[3 * normalF + 1] * ((0x4000 + w2Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
232 (STABLE[3 * normalG + 1] * ((0x4000 + w1Xw2Y * w2Z) >> VTKKW_FP_SHIFT)) + \
233 (STABLE[3 * normalH + 1] * ((0x4000 + w2Xw2Y * w2Z) >> VTKKW_FP_SHIFT)))) >> \
236 _tmpSColor[2] = (0x7fff + \
237 ((STABLE[3 * normalA + 2] * ((0x4000 + w1Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
238 (STABLE[3 * normalB + 2] * ((0x4000 + w2Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
239 (STABLE[3 * normalC + 2] * ((0x4000 + w1Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
240 (STABLE[3 * normalD + 2] * ((0x4000 + w2Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
241 (STABLE[3 * normalE + 2] * ((0x4000 + w1Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
242 (STABLE[3 * normalF + 2] * ((0x4000 + w2Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
243 (STABLE[3 * normalG + 2] * ((0x4000 + w1Xw2Y * w2Z) >> VTKKW_FP_SHIFT)) + \
244 (STABLE[3 * normalH + 2] * ((0x4000 + w2Xw2Y * w2Z) >> VTKKW_FP_SHIFT)))) >> \
247 COLOR[0] = static_cast<unsigned short>((_tmpDColor[0] * COLOR[0] + 0x7fff) >> VTKKW_FP_SHIFT); \
248 COLOR[1] = static_cast<unsigned short>((_tmpDColor[1] * COLOR[1] + 0x7fff) >> VTKKW_FP_SHIFT); \
249 COLOR[2] = static_cast<unsigned short>((_tmpDColor[2] * COLOR[2] + 0x7fff) >> VTKKW_FP_SHIFT); \
250 COLOR[0] += (_tmpSColor[0] * COLOR[3] + 0x7fff) >> VTKKW_FP_SHIFT; \
251 COLOR[1] += (_tmpSColor[1] * COLOR[3] + 0x7fff) >> VTKKW_FP_SHIFT; \
252 COLOR[2] += (_tmpSColor[2] * COLOR[3] + 0x7fff) >> VTKKW_FP_SHIFT;
254#define VTKKWRCHelper_InterpolateShadingComponent(DTABLE, STABLE, COLOR, CIDX) \
255 unsigned int _tmpDColor[3]; \
256 unsigned int _tmpSColor[3]; \
260 ((DTABLE[CIDX][3 * normalA[CIDX]] * ((0x4000 + w1Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
261 (DTABLE[CIDX][3 * normalB[CIDX]] * ((0x4000 + w2Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
262 (DTABLE[CIDX][3 * normalC[CIDX]] * ((0x4000 + w1Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
263 (DTABLE[CIDX][3 * normalD[CIDX]] * ((0x4000 + w2Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
264 (DTABLE[CIDX][3 * normalE[CIDX]] * ((0x4000 + w1Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
265 (DTABLE[CIDX][3 * normalF[CIDX]] * ((0x4000 + w2Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
266 (DTABLE[CIDX][3 * normalG[CIDX]] * ((0x4000 + w1Xw2Y * w2Z) >> VTKKW_FP_SHIFT)) + \
267 (DTABLE[CIDX][3 * normalH[CIDX]] * ((0x4000 + w2Xw2Y * w2Z) >> VTKKW_FP_SHIFT)))) >> \
272 ((DTABLE[CIDX][3 * normalA[CIDX] + 1] * ((0x4000 + w1Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
273 (DTABLE[CIDX][3 * normalB[CIDX] + 1] * ((0x4000 + w2Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
274 (DTABLE[CIDX][3 * normalC[CIDX] + 1] * ((0x4000 + w1Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
275 (DTABLE[CIDX][3 * normalD[CIDX] + 1] * ((0x4000 + w2Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
276 (DTABLE[CIDX][3 * normalE[CIDX] + 1] * ((0x4000 + w1Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
277 (DTABLE[CIDX][3 * normalF[CIDX] + 1] * ((0x4000 + w2Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
278 (DTABLE[CIDX][3 * normalG[CIDX] + 1] * ((0x4000 + w1Xw2Y * w2Z) >> VTKKW_FP_SHIFT)) + \
279 (DTABLE[CIDX][3 * normalH[CIDX] + 1] * ((0x4000 + w2Xw2Y * w2Z) >> VTKKW_FP_SHIFT)))) >> \
284 ((DTABLE[CIDX][3 * normalA[CIDX] + 2] * ((0x4000 + w1Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
285 (DTABLE[CIDX][3 * normalB[CIDX] + 2] * ((0x4000 + w2Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
286 (DTABLE[CIDX][3 * normalC[CIDX] + 2] * ((0x4000 + w1Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
287 (DTABLE[CIDX][3 * normalD[CIDX] + 2] * ((0x4000 + w2Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
288 (DTABLE[CIDX][3 * normalE[CIDX] + 2] * ((0x4000 + w1Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
289 (DTABLE[CIDX][3 * normalF[CIDX] + 2] * ((0x4000 + w2Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
290 (DTABLE[CIDX][3 * normalG[CIDX] + 2] * ((0x4000 + w1Xw2Y * w2Z) >> VTKKW_FP_SHIFT)) + \
291 (DTABLE[CIDX][3 * normalH[CIDX] + 2] * ((0x4000 + w2Xw2Y * w2Z) >> VTKKW_FP_SHIFT)))) >> \
296 ((STABLE[CIDX][3 * normalA[CIDX]] * ((0x4000 + w1Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
297 (STABLE[CIDX][3 * normalB[CIDX]] * ((0x4000 + w2Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
298 (STABLE[CIDX][3 * normalC[CIDX]] * ((0x4000 + w1Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
299 (STABLE[CIDX][3 * normalD[CIDX]] * ((0x4000 + w2Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
300 (STABLE[CIDX][3 * normalE[CIDX]] * ((0x4000 + w1Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
301 (STABLE[CIDX][3 * normalF[CIDX]] * ((0x4000 + w2Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
302 (STABLE[CIDX][3 * normalG[CIDX]] * ((0x4000 + w1Xw2Y * w2Z) >> VTKKW_FP_SHIFT)) + \
303 (STABLE[CIDX][3 * normalH[CIDX]] * ((0x4000 + w2Xw2Y * w2Z) >> VTKKW_FP_SHIFT)))) >> \
308 ((STABLE[CIDX][3 * normalA[CIDX] + 1] * ((0x4000 + w1Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
309 (STABLE[CIDX][3 * normalB[CIDX] + 1] * ((0x4000 + w2Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
310 (STABLE[CIDX][3 * normalC[CIDX] + 1] * ((0x4000 + w1Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
311 (STABLE[CIDX][3 * normalD[CIDX] + 1] * ((0x4000 + w2Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
312 (STABLE[CIDX][3 * normalE[CIDX] + 1] * ((0x4000 + w1Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
313 (STABLE[CIDX][3 * normalF[CIDX] + 1] * ((0x4000 + w2Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
314 (STABLE[CIDX][3 * normalG[CIDX] + 1] * ((0x4000 + w1Xw2Y * w2Z) >> VTKKW_FP_SHIFT)) + \
315 (STABLE[CIDX][3 * normalH[CIDX] + 1] * ((0x4000 + w2Xw2Y * w2Z) >> VTKKW_FP_SHIFT)))) >> \
320 ((STABLE[CIDX][3 * normalA[CIDX] + 2] * ((0x4000 + w1Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
321 (STABLE[CIDX][3 * normalB[CIDX] + 2] * ((0x4000 + w2Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
322 (STABLE[CIDX][3 * normalC[CIDX] + 2] * ((0x4000 + w1Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
323 (STABLE[CIDX][3 * normalD[CIDX] + 2] * ((0x4000 + w2Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
324 (STABLE[CIDX][3 * normalE[CIDX] + 2] * ((0x4000 + w1Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
325 (STABLE[CIDX][3 * normalF[CIDX] + 2] * ((0x4000 + w2Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
326 (STABLE[CIDX][3 * normalG[CIDX] + 2] * ((0x4000 + w1Xw2Y * w2Z) >> VTKKW_FP_SHIFT)) + \
327 (STABLE[CIDX][3 * normalH[CIDX] + 2] * ((0x4000 + w2Xw2Y * w2Z) >> VTKKW_FP_SHIFT)))) >> \
330 COLOR[0] = static_cast<unsigned short>((_tmpDColor[0] * COLOR[0] + 0x7fff) >> VTKKW_FP_SHIFT); \
331 COLOR[1] = static_cast<unsigned short>((_tmpDColor[1] * COLOR[1] + 0x7fff) >> VTKKW_FP_SHIFT); \
332 COLOR[2] = static_cast<unsigned short>((_tmpDColor[2] * COLOR[2] + 0x7fff) >> VTKKW_FP_SHIFT); \
333 COLOR[0] += (_tmpSColor[0] * COLOR[3] + 0x7fff) >> VTKKW_FP_SHIFT; \
334 COLOR[1] += (_tmpSColor[1] * COLOR[3] + 0x7fff) >> VTKKW_FP_SHIFT; \
335 COLOR[2] += (_tmpSColor[2] * COLOR[3] + 0x7fff) >> VTKKW_FP_SHIFT;
337#define VTKKWRCHelper_LookupColorUS(COLORTABLE, SCALAROPACITYTABLE, IDX, COLOR) \
338 COLOR[3] = SCALAROPACITYTABLE[IDX]; \
344 static_cast<unsigned short>((COLORTABLE[3 * IDX] * COLOR[3] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
345 COLOR[1] = static_cast<unsigned short>( \
346 (COLORTABLE[3 * IDX + 1] * COLOR[3] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
347 COLOR[2] = static_cast<unsigned short>( \
348 (COLORTABLE[3 * IDX + 2] * COLOR[3] + 0x7fff) >> (VTKKW_FP_SHIFT));
350#define VTKKWRCHelper_LookupColorMax(COLORTABLE, SCALAROPACITYTABLE, IDX, COLOR) \
351 COLOR[3] = SCALAROPACITYTABLE[IDX]; \
353 static_cast<unsigned short>((COLORTABLE[3 * IDX] * COLOR[3] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
354 COLOR[1] = static_cast<unsigned short>( \
355 (COLORTABLE[3 * IDX + 1] * COLOR[3] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
356 COLOR[2] = static_cast<unsigned short>( \
357 (COLORTABLE[3 * IDX + 2] * COLOR[3] + 0x7fff) >> (VTKKW_FP_SHIFT));
359#define VTKKWRCHelper_LookupDependentColorUS(COLORTABLE, SCALAROPACITYTABLE, IDX, CMPS, COLOR) \
361 unsigned short _alpha; \
365 _alpha = SCALAROPACITYTABLE[IDX[1]]; \
366 COLOR[0] = static_cast<unsigned short>( \
367 (COLORTABLE[3 * IDX[0]] * _alpha + 0x7fff) >> (VTKKW_FP_SHIFT)); \
368 COLOR[1] = static_cast<unsigned short>( \
369 (COLORTABLE[3 * IDX[0] + 1] * _alpha + 0x7fff) >> (VTKKW_FP_SHIFT)); \
370 COLOR[2] = static_cast<unsigned short>( \
371 (COLORTABLE[3 * IDX[0] + 2] * _alpha + 0x7fff) >> (VTKKW_FP_SHIFT)); \
375 _alpha = SCALAROPACITYTABLE[IDX[3]]; \
376 COLOR[0] = static_cast<unsigned short>((IDX[0] * _alpha + 0x7f) >> 8); \
377 COLOR[1] = static_cast<unsigned short>((IDX[1] * _alpha + 0x7f) >> 8); \
378 COLOR[2] = static_cast<unsigned short>((IDX[2] * _alpha + 0x7f) >> 8); \
384#define VTKKWRCHelper_LookupColorGOUS(CTABLE, SOTABLE, GOTABLE, IDX, IDX2, COLOR) \
385 COLOR[3] = (SOTABLE[IDX] * GOTABLE[IDX2] + 0x7fff) >> VTKKW_FP_SHIFT; \
391 static_cast<unsigned short>((CTABLE[3 * IDX] * COLOR[3] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
393 static_cast<unsigned short>((CTABLE[3 * IDX + 1] * COLOR[3] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
395 static_cast<unsigned short>((CTABLE[3 * IDX + 2] * COLOR[3] + 0x7fff) >> (VTKKW_FP_SHIFT));
397#define VTKKWRCHelper_LookupShading(DTABLE, STABLE, NORMAL, COLOR) \
399 static_cast<unsigned short>((DTABLE[3 * NORMAL] * COLOR[0] + 0x7fff) >> VTKKW_FP_SHIFT); \
401 static_cast<unsigned short>((DTABLE[3 * NORMAL + 1] * COLOR[1] + 0x7fff) >> VTKKW_FP_SHIFT); \
403 static_cast<unsigned short>((DTABLE[3 * NORMAL + 2] * COLOR[2] + 0x7fff) >> VTKKW_FP_SHIFT); \
404 COLOR[0] += (STABLE[3 * NORMAL] * COLOR[3] + 0x7fff) >> VTKKW_FP_SHIFT; \
405 COLOR[1] += (STABLE[3 * NORMAL + 1] * COLOR[3] + 0x7fff) >> VTKKW_FP_SHIFT; \
406 COLOR[2] += (STABLE[3 * NORMAL + 2] * COLOR[3] + 0x7fff) >> VTKKW_FP_SHIFT;
408#define VTKKWRCHelper_LookupAndCombineIndependentColorsUS( \
409 COLORTABLE, SOTABLE, SCALAR, WEIGHTS, COMPONENTS, COLOR) \
410 unsigned int _tmp[4] = { 0, 0, 0, 0 }; \
411 unsigned short _alpha[4] = { 0, 0, 0, 0 }; \
412 unsigned int _totalAlpha = 0; \
415 for (int _idx = 0; _idx < COMPONENTS; _idx++) \
417 _alpha[_idx] = static_cast<unsigned short>(SOTABLE[_idx][SCALAR[_idx]] * WEIGHTS[_idx]); \
418 _totalAlpha += _alpha[_idx]; \
427 for (int _idx = 0; _idx < COMPONENTS; _idx++) \
431 _tmp[0] += static_cast<unsigned short>( \
432 ((COLORTABLE[_idx][3 * SCALAR[_idx]]) * _alpha[_idx] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
433 _tmp[1] += static_cast<unsigned short>( \
434 ((COLORTABLE[_idx][3 * SCALAR[_idx] + 1]) * _alpha[_idx] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
435 _tmp[2] += static_cast<unsigned short>( \
436 ((COLORTABLE[_idx][3 * SCALAR[_idx] + 2]) * _alpha[_idx] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
437 _tmp[3] += ((_alpha[_idx] * _alpha[_idx]) / _totalAlpha); \
445 COLOR[0] = (_tmp[0] > 32767) ? (32767) : (_tmp[0]); \
446 COLOR[1] = (_tmp[1] > 32767) ? (32767) : (_tmp[1]); \
447 COLOR[2] = (_tmp[2] > 32767) ? (32767) : (_tmp[2]); \
448 COLOR[3] = (_tmp[3] > 32767) ? (32767) : (_tmp[3]);
450#define VTKKWRCHelper_LookupAndCombineIndependentColorsMax( \
451 COLORTABLE, SCALAROPACITYTABLE, IDX, WEIGHTS, CMPS, COLOR) \
453 unsigned int _tmp[4] = { 0, 0, 0, 0 }; \
454 for (int _idx = 0; _idx < CMPS; _idx++) \
456 unsigned short _alpha = \
457 static_cast<unsigned short>(SCALAROPACITYTABLE[_idx][IDX[_idx]] * WEIGHTS[_idx]); \
458 _tmp[0] += static_cast<unsigned short>( \
459 ((COLORTABLE[_idx][3 * IDX[_idx]]) * _alpha + 0x7fff) >> (VTKKW_FP_SHIFT)); \
460 _tmp[1] += static_cast<unsigned short>( \
461 ((COLORTABLE[_idx][3 * IDX[_idx] + 1]) * _alpha + 0x7fff) >> (VTKKW_FP_SHIFT)); \
462 _tmp[2] += static_cast<unsigned short>( \
463 ((COLORTABLE[_idx][3 * IDX[_idx] + 2]) * _alpha + 0x7fff) >> (VTKKW_FP_SHIFT)); \
466 COLOR[0] = (_tmp[0] > 32767) ? (32767) : (_tmp[0]); \
467 COLOR[1] = (_tmp[1] > 32767) ? (32767) : (_tmp[1]); \
468 COLOR[2] = (_tmp[2] > 32767) ? (32767) : (_tmp[2]); \
469 COLOR[3] = (_tmp[3] > 32767) ? (32767) : (_tmp[3]); \
472#define VTKKWRCHelper_LookupAndCombineIndependentColorsGOUS( \
473 COLORTABLE, SOTABLE, GOTABLE, SCALAR, MAG, WEIGHTS, COMPONENTS, COLOR) \
474 unsigned int _tmp[4] = { 0, 0, 0, 0 }; \
475 unsigned short _alpha[4] = { 0, 0, 0, 0 }; \
476 unsigned int _totalAlpha = 0; \
477 COMPONENTS = (COMPONENTS < 4) ? COMPONENTS : 4; \
479 for (int _idx = 0; _idx < COMPONENTS; _idx++) \
481 _alpha[_idx] = static_cast<unsigned short>(SOTABLE[_idx][SCALAR[_idx]] * WEIGHTS[_idx]); \
484 _alpha[_idx] = static_cast<unsigned short>( \
485 (_alpha[_idx] * GOTABLE[_idx][MAG[_idx]] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
486 _totalAlpha += _alpha[_idx]; \
496 for (int _idx = 0; _idx < COMPONENTS; _idx++) \
500 _tmp[0] += static_cast<unsigned short>( \
501 ((COLORTABLE[_idx][3 * SCALAR[_idx]]) * _alpha[_idx] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
502 _tmp[1] += static_cast<unsigned short>( \
503 ((COLORTABLE[_idx][3 * SCALAR[_idx] + 1]) * _alpha[_idx] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
504 _tmp[2] += static_cast<unsigned short>( \
505 ((COLORTABLE[_idx][3 * SCALAR[_idx] + 2]) * _alpha[_idx] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
506 _tmp[3] += ((_alpha[_idx] * _alpha[_idx]) / _totalAlpha); \
514 COLOR[0] = (_tmp[0] > 32767) ? (32767) : (_tmp[0]); \
515 COLOR[1] = (_tmp[1] > 32767) ? (32767) : (_tmp[1]); \
516 COLOR[2] = (_tmp[2] > 32767) ? (32767) : (_tmp[2]); \
517 COLOR[3] = (_tmp[3] > 32767) ? (32767) : (_tmp[3]);
519#define VTKKWRCHelper_LookupAndCombineIndependentColorsShadeUS( \
520 COLORTABLE, SOTABLE, DTABLE, STABLE, SCALAR, NORMAL, WEIGHTS, COMPONENTS, COLOR) \
521 unsigned int _tmp[4] = { 0, 0, 0, 0 }; \
522 unsigned int _tmpC[3]; \
523 unsigned short _alpha[4] = { 0, 0, 0, 0 }; \
524 unsigned int _totalAlpha = 0; \
527 for (int _idx = 0; _idx < COMPONENTS; _idx++) \
529 _alpha[_idx] = static_cast<unsigned short>(SOTABLE[_idx][SCALAR[_idx]] * WEIGHTS[_idx]); \
530 _totalAlpha += _alpha[_idx]; \
539 for (int _idx = 0; _idx < COMPONENTS; _idx++) \
543 _tmpC[0] = static_cast<unsigned short>( \
544 ((COLORTABLE[_idx][3 * SCALAR[_idx]]) * _alpha[_idx] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
545 _tmpC[1] = static_cast<unsigned short>( \
546 ((COLORTABLE[_idx][3 * SCALAR[_idx] + 1]) * _alpha[_idx] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
547 _tmpC[2] = static_cast<unsigned short>( \
548 ((COLORTABLE[_idx][3 * SCALAR[_idx] + 2]) * _alpha[_idx] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
549 _tmpC[0] = static_cast<unsigned short>( \
550 (DTABLE[_idx][3 * NORMAL[_idx]] * _tmpC[0] + 0x7fff) >> VTKKW_FP_SHIFT); \
551 _tmpC[1] = static_cast<unsigned short>( \
552 (DTABLE[_idx][3 * NORMAL[_idx] + 1] * _tmpC[1] + 0x7fff) >> VTKKW_FP_SHIFT); \
553 _tmpC[2] = static_cast<unsigned short>( \
554 (DTABLE[_idx][3 * NORMAL[_idx] + 2] * _tmpC[2] + 0x7fff) >> VTKKW_FP_SHIFT); \
555 _tmpC[0] += (STABLE[_idx][3 * NORMAL[_idx]] * _alpha[_idx] + 0x7fff) >> VTKKW_FP_SHIFT; \
557 (STABLE[_idx][3 * NORMAL[_idx] + 1] * _alpha[_idx] + 0x7fff) >> VTKKW_FP_SHIFT; \
559 (STABLE[_idx][3 * NORMAL[_idx] + 2] * _alpha[_idx] + 0x7fff) >> VTKKW_FP_SHIFT; \
560 _tmp[0] += _tmpC[0]; \
561 _tmp[1] += _tmpC[1]; \
562 _tmp[2] += _tmpC[2]; \
563 _tmp[3] += ((_alpha[_idx] * _alpha[_idx]) / _totalAlpha); \
572 COLOR[0] = (_tmp[0] > 32767) ? (32767) : (_tmp[0]); \
573 COLOR[1] = (_tmp[1] > 32767) ? (32767) : (_tmp[1]); \
574 COLOR[2] = (_tmp[2] > 32767) ? (32767) : (_tmp[2]); \
575 COLOR[3] = (_tmp[3] > 32767) ? (32767) : (_tmp[3]);
577#define VTKKWRCHelper_LookupAndCombineIndependentColorsInterpolateShadeUS( \
578 COLORTABLE, SOTABLE, DTABLE, STABLE, SCALAR, WEIGHTS, COMPONENTS, COLOR) \
579 unsigned int _tmp[4] = { 0, 0, 0, 0 }; \
580 unsigned int _tmpC[4]; \
581 unsigned short _alpha[4] = { 0, 0, 0, 0 }; \
582 unsigned int _totalAlpha = 0; \
585 for (int _idx = 0; _idx < COMPONENTS; _idx++) \
587 _alpha[_idx] = static_cast<unsigned short>(SOTABLE[_idx][SCALAR[_idx]] * WEIGHTS[_idx]); \
588 _totalAlpha += _alpha[_idx]; \
597 for (int _idx = 0; _idx < COMPONENTS; _idx++) \
601 _tmpC[0] = static_cast<unsigned short>( \
602 ((COLORTABLE[_idx][3 * SCALAR[_idx]]) * _alpha[_idx] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
603 _tmpC[1] = static_cast<unsigned short>( \
604 ((COLORTABLE[_idx][3 * SCALAR[_idx] + 1]) * _alpha[_idx] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
605 _tmpC[2] = static_cast<unsigned short>( \
606 ((COLORTABLE[_idx][3 * SCALAR[_idx] + 2]) * _alpha[_idx] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
607 _tmpC[3] = _alpha[_idx]; \
608 VTKKWRCHelper_InterpolateShadingComponent(DTABLE, STABLE, _tmpC, _idx); \
609 _tmp[0] += _tmpC[0]; \
610 _tmp[1] += _tmpC[1]; \
611 _tmp[2] += _tmpC[2]; \
612 _tmp[3] += ((_alpha[_idx] * _alpha[_idx]) / _totalAlpha); \
620 COLOR[0] = (_tmp[0] > 32767) ? (32767) : (_tmp[0]); \
621 COLOR[1] = (_tmp[1] > 32767) ? (32767) : (_tmp[1]); \
622 COLOR[2] = (_tmp[2] > 32767) ? (32767) : (_tmp[2]); \
623 COLOR[3] = (_tmp[3] > 32767) ? (32767) : (_tmp[3]);
625#define VTKKWRCHelper_CompositeColorAndCheckEarlyTermination(COLOR, TMP, REMAININGOPACITY) \
626 COLOR[0] += (TMP[0] * REMAININGOPACITY + 0x7fff) >> VTKKW_FP_SHIFT; \
627 COLOR[1] += (TMP[1] * REMAININGOPACITY + 0x7fff) >> VTKKW_FP_SHIFT; \
628 COLOR[2] += (TMP[2] * REMAININGOPACITY + 0x7fff) >> VTKKW_FP_SHIFT; \
630 (REMAININGOPACITY * ((~(TMP[3]) & VTKKW_FP_MASK)) + 0x7fff) >> VTKKW_FP_SHIFT; \
631 if (REMAININGOPACITY < 0xff) \
636#define VTKKWRCHelper_LookupAndCombineIndependentColorsGOShadeUS( \
637 COLORTABLE, SOTABLE, GOTABLE, DTABLE, STABLE, SCALAR, MAG, NORMAL, WEIGHTS, COMPONENTS, COLOR) \
638 unsigned int _tmp[4] = { 0, 0, 0, 0 }; \
639 unsigned int _tmpC[3]; \
640 unsigned short _alpha[4] = { 0, 0, 0, 0 }; \
641 unsigned int _totalAlpha = 0; \
644 for (int _idx = 0; _idx < COMPONENTS; _idx++) \
646 _alpha[_idx] = static_cast<unsigned short>(SOTABLE[_idx][SCALAR[_idx]] * WEIGHTS[_idx]); \
649 _alpha[_idx] = static_cast<unsigned short>( \
650 (_alpha[_idx] * GOTABLE[_idx][MAG[_idx]] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
651 _totalAlpha += _alpha[_idx]; \
662 for (int _idx = 0; _idx < COMPONENTS; _idx++) \
666 _tmpC[0] = static_cast<unsigned short>( \
667 ((COLORTABLE[_idx][3 * SCALAR[_idx]]) * _alpha[_idx] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
668 _tmpC[1] = static_cast<unsigned short>( \
669 ((COLORTABLE[_idx][3 * SCALAR[_idx] + 1]) * _alpha[_idx] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
670 _tmpC[2] = static_cast<unsigned short>( \
671 ((COLORTABLE[_idx][3 * SCALAR[_idx] + 2]) * _alpha[_idx] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
672 _tmpC[0] = static_cast<unsigned short>( \
673 (DTABLE[_idx][3 * NORMAL[_idx]] * _tmpC[0] + 0x7fff) >> VTKKW_FP_SHIFT); \
674 _tmpC[1] = static_cast<unsigned short>( \
675 (DTABLE[_idx][3 * NORMAL[_idx] + 1] * _tmpC[1] + 0x7fff) >> VTKKW_FP_SHIFT); \
676 _tmpC[2] = static_cast<unsigned short>( \
677 (DTABLE[_idx][3 * NORMAL[_idx] + 2] * _tmpC[2] + 0x7fff) >> VTKKW_FP_SHIFT); \
678 _tmpC[0] += (STABLE[_idx][3 * NORMAL[_idx]] * _alpha[_idx] + 0x7fff) >> VTKKW_FP_SHIFT; \
680 (STABLE[_idx][3 * NORMAL[_idx] + 1] * _alpha[_idx] + 0x7fff) >> VTKKW_FP_SHIFT; \
682 (STABLE[_idx][3 * NORMAL[_idx] + 2] * _alpha[_idx] + 0x7fff) >> VTKKW_FP_SHIFT; \
683 _tmp[0] += _tmpC[0]; \
684 _tmp[1] += _tmpC[1]; \
685 _tmp[2] += _tmpC[2]; \
686 _tmp[3] += ((_alpha[_idx] * _alpha[_idx]) / _totalAlpha); \
694 COLOR[0] = (_tmp[0] > 32767) ? (32767) : (_tmp[0]); \
695 COLOR[1] = (_tmp[1] > 32767) ? (32767) : (_tmp[1]); \
696 COLOR[2] = (_tmp[2] > 32767) ? (32767) : (_tmp[2]); \
697 COLOR[3] = (_tmp[3] > 32767) ? (32767) : (_tmp[3]);
699#define VTKKWRCHelper_LookupAndCombineIndependentColorsGOInterpolateShadeUS( \
700 COLORTABLE, SOTABLE, GOTABLE, DTABLE, STABLE, SCALAR, MAG, WEIGHTS, COMPONENTS, COLOR) \
701 unsigned int _tmp[4] = { 0, 0, 0, 0 }; \
702 unsigned int _tmpC[4]; \
703 unsigned short _alpha[4] = { 0, 0, 0, 0 }; \
704 unsigned int _totalAlpha = 0; \
707 for (int _idx = 0; _idx < COMPONENTS; _idx++) \
709 _alpha[_idx] = static_cast<unsigned short>(SOTABLE[_idx][SCALAR[_idx]] * WEIGHTS[_idx]); \
712 _alpha[_idx] = static_cast<unsigned short>( \
713 (_alpha[_idx] * GOTABLE[_idx][MAG[_idx]] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
714 _totalAlpha += _alpha[_idx]; \
724 for (int _idx = 0; _idx < COMPONENTS; _idx++) \
728 _tmpC[0] = static_cast<unsigned short>( \
729 ((COLORTABLE[_idx][3 * SCALAR[_idx]]) * _alpha[_idx] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
730 _tmpC[1] = static_cast<unsigned short>( \
731 ((COLORTABLE[_idx][3 * SCALAR[_idx] + 1]) * _alpha[_idx] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
732 _tmpC[2] = static_cast<unsigned short>( \
733 ((COLORTABLE[_idx][3 * SCALAR[_idx] + 2]) * _alpha[_idx] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
734 _tmpC[3] = _alpha[_idx]; \
735 VTKKWRCHelper_InterpolateShadingComponent(DTABLE, STABLE, _tmpC, _idx); \
736 _tmp[0] += _tmpC[0]; \
737 _tmp[1] += _tmpC[1]; \
738 _tmp[2] += _tmpC[2]; \
739 _tmp[3] += ((_alpha[_idx] * _alpha[_idx]) / _totalAlpha); \
747 COLOR[0] = (_tmp[0] > 32767) ? (32767) : (_tmp[0]); \
748 COLOR[1] = (_tmp[1] > 32767) ? (32767) : (_tmp[1]); \
749 COLOR[2] = (_tmp[2] > 32767) ? (32767) : (_tmp[2]); \
750 COLOR[3] = (_tmp[3] > 32767) ? (32767) : (_tmp[3]);
752#define VTKKWRCHelper_SetPixelColor(IMAGEPTR, COLOR, REMAININGOPACITY) \
753 IMAGEPTR[0] = (COLOR[0] > 32767) ? (32767) : (COLOR[0]); \
754 IMAGEPTR[1] = (COLOR[1] > 32767) ? (32767) : (COLOR[1]); \
755 IMAGEPTR[2] = (COLOR[2] > 32767) ? (32767) : (COLOR[2]); \
756 unsigned int tmpAlpha = (~REMAININGOPACITY) & VTKKW_FP_MASK; \
757 IMAGEPTR[3] = (tmpAlpha > 32767) ? (32767) : (tmpAlpha);
759#define VTKKWRCHelper_MoveToNextSampleNN() \
760 if (k < numSteps - 1) \
762 mapper->FixedPointIncrement(pos, dir); \
763 mapper->ShiftVectorDown(pos, spos); \
764 dptr = data + spos[0] * inc[0] + spos[1] * inc[1] + spos[2] * inc[2]; \
767#define VTKKWRCHelper_MoveToNextSampleGONN() \
768 if (k < numSteps - 1) \
770 mapper->FixedPointIncrement(pos, dir); \
771 mapper->ShiftVectorDown(pos, spos); \
772 dptr = data + spos[0] * inc[0] + spos[1] * inc[1] + spos[2] * inc[2]; \
773 magPtr = gradientMag[spos[2]] + spos[0] * mInc[0] + spos[1] * mInc[1]; \
776#define VTKKWRCHelper_MoveToNextSampleShadeNN() \
777 if (k < numSteps - 1) \
779 mapper->FixedPointIncrement(pos, dir); \
780 mapper->ShiftVectorDown(pos, spos); \
781 dptr = data + spos[0] * inc[0] + spos[1] * inc[1] + spos[2] * inc[2]; \
782 dirPtr = gradientDir[spos[2]] + spos[0] * dInc[0] + spos[1] * dInc[1]; \
785#define VTKKWRCHelper_MoveToNextSampleGOShadeNN() \
786 if (k < numSteps - 1) \
788 mapper->FixedPointIncrement(pos, dir); \
789 mapper->ShiftVectorDown(pos, spos); \
790 dptr = data + spos[0] * inc[0] + spos[1] * inc[1] + spos[2] * inc[2]; \
791 magPtr = gradientMag[spos[2]] + spos[0] * mInc[0] + spos[1] * mInc[1]; \
792 dirPtr = gradientDir[spos[2]] + spos[0] * dInc[0] + spos[1] * dInc[1]; \
795#define VTKKWRCHelper_InitializeVariables() \
797 unsigned short* imagePtr; \
799 int imageInUseSize[2]; \
800 int imageMemorySize[2]; \
801 int imageViewportSize[2]; \
802 int imageOrigin[2]; \
807 mapper->GetRayCastImage()->GetImageInUseSize(imageInUseSize); \
808 mapper->GetRayCastImage()->GetImageMemorySize(imageMemorySize); \
809 mapper->GetRayCastImage()->GetImageViewportSize(imageViewportSize); \
810 mapper->GetRayCastImage()->GetImageOrigin(imageOrigin); \
811 vtkImageData* imData = vtkImageData::SafeDownCast(mapper->GetInput()); \
812 vtkRectilinearGrid* rGrid = vtkRectilinearGrid::SafeDownCast(mapper->GetInput()); \
815 imData->GetDimensions(dim); \
819 rGrid->GetDimensions(dim); \
821 mapper->GetTableShift(shift); \
822 mapper->GetTableScale(scale); \
824 int* rowBounds = mapper->GetRowBounds(); \
825 unsigned short* image = mapper->GetRayCastImage()->GetImage(); \
826 vtkRenderWindow* renWin = mapper->GetRenderWindow(); \
827 int components = 1; \
830 components = imData->GetNumberOfScalarComponents(); \
834 components = rGrid->GetNumberOfScalarComponents(); \
836 int cropping = (mapper->GetCropping() && mapper->GetCroppingRegionFlags() != 0x2000); \
838 components = (components < 4) ? components : 4; \
839 unsigned short* colorTable[4]; \
840 unsigned short* scalarOpacityTable[4]; \
843 for (c = 0; c < 4; c++) \
845 colorTable[c] = mapper->GetColorTable(c); \
846 (void)(colorTable[c]); \
847 scalarOpacityTable[c] = mapper->GetScalarOpacityTable(c); \
851 inc[0] = components; \
852 inc[1] = inc[0] * dim[0]; \
853 inc[2] = inc[1] * dim[1];
855#define VTKKWRCHelper_InitializeWeights() \
856 float weights[4] = {}; \
857 weights[0] = vol->GetProperty()->GetComponentWeight(0); \
858 weights[1] = vol->GetProperty()->GetComponentWeight(1); \
859 weights[2] = vol->GetProperty()->GetComponentWeight(2); \
860 weights[3] = vol->GetProperty()->GetComponentWeight(3);
862#define VTKKWRCHelper_InitializeVariablesGO() \
863 unsigned short* gradientOpacityTable[4]; \
864 for (c = 0; c < 4; c++) \
866 gradientOpacityTable[c] = mapper->GetGradientOpacityTable(c); \
868 unsigned char** gradientMag = mapper->GetGradientMagnitude(); \
871 if (vol->GetProperty()->GetIndependentComponents()) \
880 mInc[1] = mInc[0] * dim[0]; \
881 mInc[2] = mInc[1] * dim[1]; \
884#define VTKKWRCHelper_InitializeVariablesShade() \
885 unsigned short* diffuseShadingTable[4]; \
886 unsigned short* specularShadingTable[4]; \
887 for (c = 0; c < 4; c++) \
889 diffuseShadingTable[c] = mapper->GetDiffuseShadingTable(c); \
890 specularShadingTable[c] = mapper->GetSpecularShadingTable(c); \
892 unsigned short** gradientDir = mapper->GetGradientNormal(); \
894 if (vol->GetProperty()->GetIndependentComponents()) \
903 dInc[1] = dInc[0] * dim[0]; \
904 dInc[2] = dInc[1] * dim[1]; \
907#define VTKKWRCHelper_InitializeTrilinVariables() \
908 vtkIdType Binc = components; \
909 vtkIdType Cinc = Binc * dim[0]; \
910 vtkIdType Dinc = Cinc + Binc; \
911 vtkIdType Einc = Cinc * dim[1]; \
912 vtkIdType Finc = Einc + Binc; \
913 vtkIdType Ginc = Einc + Cinc; \
914 vtkIdType Hinc = Ginc + Binc;
916#define VTKKWRCHelper_InitializeTrilinVariablesGO() \
917 vtkIdType magOffset; \
918 if (vol->GetProperty()->GetIndependentComponents()) \
920 magOffset = components; \
927 vtkIdType mBFinc = magOffset; \
928 vtkIdType mCGinc = dim[0] * magOffset; \
929 vtkIdType mDHinc = dim[0] * magOffset + magOffset;
931#define VTKKWRCHelper_InitializeTrilinVariablesShade() \
932 vtkIdType dirOffset; \
933 if (vol->GetProperty()->GetIndependentComponents()) \
935 dirOffset = components; \
942 vtkIdType dBFinc = dirOffset; \
943 vtkIdType dCGinc = dim[0] * dirOffset; \
944 vtkIdType dDHinc = dim[0] * dirOffset + dirOffset;
946#define VTKKWRCHelper_OuterInitialization() \
947 if (j % threadCount != threadID) \
953 if (renWin->CheckAbortStatus()) \
958 else if (renWin->GetAbortRender()) \
962 imagePtr = image + 4 * (j * imageMemorySize[0] + rowBounds[j * 2]);
964#define VTKKWRCHelper_InnerInitialization() \
965 unsigned int numSteps; \
966 unsigned int pos[3]; \
967 unsigned int dir[3]; \
968 mapper->ComputeRayInfo(i, j, pos, dir, &numSteps); \
972 *(imagePtr + 1) = 0; \
973 *(imagePtr + 2) = 0; \
974 *(imagePtr + 3) = 0; \
978 unsigned int spos[3]; \
981#define VTKKWRCHelper_InitializeMIPOneNN() \
982 mapper->ShiftVectorDown(pos, spos); \
983 T* dptr = data + spos[0] * inc[0] + spos[1] * inc[1] + spos[2] * inc[2]; \
984 T maxValue = *(dptr);
986#define VTKKWRCHelper_InitializeMIPMultiNN() \
987 mapper->ShiftVectorDown(pos, spos); \
988 T* dptr = data + spos[0] * inc[0] + spos[1] * inc[1] + spos[2] * inc[2]; \
989 T maxValue[4] = {}; \
990 for (c = 0; c < components; c++) \
992 maxValue[c] = *(dptr + c); \
995#define VTKKWRCHelper_InitializeMIPOneTrilin() \
997 unsigned int oldSPos[3]; \
999 oldSPos[0] = (pos[0] >> VTKKW_FP_SHIFT) + 1; \
1003 unsigned int w1X, w1Y, w1Z; \
1004 unsigned int w2X, w2Y, w2Z; \
1005 unsigned int w1Xw1Y, w2Xw1Y, w1Xw2Y, w2Xw2Y; \
1007 unsigned short maxValue = 0; \
1008 unsigned short val; \
1009 unsigned int A = 0, B = 0, C = 0, D = 0, E = 0, F = 0, G = 0, H = 0;
1011#define VTKKWRCHelper_InitializeMIPMultiTrilin() \
1013 unsigned int oldSPos[3]; \
1015 oldSPos[0] = (pos[0] >> VTKKW_FP_SHIFT) + 1; \
1019 unsigned int w1X, w1Y, w1Z; \
1020 unsigned int w2X, w2Y, w2Z; \
1021 unsigned int w1Xw1Y, w2Xw1Y, w1Xw2Y, w2Xw2Y; \
1023 unsigned short maxValue[4] = {}; \
1024 unsigned short val[4] = {}; \
1025 unsigned int A[4] = {}, B[4] = {}, C[4] = {}, D[4] = {}, E[4] = {}, F[4] = {}, G[4] = {}, \
1028#define VTKKWRCHelper_InitializeCompositeGONN() \
1029 unsigned char* magPtr = gradientMag[spos[2]] + spos[0] * mInc[0] + spos[1] * mInc[1];
1031#define VTKKWRCHelper_InitializeCompositeShadeNN() \
1032 unsigned short* dirPtr = gradientDir[spos[2]] + spos[0] * dInc[0] + spos[1] * dInc[1];
1034#define VTKKWRCHelper_InitializeCompositeOneNN() \
1035 mapper->ShiftVectorDown(pos, spos); \
1036 T* dptr = data + spos[0] * inc[0] + spos[1] * inc[1] + spos[2] * inc[2]; \
1037 unsigned int color[3] = { 0, 0, 0 }; \
1038 unsigned short remainingOpacity = 0x7fff; \
1039 unsigned short tmp[4];
1041#define VTKKWRCHelper_InitializeCompositeMultiNN() \
1042 mapper->ShiftVectorDown(pos, spos); \
1043 T* dptr = data + spos[0] * inc[0] + spos[1] * inc[1] + spos[2] * inc[2]; \
1044 unsigned int color[3] = { 0, 0, 0 }; \
1045 unsigned int remainingOpacity = 0x7fff; \
1046 unsigned short tmp[4] = {}; \
1047 unsigned short val[4] = {};
1049#define VTKKWRCHelper_InitializeCompositeOneTrilin() \
1051 unsigned int oldSPos[3]; \
1053 oldSPos[0] = (pos[0] >> VTKKW_FP_SHIFT) + 1; \
1057 unsigned int w1X, w1Y, w1Z; \
1058 unsigned int w2X, w2Y, w2Z; \
1059 unsigned int w1Xw1Y, w2Xw1Y, w1Xw2Y, w2Xw2Y; \
1061 unsigned short val; \
1062 unsigned int A = 0, B = 0, C = 0, D = 0, E = 0, F = 0, G = 0, H = 0; \
1064 unsigned int color[3] = { 0, 0, 0 }; \
1065 unsigned short remainingOpacity = 0x7fff; \
1066 unsigned short tmp[4];
1068#define VTKKWRCHelper_InitializeCompositeOneGOTrilin() \
1069 unsigned char *magPtrABCD = nullptr, *magPtrEFGH = nullptr; \
1070 unsigned short mag; \
1071 unsigned int mA = 0, mB = 0, mC = 0, mD = 0, mE = 0, mF = 0, mG = 0, mH = 0;
1073#define VTKKWRCHelper_InitializeCompositeOneShadeTrilin() \
1074 unsigned short *dirPtrABCD = 0, *dirPtrEFGH = 0; \
1075 unsigned int normalA = 0, normalB = 0, normalC = 0, normalD = 0; \
1076 unsigned int normalE = 0, normalF = 0, normalG = 0, normalH = 0;
1078#define VTKKWRCHelper_InitializeCompositeMultiTrilin() \
1080 unsigned int oldSPos[3]; \
1082 oldSPos[0] = (pos[0] >> VTKKW_FP_SHIFT) + 1; \
1086 unsigned int w1X, w1Y, w1Z; \
1087 unsigned int w2X, w2Y, w2Z; \
1088 unsigned int w1Xw1Y, w2Xw1Y, w1Xw2Y, w2Xw2Y; \
1090 unsigned short val[4] = { 0, 0, 0, 0 }; \
1091 unsigned int A[4] = { 0, 0, 0, 0 }; \
1092 unsigned int B[4] = { 0, 0, 0, 0 }; \
1093 unsigned int C[4] = { 0, 0, 0, 0 }; \
1094 unsigned int D[4] = { 0, 0, 0, 0 }; \
1095 unsigned int E[4] = { 0, 0, 0, 0 }; \
1096 unsigned int F[4] = { 0, 0, 0, 0 }; \
1097 unsigned int G[4] = { 0, 0, 0, 0 }; \
1098 unsigned int H[4] = { 0, 0, 0, 0 }; \
1100 unsigned int color[3] = { 0, 0, 0 }; \
1101 unsigned short remainingOpacity = 0x7fff; \
1102 unsigned short tmp[4];
1104#define VTKKWRCHelper_InitializeCompositeMultiGOTrilin() \
1105 unsigned char *magPtrABCD = 0, *magPtrEFGH = 0; \
1106 unsigned short mag[4] = {}; \
1107 unsigned int mA[4] = {}, mB[4] = {}, mC[4] = {}, mD[4] = {}, mE[4] = {}, mF[4] = {}, mG[4] = {}, \
1110#define VTKKWRCHelper_InitializeCompositeMultiShadeTrilin() \
1111 unsigned short *dirPtrABCD = 0, *dirPtrEFGH = 0; \
1112 unsigned int normalA[4], normalB[4], normalC[4], normalD[4]; \
1113 unsigned int normalE[4], normalF[4], normalG[4], normalH[4];
1115#define VTKKWRCHelper_InitializationAndLoopStartNN() \
1116 VTKKWRCHelper_InitializeVariables(); \
1117 for (j = 0; j < imageInUseSize[1]; j++) \
1119 VTKKWRCHelper_OuterInitialization(); \
1120 for (i = rowBounds[j * 2]; i <= rowBounds[j * 2 + 1]; i++) \
1122 VTKKWRCHelper_InnerInitialization();
1124#define VTKKWRCHelper_InitializationAndLoopStartGONN() \
1125 VTKKWRCHelper_InitializeVariables(); \
1126 VTKKWRCHelper_InitializeVariablesGO(); \
1127 for (j = 0; j < imageInUseSize[1]; j++) \
1129 VTKKWRCHelper_OuterInitialization(); \
1130 for (i = rowBounds[j * 2]; i <= rowBounds[j * 2 + 1]; i++) \
1132 VTKKWRCHelper_InnerInitialization();
1134#define VTKKWRCHelper_InitializationAndLoopStartShadeNN() \
1135 VTKKWRCHelper_InitializeVariables(); \
1136 VTKKWRCHelper_InitializeVariablesShade(); \
1137 for (j = 0; j < imageInUseSize[1]; j++) \
1139 VTKKWRCHelper_OuterInitialization(); \
1140 for (i = rowBounds[j * 2]; i <= rowBounds[j * 2 + 1]; i++) \
1142 VTKKWRCHelper_InnerInitialization();
1144#define VTKKWRCHelper_InitializationAndLoopStartGOShadeNN() \
1145 VTKKWRCHelper_InitializeVariables(); \
1146 VTKKWRCHelper_InitializeVariablesGO(); \
1147 VTKKWRCHelper_InitializeVariablesShade(); \
1148 for (j = 0; j < imageInUseSize[1]; j++) \
1150 VTKKWRCHelper_OuterInitialization(); \
1151 for (i = rowBounds[j * 2]; i <= rowBounds[j * 2 + 1]; i++) \
1153 VTKKWRCHelper_InnerInitialization();
1155#define VTKKWRCHelper_InitializationAndLoopStartTrilin() \
1156 VTKKWRCHelper_InitializeVariables(); \
1157 VTKKWRCHelper_InitializeTrilinVariables(); \
1158 for (j = 0; j < imageInUseSize[1]; j++) \
1160 VTKKWRCHelper_OuterInitialization(); \
1161 for (i = rowBounds[j * 2]; i <= rowBounds[j * 2 + 1]; i++) \
1163 VTKKWRCHelper_InnerInitialization();
1165#define VTKKWRCHelper_InitializationAndLoopStartGOTrilin() \
1166 VTKKWRCHelper_InitializeVariables(); \
1167 VTKKWRCHelper_InitializeVariablesGO(); \
1168 VTKKWRCHelper_InitializeTrilinVariables(); \
1169 VTKKWRCHelper_InitializeTrilinVariablesGO(); \
1170 for (j = 0; j < imageInUseSize[1]; j++) \
1172 VTKKWRCHelper_OuterInitialization(); \
1173 for (i = rowBounds[j * 2]; i <= rowBounds[j * 2 + 1]; i++) \
1175 VTKKWRCHelper_InnerInitialization();
1177#define VTKKWRCHelper_InitializationAndLoopStartShadeTrilin() \
1178 VTKKWRCHelper_InitializeVariables(); \
1179 VTKKWRCHelper_InitializeVariablesShade(); \
1180 VTKKWRCHelper_InitializeTrilinVariables(); \
1181 VTKKWRCHelper_InitializeTrilinVariablesShade(); \
1182 for (j = 0; j < imageInUseSize[1]; j++) \
1184 VTKKWRCHelper_OuterInitialization(); \
1185 for (i = rowBounds[j * 2]; i <= rowBounds[j * 2 + 1]; i++) \
1187 VTKKWRCHelper_InnerInitialization();
1189#define VTKKWRCHelper_InitializationAndLoopStartGOShadeTrilin() \
1190 VTKKWRCHelper_InitializeVariables(); \
1191 VTKKWRCHelper_InitializeVariablesShade(); \
1192 VTKKWRCHelper_InitializeVariablesGO(); \
1193 VTKKWRCHelper_InitializeTrilinVariables(); \
1194 VTKKWRCHelper_InitializeTrilinVariablesShade(); \
1195 VTKKWRCHelper_InitializeTrilinVariablesGO(); \
1196 for (j = 0; j < imageInUseSize[1]; j++) \
1198 VTKKWRCHelper_OuterInitialization(); \
1199 for (i = rowBounds[j * 2]; i <= rowBounds[j * 2 + 1]; i++) \
1201 VTKKWRCHelper_InnerInitialization();
1203#define VTKKWRCHelper_IncrementAndLoopEnd() \
1206 if ((j / threadCount) % 8 == 7 && threadID == 0) \
1209 fargs[0] = static_cast<double>(j) / static_cast<float>(imageInUseSize[1] - 1); \
1210 mapper->InvokeEvent(vtkCommand::VolumeMapperRenderProgressEvent, fargs); \
1214#define VTKKWRCHelper_CroppingCheckTrilin(POS) \
1217 if (mapper->CheckIfCropped(POS)) \
1223#define VTKKWRCHelper_CroppingCheckNN(POS) \
1226 if (mapper->CheckIfCropped(POS)) \
1232#define VTKKWRCHelper_SpaceLeapSetup() \
1233 unsigned int mmpos[3]; \
1234 mmpos[0] = (pos[0] >> VTKKW_FPMM_SHIFT) + 1; \
1239#define VTKKWRCHelper_SpaceLeapSetupMulti() \
1240 unsigned int mmpos[3]; \
1241 mmpos[0] = (pos[0] >> VTKKW_FPMM_SHIFT) + 1; \
1244 int mmvalid[4] = { 0, 0, 0, 0 };
1246#define VTKKWRCHelper_SpaceLeapCheck() \
1247 if (pos[0] >> VTKKW_FPMM_SHIFT != mmpos[0] || pos[1] >> VTKKW_FPMM_SHIFT != mmpos[1] || \
1248 pos[2] >> VTKKW_FPMM_SHIFT != mmpos[2]) \
1250 mmpos[0] = pos[0] >> VTKKW_FPMM_SHIFT; \
1251 mmpos[1] = pos[1] >> VTKKW_FPMM_SHIFT; \
1252 mmpos[2] = pos[2] >> VTKKW_FPMM_SHIFT; \
1253 mmvalid = mapper->CheckMinMaxVolumeFlag(mmpos, 0); \
1261#define VTKKWRCHelper_MIPSpaceLeapCheck(MAXIDX, MAXIDXDEF, FLIP) \
1262 if (pos[0] >> VTKKW_FPMM_SHIFT != mmpos[0] || pos[1] >> VTKKW_FPMM_SHIFT != mmpos[1] || \
1263 pos[2] >> VTKKW_FPMM_SHIFT != mmpos[2]) \
1265 mmpos[0] = pos[0] >> VTKKW_FPMM_SHIFT; \
1266 mmpos[1] = pos[1] >> VTKKW_FPMM_SHIFT; \
1267 mmpos[2] = pos[2] >> VTKKW_FPMM_SHIFT; \
1268 mmvalid = (MAXIDXDEF) ? (mapper->CheckMIPMinMaxVolumeFlag(mmpos, 0, MAXIDX, FLIP)) : (1); \
1276#define VTKKWRCHelper_MIPSpaceLeapPopulateMulti(MAXIDX, FLIP) \
1277 if (pos[0] >> VTKKW_FPMM_SHIFT != mmpos[0] || pos[1] >> VTKKW_FPMM_SHIFT != mmpos[1] || \
1278 pos[2] >> VTKKW_FPMM_SHIFT != mmpos[2]) \
1280 mmpos[0] = pos[0] >> VTKKW_FPMM_SHIFT; \
1281 mmpos[1] = pos[1] >> VTKKW_FPMM_SHIFT; \
1282 mmpos[2] = pos[2] >> VTKKW_FPMM_SHIFT; \
1283 for (c = 0; c < components; c++) \
1285 mmvalid[c] = mapper->CheckMIPMinMaxVolumeFlag(mmpos, c, MAXIDX[c], FLIP); \
1289#define VTKKWRCHelper_MIPSpaceLeapCheckMulti(COMP, FLIP) mmvalid[COMP]
1292#include "vtkRenderingVolumeModule.h"
An abstract helper that generates images for the volume ray cast mapper.
~vtkFixedPointVolumeRayCastHelper() override
vtkFixedPointVolumeRayCastHelper()
virtual void GenerateImage(int, int, vtkVolume *, vtkFixedPointVolumeRayCastMapper *)
static vtkFixedPointVolumeRayCastHelper * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
A fixed point mapper for volumes.
a simple class to control print indentation
abstract base class for most VTK objects
represents a volume (data & properties) in a rendered scene