File indexing completed on 2025-09-13 08:58: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
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052 #ifndef G4POLYHEDRA_HH
0053 #define G4POLYHEDRA_HH
0054
0055 #include "G4GeomTypes.hh"
0056
0057 #if defined(G4GEOM_USE_USOLIDS)
0058 #define G4GEOM_USE_UPOLYHEDRA 1
0059 #endif
0060
0061 #if defined(G4GEOM_USE_UPOLYHEDRA)
0062 #define G4UPolyhedra G4Polyhedra
0063 #include "G4UPolyhedra.hh"
0064 #else
0065
0066 #include "G4VCSGfaceted.hh"
0067 #include "G4PolyhedraSide.hh"
0068 #include "G4PolyhedraHistorical.hh"
0069 #include "G4Polyhedron.hh"
0070
0071 class G4EnclosingCylinder;
0072 class G4ReduciblePolygon;
0073
0074 class G4Polyhedra : public G4VCSGfaceted
0075 {
0076 public:
0077
0078 G4Polyhedra(const G4String& name,
0079 G4double phiStart,
0080 G4double phiTotal,
0081 G4int numSide,
0082 G4int numZPlanes,
0083 const G4double zPlane[],
0084 const G4double rInner[],
0085 const G4double rOuter[] );
0086
0087 G4Polyhedra(const G4String& name,
0088 G4double phiStart,
0089 G4double phiTotal,
0090 G4int numSide,
0091 G4int numRZ,
0092 const G4double r[],
0093 const G4double z[] );
0094
0095 ~G4Polyhedra() override;
0096
0097 EInside Inside( const G4ThreeVector& p ) const override;
0098 G4double DistanceToIn( const G4ThreeVector& p,
0099 const G4ThreeVector& v ) const override;
0100 G4double DistanceToIn( const G4ThreeVector& p ) const override;
0101
0102 void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const override;
0103 G4bool CalculateExtent(const EAxis pAxis,
0104 const G4VoxelLimits& pVoxelLimit,
0105 const G4AffineTransform& pTransform,
0106 G4double& pmin, G4double& pmax) const override;
0107
0108 void ComputeDimensions( G4VPVParameterisation* p,
0109 const G4int n,
0110 const G4VPhysicalVolume* pRep) override;
0111
0112 G4GeometryType GetEntityType() const override;
0113
0114 G4bool IsFaceted () const override;
0115
0116 G4VSolid* Clone() const override;
0117
0118 G4double GetCubicVolume() override;
0119 G4double GetSurfaceArea() override;
0120
0121 G4ThreeVector GetPointOnSurface() const override;
0122
0123 std::ostream& StreamInfo( std::ostream& os ) const override;
0124
0125 G4Polyhedron* CreatePolyhedron() const override;
0126
0127 G4bool Reset();
0128
0129
0130
0131 inline G4int GetNumSide() const;
0132 inline G4double GetStartPhi() const;
0133 inline G4double GetEndPhi() const;
0134 inline G4double GetSinStartPhi() const;
0135 inline G4double GetCosStartPhi() const;
0136 inline G4double GetSinEndPhi() const;
0137 inline G4double GetCosEndPhi() const;
0138 inline G4bool IsOpen() const;
0139 inline G4bool IsGeneric() const;
0140 inline G4int GetNumRZCorner() const;
0141 inline G4PolyhedraSideRZ GetCorner( const G4int index ) const;
0142
0143 inline G4PolyhedraHistorical* GetOriginalParameters() const;
0144
0145 inline void SetOriginalParameters(G4PolyhedraHistorical* pars);
0146
0147
0148
0149
0150 G4Polyhedra(__void__&);
0151
0152
0153
0154
0155 G4Polyhedra( const G4Polyhedra& source );
0156 G4Polyhedra& operator=( const G4Polyhedra& source );
0157
0158
0159 protected:
0160
0161 void SetOriginalParameters(G4ReduciblePolygon* rz);
0162
0163
0164 void Create( G4double phiStart,
0165 G4double phiTotal,
0166 G4int numSide,
0167 G4ReduciblePolygon* rz );
0168
0169
0170
0171 void CopyStuff( const G4Polyhedra& source );
0172 void DeleteStuff();
0173
0174
0175
0176 void SetSurfaceElements() const;
0177
0178 protected:
0179
0180 G4int numSide = 0;
0181 G4double startPhi;
0182 G4double endPhi;
0183 G4bool phiIsOpen = false;
0184 G4bool genericPgon = false;
0185 G4int numCorner = 0;
0186 G4PolyhedraSideRZ* corners = nullptr;
0187 G4PolyhedraHistorical* original_parameters = nullptr;
0188
0189 G4EnclosingCylinder* enclosingCylinder = nullptr;
0190
0191 struct surface_element { G4double area=0.; G4int i0=0, i1=0, i2=0; };
0192 mutable std::vector<surface_element>* fElements = nullptr;
0193 };
0194
0195 #include "G4Polyhedra.icc"
0196
0197 #endif
0198
0199 #endif