66 fTAlph = std::tan(fAlpha) ;
70 fdeltaX = 2 * fDz * std::tan(fTheta) * std::cos(fPhi) ;
72 fdeltaY = 2 * fDz * std::tan(fTheta) * std::sin(fPhi) ;
75 fPhiTwist = PhiTwist ;
107 :
G4VTwistSurface(a), fDx1(0.), fDx2(0.), fDy(0.), fDz(0.), fPhiTwist(0.),
108 fAlpha(0.), fTAlph(0.), fPhi(0.), fTheta(0.), fdeltaX(0.), fdeltaY(0.)
158 for (i=0; i<2; i++) {
159 distance[i] = kInfinity;
162 gxx[i].
set(kInfinity, kInfinity, kInfinity);
174 if (std::fabs(p.
z()) == 0.) {
203 isvalid[0], 0, validate, &gp, &gv);
207 distance[0] = - (p.
z() / v.
z());
215 if (distance[0] >= 0) isvalid[0] =
true;
220 if (distance[0] >= 0) isvalid[0] =
true;
224 if (distance[0] >= 0) isvalid[0] =
true;
229 isvalid[0], 1, validate, &gp, &gv);
232 G4cerr <<
"ERROR - G4TwistTrapFlatSide::DistanceToSurface(p,v)" <<
G4endl;
268 for (i=0; i<2; i++) {
269 distance[i] = kInfinity;
271 gxx[i].
set(kInfinity, kInfinity, kInfinity);
285 distance[0] = std::fabs(p.
z());
286 xx.
set(p.
x(), p.
y(), 0);
309 G4double wmax = xAxisMax(xx.
y(), fTAlph ) ;
310 G4double wmin = -xAxisMax(xx.
y(), -fTAlph ) ;
318 if (xx.
x() < wmin + ctol) {
320 if (xx.
x() <= wmin - ctol) isoutside =
true;
322 }
else if (xx.
x() > wmax - ctol) {
324 if (xx.
x() >= wmax + ctol) isoutside =
true;
334 if (xx.
y() <=
fAxisMin[yaxis] - ctol) isoutside =
true;
336 }
else if (xx.
y() >
fAxisMax[yaxis] - ctol) {
341 if (xx.
y() >=
fAxisMax[yaxis] + ctol) isoutside =
true;
349 areacode = tmpareacode;
358 if (xx.
x() < wmin ) {
360 }
else if (xx.
x() > wmax) {
385 "Feature NOT implemented !");
395 void G4TwistTrapFlatSide::SetCorners()
404 x = -fDx1 + fDy * fTAlph ;
410 x = fDx1 + fDy * fTAlph ;
416 x = fDx2 - fDy * fTAlph ;
422 x = -fDx2 - fDy * fTAlph ;
428 std::ostringstream message;
429 message <<
"Feature NOT implemented !" <<
G4endl
431 <<
" fAxis[1] = " <<
fAxis[1];
440 void G4TwistTrapFlatSide::SetBoundaries()
451 direction = direction.
unit();
457 direction = direction.
unit();
463 direction = direction.
unit();
469 direction = direction.
unit();
474 std::ostringstream message;
475 message <<
"Feature NOT implemented !" <<
G4endl
477 <<
" fAxis[1] = " <<
fAxis[1];
502 for ( i = 0 ; i<
n ; i++ ) {
504 y = -fDy + i*(2*fDy)/(n-1) ;
506 for ( j = 0 ; j<k ; j++ ) {
510 x = xmin + j*(xmax-xmin)/(k-1) ;
512 nnode =
GetNode(i,j,k,n,iside) ;
515 xyz[nnode][0] = p.
x() ;
516 xyz[nnode][1] = p.
y() ;
517 xyz[nnode][2] = p.
z() ;
519 if ( i<n-1 && j<k-1 ) {
521 nface =
GetFace(i,j,k,n,iside) ;