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
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068 #ifndef G4ELLIPTICALCONE_HH
0069 #define G4ELLIPTICALCONE_HH
0070
0071 #include "G4GeomTypes.hh"
0072
0073 #if defined(G4GEOM_USE_USOLIDS)
0074 #define G4GEOM_USE_UELLIPTICALCONE 1
0075 #endif
0076
0077 #if (defined(G4GEOM_USE_UELLIPTICALCONE) && defined(G4GEOM_USE_SYS_USOLIDS))
0078 #define G4UEllipticalCone G4EllipticalCone
0079 #include "G4UEllipticalCone.hh"
0080 #else
0081
0082 #include <CLHEP/Units/PhysicalConstants.h>
0083
0084 #include "G4VSolid.hh"
0085 #include "G4Polyhedron.hh"
0086
0087 class G4EllipticalCone : public G4VSolid
0088 {
0089 public:
0090
0091 G4EllipticalCone(const G4String& pName,
0092 G4double pxSemiAxis,
0093 G4double pySemiAxis,
0094 G4double zMax,
0095 G4double pzTopCut);
0096
0097 ~G4EllipticalCone() override;
0098
0099
0100
0101 inline G4double GetSemiAxisMin () const;
0102 inline G4double GetSemiAxisMax () const;
0103 inline G4double GetSemiAxisX () const;
0104 inline G4double GetSemiAxisY () const;
0105 inline G4double GetZMax() const;
0106 inline G4double GetZTopCut() const;
0107 inline void SetSemiAxis (G4double x, G4double y, G4double z);
0108 inline void SetZCut (G4double newzTopCut);
0109
0110 G4double GetCubicVolume() override;
0111 G4double GetSurfaceArea() override;
0112
0113
0114
0115 void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const override;
0116
0117 G4bool CalculateExtent(const EAxis pAxis,
0118 const G4VoxelLimits& pVoxelLimit,
0119 const G4AffineTransform& pTransform,
0120 G4double& pMin, G4double& pMax) const override;
0121
0122 EInside Inside(const G4ThreeVector& p) const override;
0123
0124 G4ThreeVector SurfaceNormal(const G4ThreeVector& p) const override;
0125
0126 G4double DistanceToIn(const G4ThreeVector& p,
0127 const G4ThreeVector& v) const override;
0128
0129 G4double DistanceToIn(const G4ThreeVector& p) const override;
0130
0131 G4double DistanceToOut(const G4ThreeVector& p,
0132 const G4ThreeVector& v,
0133 const G4bool calcNorm = false,
0134 G4bool* validNorm = nullptr,
0135 G4ThreeVector* n = nullptr) const override;
0136
0137 G4double DistanceToOut(const G4ThreeVector& p) const override;
0138
0139 G4GeometryType GetEntityType() const override;
0140
0141 G4VSolid* Clone() const override;
0142
0143 G4ThreeVector GetPointOnSurface() const override;
0144
0145 std::ostream& StreamInfo(std::ostream& os) const override;
0146
0147
0148
0149 G4Polyhedron* GetPolyhedron () const override;
0150 void DescribeYourselfTo(G4VGraphicsScene& scene) const override;
0151 G4VisExtent GetExtent() const override;
0152 G4Polyhedron* CreatePolyhedron() const override;
0153
0154 G4EllipticalCone(__void__&);
0155
0156
0157
0158
0159 G4EllipticalCone(const G4EllipticalCone& rhs);
0160 G4EllipticalCone& operator=(const G4EllipticalCone& rhs);
0161
0162
0163 protected:
0164
0165 mutable G4bool fRebuildPolyhedron = false;
0166 mutable G4Polyhedron* fpPolyhedron = nullptr;
0167
0168 private:
0169
0170 G4ThreeVector ApproxSurfaceNormal(const G4ThreeVector& p) const;
0171
0172
0173
0174 private:
0175
0176 G4double halfCarTol;
0177 G4double fCubicVolume = 0.0;
0178 G4double fSurfaceArea = 0.0;
0179 G4double xSemiAxis, ySemiAxis, zheight, zTopCut;
0180 G4double cosAxisMin, invXX, invYY;
0181 };
0182
0183 #include "G4EllipticalCone.icc"
0184
0185 #endif
0186
0187 #endif