File indexing completed on 2025-09-16 08:57:01
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 G4UTET_HH
0035 #define G4UTET_HH
0036
0037 #include "G4UAdapter.hh"
0038
0039 #if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
0040
0041 #include <VecGeom/volumes/UnplacedTet.h>
0042
0043 #include "G4Polyhedron.hh"
0044
0045 class G4UTet : public G4UAdapter<vecgeom::UnplacedTet>
0046 {
0047
0048 using Shape_t = vecgeom::UnplacedTet;
0049 using Base_t = G4UAdapter<vecgeom::UnplacedTet>;
0050
0051 public:
0052
0053 G4UTet(const G4String& pName,
0054 const G4ThreeVector& anchor,
0055 const G4ThreeVector& p1,
0056 const G4ThreeVector& p2,
0057 const G4ThreeVector& p3,
0058 G4bool* degeneracyFlag = nullptr);
0059
0060 ~G4UTet() override;
0061
0062 void ComputeDimensions( G4VPVParameterisation* p,
0063 const G4int n,
0064 const G4VPhysicalVolume* pRep) override;
0065
0066 G4VSolid* Clone() const override;
0067
0068 inline G4GeometryType GetEntityType() const override;
0069
0070 inline G4bool IsFaceted() const override;
0071
0072 G4UTet(const G4UTet& rhs);
0073 G4UTet& operator=(const G4UTet& rhs);
0074
0075
0076 void SetBoundingLimits(const G4ThreeVector& pMin, const G4ThreeVector& pMax);
0077 void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const override;
0078
0079 G4bool CalculateExtent(const EAxis pAxis,
0080 const G4VoxelLimits& pVoxelLimit,
0081 const G4AffineTransform& pTransform,
0082 G4double& pMin, G4double& pMax) const override;
0083
0084 G4Polyhedron* CreatePolyhedron() const override;
0085
0086 void SetVertices(const G4ThreeVector& anchor,
0087 const G4ThreeVector& p1,
0088 const G4ThreeVector& p2,
0089 const G4ThreeVector& p3,
0090 G4bool* degeneracyFlag = nullptr);
0091
0092
0093 void GetVertices(G4ThreeVector& anchor,
0094 G4ThreeVector& p1,
0095 G4ThreeVector& p2,
0096 G4ThreeVector& p3) const;
0097 std::vector<G4ThreeVector> GetVertices() const;
0098
0099
0100 G4bool CheckDegeneracy(const G4ThreeVector& p0,
0101 const G4ThreeVector& p1,
0102 const G4ThreeVector& p2,
0103 const G4ThreeVector& p3) const;
0104
0105
0106 private:
0107
0108 G4ThreeVector fBmin, fBmax;
0109 };
0110
0111
0112
0113
0114
0115 inline G4GeometryType G4UTet::GetEntityType() const
0116 {
0117 return "G4Tet";
0118 }
0119
0120 inline G4bool G4UTet::IsFaceted() const
0121 {
0122 return true;
0123 }
0124
0125 #endif
0126
0127 #endif