File indexing completed on 2025-01-18 09:58:20
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 #ifndef G4GENERICPOLYCONE_HH
0045 #define G4GENERICPOLYCONE_HH
0046
0047 #include "G4GeomTypes.hh"
0048
0049 #if defined(G4GEOM_USE_USOLIDS)
0050 #define G4GEOM_USE_UGENERICPOLYCONE 1
0051 #endif
0052
0053 #if defined(G4GEOM_USE_UGENERICPOLYCONE)
0054 #define G4UGenericPolycone G4GenericPolycone
0055 #include "G4UGenericPolycone.hh"
0056 #else
0057
0058 #include "G4VCSGfaceted.hh"
0059 #include "G4PolyconeSide.hh"
0060
0061 class G4EnclosingCylinder;
0062 class G4ReduciblePolygon;
0063 class G4VCSGface;
0064
0065 class G4GenericPolycone : public G4VCSGfaceted
0066 {
0067 public:
0068
0069 G4GenericPolycone( const G4String& name,
0070 G4double phiStart,
0071 G4double phiTotal,
0072 G4int numRZ,
0073 const G4double r[],
0074 const G4double z[] );
0075
0076 ~G4GenericPolycone() override;
0077
0078 EInside Inside( const G4ThreeVector &p ) const override;
0079 G4double DistanceToIn( const G4ThreeVector &p,
0080 const G4ThreeVector &v ) const override;
0081 G4double DistanceToIn( const G4ThreeVector &p ) const override;
0082
0083 void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const override;
0084 G4bool CalculateExtent(const EAxis pAxis,
0085 const G4VoxelLimits& pVoxelLimit,
0086 const G4AffineTransform& pTransform,
0087 G4double& pmin, G4double& pmax) const override;
0088
0089 G4double GetCubicVolume() override;
0090 G4double GetSurfaceArea() override;
0091
0092 G4ThreeVector GetPointOnSurface() const override;
0093
0094 G4GeometryType GetEntityType() const override;
0095
0096 G4VSolid* Clone() const override;
0097
0098 std::ostream& StreamInfo(std::ostream& os) const override;
0099
0100 G4Polyhedron* CreatePolyhedron() const override;
0101
0102 G4bool Reset();
0103
0104
0105
0106 inline G4double GetStartPhi() const;
0107 inline G4double GetEndPhi() const;
0108 inline G4double GetSinStartPhi() const;
0109 inline G4double GetCosStartPhi() const;
0110 inline G4double GetSinEndPhi() const;
0111 inline G4double GetCosEndPhi() const;
0112 inline G4bool IsOpen() const;
0113 inline G4int GetNumRZCorner() const;
0114 inline G4PolyconeSideRZ GetCorner(G4int index) const;
0115
0116 G4GenericPolycone(__void__&);
0117
0118
0119
0120
0121 G4GenericPolycone( const G4GenericPolycone& source );
0122 G4GenericPolycone& operator=( const G4GenericPolycone& source );
0123
0124
0125 protected:
0126
0127
0128
0129 void Create( G4double phiStart,
0130 G4double phiTotal,
0131 G4ReduciblePolygon* rz );
0132
0133 void CopyStuff( const G4GenericPolycone& source );
0134
0135
0136
0137 void SetSurfaceElements() const;
0138
0139 protected:
0140
0141
0142
0143 G4double startPhi;
0144 G4double endPhi;
0145 G4bool phiIsOpen = false;
0146 G4int numCorner;
0147 G4PolyconeSideRZ* corners = nullptr;
0148
0149 G4EnclosingCylinder* enclosingCylinder = nullptr;
0150
0151 struct surface_element { G4double area = 0.; G4int i0 = 0, i1 = 0, i2 = 0; };
0152 mutable std::vector<surface_element>* fElements = nullptr;
0153 };
0154
0155 #include "G4GenericPolycone.icc"
0156
0157 #endif
0158
0159 #endif