File indexing completed on 2025-01-18 09:58:11
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 #ifndef G4ELLIPSOID_HH
0045 #define G4ELLIPSOID_HH
0046
0047 #include "G4GeomTypes.hh"
0048
0049 #if defined(G4GEOM_USE_USOLIDS)
0050 #define G4GEOM_USE_UELLIPSOID 1
0051 #endif
0052
0053 #if (defined(G4GEOM_USE_UELLIPSOID) && defined(G4GEOM_USE_SYS_USOLIDS))
0054 #define G4UEllipsoid G4Ellipsoid
0055 #include "G4UEllipsoid.hh"
0056 #else
0057
0058 #include <CLHEP/Units/PhysicalConstants.h>
0059
0060 #include "G4VSolid.hh"
0061 #include "G4Polyhedron.hh"
0062
0063 class G4Ellipsoid : public G4VSolid
0064 {
0065 public:
0066
0067 G4Ellipsoid(const G4String& name,
0068 G4double xSemiAxis,
0069 G4double ySemiAxis,
0070 G4double zSemiAxis,
0071 G4double zBottomCut = 0.,
0072 G4double zTopCut = 0.);
0073
0074 ~G4Ellipsoid() override;
0075
0076
0077 inline G4double GetDx() const;
0078 inline G4double GetDy() const;
0079 inline G4double GetDz() const;
0080 inline G4double GetSemiAxisMax (G4int i) const;
0081 inline G4double GetZBottomCut() const;
0082 inline G4double GetZTopCut() const;
0083
0084
0085 inline void SetSemiAxis (G4double x, G4double y, G4double z);
0086 inline void SetZCuts (G4double newzBottomCut, G4double newzTopCut);
0087
0088
0089 void ComputeDimensions(G4VPVParameterisation* p,
0090 const G4int n,
0091 const G4VPhysicalVolume* pRep) override;
0092
0093 void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const override;
0094 G4bool CalculateExtent(const EAxis pAxis,
0095 const G4VoxelLimits& pVoxelLimit,
0096 const G4AffineTransform& pTransform,
0097 G4double& pmin, G4double& pmax) const override;
0098
0099 EInside Inside(const G4ThreeVector& p) const override;
0100 G4ThreeVector SurfaceNormal(const G4ThreeVector& p) const override;
0101 G4double DistanceToIn(const G4ThreeVector& p,
0102 const G4ThreeVector& v) const override;
0103 G4double DistanceToIn(const G4ThreeVector& p) const override;
0104 G4double DistanceToOut(const G4ThreeVector& p,
0105 const G4ThreeVector& v,
0106 const G4bool calcNorm = false,
0107 G4bool* validNorm = nullptr,
0108 G4ThreeVector* n = nullptr) const override;
0109 G4double DistanceToOut(const G4ThreeVector& p) const override;
0110
0111 G4GeometryType GetEntityType() const override;
0112
0113 G4VSolid* Clone() const override;
0114
0115 std::ostream& StreamInfo(std::ostream& os) const override;
0116
0117 G4double GetCubicVolume() override;
0118 G4double GetSurfaceArea() override;
0119
0120 G4ThreeVector GetPointOnSurface() const override;
0121
0122
0123 void DescribeYourselfTo(G4VGraphicsScene& scene) const override;
0124 G4VisExtent GetExtent() const override;
0125 G4Polyhedron* CreatePolyhedron() const override;
0126 G4Polyhedron* GetPolyhedron () const override;
0127
0128
0129
0130
0131 G4Ellipsoid(__void__&);
0132
0133
0134 G4Ellipsoid(const G4Ellipsoid& rhs);
0135
0136
0137 G4Ellipsoid& operator=(const G4Ellipsoid& rhs);
0138
0139 private:
0140
0141
0142 void CheckParameters();
0143
0144
0145 G4ThreeVector ApproxSurfaceNormal(const G4ThreeVector& p) const;
0146
0147
0148 G4double LateralSurfaceArea() const;
0149
0150 private:
0151
0152
0153 G4double fDx;
0154 G4double fDy;
0155 G4double fDz;
0156 G4double fZBottomCut;
0157 G4double fZTopCut;
0158
0159
0160 G4double halfTolerance;
0161 G4double fXmax;
0162 G4double fYmax;
0163 G4double fRsph;
0164 G4double fR;
0165 G4double fSx;
0166 G4double fSy;
0167 G4double fSz;
0168 G4double fZMidCut;
0169 G4double fZDimCut;
0170 G4double fQ1;
0171 G4double fQ2;
0172
0173 G4double fCubicVolume = 0.0;
0174 G4double fSurfaceArea = 0.0;
0175 mutable G4double fLateralArea = 0.0;
0176 mutable G4bool fRebuildPolyhedron = false;
0177 mutable G4Polyhedron* fpPolyhedron = nullptr;
0178 };
0179
0180 #include "G4Ellipsoid.icc"
0181
0182 #endif
0183
0184 #endif