File indexing completed on 2025-01-18 09:58:57
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 G4VSolid* Clone() const override;
0115
0116 G4double GetCubicVolume() override;
0117 G4double GetSurfaceArea() override;
0118
0119 G4ThreeVector GetPointOnSurface() const override;
0120
0121 std::ostream& StreamInfo( std::ostream& os ) const override;
0122
0123 G4Polyhedron* CreatePolyhedron() const override;
0124
0125 G4bool Reset();
0126
0127
0128
0129 inline G4int GetNumSide() const;
0130 inline G4double GetStartPhi() const;
0131 inline G4double GetEndPhi() const;
0132 inline G4double GetSinStartPhi() const;
0133 inline G4double GetCosStartPhi() const;
0134 inline G4double GetSinEndPhi() const;
0135 inline G4double GetCosEndPhi() const;
0136 inline G4bool IsOpen() const;
0137 inline G4bool IsGeneric() const;
0138 inline G4int GetNumRZCorner() const;
0139 inline G4PolyhedraSideRZ GetCorner( const G4int index ) const;
0140
0141 inline G4PolyhedraHistorical* GetOriginalParameters() const;
0142
0143 inline void SetOriginalParameters(G4PolyhedraHistorical* pars);
0144
0145
0146
0147
0148 G4Polyhedra(__void__&);
0149
0150
0151
0152
0153 G4Polyhedra( const G4Polyhedra& source );
0154 G4Polyhedra& operator=( const G4Polyhedra& source );
0155
0156
0157 protected:
0158
0159 void SetOriginalParameters(G4ReduciblePolygon* rz);
0160
0161
0162 void Create( G4double phiStart,
0163 G4double phiTotal,
0164 G4int numSide,
0165 G4ReduciblePolygon* rz );
0166
0167
0168
0169 void CopyStuff( const G4Polyhedra& source );
0170 void DeleteStuff();
0171
0172
0173
0174 void SetSurfaceElements() const;
0175
0176 protected:
0177
0178 G4int numSide = 0;
0179 G4double startPhi;
0180 G4double endPhi;
0181 G4bool phiIsOpen = false;
0182 G4bool genericPgon = false;
0183 G4int numCorner = 0;
0184 G4PolyhedraSideRZ* corners = nullptr;
0185 G4PolyhedraHistorical* original_parameters = nullptr;
0186
0187 G4EnclosingCylinder* enclosingCylinder = nullptr;
0188
0189 struct surface_element { G4double area=0.; G4int i0=0, i1=0, i2=0; };
0190 mutable std::vector<surface_element>* fElements = nullptr;
0191 };
0192
0193 #include "G4Polyhedra.icc"
0194
0195 #endif
0196
0197 #endif