61 axis0min, axis1min, axis0max, axis1max)
63 if (axis0 ==
kPhi && axis1 ==
kRho) {
64 G4Exception(
"G4TwistTubsFlatSide::G4TwistTubsFlatSide()",
66 "Should swap axis0 and axis1!");
94 G4int i = (handedness < 0 ? 0 : 1);
101 fRot.rotateZ(EndPhi[i]);
102 fTrans.set(0, 0, EndZ[i]);
108 fSurfaceArea = 0.5*DPhi * (EndOuterRadius[i]*EndOuterRadius[i]
109 - EndInnerRadius[i]*EndInnerRadius[i] ) ;
168 for (i=0; i<2; i++) {
184 if (std::fabs(p.z()) == 0.) {
213 isvalid[0], 0, validate, &gp, &gv);
217 distance[0] = - (p.z() / v.z());
225 if (distance[0] >= 0) isvalid[0] =
true;
230 if (distance[0] >= 0) isvalid[0] =
true;
234 if (distance[0] >= 0) isvalid[0] =
true;
238 isvalid[0], 1, validate, &gp, &gv);
241 G4cerr <<
"ERROR - G4TwistTubsFlatSide::DistanceToSurface(p,v)" <<
G4endl;
277 for (i=0; i<2; i++) {
293 distance[0] = std::fabs(p.z());
294 xx.set(p.x(), p.y(), 0);
332 if (xx.getRho() <=
fAxisMin[rhoaxis] + rtol) {
335 if (xx.getRho() <
fAxisMin[rhoaxis] - rtol) isoutside =
true;
337 }
else if (xx.getRho() >=
fAxisMax[rhoaxis] - rtol) {
340 if (xx.getRho() >
fAxisMax[rhoaxis] + rtol) isoutside =
true;
369 areacode = tmpareacode;
378 if (xx.getRho() <
fAxisMin[rhoaxis]) {
380 }
else if (xx.getRho() >
fAxisMax[rhoaxis]) {
406 std::ostringstream message;
407 message <<
"Feature NOT implemented !" <<
G4endl
409 <<
" fAxis[1] = " <<
fAxis[1];
410 G4Exception(
"G4TwistTubsFlatSide::GetAreaCode()",
"GeomSolids0001",
452 std::ostringstream message;
453 message <<
"Feature NOT implemented !" <<
G4endl
455 <<
" fAxis[1] = " <<
fAxis[1];
456 G4Exception(
"G4TwistTubsFlatSide::SetCorners()",
"GeomSolids0001",
474 direction = direction.unit();
480 direction = direction.unit();
486 direction = direction.unit();
492 direction = direction.unit();
496 std::ostringstream message;
497 message <<
"Feature NOT implemented !" <<
G4endl
499 <<
" fAxis[1] = " <<
fAxis[1];
500 G4Exception(
"G4TwistTubsFlatSide::SetBoundaries()",
"GeomSolids0001",
524 for ( i = 0 ; i<
n ; i++ ) {
526 r = rmin + i*(rmax-rmin)/(n-1) ;
531 for ( j = 0 ; j<k ; j++ )
533 phi = phimin + j*(phimax-phimin)/(k-1) ;
535 nnode =
GetNode(i,j,k,n,iside) ;
538 xyz[nnode][0] = p.x() ;
539 xyz[nnode][1] = p.y() ;
540 xyz[nnode][2] = p.z() ;
542 if ( i<n-1 && j<k-1 ) {
544 nface =
GetFace(i,j,k,n,iside) ;
G4int GetAreacode(G4int i) const
void SetCorner(G4int areacode, G4double x, G4double y, G4double z)
virtual void GetFacets(G4int m, G4int n, G4double xyz[][3], G4int faces[][4], G4int iside)
static const G4int sC0Min1Max
G4TwistTubsFlatSide(const G4String &name, const G4RotationMatrix &rot, const G4ThreeVector &tlate, const G4ThreeVector &n, const EAxis axis1=kRho, const EAxis axis2=kPhi, G4double axis0min=-kInfinity, G4double axis1min=-kInfinity, G4double axis0max=kInfinity, G4double axis1max=kInfinity)
static const G4int sAxisPhi
static const G4double kInfinity
CLHEP::Hep3Vector G4ThreeVector
G4ThreeVector ComputeGlobalDirection(const G4ThreeVector &lp) const
CLHEP::HepRotation G4RotationMatrix
G4ThreeVector ComputeLocalDirection(const G4ThreeVector &gp) const
G4SurfCurNormal fCurrentNormal
virtual G4double GetBoundaryMin(G4double phi)
G4ThreeVector GetCorner(G4int areacode) const
virtual ~G4TwistTubsFlatSide()
static const G4int sOutside
G4ThreeVector ComputeGlobalPoint(const G4ThreeVector &lp) const
static double normal(HepRandomEngine *eptr)
static const G4int sC0Min1Min
virtual void SetCorners()
G4bool IsOutside(G4int areacode) const
G4double GetDistance(G4int i) const
static const G4int sAxis1
static const G4int sC0Max1Max
static const G4int sBoundary
virtual G4int DistanceToSurface(const G4ThreeVector &gp, const G4ThreeVector &gv, G4ThreeVector gxx[], G4double distance[], G4int areacode[], G4bool isvalid[], EValidate validate=kValidateWithTol)
G4double GetRadialTolerance() const
void SetCurrentStatus(G4int i, G4ThreeVector &xx, G4double &dist, G4int &areacode, G4bool &isvalid, G4int nxx, EValidate validate, const G4ThreeVector *p, const G4ThreeVector *v=0)
G4bool IsValid(G4int i) const
static const G4int sAxis0
virtual G4ThreeVector SurfacePoint(G4double, G4double, G4bool isGlobal=false)
G4bool IsInside(G4int areacode, G4bool testbitmode=false) const
static const G4int sAxisMin
virtual G4int GetAreaCode(const G4ThreeVector &xx, G4bool withTol=true)
virtual void SetBoundaries()
static const G4int sInside
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static const G4int sCorner
G4int GetNode(G4int i, G4int j, G4int m, G4int n, G4int iside)
static const G4int sAxisMax
G4ThreeVector GetXX(G4int i) const
virtual G4String GetName() const
virtual void SetBoundary(const G4int &axiscode, const G4ThreeVector &direction, const G4ThreeVector &x0, const G4int &boundarytype)
virtual G4int AmIOnLeftSide(const G4ThreeVector &me, const G4ThreeVector &vec, G4bool withTol=true)
G4int GetFace(G4int i, G4int j, G4int m, G4int n, G4int iside)
virtual G4double GetBoundaryMax(G4double phi)
G4ThreeVector ComputeLocalPoint(const G4ThreeVector &gp) const
virtual G4ThreeVector GetNormal(const G4ThreeVector &, G4bool isGlobal=false)
G4int GetEdgeVisibility(G4int i, G4int j, G4int m, G4int n, G4int number, G4int orientation)
static const G4int sC0Max1Min
CurrentStatus fCurStatWithV
static G4GeometryTolerance * GetInstance()
G4GLOB_DLL std::ostream G4cerr
void ResetfDone(EValidate validate, const G4ThreeVector *p, const G4ThreeVector *v=0)
static const G4int sAxisRho