File indexing completed on 2025-01-18 09:59:17
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 #ifndef G4UTRAP_HH
0035 #define G4UTRAP_HH
0036
0037 #include "G4UAdapter.hh"
0038
0039 #if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
0040
0041 #include <VecGeom/volumes/UnplacedTrapezoid.h>
0042
0043 #include "G4Polyhedron.hh"
0044
0045 class G4UTrap : public G4UAdapter<vecgeom::UnplacedTrapezoid>
0046 {
0047 using Shape_t = vecgeom::UnplacedTrapezoid;
0048 using Base_t = G4UAdapter<vecgeom::UnplacedTrapezoid>;
0049
0050 public:
0051
0052 G4UTrap( const G4String& pName,
0053 G4double pDz,
0054 G4double pTheta, G4double pPhi,
0055 G4double pDy1, G4double pDx1, G4double pDx2,
0056 G4double pAlp1,
0057 G4double pDy2, G4double pDx3, G4double pDx4,
0058 G4double pAlp2 );
0059
0060
0061
0062
0063 G4UTrap( const G4String& pName,
0064 const G4ThreeVector pt[8] ) ;
0065
0066
0067
0068 G4UTrap( const G4String& pName,
0069 G4double pZ,
0070 G4double pY,
0071 G4double pX, G4double pLTX );
0072
0073
0074
0075 G4UTrap( const G4String& pName,
0076 G4double pDx1, G4double pDx2,
0077 G4double pDy1, G4double pDy2,
0078 G4double pDz );
0079
0080
0081
0082 G4UTrap(const G4String& pName,
0083 G4double pDx, G4double pDy, G4double pDz,
0084 G4double pAlpha, G4double pTheta, G4double pPhi );
0085
0086
0087
0088 G4UTrap( const G4String& pName );
0089
0090
0091
0092
0093 ~G4UTrap() override;
0094
0095 void ComputeDimensions( G4VPVParameterisation* p,
0096 const G4int n,
0097 const G4VPhysicalVolume* pRep) override;
0098
0099 G4VSolid* Clone() const override;
0100
0101 using Base_t::GetTanAlpha1;
0102 using Base_t::GetTanAlpha2;
0103
0104
0105
0106 G4double GetZHalfLength() const;
0107 G4double GetYHalfLength1() const;
0108 G4double GetXHalfLength1() const;
0109 G4double GetXHalfLength2() const;
0110 G4double GetTanAlpha1() const;
0111 G4double GetYHalfLength2() const;
0112 G4double GetXHalfLength3() const;
0113 G4double GetXHalfLength4() const;
0114 G4double GetTanAlpha2() const;
0115
0116 TrapSidePlane GetSidePlane(G4int n) const;
0117 G4ThreeVector GetSymAxis() const;
0118
0119 G4double GetPhi() const;
0120 G4double GetTheta() const;
0121 G4double GetAlpha1() const;
0122 G4double GetAlpha2() const;
0123
0124
0125
0126
0127 void SetAllParameters(G4double pDz, G4double pTheta, G4double pPhi,
0128 G4double pDy1, G4double pDx1, G4double pDx2,
0129 G4double pAlp1,
0130 G4double pDy2, G4double pDx3, G4double pDx4,
0131 G4double pAlp2);
0132
0133 inline G4GeometryType GetEntityType() const override;
0134
0135 void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const override;
0136
0137 G4bool CalculateExtent(const EAxis pAxis,
0138 const G4VoxelLimits& pVoxelLimit,
0139 const G4AffineTransform& pTransform,
0140 G4double& pMin, G4double& pMax) const override;
0141
0142 G4Polyhedron* CreatePolyhedron() const override;
0143
0144 public:
0145
0146 G4UTrap(__void__&);
0147
0148
0149
0150
0151 G4UTrap(const G4UTrap& rhs);
0152 G4UTrap& operator=(const G4UTrap& rhs);
0153
0154
0155 private:
0156
0157 void SetPlanes(const G4ThreeVector pt[8]);
0158
0159
0160 void CheckParameters() const;
0161
0162
0163 void GetVertices(G4ThreeVector pt[8]) const;
0164
0165
0166 void CheckPlanarity(const G4ThreeVector pt[8]) const;
0167
0168 };
0169
0170
0171
0172
0173
0174 inline G4GeometryType G4UTrap::GetEntityType() const
0175 {
0176 return "G4Trap";
0177 }
0178
0179 #endif
0180
0181 #endif