14#ifndef vtkFixedPointVolumeRayCastHelper_h
15#define vtkFixedPointVolumeRayCastHelper_h
17#define VTKKWRCHelper_GetCellScalarValues(DATA, SCALE, SHIFT) \
18 A = static_cast<unsigned int>(SCALE * (*(DATA) + SHIFT)); \
19 B = static_cast<unsigned int>(SCALE * (*(DATA + Binc) + SHIFT)); \
20 C = static_cast<unsigned int>(SCALE * (*(DATA + Cinc) + SHIFT)); \
21 D = static_cast<unsigned int>(SCALE * (*(DATA + Dinc) + SHIFT)); \
22 E = static_cast<unsigned int>(SCALE * (*(DATA + Einc) + SHIFT)); \
23 F = static_cast<unsigned int>(SCALE * (*(DATA + Finc) + SHIFT)); \
24 G = static_cast<unsigned int>(SCALE * (*(DATA + Ginc) + SHIFT)); \
25 H = static_cast<unsigned int>(SCALE * (*(DATA + Hinc) + SHIFT));
27#define VTKKWRCHelper_GetCellScalarValuesSimple(DATA) \
28 A = static_cast<unsigned int>(*(DATA)); \
29 B = static_cast<unsigned int>(*(DATA + Binc)); \
30 C = static_cast<unsigned int>(*(DATA + Cinc)); \
31 D = static_cast<unsigned int>(*(DATA + Dinc)); \
32 E = static_cast<unsigned int>(*(DATA + Einc)); \
33 F = static_cast<unsigned int>(*(DATA + Finc)); \
34 G = static_cast<unsigned int>(*(DATA + Ginc)); \
35 H = static_cast<unsigned int>(*(DATA + Hinc));
37#define VTKKWRCHelper_GetCellMagnitudeValues(ABCD, EFGH) \
38 mA = static_cast<unsigned int>(*(ABCD)); \
39 mB = static_cast<unsigned int>(*(ABCD + mBFinc)); \
40 mC = static_cast<unsigned int>(*(ABCD + mCGinc)); \
41 mD = static_cast<unsigned int>(*(ABCD + mDHinc)); \
42 mE = static_cast<unsigned int>(*(EFGH)); \
43 mF = static_cast<unsigned int>(*(EFGH + mBFinc)); \
44 mG = static_cast<unsigned int>(*(EFGH + mCGinc)); \
45 mH = static_cast<unsigned int>(*(EFGH + mDHinc));
47#define VTKKWRCHelper_GetCellDirectionValues(ABCD, EFGH) \
48 normalA = static_cast<unsigned int>(*(ABCD)); \
49 normalB = static_cast<unsigned int>(*(ABCD + dBFinc)); \
50 normalC = static_cast<unsigned int>(*(ABCD + dCGinc)); \
51 normalD = static_cast<unsigned int>(*(ABCD + dDHinc)); \
52 normalE = static_cast<unsigned int>(*(EFGH)); \
53 normalF = static_cast<unsigned int>(*(EFGH + dBFinc)); \
54 normalG = static_cast<unsigned int>(*(EFGH + dCGinc)); \
55 normalH = static_cast<unsigned int>(*(EFGH + dDHinc));
57#define VTKKWRCHelper_GetCellComponentScalarValues(DATA, CIDX, SCALE, SHIFT) \
58 A[CIDX] = static_cast<unsigned int>(SCALE * (*(DATA) + SHIFT)); \
59 B[CIDX] = static_cast<unsigned int>(SCALE * (*(DATA + Binc) + SHIFT)); \
60 C[CIDX] = static_cast<unsigned int>(SCALE * (*(DATA + Cinc) + SHIFT)); \
61 D[CIDX] = static_cast<unsigned int>(SCALE * (*(DATA + Dinc) + SHIFT)); \
62 E[CIDX] = static_cast<unsigned int>(SCALE * (*(DATA + Einc) + SHIFT)); \
63 F[CIDX] = static_cast<unsigned int>(SCALE * (*(DATA + Finc) + SHIFT)); \
64 G[CIDX] = static_cast<unsigned int>(SCALE * (*(DATA + Ginc) + SHIFT)); \
65 H[CIDX] = static_cast<unsigned int>(SCALE * (*(DATA + Hinc) + SHIFT));
67#define VTKKWRCHelper_GetCellComponentRawScalarValues(DATA, CIDX) \
68 A[CIDX] = static_cast<unsigned int>((*(DATA))); \
69 B[CIDX] = static_cast<unsigned int>((*(DATA + Binc))); \
70 C[CIDX] = static_cast<unsigned int>((*(DATA + Cinc))); \
71 D[CIDX] = static_cast<unsigned int>((*(DATA + Dinc))); \
72 E[CIDX] = static_cast<unsigned int>((*(DATA + Einc))); \
73 F[CIDX] = static_cast<unsigned int>((*(DATA + Finc))); \
74 G[CIDX] = static_cast<unsigned int>((*(DATA + Ginc))); \
75 H[CIDX] = static_cast<unsigned int>((*(DATA + Hinc)));
77#define VTKKWRCHelper_GetCellComponentMagnitudeValues(ABCD, EFGH, CIDX) \
78 mA[CIDX] = static_cast<unsigned int>(*(ABCD)); \
79 mB[CIDX] = static_cast<unsigned int>(*(ABCD + mBFinc)); \
80 mC[CIDX] = static_cast<unsigned int>(*(ABCD + mCGinc)); \
81 mD[CIDX] = static_cast<unsigned int>(*(ABCD + mDHinc)); \
82 mE[CIDX] = static_cast<unsigned int>(*(EFGH)); \
83 mF[CIDX] = static_cast<unsigned int>(*(EFGH + mBFinc)); \
84 mG[CIDX] = static_cast<unsigned int>(*(EFGH + mCGinc)); \
85 mH[CIDX] = static_cast<unsigned int>(*(EFGH + mDHinc));
87#define VTKKWRCHelper_GetCellComponentDirectionValues(ABCD, EFGH, CIDX) \
88 normalA[CIDX] = static_cast<unsigned int>(*(ABCD)); \
89 normalB[CIDX] = static_cast<unsigned int>(*(ABCD + dBFinc)); \
90 normalC[CIDX] = static_cast<unsigned int>(*(ABCD + dCGinc)); \
91 normalD[CIDX] = static_cast<unsigned int>(*(ABCD + dDHinc)); \
92 normalE[CIDX] = static_cast<unsigned int>(*(EFGH)); \
93 normalF[CIDX] = static_cast<unsigned int>(*(EFGH + dBFinc)); \
94 normalG[CIDX] = static_cast<unsigned int>(*(EFGH + dCGinc)); \
95 normalH[CIDX] = static_cast<unsigned int>(*(EFGH + dDHinc));
97#define VTKKWRCHelper_ComputeWeights(POS) \
98 w2X = (POS[0] & VTKKW_FP_MASK); \
99 w2Y = (POS[1] & VTKKW_FP_MASK); \
100 w2Z = (POS[2] & VTKKW_FP_MASK); \
102 w1X = ((~w2X) & VTKKW_FP_MASK); \
103 w1Y = ((~w2Y) & VTKKW_FP_MASK); \
104 w1Z = ((~w2Z) & VTKKW_FP_MASK); \
106 w1Xw1Y = (0x4000 + (w1X * w1Y)) >> VTKKW_FP_SHIFT; \
107 w2Xw1Y = (0x4000 + (w2X * w1Y)) >> VTKKW_FP_SHIFT; \
108 w1Xw2Y = (0x4000 + (w1X * w2Y)) >> VTKKW_FP_SHIFT; \
109 w2Xw2Y = (0x4000 + (w2X * w2Y)) >> VTKKW_FP_SHIFT;
111#define VTKKWRCHelper_InterpolateScalar(VAL) \
113 ((A * ((0x4000 + w1Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
114 (B * ((0x4000 + w2Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
115 (C * ((0x4000 + w1Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
116 (D * ((0x4000 + w2Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
117 (E * ((0x4000 + w1Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
118 (F * ((0x4000 + w2Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
119 (G * ((0x4000 + w1Xw2Y * w2Z) >> VTKKW_FP_SHIFT)) + \
120 (H * ((0x4000 + w2Xw2Y * w2Z) >> VTKKW_FP_SHIFT)))) >> \
123#define VTKKWRCHelper_InterpolateMagnitude(VAL) \
125 ((mA * ((0x4000 + w1Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
126 (mB * ((0x4000 + w2Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
127 (mC * ((0x4000 + w1Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
128 (mD * ((0x4000 + w2Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
129 (mE * ((0x4000 + w1Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
130 (mF * ((0x4000 + w2Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
131 (mG * ((0x4000 + w1Xw2Y * w2Z) >> VTKKW_FP_SHIFT)) + \
132 (mH * ((0x4000 + w2Xw2Y * w2Z) >> VTKKW_FP_SHIFT)))) >> \
135#define VTKKWRCHelper_InterpolateScalarComponent(VAL, CIDX, COMPONENTS) \
136 for (CIDX = 0; CIDX < COMPONENTS; CIDX++) \
138 VAL[CIDX] = (0x7fff + \
139 ((A[CIDX] * ((0x4000 + w1Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
140 (B[CIDX] * ((0x4000 + w2Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
141 (C[CIDX] * ((0x4000 + w1Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
142 (D[CIDX] * ((0x4000 + w2Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
143 (E[CIDX] * ((0x4000 + w1Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
144 (F[CIDX] * ((0x4000 + w2Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
145 (G[CIDX] * ((0x4000 + w1Xw2Y * w2Z) >> VTKKW_FP_SHIFT)) + \
146 (H[CIDX] * ((0x4000 + w2Xw2Y * w2Z) >> VTKKW_FP_SHIFT)))) >> \
150#define VTKKWRCHelper_InterpolateMagnitudeComponent(VAL, CIDX, COMPONENTS) \
151 for (CIDX = 0; CIDX < COMPONENTS; CIDX++) \
153 VAL[CIDX] = (0x7fff + \
154 ((mA[CIDX] * ((0x4000 + w1Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
155 (mB[CIDX] * ((0x4000 + w2Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
156 (mC[CIDX] * ((0x4000 + w1Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
157 (mD[CIDX] * ((0x4000 + w2Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
158 (mE[CIDX] * ((0x4000 + w1Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
159 (mF[CIDX] * ((0x4000 + w2Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
160 (mG[CIDX] * ((0x4000 + w1Xw2Y * w2Z) >> VTKKW_FP_SHIFT)) + \
161 (mH[CIDX] * ((0x4000 + w2Xw2Y * w2Z) >> VTKKW_FP_SHIFT)))) >> \
165#define VTKKWRCHelper_InterpolateShading(DTABLE, STABLE, COLOR) \
166 unsigned int _tmpDColor[3]; \
167 unsigned int _tmpSColor[3]; \
169 _tmpDColor[0] = (0x7fff + \
170 ((DTABLE[3 * normalA] * ((0x4000 + w1Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
171 (DTABLE[3 * normalB] * ((0x4000 + w2Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
172 (DTABLE[3 * normalC] * ((0x4000 + w1Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
173 (DTABLE[3 * normalD] * ((0x4000 + w2Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
174 (DTABLE[3 * normalE] * ((0x4000 + w1Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
175 (DTABLE[3 * normalF] * ((0x4000 + w2Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
176 (DTABLE[3 * normalG] * ((0x4000 + w1Xw2Y * w2Z) >> VTKKW_FP_SHIFT)) + \
177 (DTABLE[3 * normalH] * ((0x4000 + w2Xw2Y * w2Z) >> VTKKW_FP_SHIFT)))) >> \
180 _tmpDColor[1] = (0x7fff + \
181 ((DTABLE[3 * normalA + 1] * ((0x4000 + w1Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
182 (DTABLE[3 * normalB + 1] * ((0x4000 + w2Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
183 (DTABLE[3 * normalC + 1] * ((0x4000 + w1Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
184 (DTABLE[3 * normalD + 1] * ((0x4000 + w2Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
185 (DTABLE[3 * normalE + 1] * ((0x4000 + w1Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
186 (DTABLE[3 * normalF + 1] * ((0x4000 + w2Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
187 (DTABLE[3 * normalG + 1] * ((0x4000 + w1Xw2Y * w2Z) >> VTKKW_FP_SHIFT)) + \
188 (DTABLE[3 * normalH + 1] * ((0x4000 + w2Xw2Y * w2Z) >> VTKKW_FP_SHIFT)))) >> \
191 _tmpDColor[2] = (0x7fff + \
192 ((DTABLE[3 * normalA + 2] * ((0x4000 + w1Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
193 (DTABLE[3 * normalB + 2] * ((0x4000 + w2Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
194 (DTABLE[3 * normalC + 2] * ((0x4000 + w1Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
195 (DTABLE[3 * normalD + 2] * ((0x4000 + w2Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
196 (DTABLE[3 * normalE + 2] * ((0x4000 + w1Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
197 (DTABLE[3 * normalF + 2] * ((0x4000 + w2Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
198 (DTABLE[3 * normalG + 2] * ((0x4000 + w1Xw2Y * w2Z) >> VTKKW_FP_SHIFT)) + \
199 (DTABLE[3 * normalH + 2] * ((0x4000 + w2Xw2Y * w2Z) >> VTKKW_FP_SHIFT)))) >> \
202 _tmpSColor[0] = (0x7fff + \
203 ((STABLE[3 * normalA] * ((0x4000 + w1Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
204 (STABLE[3 * normalB] * ((0x4000 + w2Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
205 (STABLE[3 * normalC] * ((0x4000 + w1Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
206 (STABLE[3 * normalD] * ((0x4000 + w2Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
207 (STABLE[3 * normalE] * ((0x4000 + w1Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
208 (STABLE[3 * normalF] * ((0x4000 + w2Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
209 (STABLE[3 * normalG] * ((0x4000 + w1Xw2Y * w2Z) >> VTKKW_FP_SHIFT)) + \
210 (STABLE[3 * normalH] * ((0x4000 + w2Xw2Y * w2Z) >> VTKKW_FP_SHIFT)))) >> \
213 _tmpSColor[1] = (0x7fff + \
214 ((STABLE[3 * normalA + 1] * ((0x4000 + w1Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
215 (STABLE[3 * normalB + 1] * ((0x4000 + w2Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
216 (STABLE[3 * normalC + 1] * ((0x4000 + w1Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
217 (STABLE[3 * normalD + 1] * ((0x4000 + w2Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
218 (STABLE[3 * normalE + 1] * ((0x4000 + w1Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
219 (STABLE[3 * normalF + 1] * ((0x4000 + w2Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
220 (STABLE[3 * normalG + 1] * ((0x4000 + w1Xw2Y * w2Z) >> VTKKW_FP_SHIFT)) + \
221 (STABLE[3 * normalH + 1] * ((0x4000 + w2Xw2Y * w2Z) >> VTKKW_FP_SHIFT)))) >> \
224 _tmpSColor[2] = (0x7fff + \
225 ((STABLE[3 * normalA + 2] * ((0x4000 + w1Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
226 (STABLE[3 * normalB + 2] * ((0x4000 + w2Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
227 (STABLE[3 * normalC + 2] * ((0x4000 + w1Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
228 (STABLE[3 * normalD + 2] * ((0x4000 + w2Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
229 (STABLE[3 * normalE + 2] * ((0x4000 + w1Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
230 (STABLE[3 * normalF + 2] * ((0x4000 + w2Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
231 (STABLE[3 * normalG + 2] * ((0x4000 + w1Xw2Y * w2Z) >> VTKKW_FP_SHIFT)) + \
232 (STABLE[3 * normalH + 2] * ((0x4000 + w2Xw2Y * w2Z) >> VTKKW_FP_SHIFT)))) >> \
235 COLOR[0] = static_cast<unsigned short>((_tmpDColor[0] * COLOR[0] + 0x7fff) >> VTKKW_FP_SHIFT); \
236 COLOR[1] = static_cast<unsigned short>((_tmpDColor[1] * COLOR[1] + 0x7fff) >> VTKKW_FP_SHIFT); \
237 COLOR[2] = static_cast<unsigned short>((_tmpDColor[2] * COLOR[2] + 0x7fff) >> VTKKW_FP_SHIFT); \
238 COLOR[0] += (_tmpSColor[0] * COLOR[3] + 0x7fff) >> VTKKW_FP_SHIFT; \
239 COLOR[1] += (_tmpSColor[1] * COLOR[3] + 0x7fff) >> VTKKW_FP_SHIFT; \
240 COLOR[2] += (_tmpSColor[2] * COLOR[3] + 0x7fff) >> VTKKW_FP_SHIFT;
242#define VTKKWRCHelper_InterpolateShadingComponent(DTABLE, STABLE, COLOR, CIDX) \
243 unsigned int _tmpDColor[3]; \
244 unsigned int _tmpSColor[3]; \
248 ((DTABLE[CIDX][3 * normalA[CIDX]] * ((0x4000 + w1Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
249 (DTABLE[CIDX][3 * normalB[CIDX]] * ((0x4000 + w2Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
250 (DTABLE[CIDX][3 * normalC[CIDX]] * ((0x4000 + w1Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
251 (DTABLE[CIDX][3 * normalD[CIDX]] * ((0x4000 + w2Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
252 (DTABLE[CIDX][3 * normalE[CIDX]] * ((0x4000 + w1Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
253 (DTABLE[CIDX][3 * normalF[CIDX]] * ((0x4000 + w2Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
254 (DTABLE[CIDX][3 * normalG[CIDX]] * ((0x4000 + w1Xw2Y * w2Z) >> VTKKW_FP_SHIFT)) + \
255 (DTABLE[CIDX][3 * normalH[CIDX]] * ((0x4000 + w2Xw2Y * w2Z) >> VTKKW_FP_SHIFT)))) >> \
260 ((DTABLE[CIDX][3 * normalA[CIDX] + 1] * ((0x4000 + w1Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
261 (DTABLE[CIDX][3 * normalB[CIDX] + 1] * ((0x4000 + w2Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
262 (DTABLE[CIDX][3 * normalC[CIDX] + 1] * ((0x4000 + w1Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
263 (DTABLE[CIDX][3 * normalD[CIDX] + 1] * ((0x4000 + w2Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
264 (DTABLE[CIDX][3 * normalE[CIDX] + 1] * ((0x4000 + w1Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
265 (DTABLE[CIDX][3 * normalF[CIDX] + 1] * ((0x4000 + w2Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
266 (DTABLE[CIDX][3 * normalG[CIDX] + 1] * ((0x4000 + w1Xw2Y * w2Z) >> VTKKW_FP_SHIFT)) + \
267 (DTABLE[CIDX][3 * normalH[CIDX] + 1] * ((0x4000 + w2Xw2Y * w2Z) >> VTKKW_FP_SHIFT)))) >> \
272 ((DTABLE[CIDX][3 * normalA[CIDX] + 2] * ((0x4000 + w1Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
273 (DTABLE[CIDX][3 * normalB[CIDX] + 2] * ((0x4000 + w2Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
274 (DTABLE[CIDX][3 * normalC[CIDX] + 2] * ((0x4000 + w1Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
275 (DTABLE[CIDX][3 * normalD[CIDX] + 2] * ((0x4000 + w2Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
276 (DTABLE[CIDX][3 * normalE[CIDX] + 2] * ((0x4000 + w1Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
277 (DTABLE[CIDX][3 * normalF[CIDX] + 2] * ((0x4000 + w2Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
278 (DTABLE[CIDX][3 * normalG[CIDX] + 2] * ((0x4000 + w1Xw2Y * w2Z) >> VTKKW_FP_SHIFT)) + \
279 (DTABLE[CIDX][3 * normalH[CIDX] + 2] * ((0x4000 + w2Xw2Y * w2Z) >> VTKKW_FP_SHIFT)))) >> \
284 ((STABLE[CIDX][3 * normalA[CIDX]] * ((0x4000 + w1Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
285 (STABLE[CIDX][3 * normalB[CIDX]] * ((0x4000 + w2Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
286 (STABLE[CIDX][3 * normalC[CIDX]] * ((0x4000 + w1Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
287 (STABLE[CIDX][3 * normalD[CIDX]] * ((0x4000 + w2Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
288 (STABLE[CIDX][3 * normalE[CIDX]] * ((0x4000 + w1Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
289 (STABLE[CIDX][3 * normalF[CIDX]] * ((0x4000 + w2Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
290 (STABLE[CIDX][3 * normalG[CIDX]] * ((0x4000 + w1Xw2Y * w2Z) >> VTKKW_FP_SHIFT)) + \
291 (STABLE[CIDX][3 * normalH[CIDX]] * ((0x4000 + w2Xw2Y * w2Z) >> VTKKW_FP_SHIFT)))) >> \
296 ((STABLE[CIDX][3 * normalA[CIDX] + 1] * ((0x4000 + w1Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
297 (STABLE[CIDX][3 * normalB[CIDX] + 1] * ((0x4000 + w2Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
298 (STABLE[CIDX][3 * normalC[CIDX] + 1] * ((0x4000 + w1Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
299 (STABLE[CIDX][3 * normalD[CIDX] + 1] * ((0x4000 + w2Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
300 (STABLE[CIDX][3 * normalE[CIDX] + 1] * ((0x4000 + w1Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
301 (STABLE[CIDX][3 * normalF[CIDX] + 1] * ((0x4000 + w2Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
302 (STABLE[CIDX][3 * normalG[CIDX] + 1] * ((0x4000 + w1Xw2Y * w2Z) >> VTKKW_FP_SHIFT)) + \
303 (STABLE[CIDX][3 * normalH[CIDX] + 1] * ((0x4000 + w2Xw2Y * w2Z) >> VTKKW_FP_SHIFT)))) >> \
308 ((STABLE[CIDX][3 * normalA[CIDX] + 2] * ((0x4000 + w1Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
309 (STABLE[CIDX][3 * normalB[CIDX] + 2] * ((0x4000 + w2Xw1Y * w1Z) >> VTKKW_FP_SHIFT)) + \
310 (STABLE[CIDX][3 * normalC[CIDX] + 2] * ((0x4000 + w1Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
311 (STABLE[CIDX][3 * normalD[CIDX] + 2] * ((0x4000 + w2Xw2Y * w1Z) >> VTKKW_FP_SHIFT)) + \
312 (STABLE[CIDX][3 * normalE[CIDX] + 2] * ((0x4000 + w1Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
313 (STABLE[CIDX][3 * normalF[CIDX] + 2] * ((0x4000 + w2Xw1Y * w2Z) >> VTKKW_FP_SHIFT)) + \
314 (STABLE[CIDX][3 * normalG[CIDX] + 2] * ((0x4000 + w1Xw2Y * w2Z) >> VTKKW_FP_SHIFT)) + \
315 (STABLE[CIDX][3 * normalH[CIDX] + 2] * ((0x4000 + w2Xw2Y * w2Z) >> VTKKW_FP_SHIFT)))) >> \
318 COLOR[0] = static_cast<unsigned short>((_tmpDColor[0] * COLOR[0] + 0x7fff) >> VTKKW_FP_SHIFT); \
319 COLOR[1] = static_cast<unsigned short>((_tmpDColor[1] * COLOR[1] + 0x7fff) >> VTKKW_FP_SHIFT); \
320 COLOR[2] = static_cast<unsigned short>((_tmpDColor[2] * COLOR[2] + 0x7fff) >> VTKKW_FP_SHIFT); \
321 COLOR[0] += (_tmpSColor[0] * COLOR[3] + 0x7fff) >> VTKKW_FP_SHIFT; \
322 COLOR[1] += (_tmpSColor[1] * COLOR[3] + 0x7fff) >> VTKKW_FP_SHIFT; \
323 COLOR[2] += (_tmpSColor[2] * COLOR[3] + 0x7fff) >> VTKKW_FP_SHIFT;
325#define VTKKWRCHelper_LookupColorUS(COLORTABLE, SCALAROPACITYTABLE, IDX, COLOR) \
326 COLOR[3] = SCALAROPACITYTABLE[IDX]; \
332 static_cast<unsigned short>((COLORTABLE[3 * IDX] * COLOR[3] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
333 COLOR[1] = static_cast<unsigned short>( \
334 (COLORTABLE[3 * IDX + 1] * COLOR[3] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
335 COLOR[2] = static_cast<unsigned short>( \
336 (COLORTABLE[3 * IDX + 2] * COLOR[3] + 0x7fff) >> (VTKKW_FP_SHIFT));
338#define VTKKWRCHelper_LookupColorMax(COLORTABLE, SCALAROPACITYTABLE, IDX, COLOR) \
339 COLOR[3] = SCALAROPACITYTABLE[IDX]; \
341 static_cast<unsigned short>((COLORTABLE[3 * IDX] * COLOR[3] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
342 COLOR[1] = static_cast<unsigned short>( \
343 (COLORTABLE[3 * IDX + 1] * COLOR[3] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
344 COLOR[2] = static_cast<unsigned short>( \
345 (COLORTABLE[3 * IDX + 2] * COLOR[3] + 0x7fff) >> (VTKKW_FP_SHIFT));
347#define VTKKWRCHelper_LookupDependentColorUS(COLORTABLE, SCALAROPACITYTABLE, IDX, CMPS, COLOR) \
349 unsigned short _alpha; \
353 _alpha = SCALAROPACITYTABLE[IDX[1]]; \
354 COLOR[0] = static_cast<unsigned short>( \
355 (COLORTABLE[3 * IDX[0]] * _alpha + 0x7fff) >> (VTKKW_FP_SHIFT)); \
356 COLOR[1] = static_cast<unsigned short>( \
357 (COLORTABLE[3 * IDX[0] + 1] * _alpha + 0x7fff) >> (VTKKW_FP_SHIFT)); \
358 COLOR[2] = static_cast<unsigned short>( \
359 (COLORTABLE[3 * IDX[0] + 2] * _alpha + 0x7fff) >> (VTKKW_FP_SHIFT)); \
363 _alpha = SCALAROPACITYTABLE[IDX[3]]; \
364 COLOR[0] = static_cast<unsigned short>((IDX[0] * _alpha + 0x7f) >> 8); \
365 COLOR[1] = static_cast<unsigned short>((IDX[1] * _alpha + 0x7f) >> 8); \
366 COLOR[2] = static_cast<unsigned short>((IDX[2] * _alpha + 0x7f) >> 8); \
372#define VTKKWRCHelper_LookupColorGOUS(CTABLE, SOTABLE, GOTABLE, IDX, IDX2, COLOR) \
373 COLOR[3] = (SOTABLE[IDX] * GOTABLE[IDX2] + 0x7fff) >> VTKKW_FP_SHIFT; \
379 static_cast<unsigned short>((CTABLE[3 * IDX] * COLOR[3] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
381 static_cast<unsigned short>((CTABLE[3 * IDX + 1] * COLOR[3] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
383 static_cast<unsigned short>((CTABLE[3 * IDX + 2] * COLOR[3] + 0x7fff) >> (VTKKW_FP_SHIFT));
385#define VTKKWRCHelper_LookupShading(DTABLE, STABLE, NORMAL, COLOR) \
387 static_cast<unsigned short>((DTABLE[3 * NORMAL] * COLOR[0] + 0x7fff) >> VTKKW_FP_SHIFT); \
389 static_cast<unsigned short>((DTABLE[3 * NORMAL + 1] * COLOR[1] + 0x7fff) >> VTKKW_FP_SHIFT); \
391 static_cast<unsigned short>((DTABLE[3 * NORMAL + 2] * COLOR[2] + 0x7fff) >> VTKKW_FP_SHIFT); \
392 COLOR[0] += (STABLE[3 * NORMAL] * COLOR[3] + 0x7fff) >> VTKKW_FP_SHIFT; \
393 COLOR[1] += (STABLE[3 * NORMAL + 1] * COLOR[3] + 0x7fff) >> VTKKW_FP_SHIFT; \
394 COLOR[2] += (STABLE[3 * NORMAL + 2] * COLOR[3] + 0x7fff) >> VTKKW_FP_SHIFT;
396#define VTKKWRCHelper_LookupAndCombineIndependentColorsUS( \
397 COLORTABLE, SOTABLE, SCALAR, WEIGHTS, COMPONENTS, COLOR) \
398 unsigned int _tmp[4] = { 0, 0, 0, 0 }; \
399 unsigned short _alpha[4] = { 0, 0, 0, 0 }; \
400 unsigned int _totalAlpha = 0; \
403 for (int _idx = 0; _idx < COMPONENTS; _idx++) \
405 _alpha[_idx] = static_cast<unsigned short>(SOTABLE[_idx][SCALAR[_idx]] * WEIGHTS[_idx]); \
406 _totalAlpha += _alpha[_idx]; \
415 for (int _idx = 0; _idx < COMPONENTS; _idx++) \
419 _tmp[0] += static_cast<unsigned short>( \
420 ((COLORTABLE[_idx][3 * SCALAR[_idx]]) * _alpha[_idx] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
421 _tmp[1] += static_cast<unsigned short>( \
422 ((COLORTABLE[_idx][3 * SCALAR[_idx] + 1]) * _alpha[_idx] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
423 _tmp[2] += static_cast<unsigned short>( \
424 ((COLORTABLE[_idx][3 * SCALAR[_idx] + 2]) * _alpha[_idx] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
425 _tmp[3] += ((_alpha[_idx] * _alpha[_idx]) / _totalAlpha); \
433 COLOR[0] = (_tmp[0] > 32767) ? (32767) : (_tmp[0]); \
434 COLOR[1] = (_tmp[1] > 32767) ? (32767) : (_tmp[1]); \
435 COLOR[2] = (_tmp[2] > 32767) ? (32767) : (_tmp[2]); \
436 COLOR[3] = (_tmp[3] > 32767) ? (32767) : (_tmp[3]);
438#define VTKKWRCHelper_LookupAndCombineIndependentColorsMax( \
439 COLORTABLE, SCALAROPACITYTABLE, IDX, WEIGHTS, CMPS, COLOR) \
441 unsigned int _tmp[4] = { 0, 0, 0, 0 }; \
442 for (int _idx = 0; _idx < CMPS; _idx++) \
444 unsigned short _alpha = \
445 static_cast<unsigned short>(SCALAROPACITYTABLE[_idx][IDX[_idx]] * WEIGHTS[_idx]); \
446 _tmp[0] += static_cast<unsigned short>( \
447 ((COLORTABLE[_idx][3 * IDX[_idx]]) * _alpha + 0x7fff) >> (VTKKW_FP_SHIFT)); \
448 _tmp[1] += static_cast<unsigned short>( \
449 ((COLORTABLE[_idx][3 * IDX[_idx] + 1]) * _alpha + 0x7fff) >> (VTKKW_FP_SHIFT)); \
450 _tmp[2] += static_cast<unsigned short>( \
451 ((COLORTABLE[_idx][3 * IDX[_idx] + 2]) * _alpha + 0x7fff) >> (VTKKW_FP_SHIFT)); \
454 COLOR[0] = (_tmp[0] > 32767) ? (32767) : (_tmp[0]); \
455 COLOR[1] = (_tmp[1] > 32767) ? (32767) : (_tmp[1]); \
456 COLOR[2] = (_tmp[2] > 32767) ? (32767) : (_tmp[2]); \
457 COLOR[3] = (_tmp[3] > 32767) ? (32767) : (_tmp[3]); \
460#define VTKKWRCHelper_LookupAndCombineIndependentColorsGOUS( \
461 COLORTABLE, SOTABLE, GOTABLE, SCALAR, MAG, WEIGHTS, COMPONENTS, COLOR) \
462 unsigned int _tmp[4] = { 0, 0, 0, 0 }; \
463 unsigned short _alpha[4] = { 0, 0, 0, 0 }; \
464 unsigned int _totalAlpha = 0; \
465 COMPONENTS = (COMPONENTS < 4) ? COMPONENTS : 4; \
467 for (int _idx = 0; _idx < COMPONENTS; _idx++) \
469 _alpha[_idx] = static_cast<unsigned short>(SOTABLE[_idx][SCALAR[_idx]] * WEIGHTS[_idx]); \
472 _alpha[_idx] = static_cast<unsigned short>( \
473 (_alpha[_idx] * GOTABLE[_idx][MAG[_idx]] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
474 _totalAlpha += _alpha[_idx]; \
484 for (int _idx = 0; _idx < COMPONENTS; _idx++) \
488 _tmp[0] += static_cast<unsigned short>( \
489 ((COLORTABLE[_idx][3 * SCALAR[_idx]]) * _alpha[_idx] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
490 _tmp[1] += static_cast<unsigned short>( \
491 ((COLORTABLE[_idx][3 * SCALAR[_idx] + 1]) * _alpha[_idx] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
492 _tmp[2] += static_cast<unsigned short>( \
493 ((COLORTABLE[_idx][3 * SCALAR[_idx] + 2]) * _alpha[_idx] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
494 _tmp[3] += ((_alpha[_idx] * _alpha[_idx]) / _totalAlpha); \
502 COLOR[0] = (_tmp[0] > 32767) ? (32767) : (_tmp[0]); \
503 COLOR[1] = (_tmp[1] > 32767) ? (32767) : (_tmp[1]); \
504 COLOR[2] = (_tmp[2] > 32767) ? (32767) : (_tmp[2]); \
505 COLOR[3] = (_tmp[3] > 32767) ? (32767) : (_tmp[3]);
507#define VTKKWRCHelper_LookupAndCombineIndependentColorsShadeUS( \
508 COLORTABLE, SOTABLE, DTABLE, STABLE, SCALAR, NORMAL, WEIGHTS, COMPONENTS, COLOR) \
509 unsigned int _tmp[4] = { 0, 0, 0, 0 }; \
510 unsigned int _tmpC[3]; \
511 unsigned short _alpha[4] = { 0, 0, 0, 0 }; \
512 unsigned int _totalAlpha = 0; \
515 for (int _idx = 0; _idx < COMPONENTS; _idx++) \
517 _alpha[_idx] = static_cast<unsigned short>(SOTABLE[_idx][SCALAR[_idx]] * WEIGHTS[_idx]); \
518 _totalAlpha += _alpha[_idx]; \
527 for (int _idx = 0; _idx < COMPONENTS; _idx++) \
531 _tmpC[0] = static_cast<unsigned short>( \
532 ((COLORTABLE[_idx][3 * SCALAR[_idx]]) * _alpha[_idx] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
533 _tmpC[1] = static_cast<unsigned short>( \
534 ((COLORTABLE[_idx][3 * SCALAR[_idx] + 1]) * _alpha[_idx] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
535 _tmpC[2] = static_cast<unsigned short>( \
536 ((COLORTABLE[_idx][3 * SCALAR[_idx] + 2]) * _alpha[_idx] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
537 _tmpC[0] = static_cast<unsigned short>( \
538 (DTABLE[_idx][3 * NORMAL[_idx]] * _tmpC[0] + 0x7fff) >> VTKKW_FP_SHIFT); \
539 _tmpC[1] = static_cast<unsigned short>( \
540 (DTABLE[_idx][3 * NORMAL[_idx] + 1] * _tmpC[1] + 0x7fff) >> VTKKW_FP_SHIFT); \
541 _tmpC[2] = static_cast<unsigned short>( \
542 (DTABLE[_idx][3 * NORMAL[_idx] + 2] * _tmpC[2] + 0x7fff) >> VTKKW_FP_SHIFT); \
543 _tmpC[0] += (STABLE[_idx][3 * NORMAL[_idx]] * _alpha[_idx] + 0x7fff) >> VTKKW_FP_SHIFT; \
545 (STABLE[_idx][3 * NORMAL[_idx] + 1] * _alpha[_idx] + 0x7fff) >> VTKKW_FP_SHIFT; \
547 (STABLE[_idx][3 * NORMAL[_idx] + 2] * _alpha[_idx] + 0x7fff) >> VTKKW_FP_SHIFT; \
548 _tmp[0] += _tmpC[0]; \
549 _tmp[1] += _tmpC[1]; \
550 _tmp[2] += _tmpC[2]; \
551 _tmp[3] += ((_alpha[_idx] * _alpha[_idx]) / _totalAlpha); \
560 COLOR[0] = (_tmp[0] > 32767) ? (32767) : (_tmp[0]); \
561 COLOR[1] = (_tmp[1] > 32767) ? (32767) : (_tmp[1]); \
562 COLOR[2] = (_tmp[2] > 32767) ? (32767) : (_tmp[2]); \
563 COLOR[3] = (_tmp[3] > 32767) ? (32767) : (_tmp[3]);
565#define VTKKWRCHelper_LookupAndCombineIndependentColorsInterpolateShadeUS( \
566 COLORTABLE, SOTABLE, DTABLE, STABLE, SCALAR, WEIGHTS, COMPONENTS, COLOR) \
567 unsigned int _tmp[4] = { 0, 0, 0, 0 }; \
568 unsigned int _tmpC[4]; \
569 unsigned short _alpha[4] = { 0, 0, 0, 0 }; \
570 unsigned int _totalAlpha = 0; \
573 for (int _idx = 0; _idx < COMPONENTS; _idx++) \
575 _alpha[_idx] = static_cast<unsigned short>(SOTABLE[_idx][SCALAR[_idx]] * WEIGHTS[_idx]); \
576 _totalAlpha += _alpha[_idx]; \
585 for (int _idx = 0; _idx < COMPONENTS; _idx++) \
589 _tmpC[0] = static_cast<unsigned short>( \
590 ((COLORTABLE[_idx][3 * SCALAR[_idx]]) * _alpha[_idx] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
591 _tmpC[1] = static_cast<unsigned short>( \
592 ((COLORTABLE[_idx][3 * SCALAR[_idx] + 1]) * _alpha[_idx] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
593 _tmpC[2] = static_cast<unsigned short>( \
594 ((COLORTABLE[_idx][3 * SCALAR[_idx] + 2]) * _alpha[_idx] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
595 _tmpC[3] = _alpha[_idx]; \
596 VTKKWRCHelper_InterpolateShadingComponent(DTABLE, STABLE, _tmpC, _idx) \
597 _tmp[0] += _tmpC[0]; \
598 _tmp[1] += _tmpC[1]; \
599 _tmp[2] += _tmpC[2]; \
600 _tmp[3] += ((_alpha[_idx] * _alpha[_idx]) / _totalAlpha); \
608 COLOR[0] = (_tmp[0] > 32767) ? (32767) : (_tmp[0]); \
609 COLOR[1] = (_tmp[1] > 32767) ? (32767) : (_tmp[1]); \
610 COLOR[2] = (_tmp[2] > 32767) ? (32767) : (_tmp[2]); \
611 COLOR[3] = (_tmp[3] > 32767) ? (32767) : (_tmp[3]);
613#define VTKKWRCHelper_CompositeColorAndCheckEarlyTermination(COLOR, TMP, REMAININGOPACITY) \
614 COLOR[0] += (TMP[0] * REMAININGOPACITY + 0x7fff) >> VTKKW_FP_SHIFT; \
615 COLOR[1] += (TMP[1] * REMAININGOPACITY + 0x7fff) >> VTKKW_FP_SHIFT; \
616 COLOR[2] += (TMP[2] * REMAININGOPACITY + 0x7fff) >> VTKKW_FP_SHIFT; \
618 (REMAININGOPACITY * ((~(TMP[3]) & VTKKW_FP_MASK)) + 0x7fff) >> VTKKW_FP_SHIFT; \
619 if (REMAININGOPACITY < 0xff) \
624#define VTKKWRCHelper_LookupAndCombineIndependentColorsGOShadeUS( \
625 COLORTABLE, SOTABLE, GOTABLE, DTABLE, STABLE, SCALAR, MAG, NORMAL, WEIGHTS, COMPONENTS, COLOR) \
626 unsigned int _tmp[4] = { 0, 0, 0, 0 }; \
627 unsigned int _tmpC[3]; \
628 unsigned short _alpha[4] = { 0, 0, 0, 0 }; \
629 unsigned int _totalAlpha = 0; \
632 for (int _idx = 0; _idx < COMPONENTS; _idx++) \
634 _alpha[_idx] = static_cast<unsigned short>(SOTABLE[_idx][SCALAR[_idx]] * WEIGHTS[_idx]); \
637 _alpha[_idx] = static_cast<unsigned short>( \
638 (_alpha[_idx] * GOTABLE[_idx][MAG[_idx]] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
639 _totalAlpha += _alpha[_idx]; \
650 for (int _idx = 0; _idx < COMPONENTS; _idx++) \
654 _tmpC[0] = static_cast<unsigned short>( \
655 ((COLORTABLE[_idx][3 * SCALAR[_idx]]) * _alpha[_idx] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
656 _tmpC[1] = static_cast<unsigned short>( \
657 ((COLORTABLE[_idx][3 * SCALAR[_idx] + 1]) * _alpha[_idx] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
658 _tmpC[2] = static_cast<unsigned short>( \
659 ((COLORTABLE[_idx][3 * SCALAR[_idx] + 2]) * _alpha[_idx] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
660 _tmpC[0] = static_cast<unsigned short>( \
661 (DTABLE[_idx][3 * NORMAL[_idx]] * _tmpC[0] + 0x7fff) >> VTKKW_FP_SHIFT); \
662 _tmpC[1] = static_cast<unsigned short>( \
663 (DTABLE[_idx][3 * NORMAL[_idx] + 1] * _tmpC[1] + 0x7fff) >> VTKKW_FP_SHIFT); \
664 _tmpC[2] = static_cast<unsigned short>( \
665 (DTABLE[_idx][3 * NORMAL[_idx] + 2] * _tmpC[2] + 0x7fff) >> VTKKW_FP_SHIFT); \
666 _tmpC[0] += (STABLE[_idx][3 * NORMAL[_idx]] * _alpha[_idx] + 0x7fff) >> VTKKW_FP_SHIFT; \
668 (STABLE[_idx][3 * NORMAL[_idx] + 1] * _alpha[_idx] + 0x7fff) >> VTKKW_FP_SHIFT; \
670 (STABLE[_idx][3 * NORMAL[_idx] + 2] * _alpha[_idx] + 0x7fff) >> VTKKW_FP_SHIFT; \
671 _tmp[0] += _tmpC[0]; \
672 _tmp[1] += _tmpC[1]; \
673 _tmp[2] += _tmpC[2]; \
674 _tmp[3] += ((_alpha[_idx] * _alpha[_idx]) / _totalAlpha); \
682 COLOR[0] = (_tmp[0] > 32767) ? (32767) : (_tmp[0]); \
683 COLOR[1] = (_tmp[1] > 32767) ? (32767) : (_tmp[1]); \
684 COLOR[2] = (_tmp[2] > 32767) ? (32767) : (_tmp[2]); \
685 COLOR[3] = (_tmp[3] > 32767) ? (32767) : (_tmp[3]);
687#define VTKKWRCHelper_LookupAndCombineIndependentColorsGOInterpolateShadeUS( \
688 COLORTABLE, SOTABLE, GOTABLE, DTABLE, STABLE, SCALAR, MAG, WEIGHTS, COMPONENTS, COLOR) \
689 unsigned int _tmp[4] = { 0, 0, 0, 0 }; \
690 unsigned int _tmpC[4]; \
691 unsigned short _alpha[4] = { 0, 0, 0, 0 }; \
692 unsigned int _totalAlpha = 0; \
695 for (int _idx = 0; _idx < COMPONENTS; _idx++) \
697 _alpha[_idx] = static_cast<unsigned short>(SOTABLE[_idx][SCALAR[_idx]] * WEIGHTS[_idx]); \
700 _alpha[_idx] = static_cast<unsigned short>( \
701 (_alpha[_idx] * GOTABLE[_idx][MAG[_idx]] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
702 _totalAlpha += _alpha[_idx]; \
712 for (int _idx = 0; _idx < COMPONENTS; _idx++) \
716 _tmpC[0] = static_cast<unsigned short>( \
717 ((COLORTABLE[_idx][3 * SCALAR[_idx]]) * _alpha[_idx] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
718 _tmpC[1] = static_cast<unsigned short>( \
719 ((COLORTABLE[_idx][3 * SCALAR[_idx] + 1]) * _alpha[_idx] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
720 _tmpC[2] = static_cast<unsigned short>( \
721 ((COLORTABLE[_idx][3 * SCALAR[_idx] + 2]) * _alpha[_idx] + 0x7fff) >> (VTKKW_FP_SHIFT)); \
722 _tmpC[3] = _alpha[_idx]; \
723 VTKKWRCHelper_InterpolateShadingComponent(DTABLE, STABLE, _tmpC, _idx) \
724 _tmp[0] += _tmpC[0]; \
725 _tmp[1] += _tmpC[1]; \
726 _tmp[2] += _tmpC[2]; \
727 _tmp[3] += ((_alpha[_idx] * _alpha[_idx]) / _totalAlpha); \
735 COLOR[0] = (_tmp[0] > 32767) ? (32767) : (_tmp[0]); \
736 COLOR[1] = (_tmp[1] > 32767) ? (32767) : (_tmp[1]); \
737 COLOR[2] = (_tmp[2] > 32767) ? (32767) : (_tmp[2]); \
738 COLOR[3] = (_tmp[3] > 32767) ? (32767) : (_tmp[3]);
740#define VTKKWRCHelper_SetPixelColor(IMAGEPTR, COLOR, REMAININGOPACITY) \
741 IMAGEPTR[0] = (COLOR[0] > 32767) ? (32767) : (COLOR[0]); \
742 IMAGEPTR[1] = (COLOR[1] > 32767) ? (32767) : (COLOR[1]); \
743 IMAGEPTR[2] = (COLOR[2] > 32767) ? (32767) : (COLOR[2]); \
744 unsigned int tmpAlpha = (~REMAININGOPACITY) & VTKKW_FP_MASK; \
745 IMAGEPTR[3] = (tmpAlpha > 32767) ? (32767) : (tmpAlpha);
747#define VTKKWRCHelper_MoveToNextSampleNN \
748 if (k < numSteps - 1) \
750 mapper->FixedPointIncrement(pos, dir); \
751 mapper->ShiftVectorDown(pos, spos); \
752 dptr = data + spos[0] * inc[0] + spos[1] * inc[1] + spos[2] * inc[2]; \
755#define VTKKWRCHelper_MoveToNextSampleGONN \
756 if (k < numSteps - 1) \
758 mapper->FixedPointIncrement(pos, dir); \
759 mapper->ShiftVectorDown(pos, spos); \
760 dptr = data + spos[0] * inc[0] + spos[1] * inc[1] + spos[2] * inc[2]; \
761 magPtr = gradientMag[spos[2]] + spos[0] * mInc[0] + spos[1] * mInc[1]; \
764#define VTKKWRCHelper_MoveToNextSampleShadeNN \
765 if (k < numSteps - 1) \
767 mapper->FixedPointIncrement(pos, dir); \
768 mapper->ShiftVectorDown(pos, spos); \
769 dptr = data + spos[0] * inc[0] + spos[1] * inc[1] + spos[2] * inc[2]; \
770 dirPtr = gradientDir[spos[2]] + spos[0] * dInc[0] + spos[1] * dInc[1]; \
773#define VTKKWRCHelper_MoveToNextSampleGOShadeNN \
774 if (k < numSteps - 1) \
776 mapper->FixedPointIncrement(pos, dir); \
777 mapper->ShiftVectorDown(pos, spos); \
778 dptr = data + spos[0] * inc[0] + spos[1] * inc[1] + spos[2] * inc[2]; \
779 magPtr = gradientMag[spos[2]] + spos[0] * mInc[0] + spos[1] * mInc[1]; \
780 dirPtr = gradientDir[spos[2]] + spos[0] * dInc[0] + spos[1] * dInc[1]; \
783#define VTKKWRCHelper_InitializeVariables \
785 unsigned short* imagePtr; \
787 int imageInUseSize[2]; \
788 int imageMemorySize[2]; \
789 int imageViewportSize[2]; \
790 int imageOrigin[2]; \
795 mapper->GetRayCastImage()->GetImageInUseSize(imageInUseSize); \
796 mapper->GetRayCastImage()->GetImageMemorySize(imageMemorySize); \
797 mapper->GetRayCastImage()->GetImageViewportSize(imageViewportSize); \
798 mapper->GetRayCastImage()->GetImageOrigin(imageOrigin); \
799 vtkImageData* imData = vtkImageData::SafeDownCast(mapper->GetInput()); \
800 vtkRectilinearGrid* rGrid = vtkRectilinearGrid::SafeDownCast(mapper->GetInput()); \
803 imData->GetDimensions(dim); \
807 rGrid->GetDimensions(dim); \
809 mapper->GetTableShift(shift); \
810 mapper->GetTableScale(scale); \
812 int* rowBounds = mapper->GetRowBounds(); \
813 unsigned short* image = mapper->GetRayCastImage()->GetImage(); \
814 vtkRenderWindow* renWin = mapper->GetRenderWindow(); \
815 int components = 1; \
818 components = imData->GetNumberOfScalarComponents(); \
822 components = rGrid->GetNumberOfScalarComponents(); \
824 int cropping = (mapper->GetCropping() && mapper->GetCroppingRegionFlags() != 0x2000); \
826 components = (components < 4) ? components : 4; \
827 unsigned short* colorTable[4]; \
828 unsigned short* scalarOpacityTable[4]; \
831 for (c = 0; c < 4; c++) \
833 colorTable[c] = mapper->GetColorTable(c); \
834 (void)(colorTable[c]); \
835 scalarOpacityTable[c] = mapper->GetScalarOpacityTable(c); \
839 inc[0] = components; \
840 inc[1] = inc[0] * dim[0]; \
841 inc[2] = inc[1] * dim[1];
843#define VTKKWRCHelper_InitializeWeights \
844 float weights[4] = {}; \
845 weights[0] = vol->GetProperty()->GetComponentWeight(0); \
846 weights[1] = vol->GetProperty()->GetComponentWeight(1); \
847 weights[2] = vol->GetProperty()->GetComponentWeight(2); \
848 weights[3] = vol->GetProperty()->GetComponentWeight(3);
850#define VTKKWRCHelper_InitializeVariablesGO \
851 unsigned short* gradientOpacityTable[4]; \
852 for (c = 0; c < 4; c++) \
854 gradientOpacityTable[c] = mapper->GetGradientOpacityTable(c); \
856 unsigned char** gradientMag = mapper->GetGradientMagnitude(); \
859 if (vol->GetProperty()->GetIndependentComponents()) \
868 mInc[1] = mInc[0] * dim[0]; \
869 mInc[2] = mInc[1] * dim[1]; \
872#define VTKKWRCHelper_InitializeVariablesShade \
873 unsigned short* diffuseShadingTable[4]; \
874 unsigned short* specularShadingTable[4]; \
875 for (c = 0; c < 4; c++) \
877 diffuseShadingTable[c] = mapper->GetDiffuseShadingTable(c); \
878 specularShadingTable[c] = mapper->GetSpecularShadingTable(c); \
880 unsigned short** gradientDir = mapper->GetGradientNormal(); \
882 if (vol->GetProperty()->GetIndependentComponents()) \
891 dInc[1] = dInc[0] * dim[0]; \
892 dInc[2] = dInc[1] * dim[1]; \
895#define VTKKWRCHelper_InitializeTrilinVariables \
896 vtkIdType Binc = components; \
897 vtkIdType Cinc = Binc * dim[0]; \
898 vtkIdType Dinc = Cinc + Binc; \
899 vtkIdType Einc = Cinc * dim[1]; \
900 vtkIdType Finc = Einc + Binc; \
901 vtkIdType Ginc = Einc + Cinc; \
902 vtkIdType Hinc = Ginc + Binc;
904#define VTKKWRCHelper_InitializeTrilinVariablesGO \
905 vtkIdType magOffset; \
906 if (vol->GetProperty()->GetIndependentComponents()) \
908 magOffset = components; \
915 vtkIdType mBFinc = magOffset; \
916 vtkIdType mCGinc = dim[0] * magOffset; \
917 vtkIdType mDHinc = dim[0] * magOffset + magOffset;
919#define VTKKWRCHelper_InitializeTrilinVariablesShade \
920 vtkIdType dirOffset; \
921 if (vol->GetProperty()->GetIndependentComponents()) \
923 dirOffset = components; \
930 vtkIdType dBFinc = dirOffset; \
931 vtkIdType dCGinc = dim[0] * dirOffset; \
932 vtkIdType dDHinc = dim[0] * dirOffset + dirOffset;
934#define VTKKWRCHelper_OuterInitialization \
935 if (j % threadCount != threadID) \
941 if (renWin->CheckAbortStatus()) \
946 else if (renWin->GetAbortRender()) \
950 imagePtr = image + 4 * (j * imageMemorySize[0] + rowBounds[j * 2]);
952#define VTKKWRCHelper_InnerInitialization \
953 unsigned int numSteps; \
954 unsigned int pos[3]; \
955 unsigned int dir[3]; \
956 mapper->ComputeRayInfo(i, j, pos, dir, &numSteps); \
960 *(imagePtr + 1) = 0; \
961 *(imagePtr + 2) = 0; \
962 *(imagePtr + 3) = 0; \
966 unsigned int spos[3]; \
969#define VTKKWRCHelper_InitializeMIPOneNN \
970 mapper->ShiftVectorDown(pos, spos); \
971 T* dptr = data + spos[0] * inc[0] + spos[1] * inc[1] + spos[2] * inc[2]; \
972 T maxValue = *(dptr);
974#define VTKKWRCHelper_InitializeMIPMultiNN \
975 mapper->ShiftVectorDown(pos, spos); \
976 T* dptr = data + spos[0] * inc[0] + spos[1] * inc[1] + spos[2] * inc[2]; \
977 T maxValue[4] = {}; \
978 for (c = 0; c < components; c++) \
980 maxValue[c] = *(dptr + c); \
983#define VTKKWRCHelper_InitializeMIPOneTrilin \
985 unsigned int oldSPos[3]; \
987 oldSPos[0] = (pos[0] >> VTKKW_FP_SHIFT) + 1; \
991 unsigned int w1X, w1Y, w1Z; \
992 unsigned int w2X, w2Y, w2Z; \
993 unsigned int w1Xw1Y, w2Xw1Y, w1Xw2Y, w2Xw2Y; \
995 unsigned short maxValue = 0; \
996 unsigned short val; \
997 unsigned int A = 0, B = 0, C = 0, D = 0, E = 0, F = 0, G = 0, H = 0;
999#define VTKKWRCHelper_InitializeMIPMultiTrilin \
1001 unsigned int oldSPos[3]; \
1003 oldSPos[0] = (pos[0] >> VTKKW_FP_SHIFT) + 1; \
1007 unsigned int w1X, w1Y, w1Z; \
1008 unsigned int w2X, w2Y, w2Z; \
1009 unsigned int w1Xw1Y, w2Xw1Y, w1Xw2Y, w2Xw2Y; \
1011 unsigned short maxValue[4] = {}; \
1012 unsigned short val[4] = {}; \
1013 unsigned int A[4] = {}, B[4] = {}, C[4] = {}, D[4] = {}, E[4] = {}, F[4] = {}, G[4] = {}, \
1016#define VTKKWRCHelper_InitializeCompositeGONN \
1017 unsigned char* magPtr = gradientMag[spos[2]] + spos[0] * mInc[0] + spos[1] * mInc[1];
1019#define VTKKWRCHelper_InitializeCompositeShadeNN \
1020 unsigned short* dirPtr = gradientDir[spos[2]] + spos[0] * dInc[0] + spos[1] * dInc[1];
1022#define VTKKWRCHelper_InitializeCompositeOneNN \
1023 mapper->ShiftVectorDown(pos, spos); \
1024 T* dptr = data + spos[0] * inc[0] + spos[1] * inc[1] + spos[2] * inc[2]; \
1025 unsigned int color[3] = { 0, 0, 0 }; \
1026 unsigned short remainingOpacity = 0x7fff; \
1027 unsigned short tmp[4];
1029#define VTKKWRCHelper_InitializeCompositeMultiNN \
1030 mapper->ShiftVectorDown(pos, spos); \
1031 T* dptr = data + spos[0] * inc[0] + spos[1] * inc[1] + spos[2] * inc[2]; \
1032 unsigned int color[3] = { 0, 0, 0 }; \
1033 unsigned int remainingOpacity = 0x7fff; \
1034 unsigned short tmp[4] = {}; \
1035 unsigned short val[4] = {};
1037#define VTKKWRCHelper_InitializeCompositeOneTrilin \
1039 unsigned int oldSPos[3]; \
1041 oldSPos[0] = (pos[0] >> VTKKW_FP_SHIFT) + 1; \
1045 unsigned int w1X, w1Y, w1Z; \
1046 unsigned int w2X, w2Y, w2Z; \
1047 unsigned int w1Xw1Y, w2Xw1Y, w1Xw2Y, w2Xw2Y; \
1049 unsigned short val; \
1050 unsigned int A = 0, B = 0, C = 0, D = 0, E = 0, F = 0, G = 0, H = 0; \
1052 unsigned int color[3] = { 0, 0, 0 }; \
1053 unsigned short remainingOpacity = 0x7fff; \
1054 unsigned short tmp[4];
1056#define VTKKWRCHelper_InitializeCompositeOneGOTrilin \
1057 unsigned char *magPtrABCD = nullptr, *magPtrEFGH = nullptr; \
1058 unsigned short mag; \
1059 unsigned int mA = 0, mB = 0, mC = 0, mD = 0, mE = 0, mF = 0, mG = 0, mH = 0;
1061#define VTKKWRCHelper_InitializeCompositeOneShadeTrilin \
1062 unsigned short *dirPtrABCD = nullptr, *dirPtrEFGH = nullptr; \
1063 unsigned int normalA = 0, normalB = 0, normalC = 0, normalD = 0; \
1064 unsigned int normalE = 0, normalF = 0, normalG = 0, normalH = 0;
1066#define VTKKWRCHelper_InitializeCompositeMultiTrilin \
1068 unsigned int oldSPos[3]; \
1070 oldSPos[0] = (pos[0] >> VTKKW_FP_SHIFT) + 1; \
1074 unsigned int w1X, w1Y, w1Z; \
1075 unsigned int w2X, w2Y, w2Z; \
1076 unsigned int w1Xw1Y, w2Xw1Y, w1Xw2Y, w2Xw2Y; \
1078 unsigned short val[4] = { 0, 0, 0, 0 }; \
1079 unsigned int A[4] = { 0, 0, 0, 0 }; \
1080 unsigned int B[4] = { 0, 0, 0, 0 }; \
1081 unsigned int C[4] = { 0, 0, 0, 0 }; \
1082 unsigned int D[4] = { 0, 0, 0, 0 }; \
1083 unsigned int E[4] = { 0, 0, 0, 0 }; \
1084 unsigned int F[4] = { 0, 0, 0, 0 }; \
1085 unsigned int G[4] = { 0, 0, 0, 0 }; \
1086 unsigned int H[4] = { 0, 0, 0, 0 }; \
1088 unsigned int color[3] = { 0, 0, 0 }; \
1089 unsigned short remainingOpacity = 0x7fff; \
1090 unsigned short tmp[4];
1092#define VTKKWRCHelper_InitializeCompositeMultiGOTrilin \
1093 unsigned char *magPtrABCD = nullptr, *magPtrEFGH = nullptr; \
1094 unsigned short mag[4] = {}; \
1095 unsigned int mA[4] = {}, mB[4] = {}, mC[4] = {}, mD[4] = {}, mE[4] = {}, mF[4] = {}, mG[4] = {}, \
1098#define VTKKWRCHelper_InitializeCompositeMultiShadeTrilin \
1099 unsigned short *dirPtrABCD = nullptr, *dirPtrEFGH = nullptr; \
1100 unsigned int normalA[4], normalB[4], normalC[4], normalD[4]; \
1101 unsigned int normalE[4], normalF[4], normalG[4], normalH[4];
1103#define VTKKWRCHelper_InitializationAndLoopStartNN \
1104 VTKKWRCHelper_InitializeVariables \
1105 for (j = 0; j < imageInUseSize[1]; j++) \
1107 VTKKWRCHelper_OuterInitialization \
1108 for (i = rowBounds[j * 2]; i <= rowBounds[j * 2 + 1]; i++) \
1110 VTKKWRCHelper_InnerInitialization
1112#define VTKKWRCHelper_InitializationAndLoopStartGONN \
1113 VTKKWRCHelper_InitializeVariables \
1114 VTKKWRCHelper_InitializeVariablesGO \
1115 for (j = 0; j < imageInUseSize[1]; j++) \
1117 VTKKWRCHelper_OuterInitialization \
1118 for (i = rowBounds[j * 2]; i <= rowBounds[j * 2 + 1]; i++) \
1120 VTKKWRCHelper_InnerInitialization
1122#define VTKKWRCHelper_InitializationAndLoopStartShadeNN \
1123 VTKKWRCHelper_InitializeVariables \
1124 VTKKWRCHelper_InitializeVariablesShade \
1125 for (j = 0; j < imageInUseSize[1]; j++) \
1127 VTKKWRCHelper_OuterInitialization \
1128 for (i = rowBounds[j * 2]; i <= rowBounds[j * 2 + 1]; i++) \
1130 VTKKWRCHelper_InnerInitialization
1132#define VTKKWRCHelper_InitializationAndLoopStartGOShadeNN \
1133 VTKKWRCHelper_InitializeVariables \
1134 VTKKWRCHelper_InitializeVariablesGO \
1135 VTKKWRCHelper_InitializeVariablesShade \
1136 for (j = 0; j < imageInUseSize[1]; j++) \
1138 VTKKWRCHelper_OuterInitialization \
1139 for (i = rowBounds[j * 2]; i <= rowBounds[j * 2 + 1]; i++) \
1141 VTKKWRCHelper_InnerInitialization
1143#define VTKKWRCHelper_InitializationAndLoopStartTrilin \
1144 VTKKWRCHelper_InitializeVariables \
1145 VTKKWRCHelper_InitializeTrilinVariables \
1146 for (j = 0; j < imageInUseSize[1]; j++) \
1148 VTKKWRCHelper_OuterInitialization \
1149 for (i = rowBounds[j * 2]; i <= rowBounds[j * 2 + 1]; i++) \
1151 VTKKWRCHelper_InnerInitialization
1153#define VTKKWRCHelper_InitializationAndLoopStartGOTrilin \
1154 VTKKWRCHelper_InitializeVariables \
1155 VTKKWRCHelper_InitializeVariablesGO \
1156 VTKKWRCHelper_InitializeTrilinVariables \
1157 VTKKWRCHelper_InitializeTrilinVariablesGO \
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_InitializationAndLoopStartShadeTrilin \
1166 VTKKWRCHelper_InitializeVariables \
1167 VTKKWRCHelper_InitializeVariablesShade \
1168 VTKKWRCHelper_InitializeTrilinVariables \
1169 VTKKWRCHelper_InitializeTrilinVariablesShade \
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_InitializationAndLoopStartGOShadeTrilin \
1178 VTKKWRCHelper_InitializeVariables \
1179 VTKKWRCHelper_InitializeVariablesShade \
1180 VTKKWRCHelper_InitializeVariablesGO \
1181 VTKKWRCHelper_InitializeTrilinVariables \
1182 VTKKWRCHelper_InitializeTrilinVariablesShade \
1183 VTKKWRCHelper_InitializeTrilinVariablesGO \
1184 for (j = 0; j < imageInUseSize[1]; j++) \
1186 VTKKWRCHelper_OuterInitialization \
1187 for (i = rowBounds[j * 2]; i <= rowBounds[j * 2 + 1]; i++) \
1189 VTKKWRCHelper_InnerInitialization
1191#define VTKKWRCHelper_IncrementAndLoopEnd \
1194 if ((j / threadCount) % 8 == 7 && threadID == 0) \
1197 fargs[0] = static_cast<double>(j) / static_cast<float>(imageInUseSize[1] - 1); \
1198 mapper->InvokeEvent(vtkCommand::VolumeMapperRenderProgressEvent, fargs); \
1202#define VTKKWRCHelper_CroppingCheckTrilin(POS) \
1205 if (mapper->CheckIfCropped(POS)) \
1211#define VTKKWRCHelper_CroppingCheckNN(POS) \
1214 if (mapper->CheckIfCropped(POS)) \
1220#define VTKKWRCHelper_SpaceLeapSetup \
1221 unsigned int mmpos[3]; \
1222 mmpos[0] = (pos[0] >> VTKKW_FPMM_SHIFT) + 1; \
1227#define VTKKWRCHelper_SpaceLeapSetupMulti \
1228 unsigned int mmpos[3]; \
1229 mmpos[0] = (pos[0] >> VTKKW_FPMM_SHIFT) + 1; \
1232 int mmvalid[4] = { 0, 0, 0, 0 };
1234#define VTKKWRCHelper_SpaceLeapCheck \
1235 if (pos[0] >> VTKKW_FPMM_SHIFT != mmpos[0] || pos[1] >> VTKKW_FPMM_SHIFT != mmpos[1] || \
1236 pos[2] >> VTKKW_FPMM_SHIFT != mmpos[2]) \
1238 mmpos[0] = pos[0] >> VTKKW_FPMM_SHIFT; \
1239 mmpos[1] = pos[1] >> VTKKW_FPMM_SHIFT; \
1240 mmpos[2] = pos[2] >> VTKKW_FPMM_SHIFT; \
1241 mmvalid = mapper->CheckMinMaxVolumeFlag(mmpos, 0); \
1249#define VTKKWRCHelper_MIPSpaceLeapCheck(MAXIDX, MAXIDXDEF, FLIP) \
1250 if (pos[0] >> VTKKW_FPMM_SHIFT != mmpos[0] || pos[1] >> VTKKW_FPMM_SHIFT != mmpos[1] || \
1251 pos[2] >> VTKKW_FPMM_SHIFT != mmpos[2]) \
1253 mmpos[0] = pos[0] >> VTKKW_FPMM_SHIFT; \
1254 mmpos[1] = pos[1] >> VTKKW_FPMM_SHIFT; \
1255 mmpos[2] = pos[2] >> VTKKW_FPMM_SHIFT; \
1256 mmvalid = (MAXIDXDEF) ? (mapper->CheckMIPMinMaxVolumeFlag(mmpos, 0, MAXIDX, FLIP)) : (1); \
1264#define VTKKWRCHelper_MIPSpaceLeapPopulateMulti(MAXIDX, FLIP) \
1265 if (pos[0] >> VTKKW_FPMM_SHIFT != mmpos[0] || pos[1] >> VTKKW_FPMM_SHIFT != mmpos[1] || \
1266 pos[2] >> VTKKW_FPMM_SHIFT != mmpos[2]) \
1268 mmpos[0] = pos[0] >> VTKKW_FPMM_SHIFT; \
1269 mmpos[1] = pos[1] >> VTKKW_FPMM_SHIFT; \
1270 mmpos[2] = pos[2] >> VTKKW_FPMM_SHIFT; \
1271 for (c = 0; c < components; c++) \
1273 mmvalid[c] = mapper->CheckMIPMinMaxVolumeFlag(mmpos, c, MAXIDX[c], FLIP); \
1277#define VTKKWRCHelper_MIPSpaceLeapCheckMulti(COMP, FLIP) mmvalid[COMP]
1280#include "vtkRenderingVolumeModule.h"
1282VTK_ABI_NAMESPACE_BEGIN
1304VTK_ABI_NAMESPACE_END
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