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 #ifndef G4ELLIPTICALTUBE_HH
0044 #define G4ELLIPTICALTUBE_HH
0045
0046 #include "G4GeomTypes.hh"
0047
0048 #if defined(G4GEOM_USE_USOLIDS)
0049 #define G4GEOM_USE_UELLIPTICALTUBE 1
0050 #endif
0051
0052 #if (defined(G4GEOM_USE_UELLIPTICALTUBE) && defined(G4GEOM_USE_SYS_USOLIDS))
0053 #define G4UEllipticalTube G4EllipticalTube
0054 #include "G4UEllipticalTube.hh"
0055 #else
0056
0057 #include "G4VSolid.hh"
0058 #include "G4Polyhedron.hh"
0059
0060 class G4EllipticalTube : public G4VSolid
0061 {
0062 public:
0063
0064 G4EllipticalTube( const G4String& name,
0065 G4double Dx,
0066 G4double Dy,
0067 G4double Dz );
0068
0069 ~G4EllipticalTube() override;
0070
0071
0072
0073 void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const override;
0074
0075 G4bool CalculateExtent(const EAxis pAxis,
0076 const G4VoxelLimits& pVoxelLimit,
0077 const G4AffineTransform& pTransform,
0078 G4double& pmin, G4double& pmax) const override;
0079
0080 EInside Inside( const G4ThreeVector& p ) const override;
0081
0082 G4ThreeVector SurfaceNormal( const G4ThreeVector& p ) const override;
0083
0084 G4double DistanceToIn( const G4ThreeVector& p,
0085 const G4ThreeVector& v ) const override;
0086
0087 G4double DistanceToIn( const G4ThreeVector& p ) const override;
0088
0089 G4double DistanceToOut( const G4ThreeVector& p,
0090 const G4ThreeVector& v,
0091 const G4bool calcNorm = false,
0092 G4bool* validNorm = nullptr,
0093 G4ThreeVector* n = nullptr ) const override;
0094
0095 G4double DistanceToOut( const G4ThreeVector& p ) const override;
0096
0097 G4GeometryType GetEntityType() const override;
0098
0099 G4VSolid* Clone() const override;
0100
0101 std::ostream& StreamInfo(std::ostream& os) const override;
0102
0103 G4double GetCubicVolume() override;
0104 G4double GetSurfaceArea() override;
0105
0106 G4ThreeVector GetPointOnSurface() const override;
0107
0108
0109
0110 G4Polyhedron* CreatePolyhedron() const override;
0111 G4Polyhedron* GetPolyhedron () const override;
0112 void DescribeYourselfTo( G4VGraphicsScene& scene ) const override;
0113 G4VisExtent GetExtent() const override;
0114
0115
0116
0117 inline G4double GetDx() const;
0118 inline G4double GetDy() const;
0119 inline G4double GetDz() const;
0120
0121 inline void SetDx( G4double Dx );
0122 inline void SetDy( G4double Dy );
0123 inline void SetDz( G4double Dz );
0124
0125 G4EllipticalTube(__void__&);
0126
0127
0128
0129
0130 G4EllipticalTube(const G4EllipticalTube& rhs);
0131 G4EllipticalTube& operator=(const G4EllipticalTube& rhs);
0132
0133
0134 private:
0135
0136 void CheckParameters();
0137
0138
0139 G4ThreeVector ApproxSurfaceNormal( const G4ThreeVector& p ) const;
0140
0141
0142
0143 G4double GetCachedSurfaceArea() const;
0144
0145
0146 private:
0147
0148 G4double halfTolerance;
0149
0150 G4double fDx;
0151 G4double fDy;
0152 G4double fDz;
0153
0154 G4double fCubicVolume = 0.0;
0155 G4double fSurfaceArea = 0.0;
0156
0157
0158 G4double fRsph;
0159 G4double fDDx;
0160 G4double fDDy;
0161 G4double fSx;
0162 G4double fSy;
0163 G4double fR;
0164 G4double fQ1;
0165 G4double fQ2;
0166 G4double fScratch;
0167
0168 mutable G4bool fRebuildPolyhedron = false;
0169 mutable G4Polyhedron* fpPolyhedron = nullptr;
0170 };
0171
0172 #include "G4EllipticalTube.icc"
0173
0174 #endif
0175
0176 #endif