50 axis0min, axis1min, axis0max, axis1max)
54 G4Exception(
"G4TwistTubsFlatSide::G4TwistTubsFlatSide()",
56 "Should swap axis0 and axis1!");
81 G4int i = (handedness < 0 ? 0 : 1);
95 fSurfaceArea = 0.5*DPhi * (EndOuterRadius[i]*EndOuterRadius[i]
96 - EndInnerRadius[i]*EndInnerRadius[i] ) ;
154 for (
G4int i=0; i<2; ++i)
156 distance[i] = kInfinity;
159 gxx[i].
set(kInfinity, kInfinity, kInfinity);
171 if (std::fabs(p.
z()) == 0.)
207 isvalid[0], 0, validate, &gp, &gv);
211 distance[0] = - (p.
z() / v.
z());
221 if (distance[0] >= 0) isvalid[0] =
true;
229 if (distance[0] >= 0) isvalid[0] =
true;
235 if (distance[0] >= 0) isvalid[0] =
true;
239 isvalid[0], 1, validate, &gp, &gv);
242 G4cerr <<
"ERROR - G4TwistTubsFlatSide::DistanceToSurface(p,v)" <<
G4endl;
279 for (
auto i=0; i<2; ++i)
281 distance[i] = kInfinity;
283 gxx[i].
set(kInfinity, kInfinity, kInfinity);
299 distance[0] = std::fabs(p.
z());
300 xx.
set(p.
x(), p.
y(), 0);
374 G4int tmpareacode = areacode & (~sInside);
375 areacode = tmpareacode;
422 std::ostringstream message;
423 message <<
"Feature NOT implemented !" <<
G4endl
425 <<
" fAxis[1] = " <<
fAxis[1];
426 G4Exception(
"G4TwistTubsFlatSide::GetAreaCode()",
"GeomSolids0001",
435void G4TwistTubsFlatSide::SetCorners()
469 std::ostringstream message;
470 message <<
"Feature NOT implemented !" <<
G4endl
472 <<
" fAxis[1] = " <<
fAxis[1];
473 G4Exception(
"G4TwistTubsFlatSide::SetCorners()",
"GeomSolids0001",
481void G4TwistTubsFlatSide::SetBoundaries()
491 direction = direction.
unit();
497 direction = direction.
unit();
503 direction = direction.
unit();
509 direction = direction.
unit();
515 std::ostringstream message;
516 message <<
"Feature NOT implemented !" <<
G4endl
518 <<
" fAxis[1] = " <<
fAxis[1];
519 G4Exception(
"G4TwistTubsFlatSide::SetBoundaries()",
"GeomSolids0001",
539 for (
G4int i = 0 ; i<n ; ++i )
541 r = rmin + i*(rmax-rmin)/(n-1) ;
546 for (
G4int j = 0 ; j<k ; ++j )
548 phi = phimin + j*(phimax-phimin)/(k-1) ;
550 nnode =
GetNode(i,j,k,n,iside) ;
553 xyz[nnode][0] = p.
x() ;
554 xyz[nnode][1] = p.
y() ;
555 xyz[nnode][2] = p.
z() ;
557 if ( i<n-1 && j<k-1 )
559 nface =
GetFace(i,j,k,n,iside) ;
564 * (
GetNode(i ,j ,k,n,iside)+1) ;
566 * (
GetNode(i ,j+1,k,n,iside)+1) ;
568 * (
GetNode(i+1,j+1,k,n,iside)+1) ;
570 * (
GetNode(i+1,j ,k,n,iside)+1) ;
575 * (
GetNode(i ,j ,k,n,iside)+1) ;
577 * (
GetNode(i+1,j ,k,n,iside)+1) ;
579 * (
GetNode(i+1,j+1,k,n,iside)+1) ;
581 * (
GetNode(i ,j+1,k,n,iside)+1) ;
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4GLOB_DLL std::ostream G4cerr
void set(double x, double y, double z)
HepRotation inverse() const
HepRotation & rotateZ(double delta)
G4double GetRadialTolerance() const
static G4GeometryTolerance * GetInstance()
G4int GetAreaCode(const G4ThreeVector &xx, G4bool withTol=true) override
void GetFacets(G4int m, G4int n, G4double xyz[][3], G4int faces[][4], G4int iside) override
~G4TwistTubsFlatSide() override
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)
G4double GetBoundaryMin(G4double phi) override
G4int DistanceToSurface(const G4ThreeVector &gp, const G4ThreeVector &gv, G4ThreeVector gxx[], G4double distance[], G4int areacode[], G4bool isvalid[], EValidate validate=kValidateWithTol) override
G4ThreeVector GetNormal(const G4ThreeVector &, G4bool isGlobal=false) override
G4double GetBoundaryMax(G4double phi) override
G4ThreeVector SurfacePoint(G4double, G4double, G4bool isGlobal=false) override
G4int GetAreacode(G4int i) const
G4double GetDistance(G4int i) const
G4bool IsValid(G4int i) const
void SetCurrentStatus(G4int i, G4ThreeVector &xx, G4double &dist, G4int &areacode, G4bool &isvalid, G4int nxx, EValidate validate, const G4ThreeVector *p, const G4ThreeVector *v=nullptr)
G4ThreeVector GetXX(G4int i) const
void ResetfDone(EValidate validate, const G4ThreeVector *p, const G4ThreeVector *v=nullptr)
virtual G4int AmIOnLeftSide(const G4ThreeVector &me, const G4ThreeVector &vec, G4bool withTol=true)
static const G4int sC0Min1Min
static const G4int sC0Min1Max
G4int GetNode(G4int i, G4int j, G4int m, G4int n, G4int iside)
static const G4int sOutside
G4ThreeVector ComputeGlobalDirection(const G4ThreeVector &lp) const
static const G4int sAxisMax
static const G4int sAxis0
G4int GetFace(G4int i, G4int j, G4int m, G4int n, G4int iside)
G4int GetEdgeVisibility(G4int i, G4int j, G4int m, G4int n, G4int number, G4int orientation)
G4ThreeVector ComputeLocalDirection(const G4ThreeVector &gp) const
static const G4int sAxisPhi
static const G4int sAxisMin
static const G4int sC0Max1Max
static const G4int sAxis1
G4bool IsInside(G4int areacode, G4bool testbitmode=false) const
virtual void SetBoundary(const G4int &axiscode, const G4ThreeVector &direction, const G4ThreeVector &x0, const G4int &boundarytype)
G4ThreeVector ComputeLocalPoint(const G4ThreeVector &gp) const
static const G4int sAxisRho
void SetCorner(G4int areacode, G4double x, G4double y, G4double z)
G4ThreeVector GetCorner(G4int areacode) const
static const G4int sBoundary
G4bool IsOutside(G4int areacode) const
static const G4int sCorner
static const G4int sC0Max1Min
static const G4int sInside
virtual G4String GetName() const
CurrentStatus fCurStatWithV
G4ThreeVector ComputeGlobalPoint(const G4ThreeVector &lp) const
G4SurfCurNormal fCurrentNormal