File indexing completed on 2025-01-18 09:58:05
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042 #ifndef G4CUTTUBS_HH
0043 #define G4CUTTUBS_HH
0044
0045 #include "G4GeomTypes.hh"
0046
0047 #if defined(G4GEOM_USE_USOLIDS)
0048 #define G4GEOM_USE_UCTUBS 1
0049 #endif
0050
0051 #if defined(G4GEOM_USE_UCTUBS)
0052 #define G4UCutTubs G4CutTubs
0053 #include "G4UCutTubs.hh"
0054 #else
0055
0056 #include "G4CSGSolid.hh"
0057 #include "G4Polyhedron.hh"
0058
0059 class G4CutTubs : public G4CSGSolid
0060 {
0061 public:
0062
0063 G4CutTubs( const G4String& pName,
0064 G4double pRMin,
0065 G4double pRMax,
0066 G4double pDz,
0067 G4double pSPhi,
0068 G4double pDPhi,
0069 G4ThreeVector pLowNorm,
0070 G4ThreeVector pHighNorm );
0071
0072
0073
0074 ~G4CutTubs() override;
0075
0076
0077
0078
0079
0080 inline G4double GetInnerRadius () const;
0081 inline G4double GetOuterRadius () const;
0082 inline G4double GetZHalfLength () const;
0083 inline G4double GetStartPhiAngle () const;
0084 inline G4double GetDeltaPhiAngle () const;
0085 inline G4double GetSinStartPhi () const;
0086 inline G4double GetCosStartPhi () const;
0087 inline G4double GetSinEndPhi () const;
0088 inline G4double GetCosEndPhi () const;
0089 inline G4ThreeVector GetLowNorm () const;
0090 inline G4ThreeVector GetHighNorm () const;
0091
0092
0093
0094 inline void SetInnerRadius (G4double newRMin);
0095 inline void SetOuterRadius (G4double newRMax);
0096 inline void SetZHalfLength (G4double newDz);
0097 inline void SetStartPhiAngle (G4double newSPhi, G4bool trig=true);
0098 inline void SetDeltaPhiAngle (G4double newDPhi);
0099
0100
0101
0102 G4double GetCubicVolume() override;
0103 G4double GetSurfaceArea() override;
0104
0105 void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const override;
0106
0107 G4bool CalculateExtent(const EAxis pAxis,
0108 const G4VoxelLimits& pVoxelLimit,
0109 const G4AffineTransform& pTransform,
0110 G4double& pmin, G4double& pmax) const override;
0111
0112 EInside Inside( const G4ThreeVector& p ) const override;
0113
0114 G4ThreeVector SurfaceNormal( const G4ThreeVector& p ) const override;
0115
0116 G4double DistanceToIn(const G4ThreeVector& p,
0117 const G4ThreeVector& v) const override;
0118 G4double DistanceToIn(const G4ThreeVector& p) const override;
0119 G4double DistanceToOut(const G4ThreeVector& p, const G4ThreeVector& v,
0120 const G4bool calcNorm = false,
0121 G4bool* validNorm = nullptr,
0122 G4ThreeVector* n = nullptr) const override;
0123 G4double DistanceToOut(const G4ThreeVector& p) const override;
0124
0125 G4GeometryType GetEntityType() const override;
0126
0127 G4ThreeVector GetPointOnSurface() const override;
0128
0129 G4VSolid* Clone() const override;
0130
0131 std::ostream& StreamInfo( std::ostream& os ) const override;
0132
0133
0134
0135 void DescribeYourselfTo ( G4VGraphicsScene& scene ) const override;
0136 G4Polyhedron* CreatePolyhedron () const override;
0137
0138 G4CutTubs(__void__&);
0139
0140
0141
0142
0143
0144 G4CutTubs(const G4CutTubs& rhs);
0145 G4CutTubs& operator=(const G4CutTubs& rhs);
0146
0147
0148 protected:
0149
0150 inline void Initialize();
0151
0152
0153
0154 inline void CheckSPhiAngle(G4double sPhi);
0155 inline void CheckDPhiAngle(G4double dPhi);
0156 inline void CheckPhiAngles(G4double sPhi, G4double dPhi);
0157
0158
0159
0160 inline void InitializeTrigonometry();
0161
0162
0163
0164 G4ThreeVector ApproxSurfaceNormal( const G4ThreeVector& p ) const;
0165
0166
0167
0168
0169 G4bool IsCrossingCutPlanes() const;
0170
0171
0172
0173 G4double GetCutZ(const G4ThreeVector& p) const;
0174
0175
0176 private:
0177
0178 G4double kRadTolerance, kAngTolerance;
0179
0180
0181
0182 G4double fRMin, fRMax, fDz, fSPhi, fDPhi;
0183 mutable G4double fZMin, fZMax;
0184
0185
0186
0187 G4double sinCPhi, cosCPhi, cosHDPhi, cosHDPhiOT, cosHDPhiIT,
0188 sinSPhi, cosSPhi, sinEPhi, cosEPhi;
0189
0190
0191
0192 G4bool fPhiFullCutTube = false;
0193
0194
0195
0196 G4double halfCarTolerance, halfRadTolerance, halfAngTolerance;
0197
0198
0199
0200 G4ThreeVector fLowNorm, fHighNorm;
0201
0202
0203 };
0204
0205 #include "G4CutTubs.icc"
0206
0207 #endif
0208
0209 #endif