File indexing completed on 2025-01-18 09:59:14
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 #ifndef G4TRD_HH
0046 #define G4TRD_HH
0047
0048 #include "G4GeomTypes.hh"
0049
0050 #if defined(G4GEOM_USE_USOLIDS)
0051 #define G4GEOM_USE_UTRD 1
0052 #endif
0053
0054 #if defined(G4GEOM_USE_UTRD)
0055 #define G4UTrd G4Trd
0056 #include "G4UTrd.hh"
0057 #else
0058
0059 #include "G4CSGSolid.hh"
0060 #include "G4Polyhedron.hh"
0061
0062 class G4Trd : public G4CSGSolid
0063 {
0064 public:
0065
0066 G4Trd( const G4String& pName,
0067 G4double pdx1, G4double pdx2,
0068 G4double pdy1, G4double pdy2,
0069 G4double pdz );
0070
0071
0072
0073 ~G4Trd() override;
0074
0075
0076
0077
0078
0079 inline G4double GetXHalfLength1() const;
0080 inline G4double GetXHalfLength2() const;
0081 inline G4double GetYHalfLength1() const;
0082 inline G4double GetYHalfLength2() const;
0083 inline G4double GetZHalfLength() const;
0084
0085
0086
0087 inline void SetXHalfLength1(G4double val);
0088 inline void SetXHalfLength2(G4double val);
0089 inline void SetYHalfLength1(G4double val);
0090 inline void SetYHalfLength2(G4double val);
0091 inline void SetZHalfLength(G4double val);
0092
0093 void SetAllParameters ( G4double pdx1, G4double pdx2,
0094 G4double pdy1, G4double pdy2,
0095 G4double pdz );
0096
0097
0098
0099 G4double GetCubicVolume() override;
0100 G4double GetSurfaceArea() override;
0101
0102 void ComputeDimensions( G4VPVParameterisation* p,
0103 const G4int n,
0104 const G4VPhysicalVolume* pRep ) override;
0105
0106 void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const override;
0107
0108 G4bool CalculateExtent(const EAxis pAxis,
0109 const G4VoxelLimits& pVoxelLimit,
0110 const G4AffineTransform& pTransform,
0111 G4double& pMin, G4double& pMax) const override;
0112
0113 EInside Inside( const G4ThreeVector& p ) const override;
0114
0115 G4ThreeVector SurfaceNormal( const G4ThreeVector& p ) const override;
0116
0117 G4double DistanceToIn( const G4ThreeVector& p,
0118 const G4ThreeVector& v ) const override;
0119
0120 G4double DistanceToIn( const G4ThreeVector& p ) const override;
0121
0122 G4double DistanceToOut( const G4ThreeVector& p,
0123 const G4ThreeVector& v,
0124 const G4bool calcNorm = false,
0125 G4bool* validNorm = nullptr,
0126 G4ThreeVector* n = nullptr ) const override;
0127
0128 G4double DistanceToOut( const G4ThreeVector& p ) const override;
0129
0130 G4GeometryType GetEntityType() const override;
0131
0132 G4ThreeVector GetPointOnSurface() const override;
0133
0134 G4VSolid* Clone() const override;
0135
0136 std::ostream& StreamInfo( std::ostream& os ) const override;
0137
0138
0139
0140 void DescribeYourselfTo (G4VGraphicsScene& scene) const override;
0141 G4Polyhedron* CreatePolyhedron () const override;
0142
0143 G4Trd(__void__&);
0144
0145
0146
0147
0148 G4Trd(const G4Trd& rhs);
0149 G4Trd& operator=(const G4Trd& rhs);
0150
0151
0152 private:
0153
0154 void CheckParameters();
0155
0156
0157 void MakePlanes();
0158
0159
0160 G4ThreeVector ApproxSurfaceNormal( const G4ThreeVector& p ) const;
0161
0162
0163
0164 private:
0165
0166 G4double halfCarTolerance;
0167 G4double fDx1,fDx2,fDy1,fDy2,fDz,fHx,fHy;
0168 struct { G4double a,b,c,d; } fPlanes[4];
0169 };
0170
0171 #include "G4Trd.icc"
0172
0173 #endif
0174
0175 #endif