427{
430
431
432
433 pmin.
set(-rmax,-rmax);
434 pmax.
set( rmax, rmax);
435
438
439
440
441
442
443
444
445 G4int icase = (cosEnd < 0) ? 1 : 0;
446 if (sinEnd < 0) icase += 2;
447 if (cosStart < 0) icase += 4;
448 if (sinStart < 0) icase += 8;
449
450 switch (icase)
451 {
452
453 case 0:
454 if (sinEnd < sinStart) break;
455 pmin.
set(rmin*cosEnd,rmin*sinStart);
456 pmax.
set(rmax*cosStart,rmax*sinEnd );
457 break;
458 case 1:
459 pmin.
set(rmax*cosEnd,std::min(rmin*sinStart,rmin*sinEnd));
460 pmax.
set(rmax*cosStart,rmax );
461 break;
462 case 2:
463 pmin.
set(-rmax,-rmax);
464 pmax.
set(std::max(rmax*cosStart,rmax*cosEnd),rmax);
465 break;
466 case 3:
467 pmin.
set(-rmax,rmax*sinEnd);
468 pmax.
set(rmax*cosStart,rmax);
469 break;
470
471 case 4:
472 pmin.
set(-rmax,-rmax);
473 pmax.
set(rmax,std::max(rmax*sinStart,rmax*sinEnd));
474 break;
475 case 5:
476 if (sinEnd > sinStart) break;
477 pmin.
set(rmax*cosEnd,rmin*sinEnd );
478 pmax.
set(rmin*cosStart,rmax*sinStart);
479 break;
480 case 6:
481 pmin.
set(-rmax,-rmax);
482 pmax.
set(rmax*cosEnd,rmax*sinStart);
483 break;
484 case 7:
485 pmin.
set(-rmax,rmax*sinEnd);
486 pmax.
set(std::max(rmin*cosStart,rmin*cosEnd),rmax*sinStart);
487 break;
488
489 case 8:
490 pmin.
set(std::min(rmin*cosStart,rmin*cosEnd),rmax*sinStart);
491 pmax.
set(rmax,rmax*sinEnd);
492 break;
493 case 9:
494 pmin.
set(rmax*cosEnd,rmax*sinStart);
496 break;
497 case 10:
498 if (sinEnd < sinStart) break;
499 pmin.
set(rmin*cosStart,rmax*sinStart);
500 pmax.
set(rmax*cosEnd,rmin*sinEnd );
501 break;
502 case 11:
503 pmin.
set(-rmax,std::min(rmax*sinStart,rmax*sinEnd));
505 break;
506
507 case 12:
508 pmin.
set(rmax*cosStart,-rmax);
509 pmax.
set(rmax,rmax*sinEnd);
510 break;
511 case 13:
512 pmin.
set(std::min(rmax*cosStart,rmax*cosEnd),-rmax);
514 break;
515 case 14:
516 pmin.
set(rmax*cosStart,-rmax);
517 pmax.
set(rmax*cosEnd,std::max(rmin*sinStart,rmin*sinEnd));
518 break;
519 case 15:
520 if (sinEnd > sinStart) break;
521 pmin.
set(rmax*cosStart,rmax*sinEnd);
522 pmax.
set(rmin*cosEnd,rmin*sinStart);
523 break;
524 }
525 return;
526}
const G4double kCarTolerance
void set(double x, double y)
G4double GetSurfaceTolerance() const
static G4GeometryTolerance * GetInstance()