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 (0x7fff + ((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)))) >> VTKKW_FP_SHIFT; 134 #define VTKKWRCHelper_InterpolateMagnitude( VAL ) \ 136 (0x7fff + ((mA*((0x4000 + w1Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 137 (mB*((0x4000 + w2Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 138 (mC*((0x4000 + w1Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 139 (mD*((0x4000 + w2Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 140 (mE*((0x4000 + w1Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 141 (mF*((0x4000 + w2Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 142 (mG*((0x4000 + w1Xw2Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 143 (mH*((0x4000 + w2Xw2Y*w2Z)>>VTKKW_FP_SHIFT)))) >> VTKKW_FP_SHIFT; 145 #define VTKKWRCHelper_InterpolateScalarComponent( VAL, CIDX, COMPONENTS ) \ 146 for ( CIDX = 0; CIDX < COMPONENTS; CIDX++ ) \ 149 (0x7fff + ((A[CIDX]*((0x4000 + w1Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 150 (B[CIDX]*((0x4000 + w2Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 151 (C[CIDX]*((0x4000 + w1Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 152 (D[CIDX]*((0x4000 + w2Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 153 (E[CIDX]*((0x4000 + w1Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 154 (F[CIDX]*((0x4000 + w2Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 155 (G[CIDX]*((0x4000 + w1Xw2Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 156 (H[CIDX]*((0x4000 + w2Xw2Y*w2Z)>>VTKKW_FP_SHIFT)))) >> VTKKW_FP_SHIFT; \ 159 #define VTKKWRCHelper_InterpolateMagnitudeComponent( VAL, CIDX, COMPONENTS ) \ 160 for ( CIDX = 0; CIDX < COMPONENTS; CIDX++ ) \ 163 (0x7fff + ((mA[CIDX]*((0x4000 + w1Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 164 (mB[CIDX]*((0x4000 + w2Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 165 (mC[CIDX]*((0x4000 + w1Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 166 (mD[CIDX]*((0x4000 + w2Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 167 (mE[CIDX]*((0x4000 + w1Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 168 (mF[CIDX]*((0x4000 + w2Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 169 (mG[CIDX]*((0x4000 + w1Xw2Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 170 (mH[CIDX]*((0x4000 + w2Xw2Y*w2Z)>>VTKKW_FP_SHIFT)))) >> VTKKW_FP_SHIFT; \ 173 #define VTKKWRCHelper_InterpolateShading( DTABLE, STABLE, COLOR ) \ 174 unsigned int _tmpDColor[3]; \ 175 unsigned int _tmpSColor[3]; \ 178 (0x7fff + ((DTABLE[3*normalA] * ((0x4000 + w1Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 179 (DTABLE[3*normalB] * ((0x4000 + w2Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 180 (DTABLE[3*normalC] * ((0x4000 + w1Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 181 (DTABLE[3*normalD] * ((0x4000 + w2Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 182 (DTABLE[3*normalE] * ((0x4000 + w1Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 183 (DTABLE[3*normalF] * ((0x4000 + w2Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 184 (DTABLE[3*normalG] * ((0x4000 + w1Xw2Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 185 (DTABLE[3*normalH] * ((0x4000 + w2Xw2Y*w2Z)>>VTKKW_FP_SHIFT)))) >> VTKKW_FP_SHIFT; \ 188 (0x7fff + ((DTABLE[3*normalA+1] * ((0x4000 + w1Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 189 (DTABLE[3*normalB+1] * ((0x4000 + w2Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 190 (DTABLE[3*normalC+1] * ((0x4000 + w1Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 191 (DTABLE[3*normalD+1] * ((0x4000 + w2Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 192 (DTABLE[3*normalE+1] * ((0x4000 + w1Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 193 (DTABLE[3*normalF+1] * ((0x4000 + w2Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 194 (DTABLE[3*normalG+1] * ((0x4000 + w1Xw2Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 195 (DTABLE[3*normalH+1] * ((0x4000 + w2Xw2Y*w2Z)>>VTKKW_FP_SHIFT)))) >> VTKKW_FP_SHIFT; \ 198 (0x7fff + ((DTABLE[3*normalA+2] * ((0x4000 + w1Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 199 (DTABLE[3*normalB+2] * ((0x4000 + w2Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 200 (DTABLE[3*normalC+2] * ((0x4000 + w1Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 201 (DTABLE[3*normalD+2] * ((0x4000 + w2Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 202 (DTABLE[3*normalE+2] * ((0x4000 + w1Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 203 (DTABLE[3*normalF+2] * ((0x4000 + w2Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 204 (DTABLE[3*normalG+2] * ((0x4000 + w1Xw2Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 205 (DTABLE[3*normalH+2] * ((0x4000 + w2Xw2Y*w2Z)>>VTKKW_FP_SHIFT)))) >> VTKKW_FP_SHIFT; \ 208 (0x7fff + ((STABLE[3*normalA] * ((0x4000 + w1Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 209 (STABLE[3*normalB] * ((0x4000 + w2Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 210 (STABLE[3*normalC] * ((0x4000 + w1Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 211 (STABLE[3*normalD] * ((0x4000 + w2Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 212 (STABLE[3*normalE] * ((0x4000 + w1Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 213 (STABLE[3*normalF] * ((0x4000 + w2Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 214 (STABLE[3*normalG] * ((0x4000 + w1Xw2Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 215 (STABLE[3*normalH] * ((0x4000 + w2Xw2Y*w2Z)>>VTKKW_FP_SHIFT)))) >> VTKKW_FP_SHIFT; \ 218 (0x7fff + ((STABLE[3*normalA+1] * ((0x4000 + w1Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 219 (STABLE[3*normalB+1] * ((0x4000 + w2Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 220 (STABLE[3*normalC+1] * ((0x4000 + w1Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 221 (STABLE[3*normalD+1] * ((0x4000 + w2Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 222 (STABLE[3*normalE+1] * ((0x4000 + w1Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 223 (STABLE[3*normalF+1] * ((0x4000 + w2Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 224 (STABLE[3*normalG+1] * ((0x4000 + w1Xw2Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 225 (STABLE[3*normalH+1] * ((0x4000 + w2Xw2Y*w2Z)>>VTKKW_FP_SHIFT)))) >> VTKKW_FP_SHIFT; \ 228 (0x7fff + ((STABLE[3*normalA+2] * ((0x4000 + w1Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 229 (STABLE[3*normalB+2] * ((0x4000 + w2Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 230 (STABLE[3*normalC+2] * ((0x4000 + w1Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 231 (STABLE[3*normalD+2] * ((0x4000 + w2Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 232 (STABLE[3*normalE+2] * ((0x4000 + w1Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 233 (STABLE[3*normalF+2] * ((0x4000 + w2Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 234 (STABLE[3*normalG+2] * ((0x4000 + w1Xw2Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 235 (STABLE[3*normalH+2] * ((0x4000 + w2Xw2Y*w2Z)>>VTKKW_FP_SHIFT)))) >> VTKKW_FP_SHIFT; \ 238 COLOR[0] = static_cast<unsigned short>((_tmpDColor[0]*COLOR[0]+0x7fff)>>VTKKW_FP_SHIFT); \ 239 COLOR[1] = static_cast<unsigned short>((_tmpDColor[1]*COLOR[1]+0x7fff)>>VTKKW_FP_SHIFT); \ 240 COLOR[2] = static_cast<unsigned short>((_tmpDColor[2]*COLOR[2]+0x7fff)>>VTKKW_FP_SHIFT); \ 241 COLOR[0] += (_tmpSColor[0]*COLOR[3] + 0x7fff)>>VTKKW_FP_SHIFT; \ 242 COLOR[1] += (_tmpSColor[1]*COLOR[3] + 0x7fff)>>VTKKW_FP_SHIFT; \ 243 COLOR[2] += (_tmpSColor[2]*COLOR[3] + 0x7fff)>>VTKKW_FP_SHIFT; 245 #define VTKKWRCHelper_InterpolateShadingComponent( DTABLE, STABLE, COLOR, CIDX ) \ 246 unsigned int _tmpDColor[3]; \ 247 unsigned int _tmpSColor[3]; \ 250 (0x7fff + ((DTABLE[CIDX][3*normalA[CIDX]] * ((0x4000 + w1Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 251 (DTABLE[CIDX][3*normalB[CIDX]] * ((0x4000 + w2Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 252 (DTABLE[CIDX][3*normalC[CIDX]] * ((0x4000 + w1Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 253 (DTABLE[CIDX][3*normalD[CIDX]] * ((0x4000 + w2Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 254 (DTABLE[CIDX][3*normalE[CIDX]] * ((0x4000 + w1Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 255 (DTABLE[CIDX][3*normalF[CIDX]] * ((0x4000 + w2Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 256 (DTABLE[CIDX][3*normalG[CIDX]] * ((0x4000 + w1Xw2Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 257 (DTABLE[CIDX][3*normalH[CIDX]] * ((0x4000 + w2Xw2Y*w2Z)>>VTKKW_FP_SHIFT)))) >> VTKKW_FP_SHIFT; \ 260 (0x7fff + ((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)))) >> VTKKW_FP_SHIFT; \ 270 (0x7fff + ((DTABLE[CIDX][3*normalA[CIDX]+2] * ((0x4000 + w1Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 271 (DTABLE[CIDX][3*normalB[CIDX]+2] * ((0x4000 + w2Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 272 (DTABLE[CIDX][3*normalC[CIDX]+2] * ((0x4000 + w1Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 273 (DTABLE[CIDX][3*normalD[CIDX]+2] * ((0x4000 + w2Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 274 (DTABLE[CIDX][3*normalE[CIDX]+2] * ((0x4000 + w1Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 275 (DTABLE[CIDX][3*normalF[CIDX]+2] * ((0x4000 + w2Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 276 (DTABLE[CIDX][3*normalG[CIDX]+2] * ((0x4000 + w1Xw2Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 277 (DTABLE[CIDX][3*normalH[CIDX]+2] * ((0x4000 + w2Xw2Y*w2Z)>>VTKKW_FP_SHIFT)))) >> VTKKW_FP_SHIFT; \ 280 (0x7fff + ((STABLE[CIDX][3*normalA[CIDX]] * ((0x4000 + w1Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 281 (STABLE[CIDX][3*normalB[CIDX]] * ((0x4000 + w2Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 282 (STABLE[CIDX][3*normalC[CIDX]] * ((0x4000 + w1Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 283 (STABLE[CIDX][3*normalD[CIDX]] * ((0x4000 + w2Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 284 (STABLE[CIDX][3*normalE[CIDX]] * ((0x4000 + w1Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 285 (STABLE[CIDX][3*normalF[CIDX]] * ((0x4000 + w2Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 286 (STABLE[CIDX][3*normalG[CIDX]] * ((0x4000 + w1Xw2Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 287 (STABLE[CIDX][3*normalH[CIDX]] * ((0x4000 + w2Xw2Y*w2Z)>>VTKKW_FP_SHIFT)))) >> VTKKW_FP_SHIFT; \ 290 (0x7fff + ((STABLE[CIDX][3*normalA[CIDX]+1] * ((0x4000 + w1Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 291 (STABLE[CIDX][3*normalB[CIDX]+1] * ((0x4000 + w2Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 292 (STABLE[CIDX][3*normalC[CIDX]+1] * ((0x4000 + w1Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 293 (STABLE[CIDX][3*normalD[CIDX]+1] * ((0x4000 + w2Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 294 (STABLE[CIDX][3*normalE[CIDX]+1] * ((0x4000 + w1Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 295 (STABLE[CIDX][3*normalF[CIDX]+1] * ((0x4000 + w2Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 296 (STABLE[CIDX][3*normalG[CIDX]+1] * ((0x4000 + w1Xw2Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 297 (STABLE[CIDX][3*normalH[CIDX]+1] * ((0x4000 + w2Xw2Y*w2Z)>>VTKKW_FP_SHIFT)))) >> VTKKW_FP_SHIFT; \ 300 (0x7fff + ((STABLE[CIDX][3*normalA[CIDX]+2] * ((0x4000 + w1Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 301 (STABLE[CIDX][3*normalB[CIDX]+2] * ((0x4000 + w2Xw1Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 302 (STABLE[CIDX][3*normalC[CIDX]+2] * ((0x4000 + w1Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 303 (STABLE[CIDX][3*normalD[CIDX]+2] * ((0x4000 + w2Xw2Y*w1Z)>>VTKKW_FP_SHIFT)) + \ 304 (STABLE[CIDX][3*normalE[CIDX]+2] * ((0x4000 + w1Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 305 (STABLE[CIDX][3*normalF[CIDX]+2] * ((0x4000 + w2Xw1Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 306 (STABLE[CIDX][3*normalG[CIDX]+2] * ((0x4000 + w1Xw2Y*w2Z)>>VTKKW_FP_SHIFT)) + \ 307 (STABLE[CIDX][3*normalH[CIDX]+2] * ((0x4000 + w2Xw2Y*w2Z)>>VTKKW_FP_SHIFT)))) >> VTKKW_FP_SHIFT; \ 310 COLOR[0] = static_cast<unsigned short>((_tmpDColor[0]*COLOR[0]+0x7fff)>>VTKKW_FP_SHIFT); \ 311 COLOR[1] = static_cast<unsigned short>((_tmpDColor[1]*COLOR[1]+0x7fff)>>VTKKW_FP_SHIFT); \ 312 COLOR[2] = static_cast<unsigned short>((_tmpDColor[2]*COLOR[2]+0x7fff)>>VTKKW_FP_SHIFT); \ 313 COLOR[0] += (_tmpSColor[0]*COLOR[3] + 0x7fff)>>VTKKW_FP_SHIFT; \ 314 COLOR[1] += (_tmpSColor[1]*COLOR[3] + 0x7fff)>>VTKKW_FP_SHIFT; \ 315 COLOR[2] += (_tmpSColor[2]*COLOR[3] + 0x7fff)>>VTKKW_FP_SHIFT; 317 #define VTKKWRCHelper_LookupColorUS( COLORTABLE, SCALAROPACITYTABLE, IDX, COLOR ) \ 318 COLOR[3] = SCALAROPACITYTABLE[IDX]; \ 319 if ( !COLOR[3] ) {continue;} \ 320 COLOR[0] = static_cast<unsigned short> \ 321 ((COLORTABLE[3*IDX ]*COLOR[3] + 0x7fff)>>(VTKKW_FP_SHIFT)); \ 322 COLOR[1] = static_cast<unsigned short> \ 323 ((COLORTABLE[3*IDX+1]*COLOR[3] + 0x7fff)>>(VTKKW_FP_SHIFT)); \ 324 COLOR[2] = static_cast<unsigned short> \ 325 ((COLORTABLE[3*IDX+2]*COLOR[3] + 0x7fff)>>(VTKKW_FP_SHIFT)); 327 #define VTKKWRCHelper_LookupColorMax( COLORTABLE, SCALAROPACITYTABLE, IDX, COLOR ) \ 328 COLOR[3] = SCALAROPACITYTABLE[IDX]; \ 329 COLOR[0] = static_cast<unsigned short> \ 330 ((COLORTABLE[3*IDX ]*COLOR[3] + 0x7fff)>>(VTKKW_FP_SHIFT)); \ 331 COLOR[1] = static_cast<unsigned short> \ 332 ((COLORTABLE[3*IDX+1]*COLOR[3] + 0x7fff)>>(VTKKW_FP_SHIFT)); \ 333 COLOR[2] = static_cast<unsigned short> \ 334 ((COLORTABLE[3*IDX+2]*COLOR[3] + 0x7fff)>>(VTKKW_FP_SHIFT)); 336 #define VTKKWRCHelper_LookupDependentColorUS( COLORTABLE, SCALAROPACITYTABLE, IDX, CMPS, COLOR ) \ 338 unsigned short _alpha; \ 342 _alpha = SCALAROPACITYTABLE[IDX[1]]; \ 343 COLOR[0] = static_cast<unsigned short> \ 344 ((COLORTABLE[3*IDX[0] ]*_alpha + 0x7fff)>>(VTKKW_FP_SHIFT)); \ 345 COLOR[1] = static_cast<unsigned short> \ 346 ((COLORTABLE[3*IDX[0]+1]*_alpha + 0x7fff)>>(VTKKW_FP_SHIFT)); \ 347 COLOR[2] = static_cast<unsigned short> \ 348 ((COLORTABLE[3*IDX[0]+2]*_alpha + 0x7fff)>>(VTKKW_FP_SHIFT)); \ 352 _alpha = SCALAROPACITYTABLE[IDX[3]]; \ 353 COLOR[0] = static_cast<unsigned short>((IDX[0]*_alpha + 0x7f)>>8 ); \ 354 COLOR[1] = static_cast<unsigned short>((IDX[1]*_alpha + 0x7f)>>8 ); \ 355 COLOR[2] = static_cast<unsigned short>((IDX[2]*_alpha + 0x7f)>>8 ); \ 361 #define VTKKWRCHelper_LookupColorGOUS( CTABLE, SOTABLE, GOTABLE, IDX, IDX2, COLOR ) \ 362 COLOR[3] = (SOTABLE[IDX] * GOTABLE[IDX2] + 0x7fff)>>VTKKW_FP_SHIFT; \ 363 if ( !COLOR[3] ) {continue;} \ 364 COLOR[0] = static_cast<unsigned short> \ 365 ((CTABLE[3*IDX ]*COLOR[3] + 0x7fff)>>(VTKKW_FP_SHIFT)); \ 366 COLOR[1] = static_cast<unsigned short> \ 367 ((CTABLE[3*IDX+1]*COLOR[3] + 0x7fff)>>(VTKKW_FP_SHIFT)); \ 368 COLOR[2] = static_cast<unsigned short> \ 369 ((CTABLE[3*IDX+2]*COLOR[3] + 0x7fff)>>(VTKKW_FP_SHIFT)); 371 #define VTKKWRCHelper_LookupShading( DTABLE, STABLE, NORMAL, COLOR ) \ 372 COLOR[0] = static_cast<unsigned short>((DTABLE[3*NORMAL ]*COLOR[0]+0x7fff)>>VTKKW_FP_SHIFT); \ 373 COLOR[1] = static_cast<unsigned short>((DTABLE[3*NORMAL+1]*COLOR[1]+0x7fff)>>VTKKW_FP_SHIFT); \ 374 COLOR[2] = static_cast<unsigned short>((DTABLE[3*NORMAL+2]*COLOR[2]+0x7fff)>>VTKKW_FP_SHIFT); \ 375 COLOR[0] += (STABLE[3*NORMAL ]*COLOR[3] + 0x7fff)>>VTKKW_FP_SHIFT; \ 376 COLOR[1] += (STABLE[3*NORMAL+1]*COLOR[3] + 0x7fff)>>VTKKW_FP_SHIFT; \ 377 COLOR[2] += (STABLE[3*NORMAL+2]*COLOR[3] + 0x7fff)>>VTKKW_FP_SHIFT; 379 #define VTKKWRCHelper_LookupAndCombineIndependentColorsUS( COLORTABLE, SOTABLE, \ 381 COMPONENTS, COLOR ) \ 382 unsigned int _tmp[4] = {0,0,0,0}; \ 383 unsigned short _alpha[4] = {0,0,0,0}; \ 384 unsigned int _totalAlpha = 0; \ 386 {for ( int _idx = 0; _idx < COMPONENTS; _idx++ ) \ 388 _alpha[_idx] = static_cast<unsigned short>(SOTABLE[_idx][SCALAR[_idx]]*WEIGHTS[_idx]); \ 389 _totalAlpha += _alpha[_idx]; \ 392 if ( !_totalAlpha ) {continue;} \ 393 {for ( int _idx = 0; _idx < COMPONENTS; _idx++ ) \ 395 if ( _alpha[_idx] ) \ 397 _tmp[0] += static_cast<unsigned short>(((COLORTABLE[_idx][3*SCALAR[_idx] ])*_alpha[_idx] + 0x7fff)>>(VTKKW_FP_SHIFT)); \ 398 _tmp[1] += static_cast<unsigned short>(((COLORTABLE[_idx][3*SCALAR[_idx]+1])*_alpha[_idx] + 0x7fff)>>(VTKKW_FP_SHIFT)); \ 399 _tmp[2] += static_cast<unsigned short>(((COLORTABLE[_idx][3*SCALAR[_idx]+2])*_alpha[_idx] + 0x7fff)>>(VTKKW_FP_SHIFT)); \ 400 _tmp[3] += ((_alpha[_idx]*_alpha[_idx])/_totalAlpha); \ 403 if ( !_tmp[3] ) {continue;} \ 404 COLOR[0] = (_tmp[0]>32767)?(32767):(_tmp[0]); \ 405 COLOR[1] = (_tmp[1]>32767)?(32767):(_tmp[1]); \ 406 COLOR[2] = (_tmp[2]>32767)?(32767):(_tmp[2]); \ 407 COLOR[3] = (_tmp[3]>32767)?(32767):(_tmp[3]); 409 #define VTKKWRCHelper_LookupAndCombineIndependentColorsMax( COLORTABLE, SCALAROPACITYTABLE, \ 410 IDX, WEIGHTS, CMPS, COLOR ) \ 412 unsigned int _tmp[4] = {0,0,0,0}; \ 413 for ( int _idx = 0; _idx < CMPS; _idx++ ) \ 415 unsigned short _alpha = static_cast<unsigned short>(SCALAROPACITYTABLE[_idx][IDX[_idx]]*WEIGHTS[_idx]); \ 416 _tmp[0] += static_cast<unsigned short>(((COLORTABLE[_idx][3*IDX[_idx] ])*_alpha + 0x7fff)>>(VTKKW_FP_SHIFT)); \ 417 _tmp[1] += static_cast<unsigned short>(((COLORTABLE[_idx][3*IDX[_idx]+1])*_alpha + 0x7fff)>>(VTKKW_FP_SHIFT)); \ 418 _tmp[2] += static_cast<unsigned short>(((COLORTABLE[_idx][3*IDX[_idx]+2])*_alpha + 0x7fff)>>(VTKKW_FP_SHIFT)); \ 421 COLOR[0] = (_tmp[0]>32767)?(32767):(_tmp[0]); \ 422 COLOR[1] = (_tmp[1]>32767)?(32767):(_tmp[1]); \ 423 COLOR[2] = (_tmp[2]>32767)?(32767):(_tmp[2]); \ 424 COLOR[3] = (_tmp[3]>32767)?(32767):(_tmp[3]); \ 427 #define VTKKWRCHelper_LookupAndCombineIndependentColorsGOUS( COLORTABLE, SOTABLE, \ 429 SCALAR, MAG, WEIGHTS, \ 430 COMPONENTS, COLOR ) \ 431 unsigned int _tmp[4] = {0,0,0,0}; \ 432 unsigned short _alpha[4] = {0,0,0,0}; \ 433 unsigned int _totalAlpha = 0; \ 434 COMPONENTS = (COMPONENTS < 4) ? COMPONENTS : 4; \ 435 {for ( int _idx = 0; _idx < COMPONENTS; _idx++ ) \ 437 _alpha[_idx] = static_cast<unsigned short>(SOTABLE[_idx][SCALAR[_idx]]*WEIGHTS[_idx]); \ 438 if ( _alpha[_idx] ) \ 440 _alpha[_idx] = static_cast<unsigned short>((_alpha[_idx]*GOTABLE[_idx][MAG[_idx]] + 0x7fff)>>(VTKKW_FP_SHIFT)); \ 441 _totalAlpha += _alpha[_idx]; \ 445 if ( !_totalAlpha ) {continue;} \ 446 {for ( int _idx = 0; _idx < COMPONENTS; _idx++ ) \ 448 if ( _alpha[_idx] ) \ 450 _tmp[0] += static_cast<unsigned short>(((COLORTABLE[_idx][3*SCALAR[_idx] ])*_alpha[_idx] + 0x7fff)>>(VTKKW_FP_SHIFT)); \ 451 _tmp[1] += static_cast<unsigned short>(((COLORTABLE[_idx][3*SCALAR[_idx]+1])*_alpha[_idx] + 0x7fff)>>(VTKKW_FP_SHIFT)); \ 452 _tmp[2] += static_cast<unsigned short>(((COLORTABLE[_idx][3*SCALAR[_idx]+2])*_alpha[_idx] + 0x7fff)>>(VTKKW_FP_SHIFT)); \ 453 _tmp[3] += ((_alpha[_idx]*_alpha[_idx])/_totalAlpha); \ 456 if ( !_tmp[3] ) {continue;}; \ 457 COLOR[0] = (_tmp[0]>32767)?(32767):(_tmp[0]); \ 458 COLOR[1] = (_tmp[1]>32767)?(32767):(_tmp[1]); \ 459 COLOR[2] = (_tmp[2]>32767)?(32767):(_tmp[2]); \ 460 COLOR[3] = (_tmp[3]>32767)?(32767):(_tmp[3]); 462 #define VTKKWRCHelper_LookupAndCombineIndependentColorsShadeUS( COLORTABLE, SOTABLE, \ 464 SCALAR, NORMAL, WEIGHTS, \ 465 COMPONENTS, COLOR ) \ 466 unsigned int _tmp[4] = {0,0,0,0}; \ 467 unsigned int _tmpC[3]; \ 468 unsigned short _alpha[4] = {0,0,0,0}; \ 469 unsigned int _totalAlpha = 0; \ 471 {for ( int _idx = 0; _idx < COMPONENTS; _idx++ ) \ 473 _alpha[_idx] = static_cast<unsigned short>(SOTABLE[_idx][SCALAR[_idx]]*WEIGHTS[_idx]); \ 474 _totalAlpha += _alpha[_idx]; \ 477 if ( !_totalAlpha ) {continue;} \ 478 {for ( int _idx = 0; _idx < COMPONENTS; _idx++ ) \ 480 if ( _alpha[_idx] ) \ 482 _tmpC[0] = static_cast<unsigned short>(((COLORTABLE[_idx][3*SCALAR[_idx] ])*_alpha[_idx] + 0x7fff)>>(VTKKW_FP_SHIFT)); \ 483 _tmpC[1] = static_cast<unsigned short>(((COLORTABLE[_idx][3*SCALAR[_idx]+1])*_alpha[_idx] + 0x7fff)>>(VTKKW_FP_SHIFT)); \ 484 _tmpC[2] = static_cast<unsigned short>(((COLORTABLE[_idx][3*SCALAR[_idx]+2])*_alpha[_idx] + 0x7fff)>>(VTKKW_FP_SHIFT)); \ 485 _tmpC[0] = static_cast<unsigned short>((DTABLE[_idx][3*NORMAL[_idx] ]*_tmpC[0]+0x7fff)>>VTKKW_FP_SHIFT); \ 486 _tmpC[1] = static_cast<unsigned short>((DTABLE[_idx][3*NORMAL[_idx]+1]*_tmpC[1]+0x7fff)>>VTKKW_FP_SHIFT); \ 487 _tmpC[2] = static_cast<unsigned short>((DTABLE[_idx][3*NORMAL[_idx]+2]*_tmpC[2]+0x7fff)>>VTKKW_FP_SHIFT); \ 488 _tmpC[0] += (STABLE[_idx][3*NORMAL[_idx] ]*_alpha[_idx] + 0x7fff)>>VTKKW_FP_SHIFT; \ 489 _tmpC[1] += (STABLE[_idx][3*NORMAL[_idx]+1]*_alpha[_idx] + 0x7fff)>>VTKKW_FP_SHIFT; \ 490 _tmpC[2] += (STABLE[_idx][3*NORMAL[_idx]+2]*_alpha[_idx] + 0x7fff)>>VTKKW_FP_SHIFT; \ 491 _tmp[0] += _tmpC[0]; \ 492 _tmp[1] += _tmpC[1]; \ 493 _tmp[2] += _tmpC[2]; \ 494 _tmp[3] += ((_alpha[_idx]*_alpha[_idx])/_totalAlpha); \ 497 if ( !_tmp[3] ) {continue;} \ 499 COLOR[0] = (_tmp[0]>32767)?(32767):(_tmp[0]); \ 500 COLOR[1] = (_tmp[1]>32767)?(32767):(_tmp[1]); \ 501 COLOR[2] = (_tmp[2]>32767)?(32767):(_tmp[2]); \ 502 COLOR[3] = (_tmp[3]>32767)?(32767):(_tmp[3]); 504 #define VTKKWRCHelper_LookupAndCombineIndependentColorsInterpolateShadeUS( COLORTABLE, SOTABLE, \ 507 COMPONENTS, COLOR ) \ 508 unsigned int _tmp[4] = {0,0,0,0}; \ 509 unsigned int _tmpC[4]; \ 510 unsigned short _alpha[4] = {0,0,0,0}; \ 511 unsigned int _totalAlpha = 0; \ 513 {for ( int _idx = 0; _idx < COMPONENTS; _idx++ ) \ 515 _alpha[_idx] = static_cast<unsigned short>(SOTABLE[_idx][SCALAR[_idx]]*WEIGHTS[_idx]); \ 516 _totalAlpha += _alpha[_idx]; \ 519 if ( !_totalAlpha ) {continue;} \ 520 {for ( int _idx = 0; _idx < COMPONENTS; _idx++ ) \ 522 if ( _alpha[_idx] ) \ 524 _tmpC[0] = static_cast<unsigned short>(((COLORTABLE[_idx][3*SCALAR[_idx] ])*_alpha[_idx] + 0x7fff)>>(VTKKW_FP_SHIFT)); \ 525 _tmpC[1] = static_cast<unsigned short>(((COLORTABLE[_idx][3*SCALAR[_idx]+1])*_alpha[_idx] + 0x7fff)>>(VTKKW_FP_SHIFT)); \ 526 _tmpC[2] = static_cast<unsigned short>(((COLORTABLE[_idx][3*SCALAR[_idx]+2])*_alpha[_idx] + 0x7fff)>>(VTKKW_FP_SHIFT)); \ 527 _tmpC[3] = _alpha[_idx]; \ 528 VTKKWRCHelper_InterpolateShadingComponent( DTABLE, STABLE, _tmpC, _idx ); \ 529 _tmp[0] += _tmpC[0]; \ 530 _tmp[1] += _tmpC[1]; \ 531 _tmp[2] += _tmpC[2]; \ 532 _tmp[3] += ((_alpha[_idx]*_alpha[_idx])/_totalAlpha); \ 535 if (!_tmp[3]) {continue;} \ 536 COLOR[0] = (_tmp[0]>32767)?(32767):(_tmp[0]); \ 537 COLOR[1] = (_tmp[1]>32767)?(32767):(_tmp[1]); \ 538 COLOR[2] = (_tmp[2]>32767)?(32767):(_tmp[2]); \ 539 COLOR[3] = (_tmp[3]>32767)?(32767):(_tmp[3]); 541 #define VTKKWRCHelper_CompositeColorAndCheckEarlyTermination( COLOR, TMP, REMAININGOPACITY ) \ 542 COLOR[0] += (TMP[0]*REMAININGOPACITY+0x7fff)>>VTKKW_FP_SHIFT; \ 543 COLOR[1] += (TMP[1]*REMAININGOPACITY+0x7fff)>>VTKKW_FP_SHIFT; \ 544 COLOR[2] += (TMP[2]*REMAININGOPACITY+0x7fff)>>VTKKW_FP_SHIFT; \ 545 REMAININGOPACITY = (REMAININGOPACITY*((~(TMP[3])&VTKKW_FP_MASK))+0x7fff)>>VTKKW_FP_SHIFT; \ 546 if ( REMAININGOPACITY < 0xff ) \ 551 #define VTKKWRCHelper_LookupAndCombineIndependentColorsGOShadeUS( COLORTABLE, SOTABLE, GOTABLE, \ 553 SCALAR, MAG, NORMAL, WEIGHTS, \ 554 COMPONENTS, COLOR ) \ 555 unsigned int _tmp[4] = {0,0,0,0}; \ 556 unsigned int _tmpC[3]; \ 557 unsigned short _alpha[4] = {0,0,0,0}; \ 558 unsigned int _totalAlpha = 0; \ 560 {for ( int _idx = 0; _idx < COMPONENTS; _idx++ ) \ 562 _alpha[_idx] = static_cast<unsigned short>(SOTABLE[_idx][SCALAR[_idx]]*WEIGHTS[_idx]); \ 563 if ( _alpha[_idx] ) \ 565 _alpha[_idx] = static_cast<unsigned short>((_alpha[_idx]*GOTABLE[_idx][MAG[_idx]] + 0x7fff)>>(VTKKW_FP_SHIFT)); \ 566 _totalAlpha += _alpha[_idx]; \ 570 if ( !_totalAlpha ) {continue;} \ 572 {for ( int _idx = 0; _idx < COMPONENTS; _idx++ ) \ 574 if ( _alpha[_idx] ) \ 576 _tmpC[0] = static_cast<unsigned short>(((COLORTABLE[_idx][3*SCALAR[_idx] ])*_alpha[_idx] + 0x7fff)>>(VTKKW_FP_SHIFT)); \ 577 _tmpC[1] = static_cast<unsigned short>(((COLORTABLE[_idx][3*SCALAR[_idx]+1])*_alpha[_idx] + 0x7fff)>>(VTKKW_FP_SHIFT)); \ 578 _tmpC[2] = static_cast<unsigned short>(((COLORTABLE[_idx][3*SCALAR[_idx]+2])*_alpha[_idx] + 0x7fff)>>(VTKKW_FP_SHIFT)); \ 579 _tmpC[0] = static_cast<unsigned short>((DTABLE[_idx][3*NORMAL[_idx] ]*_tmpC[0]+0x7fff)>>VTKKW_FP_SHIFT); \ 580 _tmpC[1] = static_cast<unsigned short>((DTABLE[_idx][3*NORMAL[_idx]+1]*_tmpC[1]+0x7fff)>>VTKKW_FP_SHIFT); \ 581 _tmpC[2] = static_cast<unsigned short>((DTABLE[_idx][3*NORMAL[_idx]+2]*_tmpC[2]+0x7fff)>>VTKKW_FP_SHIFT); \ 582 _tmpC[0] += (STABLE[_idx][3*NORMAL[_idx] ]*_alpha[_idx] + 0x7fff)>>VTKKW_FP_SHIFT; \ 583 _tmpC[1] += (STABLE[_idx][3*NORMAL[_idx]+1]*_alpha[_idx] + 0x7fff)>>VTKKW_FP_SHIFT; \ 584 _tmpC[2] += (STABLE[_idx][3*NORMAL[_idx]+2]*_alpha[_idx] + 0x7fff)>>VTKKW_FP_SHIFT; \ 585 _tmp[0] += _tmpC[0]; \ 586 _tmp[1] += _tmpC[1]; \ 587 _tmp[2] += _tmpC[2]; \ 588 _tmp[3] += ((_alpha[_idx]*_alpha[_idx])/_totalAlpha); \ 591 if ( !_tmp[3] ) {continue;} \ 592 COLOR[0] = (_tmp[0]>32767)?(32767):(_tmp[0]); \ 593 COLOR[1] = (_tmp[1]>32767)?(32767):(_tmp[1]); \ 594 COLOR[2] = (_tmp[2]>32767)?(32767):(_tmp[2]); \ 595 COLOR[3] = (_tmp[3]>32767)?(32767):(_tmp[3]); 597 #define VTKKWRCHelper_LookupAndCombineIndependentColorsGOInterpolateShadeUS( COLORTABLE, SOTABLE, GOTABLE, \ 599 SCALAR, MAG, WEIGHTS, \ 600 COMPONENTS, COLOR ) \ 601 unsigned int _tmp[4] = {0,0,0,0}; \ 602 unsigned int _tmpC[4]; \ 603 unsigned short _alpha[4] = {0,0,0,0}; \ 604 unsigned int _totalAlpha = 0; \ 606 {for ( int _idx = 0; _idx < COMPONENTS; _idx++ ) \ 608 _alpha[_idx] = static_cast<unsigned short>(SOTABLE[_idx][SCALAR[_idx]]*WEIGHTS[_idx]); \ 609 if ( _alpha[_idx] ) \ 611 _alpha[_idx] = static_cast<unsigned short>((_alpha[_idx]*GOTABLE[_idx][MAG[_idx]] + 0x7fff)>>(VTKKW_FP_SHIFT)); \ 612 _totalAlpha += _alpha[_idx]; \ 616 if ( !_totalAlpha ) {continue;} \ 617 {for ( int _idx = 0; _idx < COMPONENTS; _idx++ ) \ 619 if ( _alpha[_idx] ) \ 621 _tmpC[0] = static_cast<unsigned short>(((COLORTABLE[_idx][3*SCALAR[_idx] ])*_alpha[_idx] + 0x7fff)>>(VTKKW_FP_SHIFT)); \ 622 _tmpC[1] = static_cast<unsigned short>(((COLORTABLE[_idx][3*SCALAR[_idx]+1])*_alpha[_idx] + 0x7fff)>>(VTKKW_FP_SHIFT)); \ 623 _tmpC[2] = static_cast<unsigned short>(((COLORTABLE[_idx][3*SCALAR[_idx]+2])*_alpha[_idx] + 0x7fff)>>(VTKKW_FP_SHIFT)); \ 624 _tmpC[3] = _alpha[_idx]; \ 625 VTKKWRCHelper_InterpolateShadingComponent( DTABLE, STABLE, _tmpC, _idx ); \ 626 _tmp[0] += _tmpC[0]; \ 627 _tmp[1] += _tmpC[1]; \ 628 _tmp[2] += _tmpC[2]; \ 629 _tmp[3] += ((_alpha[_idx]*_alpha[_idx])/_totalAlpha); \ 632 if ( !_tmp[3] ) {continue;} \ 633 COLOR[0] = (_tmp[0]>32767)?(32767):(_tmp[0]); \ 634 COLOR[1] = (_tmp[1]>32767)?(32767):(_tmp[1]); \ 635 COLOR[2] = (_tmp[2]>32767)?(32767):(_tmp[2]); \ 636 COLOR[3] = (_tmp[3]>32767)?(32767):(_tmp[3]); 638 #define VTKKWRCHelper_SetPixelColor( IMAGEPTR, COLOR, REMAININGOPACITY ) \ 639 IMAGEPTR[0] = (COLOR[0]>32767)?(32767):(COLOR[0]); \ 640 IMAGEPTR[1] = (COLOR[1]>32767)?(32767):(COLOR[1]); \ 641 IMAGEPTR[2] = (COLOR[2]>32767)?(32767):(COLOR[2]); \ 642 unsigned int tmpAlpha = (~REMAININGOPACITY)&VTKKW_FP_MASK; \ 643 IMAGEPTR[3] = (tmpAlpha>32767)?(32767):(tmpAlpha); 645 #define VTKKWRCHelper_MoveToNextSampleNN() \ 646 if ( k < numSteps-1 ) \ 648 mapper->FixedPointIncrement( pos, dir ); \ 649 mapper->ShiftVectorDown( pos, spos ); \ 650 dptr = data + spos[0]*inc[0] + spos[1]*inc[1] + spos[2]*inc[2]; \ 653 #define VTKKWRCHelper_MoveToNextSampleGONN() \ 654 if ( k < numSteps-1 ) \ 656 mapper->FixedPointIncrement( pos, dir ); \ 657 mapper->ShiftVectorDown( pos, spos ); \ 658 dptr = data + spos[0]*inc[0] + spos[1]*inc[1] + spos[2]*inc[2]; \ 659 magPtr = gradientMag[spos[2]] + spos[0]*mInc[0] + spos[1]*mInc[1]; \ 662 #define VTKKWRCHelper_MoveToNextSampleShadeNN() \ 663 if ( k < numSteps-1 ) \ 665 mapper->FixedPointIncrement( pos, dir ); \ 666 mapper->ShiftVectorDown( pos, spos ); \ 667 dptr = data + spos[0]*inc[0] + spos[1]*inc[1] + spos[2]*inc[2]; \ 668 dirPtr = gradientDir[spos[2]] + spos[0]*dInc[0] + spos[1]*dInc[1]; \ 671 #define VTKKWRCHelper_MoveToNextSampleGOShadeNN() \ 672 if ( k < numSteps-1 ) \ 674 mapper->FixedPointIncrement( pos, dir ); \ 675 mapper->ShiftVectorDown( pos, spos ); \ 676 dptr = data + spos[0]*inc[0] + spos[1]*inc[1] + spos[2]*inc[2]; \ 677 magPtr = gradientMag[spos[2]] + spos[0]*mInc[0] + spos[1]*mInc[1]; \ 678 dirPtr = gradientDir[spos[2]] + spos[0]*dInc[0] + spos[1]*dInc[1]; \ 681 #define VTKKWRCHelper_InitializeVariables() \ 683 unsigned short *imagePtr; \ 685 int imageInUseSize[2]; \ 686 int imageMemorySize[2]; \ 687 int imageViewportSize[2]; \ 688 int imageOrigin[2]; \ 693 mapper->GetRayCastImage()->GetImageInUseSize(imageInUseSize); \ 694 mapper->GetRayCastImage()->GetImageMemorySize(imageMemorySize); \ 695 mapper->GetRayCastImage()->GetImageViewportSize(imageViewportSize); \ 696 mapper->GetRayCastImage()->GetImageOrigin(imageOrigin); \ 697 mapper->GetInput()->GetDimensions(dim); \ 698 mapper->GetTableShift( shift ); \ 699 mapper->GetTableScale( scale ); \ 701 int *rowBounds = mapper->GetRowBounds(); \ 702 unsigned short *image = mapper->GetRayCastImage()->GetImage(); \ 703 vtkRenderWindow *renWin = mapper->GetRenderWindow(); \ 704 int components = mapper->GetInput()->GetNumberOfScalarComponents(); \ 705 int cropping = (mapper->GetCropping() && \ 706 mapper->GetCroppingRegionFlags() != 0x2000 ); \ 708 components = (components < 4) ? components : 4; \ 709 unsigned short *colorTable[4]; \ 710 unsigned short *scalarOpacityTable[4]; \ 713 for ( c = 0; c < 4; c++ ) \ 715 colorTable[c] = mapper->GetColorTable(c); \ 716 (void)(colorTable[c]); \ 717 scalarOpacityTable[c] = mapper->GetScalarOpacityTable(c); \ 721 inc[0] = components; \ 722 inc[1] = inc[0]*dim[0]; \ 723 inc[2] = inc[1]*dim[1]; 725 #define VTKKWRCHelper_InitializeWeights() \ 726 float weights[4] = {}; \ 727 weights[0] = vol->GetProperty()->GetComponentWeight(0); \ 728 weights[1] = vol->GetProperty()->GetComponentWeight(1); \ 729 weights[2] = vol->GetProperty()->GetComponentWeight(2); \ 730 weights[3] = vol->GetProperty()->GetComponentWeight(3); 732 #define VTKKWRCHelper_InitializeVariablesGO() \ 733 unsigned short *gradientOpacityTable[4]; \ 734 for ( c = 0; c < 4; c++ ) \ 736 gradientOpacityTable[c] = mapper->GetGradientOpacityTable(c); \ 738 unsigned char **gradientMag = mapper->GetGradientMagnitude(); \ 741 if ( vol->GetProperty()->GetIndependentComponents() ) \ 750 mInc[1] = mInc[0]*dim[0]; \ 751 mInc[2] = mInc[1]*dim[1]; \ 754 #define VTKKWRCHelper_InitializeVariablesShade() \ 755 unsigned short *diffuseShadingTable[4]; \ 756 unsigned short *specularShadingTable[4]; \ 757 for ( c = 0; c < 4; c++ ) \ 759 diffuseShadingTable[c] = mapper->GetDiffuseShadingTable(c); \ 760 specularShadingTable[c] = mapper->GetSpecularShadingTable(c); \ 762 unsigned short **gradientDir = mapper->GetGradientNormal(); \ 764 if ( vol->GetProperty()->GetIndependentComponents() ) \ 773 dInc[1] = dInc[0]*dim[0]; \ 774 dInc[2] = dInc[1]*dim[1]; \ 777 #define VTKKWRCHelper_InitializeTrilinVariables() \ 778 vtkIdType Binc = components; \ 779 vtkIdType Cinc = Binc*dim[0]; \ 780 vtkIdType Dinc = Cinc + Binc; \ 781 vtkIdType Einc = Cinc*dim[1]; \ 782 vtkIdType Finc = Einc + Binc; \ 783 vtkIdType Ginc = Einc + Cinc; \ 784 vtkIdType Hinc = Ginc + Binc; 786 #define VTKKWRCHelper_InitializeTrilinVariablesGO() \ 787 vtkIdType magOffset; \ 788 if ( vol->GetProperty()->GetIndependentComponents() ) \ 790 magOffset = components; \ 797 vtkIdType mBFinc = magOffset; \ 798 vtkIdType mCGinc = dim[0]*magOffset; \ 799 vtkIdType mDHinc = dim[0]*magOffset + magOffset; 801 #define VTKKWRCHelper_InitializeTrilinVariablesShade() \ 802 vtkIdType dirOffset; \ 803 if ( vol->GetProperty()->GetIndependentComponents() ) \ 805 dirOffset = components; \ 812 vtkIdType dBFinc = dirOffset; \ 813 vtkIdType dCGinc = dim[0]*dirOffset; \ 814 vtkIdType dDHinc = dim[0]*dirOffset + dirOffset; 816 #define VTKKWRCHelper_OuterInitialization() \ 817 if ( j%threadCount != threadID ) \ 823 if ( renWin->CheckAbortStatus() ) \ 828 else if ( renWin->GetAbortRender() ) \ 832 imagePtr = image + 4*(j*imageMemorySize[0] + rowBounds[j*2]); 834 #define VTKKWRCHelper_InnerInitialization() \ 835 unsigned int numSteps; \ 836 unsigned int pos[3]; \ 837 unsigned int dir[3]; \ 838 mapper->ComputeRayInfo( i, j, pos, dir, &numSteps ); \ 839 if ( numSteps == 0 ) \ 848 unsigned int spos[3]; \ 851 #define VTKKWRCHelper_InitializeMIPOneNN() \ 852 mapper->ShiftVectorDown( pos, spos ); \ 853 T *dptr = data + spos[0]*inc[0] + spos[1]*inc[1] + spos[2]*inc[2]; \ 854 T maxValue = *(dptr); 856 #define VTKKWRCHelper_InitializeMIPMultiNN() \ 857 mapper->ShiftVectorDown( pos, spos ); \ 858 T *dptr = data + spos[0]*inc[0] + spos[1]*inc[1] + spos[2]*inc[2]; \ 859 T maxValue[4] = {}; \ 860 for ( c = 0; c < components; c++ ) \ 862 maxValue[c] = *(dptr+c); \ 865 #define VTKKWRCHelper_InitializeMIPOneTrilin() \ 867 unsigned int oldSPos[3]; \ 869 oldSPos[0] = (pos[0] >> VTKKW_FP_SHIFT) + 1; \ 873 unsigned int w1X, w1Y, w1Z; \ 874 unsigned int w2X, w2Y, w2Z; \ 875 unsigned int w1Xw1Y, w2Xw1Y, w1Xw2Y, w2Xw2Y; \ 877 unsigned short maxValue=0; \ 878 unsigned short val; \ 879 unsigned int A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0; 881 #define VTKKWRCHelper_InitializeMIPMultiTrilin() \ 883 unsigned int oldSPos[3]; \ 885 oldSPos[0] = (pos[0] >> VTKKW_FP_SHIFT) + 1; \ 889 unsigned int w1X, w1Y, w1Z; \ 890 unsigned int w2X, w2Y, w2Z; \ 891 unsigned int w1Xw1Y, w2Xw1Y, w1Xw2Y, w2Xw2Y; \ 893 unsigned short maxValue[4] = {}; \ 894 unsigned short val[4] = {}; \ 895 unsigned int A[4] = {}, B[4] = {}, C[4] = {}, D[4] = {}, \ 896 E[4] = {}, F[4] = {}, G[4] = {}, H[4] = {}; 898 #define VTKKWRCHelper_InitializeCompositeGONN() \ 899 unsigned char *magPtr = gradientMag[spos[2]] + spos[0]*mInc[0] + spos[1]*mInc[1]; 901 #define VTKKWRCHelper_InitializeCompositeShadeNN() \ 902 unsigned short *dirPtr = gradientDir[spos[2]] + spos[0]*dInc[0] + spos[1]*dInc[1]; 904 #define VTKKWRCHelper_InitializeCompositeOneNN() \ 905 mapper->ShiftVectorDown( pos, spos ); \ 906 T *dptr = data + spos[0]*inc[0] + spos[1]*inc[1] + spos[2]*inc[2]; \ 907 unsigned int color[3] = {0,0,0}; \ 908 unsigned short remainingOpacity = 0x7fff; \ 909 unsigned short tmp[4]; 911 #define VTKKWRCHelper_InitializeCompositeMultiNN() \ 912 mapper->ShiftVectorDown( pos, spos ); \ 913 T *dptr = data + spos[0]*inc[0] + spos[1]*inc[1] + spos[2]*inc[2]; \ 914 unsigned int color[3] = {0,0,0}; \ 915 unsigned int remainingOpacity = 0x7fff; \ 916 unsigned short tmp[4] = {}; \ 917 unsigned short val[4] = {}; 919 #define VTKKWRCHelper_InitializeCompositeOneTrilin() \ 921 unsigned int oldSPos[3]; \ 923 oldSPos[0] = (pos[0] >> VTKKW_FP_SHIFT) + 1; \ 927 unsigned int w1X, w1Y, w1Z; \ 928 unsigned int w2X, w2Y, w2Z; \ 929 unsigned int w1Xw1Y, w2Xw1Y, w1Xw2Y, w2Xw2Y; \ 931 unsigned short val; \ 932 unsigned int A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0; \ 934 unsigned int color[3] = {0,0,0}; \ 935 unsigned short remainingOpacity = 0x7fff; \ 936 unsigned short tmp[4]; 938 #define VTKKWRCHelper_InitializeCompositeOneGOTrilin() \ 939 unsigned char *magPtrABCD = 0, *magPtrEFGH = 0; \ 940 unsigned short mag; \ 941 unsigned int mA=0,mB=0,mC=0,mD=0,mE=0,mF=0,mG=0,mH=0; 943 #define VTKKWRCHelper_InitializeCompositeOneShadeTrilin() \ 944 unsigned short *dirPtrABCD = 0, *dirPtrEFGH = 0; \ 945 unsigned int normalA=0,normalB=0,normalC=0,normalD=0; \ 946 unsigned int normalE=0,normalF=0,normalG=0,normalH=0; 948 #define VTKKWRCHelper_InitializeCompositeMultiTrilin() \ 950 unsigned int oldSPos[3]; \ 952 oldSPos[0] = (pos[0] >> VTKKW_FP_SHIFT) + 1; \ 956 unsigned int w1X, w1Y, w1Z; \ 957 unsigned int w2X, w2Y, w2Z; \ 958 unsigned int w1Xw1Y, w2Xw1Y, w1Xw2Y, w2Xw2Y; \ 960 unsigned short val[4] = {0, 0, 0, 0}; \ 961 unsigned int A[4] = {0, 0, 0, 0}; \ 962 unsigned int B[4] = {0, 0, 0, 0}; \ 963 unsigned int C[4] = {0, 0, 0, 0}; \ 964 unsigned int D[4] = {0, 0, 0, 0}; \ 965 unsigned int E[4] = {0, 0, 0, 0}; \ 966 unsigned int F[4] = {0, 0, 0, 0}; \ 967 unsigned int G[4] = {0, 0, 0, 0}; \ 968 unsigned int H[4] = {0, 0, 0, 0}; \ 970 unsigned int color[3] = {0,0,0}; \ 971 unsigned short remainingOpacity = 0x7fff; \ 972 unsigned short tmp[4]; 974 #define VTKKWRCHelper_InitializeCompositeMultiGOTrilin() \ 975 unsigned char *magPtrABCD = 0, *magPtrEFGH = 0; \ 976 unsigned short mag[4] = {}; \ 977 unsigned int mA[4] = {}, mB[4] = {}, mC[4] = {}, \ 978 mD[4] = {}, mE[4] = {}, mF[4] = {}, \ 979 mG[4] = {}, mH[4] = {}; 981 #define VTKKWRCHelper_InitializeCompositeMultiShadeTrilin() \ 982 unsigned short *dirPtrABCD = 0, *dirPtrEFGH = 0; \ 983 unsigned int normalA[4],normalB[4],normalC[4],normalD[4]; \ 984 unsigned int normalE[4],normalF[4],normalG[4],normalH[4]; 986 #define VTKKWRCHelper_InitializationAndLoopStartNN() \ 987 VTKKWRCHelper_InitializeVariables(); \ 988 for ( j = 0; j < imageInUseSize[1]; j++ ) \ 990 VTKKWRCHelper_OuterInitialization(); \ 991 for ( i = rowBounds[j*2]; i <= rowBounds[j*2+1]; i++ ) \ 993 VTKKWRCHelper_InnerInitialization(); 995 #define VTKKWRCHelper_InitializationAndLoopStartGONN() \ 996 VTKKWRCHelper_InitializeVariables(); \ 997 VTKKWRCHelper_InitializeVariablesGO(); \ 998 for ( j = 0; j < imageInUseSize[1]; j++ ) \ 1000 VTKKWRCHelper_OuterInitialization(); \ 1001 for ( i = rowBounds[j*2]; i <= rowBounds[j*2+1]; i++ ) \ 1003 VTKKWRCHelper_InnerInitialization(); 1005 #define VTKKWRCHelper_InitializationAndLoopStartShadeNN() \ 1006 VTKKWRCHelper_InitializeVariables(); \ 1007 VTKKWRCHelper_InitializeVariablesShade(); \ 1008 for ( j = 0; j < imageInUseSize[1]; j++ ) \ 1010 VTKKWRCHelper_OuterInitialization(); \ 1011 for ( i = rowBounds[j*2]; i <= rowBounds[j*2+1]; i++ ) \ 1013 VTKKWRCHelper_InnerInitialization(); 1015 #define VTKKWRCHelper_InitializationAndLoopStartGOShadeNN() \ 1016 VTKKWRCHelper_InitializeVariables(); \ 1017 VTKKWRCHelper_InitializeVariablesGO(); \ 1018 VTKKWRCHelper_InitializeVariablesShade(); \ 1019 for ( j = 0; j < imageInUseSize[1]; j++ ) \ 1021 VTKKWRCHelper_OuterInitialization(); \ 1022 for ( i = rowBounds[j*2]; i <= rowBounds[j*2+1]; i++ ) \ 1024 VTKKWRCHelper_InnerInitialization(); 1026 #define VTKKWRCHelper_InitializationAndLoopStartTrilin() \ 1027 VTKKWRCHelper_InitializeVariables(); \ 1028 VTKKWRCHelper_InitializeTrilinVariables(); \ 1029 for ( j = 0; j < imageInUseSize[1]; j++ ) \ 1031 VTKKWRCHelper_OuterInitialization(); \ 1032 for ( i = rowBounds[j*2]; i <= rowBounds[j*2+1]; i++ ) \ 1034 VTKKWRCHelper_InnerInitialization(); 1036 #define VTKKWRCHelper_InitializationAndLoopStartGOTrilin() \ 1037 VTKKWRCHelper_InitializeVariables(); \ 1038 VTKKWRCHelper_InitializeVariablesGO(); \ 1039 VTKKWRCHelper_InitializeTrilinVariables(); \ 1040 VTKKWRCHelper_InitializeTrilinVariablesGO(); \ 1041 for ( j = 0; j < imageInUseSize[1]; j++ ) \ 1043 VTKKWRCHelper_OuterInitialization(); \ 1044 for ( i = rowBounds[j*2]; i <= rowBounds[j*2+1]; i++ ) \ 1046 VTKKWRCHelper_InnerInitialization(); 1048 #define VTKKWRCHelper_InitializationAndLoopStartShadeTrilin() \ 1049 VTKKWRCHelper_InitializeVariables(); \ 1050 VTKKWRCHelper_InitializeVariablesShade(); \ 1051 VTKKWRCHelper_InitializeTrilinVariables(); \ 1052 VTKKWRCHelper_InitializeTrilinVariablesShade(); \ 1053 for ( j = 0; j < imageInUseSize[1]; j++ ) \ 1055 VTKKWRCHelper_OuterInitialization(); \ 1056 for ( i = rowBounds[j*2]; i <= rowBounds[j*2+1]; i++ ) \ 1058 VTKKWRCHelper_InnerInitialization(); 1060 #define VTKKWRCHelper_InitializationAndLoopStartGOShadeTrilin() \ 1061 VTKKWRCHelper_InitializeVariables(); \ 1062 VTKKWRCHelper_InitializeVariablesShade(); \ 1063 VTKKWRCHelper_InitializeVariablesGO(); \ 1064 VTKKWRCHelper_InitializeTrilinVariables(); \ 1065 VTKKWRCHelper_InitializeTrilinVariablesShade(); \ 1066 VTKKWRCHelper_InitializeTrilinVariablesGO(); \ 1067 for ( j = 0; j < imageInUseSize[1]; j++ ) \ 1069 VTKKWRCHelper_OuterInitialization(); \ 1070 for ( i = rowBounds[j*2]; i <= rowBounds[j*2+1]; i++ ) \ 1072 VTKKWRCHelper_InnerInitialization(); 1074 #define VTKKWRCHelper_IncrementAndLoopEnd() \ 1077 if ( (j/threadCount)%8 == 7 && threadID == 0) \ 1080 fargs[0] = static_cast<double>(j)/static_cast<float>(imageInUseSize[1]-1); \ 1081 mapper->InvokeEvent( vtkCommand::VolumeMapperRenderProgressEvent, fargs ); \ 1085 #define VTKKWRCHelper_CroppingCheckTrilin( POS ) \ 1088 if ( mapper->CheckIfCropped( POS ) ) \ 1094 #define VTKKWRCHelper_CroppingCheckNN( POS ) \ 1097 if ( mapper->CheckIfCropped( POS ) ) \ 1103 #define VTKKWRCHelper_SpaceLeapSetup() \ 1104 unsigned int mmpos[3]; \ 1105 mmpos[0] = (pos[0] >> VTKKW_FPMM_SHIFT) + 1; \ 1110 #define VTKKWRCHelper_SpaceLeapSetupMulti() \ 1111 unsigned int mmpos[3]; \ 1112 mmpos[0] = (pos[0] >> VTKKW_FPMM_SHIFT) + 1; \ 1115 int mmvalid[4] = {0,0,0,0}; 1117 #define VTKKWRCHelper_SpaceLeapCheck() \ 1118 if ( pos[0] >> VTKKW_FPMM_SHIFT != mmpos[0] || \ 1119 pos[1] >> VTKKW_FPMM_SHIFT != mmpos[1] || \ 1120 pos[2] >> VTKKW_FPMM_SHIFT != mmpos[2] ) \ 1122 mmpos[0] = pos[0] >> VTKKW_FPMM_SHIFT; \ 1123 mmpos[1] = pos[1] >> VTKKW_FPMM_SHIFT; \ 1124 mmpos[2] = pos[2] >> VTKKW_FPMM_SHIFT; \ 1125 mmvalid = mapper->CheckMinMaxVolumeFlag( mmpos, 0 ); \ 1133 #define VTKKWRCHelper_MIPSpaceLeapCheck( MAXIDX, MAXIDXDEF, FLIP ) \ 1134 if ( pos[0] >> VTKKW_FPMM_SHIFT != mmpos[0] || \ 1135 pos[1] >> VTKKW_FPMM_SHIFT != mmpos[1] || \ 1136 pos[2] >> VTKKW_FPMM_SHIFT != mmpos[2] ) \ 1138 mmpos[0] = pos[0] >> VTKKW_FPMM_SHIFT; \ 1139 mmpos[1] = pos[1] >> VTKKW_FPMM_SHIFT; \ 1140 mmpos[2] = pos[2] >> VTKKW_FPMM_SHIFT; \ 1141 mmvalid = (MAXIDXDEF)? \ 1142 (mapper->CheckMIPMinMaxVolumeFlag( mmpos, 0, MAXIDX, FLIP )):(1); \ 1150 #define VTKKWRCHelper_MIPSpaceLeapPopulateMulti( MAXIDX, FLIP ) \ 1151 if ( pos[0] >> VTKKW_FPMM_SHIFT != mmpos[0] || \ 1152 pos[1] >> VTKKW_FPMM_SHIFT != mmpos[1] || \ 1153 pos[2] >> VTKKW_FPMM_SHIFT != mmpos[2] ) \ 1155 mmpos[0] = pos[0] >> VTKKW_FPMM_SHIFT; \ 1156 mmpos[1] = pos[1] >> VTKKW_FPMM_SHIFT; \ 1157 mmpos[2] = pos[2] >> VTKKW_FPMM_SHIFT; \ 1158 for ( c = 0; c < components; c++ ) \ 1160 mmvalid[c] = mapper->CheckMIPMinMaxVolumeFlag( mmpos, c, MAXIDX[c], FLIP ); \ 1164 #define VTKKWRCHelper_MIPSpaceLeapCheckMulti( COMP, FLIP ) mmvalid[COMP] 1166 #include "vtkRenderingVolumeModule.h" represents a volume (data & properties) in a rendered scene
abstract base class for most VTK objects
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
An abstract helper that generates images for the volume ray cast mapper.
a simple class to control print indentation
A fixed point mapper for volumes.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual void GenerateImage(int, int, vtkVolume *, vtkFixedPointVolumeRayCastMapper *)