File indexing completed on 2025-09-15 08:59:36
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 G4UPOLYHEDRA_HH
0035 #define G4UPOLYHEDRA_HH
0036
0037 #include "G4UAdapter.hh"
0038
0039 #if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
0040
0041 #include <VecGeom/volumes/UnplacedPolyhedron.h>
0042
0043 #include "G4TwoVector.hh"
0044 #include "G4PolyhedraSide.hh"
0045 #include "G4PolyhedraHistorical.hh"
0046 #include "G4Polyhedron.hh"
0047
0048 class G4EnclosingCylinder;
0049 class G4ReduciblePolygon;
0050
0051 class G4UPolyhedra : public G4UAdapter<vecgeom::UnplacedPolyhedron>
0052 {
0053 using Shape_t = vecgeom::UnplacedPolyhedron;
0054 using Base_t = G4UAdapter<vecgeom::UnplacedPolyhedron>;
0055
0056 public:
0057
0058 G4UPolyhedra( const G4String& name,
0059 G4double phiStart,
0060 G4double phiTotal,
0061 G4int numSide,
0062 G4int numZPlanes,
0063 const G4double zPlane[],
0064 const G4double rInner[],
0065 const G4double rOuter[] );
0066
0067 G4UPolyhedra( const G4String& name,
0068 G4double phiStart,
0069 G4double phiTotal,
0070 G4int numSide,
0071 G4int numRZ,
0072 const G4double r[],
0073 const G4double z[] );
0074
0075 ~G4UPolyhedra() override;
0076
0077 void ComputeDimensions( G4VPVParameterisation* p,
0078 const G4int n,
0079 const G4VPhysicalVolume* pRep) override;
0080
0081 G4VSolid* Clone() const override;
0082
0083 G4int GetNumSide() const;
0084 G4double GetStartPhi() const;
0085 G4double GetEndPhi() const;
0086 G4double GetSinStartPhi() const;
0087 G4double GetCosStartPhi() const;
0088 G4double GetSinEndPhi() const;
0089 G4double GetCosEndPhi() const;
0090 G4bool IsOpen() const;
0091 G4bool IsGeneric() const;
0092 G4int GetNumRZCorner() const;
0093 G4PolyhedraSideRZ GetCorner( const G4int index ) const;
0094 G4PolyhedraHistorical* GetOriginalParameters() const;
0095 void SetOriginalParameters(G4PolyhedraHistorical* pars);
0096
0097 G4bool Reset();
0098
0099 inline G4GeometryType GetEntityType() const override;
0100
0101 inline G4bool IsFaceted() const override;
0102
0103 G4UPolyhedra( const G4UPolyhedra& source );
0104 G4UPolyhedra& operator=( const G4UPolyhedra& source );
0105
0106
0107 void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const override;
0108
0109 G4bool CalculateExtent(const EAxis pAxis,
0110 const G4VoxelLimits& pVoxelLimit,
0111 const G4AffineTransform& pTransform,
0112 G4double& pMin, G4double& pMax) const override;
0113
0114 G4Polyhedron* CreatePolyhedron() const override;
0115
0116 protected:
0117
0118 void SetOriginalParameters();
0119
0120 G4bool fGenericPgon;
0121 G4PolyhedraHistorical fOriginalParameters;
0122
0123 private:
0124
0125 G4double wrStart;
0126 G4double wrDelta;
0127 G4int wrNumSide;
0128 std::vector<G4TwoVector> rzcorners;
0129 };
0130
0131
0132
0133
0134
0135 inline G4GeometryType G4UPolyhedra::GetEntityType() const
0136 {
0137 return "G4Polyhedra";
0138 }
0139
0140 inline G4bool G4UPolyhedra::IsFaceted() const
0141 {
0142 return true;
0143 }
0144
0145 #endif
0146
0147 #endif