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