00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 #ifndef __G4TWISTTUBSFLATSIDE__
00048 #define __G4TWISTTUBSFLATSIDE__
00049
00050 #include "G4VTwistSurface.hh"
00051
00052 class G4TwistTubsFlatSide : public G4VTwistSurface
00053 {
00054 public:
00055
00056 G4TwistTubsFlatSide(const G4String &name,
00057 const G4RotationMatrix &rot,
00058 const G4ThreeVector &tlate,
00059 const G4ThreeVector &n,
00060 const EAxis axis1 = kRho,
00061 const EAxis axis2 = kPhi,
00062 G4double axis0min = -kInfinity,
00063 G4double axis1min = -kInfinity,
00064 G4double axis0max = kInfinity,
00065 G4double axis1max = kInfinity );
00066
00067 G4TwistTubsFlatSide( const G4String &name,
00068 G4double EndInnerRadius[2],
00069 G4double EndOuterRadius[2],
00070 G4double DPhi,
00071 G4double EndPhi[2],
00072 G4double EndZ[2],
00073 G4int handedness ) ;
00074
00075 virtual ~G4TwistTubsFlatSide();
00076 virtual G4ThreeVector GetNormal(const G4ThreeVector & ,
00077 G4bool isGlobal = false);
00078 virtual G4int DistanceToSurface(const G4ThreeVector &gp,
00079 const G4ThreeVector &gv,
00080 G4ThreeVector gxx[],
00081 G4double distance[],
00082 G4int areacode[],
00083 G4bool isvalid[],
00084 EValidate validate = kValidateWithTol);
00085
00086 virtual G4int DistanceToSurface(const G4ThreeVector &gp,
00087 G4ThreeVector gxx[],
00088 G4double distance[],
00089 G4int areacode[]);
00090
00091 virtual G4ThreeVector SurfacePoint(G4double, G4double,
00092 G4bool isGlobal = false ) ;
00093 virtual G4double GetBoundaryMin(G4double phi) ;
00094 virtual G4double GetBoundaryMax(G4double phi) ;
00095 virtual G4double GetSurfaceArea() { return fSurfaceArea ; }
00096 virtual void GetFacets( G4int m, G4int n, G4double xyz[][3],
00097 G4int faces[][4], G4int iside ) ;
00098
00099 G4double fSurfaceArea ;
00100
00101 public:
00102
00103 G4TwistTubsFlatSide(__void__&);
00104
00105
00106
00107
00108 protected:
00109
00110 virtual G4int GetAreaCode(const G4ThreeVector &xx,
00111 G4bool withTol = true) ;
00112
00113 private:
00114
00115 virtual void SetCorners();
00116 virtual void SetBoundaries();
00117
00118 };
00119
00120 inline G4ThreeVector G4TwistTubsFlatSide::
00121 SurfacePoint(G4double phi , G4double rho , G4bool isGlobal )
00122 {
00123 G4ThreeVector SurfPoint (rho*std::cos(phi) , rho*std::sin(phi) , 0);
00124
00125 if (isGlobal) { return (fRot * SurfPoint + fTrans); }
00126 return SurfPoint;
00127 }
00128
00129 inline
00130 G4double G4TwistTubsFlatSide::GetBoundaryMin(G4double)
00131 {
00132 G4ThreeVector dphimin = GetCorner(sC0Max1Min);
00133 return std::atan2( dphimin.y(), dphimin.x() );
00134 }
00135
00136 inline
00137 G4double G4TwistTubsFlatSide::GetBoundaryMax(G4double)
00138 {
00139 G4ThreeVector dphimax = GetCorner(sC0Max1Max);
00140 return std::atan2( dphimax.y(), dphimax.x() );
00141 }
00142
00143 #endif