211{
212
213
214
215
216
218
219
220
221
224
225 register const G4Vector3D& RayDir = rayref.GetDir();
226 register const G4Point3D& RayStart = rayref.GetStart();
227
231
234
235 b = norm.
x() * dirx + norm.
y() * diry + norm.
z() * dirz;
236
237 if ( std::fabs(b) < perMillion )
238 {
239
240 }
241 else
242 {
246
247 a = norm.
x() * (srf_point.
x() - startx) +
248 norm.
y() * (srf_point.
y() - starty) +
249 norm.
z() * (srf_point.
z() - startz) ;
250
251 t = a/b;
252
253
254
256 solx = startx + t * dirx;
257 soly = starty + t * diry;
258 solz = startz + t * dirz;
259
260
262 solx = startx;
263
265 soly = starty;
266
268 solz = startz;
269
270 G4bool xhit = (dirx < 0 && solx <= startx) || (dirx >= 0 && solx >= startx);
271 G4bool yhit = (diry < 0 && soly <= starty) || (diry >= 0 && soly >= starty);
272 G4bool zhit = (dirz < 0 && solz <= startz) || (dirz >= 0 && solz >= startz);
273
274 if( xhit && yhit && zhit ) {
276 }
277 }
278
279
281
283 {
284
287 return 0;
288 }
289 else
290 {
291
292
293
295
296
297
298
299
300
301
303
304
306
307
309
310
311
312
313 if(nbinter&1)
314 {
315
316
318 {
319
321 }
322 else
323 {
324
325 }
326
327 return 1 ;
328 }
329 else
330 {
331
332
335 return 0;
336 }
337 }
338}
const G4Point3D PINFINITY(kInfinity, kInfinity, kInfinity)
HepGeom::Vector3D< G4double > G4Vector3D
G4int IntersectRay2D(const G4Ray &ray)
void SetDistance(G4double Dist)