File indexing completed on 2025-01-18 09:58:24
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
0043
0044
0045
0046
0047 #ifndef G4HYPE_HH
0048 #define G4HYPE_HH
0049
0050 #include "G4GeomTypes.hh"
0051
0052 #if defined(G4GEOM_USE_USOLIDS)
0053 #define G4GEOM_USE_UHYPE 1
0054 #endif
0055
0056 #if (defined(G4GEOM_USE_UHYPE) && defined(G4GEOM_USE_SYS_USOLIDS))
0057 #define G4UHype G4Hype
0058 #include "G4UHype.hh"
0059 #else
0060
0061 #include "G4VSolid.hh"
0062 #include "G4ThreeVector.hh"
0063 #include "G4Polyhedron.hh"
0064
0065 class G4SolidExtentList;
0066 class G4ClippablePolygon;
0067
0068 class G4Hype : public G4VSolid
0069 {
0070 public:
0071
0072 G4Hype(const G4String& pName,
0073 G4double newInnerRadius,
0074 G4double newOuterRadius,
0075 G4double newInnerStereo,
0076 G4double newOuterStereo,
0077 G4double newHalfLenZ);
0078
0079 ~G4Hype() override;
0080
0081 void ComputeDimensions( G4VPVParameterisation* p,
0082 const G4int n,
0083 const G4VPhysicalVolume* pRep) override;
0084
0085 void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const override;
0086
0087 G4bool CalculateExtent(const EAxis pAxis,
0088 const G4VoxelLimits& pVoxelLimit,
0089 const G4AffineTransform& pTransform,
0090 G4double& pMin, G4double& pMax) const override;
0091
0092 inline G4double GetInnerRadius () const;
0093 inline G4double GetOuterRadius () const;
0094 inline G4double GetZHalfLength () const;
0095 inline G4double GetInnerStereo () const;
0096 inline G4double GetOuterStereo () const;
0097
0098 inline void SetInnerRadius (G4double newIRad);
0099 inline void SetOuterRadius (G4double newORad);
0100 inline void SetZHalfLength (G4double newHLZ);
0101 inline void SetInnerStereo (G4double newISte);
0102 inline void SetOuterStereo (G4double newOSte);
0103
0104 EInside Inside(const G4ThreeVector& p) const override;
0105
0106 G4ThreeVector SurfaceNormal(const G4ThreeVector& p) const override;
0107
0108 G4double DistanceToIn(const G4ThreeVector& p,
0109 const G4ThreeVector& v) const override;
0110 G4double DistanceToIn(const G4ThreeVector& p) const override;
0111 G4double DistanceToOut(const G4ThreeVector& p, const G4ThreeVector& v,
0112 const G4bool calcNorm = false,
0113 G4bool* validNorm = nullptr,
0114 G4ThreeVector* n = nullptr) const override;
0115 G4double DistanceToOut(const G4ThreeVector& p) const override;
0116
0117 G4GeometryType GetEntityType() const override;
0118
0119 G4VSolid* Clone() const override;
0120
0121 std::ostream& StreamInfo(std::ostream& os) const override;
0122
0123 G4double GetCubicVolume() override;
0124 G4double GetSurfaceArea() override;
0125
0126 G4ThreeVector GetPointOnSurface() const override;
0127
0128 void DescribeYourselfTo (G4VGraphicsScene& scene) const override;
0129 G4VisExtent GetExtent () const override;
0130 G4Polyhedron* CreatePolyhedron () const override;
0131 G4Polyhedron* GetPolyhedron () const override;
0132
0133 G4Hype(__void__&);
0134
0135
0136
0137
0138 G4Hype(const G4Hype& rhs);
0139 G4Hype& operator=(const G4Hype& rhs);
0140
0141
0142 protected:
0143
0144 inline G4bool InnerSurfaceExists() const;
0145
0146
0147 static G4double ApproxDistOutside( G4double pr, G4double pz,
0148 G4double r0, G4double tanPhi );
0149 static G4double ApproxDistInside( G4double pr, G4double pz,
0150 G4double r0, G4double tan2Phi );
0151
0152
0153 inline G4double HypeInnerRadius2(G4double zVal) const;
0154 inline G4double HypeOuterRadius2(G4double zVal) const;
0155
0156
0157 static G4int IntersectHype( const G4ThreeVector &p, const G4ThreeVector &v,
0158 G4double r2, G4double tan2Phi, G4double s[2] );
0159
0160
0161 private:
0162
0163 G4double asinh(G4double arg);
0164
0165 protected:
0166
0167 G4double innerRadius;
0168 G4double outerRadius;
0169 G4double halfLenZ;
0170 G4double innerStereo;
0171 G4double outerStereo;
0172
0173
0174
0175 G4double tanInnerStereo;
0176 G4double tanOuterStereo;
0177 G4double tanInnerStereo2;
0178 G4double tanOuterStereo2;
0179 G4double innerRadius2;
0180 G4double outerRadius2;
0181 G4double endInnerRadius2;
0182 G4double endOuterRadius2;
0183 G4double endInnerRadius;
0184 G4double endOuterRadius;
0185
0186
0187
0188 enum ESide {outerFace,innerFace,leftCap, rightCap};
0189
0190 private:
0191
0192 G4double fCubicVolume = 0.0;
0193 G4double fSurfaceArea = 0.0;
0194
0195 G4double fHalfTol;
0196
0197 mutable G4bool fRebuildPolyhedron = false;
0198 mutable G4Polyhedron* fpPolyhedron = nullptr;
0199 };
0200
0201 #include "G4Hype.icc"
0202
0203 #endif
0204
0205 #endif