File indexing completed on 2025-01-18 09:58:50
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
0053
0054
0055
0056
0057
0058
0059
0060
0061 #ifndef G4PARA_HH
0062 #define G4PARA_HH
0063
0064 #include "G4GeomTypes.hh"
0065
0066 #if defined(G4GEOM_USE_USOLIDS)
0067 #define G4GEOM_USE_UPARA 1
0068 #endif
0069
0070 #if defined(G4GEOM_USE_UPARA)
0071 #define G4UPara G4Para
0072 #include "G4UPara.hh"
0073 #else
0074
0075 #include "G4CSGSolid.hh"
0076 #include "G4Polyhedron.hh"
0077
0078 class G4Para : public G4CSGSolid
0079 {
0080 public:
0081
0082 G4Para(const G4String& pName,
0083 G4double pDx, G4double pDy, G4double pDz,
0084 G4double pAlpha, G4double pTheta, G4double pPhi);
0085
0086 G4Para(const G4String& pName,
0087 const G4ThreeVector pt[8]);
0088
0089 ~G4Para() override;
0090
0091
0092
0093 inline G4double GetZHalfLength() const;
0094 inline G4ThreeVector GetSymAxis() const;
0095 inline G4double GetYHalfLength() const;
0096 inline G4double GetXHalfLength() const;
0097 inline G4double GetTanAlpha() const;
0098
0099 inline G4double GetAlpha() const;
0100 inline G4double GetTheta() const;
0101 inline G4double GetPhi() const;
0102
0103
0104
0105
0106 inline void SetXHalfLength(G4double val);
0107 inline void SetYHalfLength(G4double val);
0108 inline void SetZHalfLength(G4double val);
0109 inline void SetAlpha(G4double alpha);
0110 inline void SetTanAlpha(G4double val);
0111 inline void SetThetaAndPhi(G4double pTheta, G4double pPhi);
0112
0113 void SetAllParameters(G4double pDx, G4double pDy, G4double pDz,
0114 G4double pAlpha, G4double pTheta, G4double pPhi);
0115
0116
0117
0118 G4double GetCubicVolume() override;
0119 G4double GetSurfaceArea() override;
0120
0121 void ComputeDimensions(G4VPVParameterisation* p,
0122 const G4int n,
0123 const G4VPhysicalVolume* pRep) override;
0124
0125 void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const override;
0126
0127 G4bool CalculateExtent(const EAxis pAxis,
0128 const G4VoxelLimits& pVoxelLimit,
0129 const G4AffineTransform& pTransform,
0130 G4double& pMin, G4double& pMax) const override;
0131
0132 EInside Inside(const G4ThreeVector& p) const override;
0133
0134 G4ThreeVector SurfaceNormal( const G4ThreeVector& p) const override;
0135
0136 G4double DistanceToIn(const G4ThreeVector& p,
0137 const G4ThreeVector& v) const override;
0138 G4double DistanceToIn(const G4ThreeVector& p) const override;
0139
0140 G4double DistanceToOut(const G4ThreeVector& p, const G4ThreeVector& v,
0141 const G4bool calcNorm = false,
0142 G4bool* validNorm = nullptr,
0143 G4ThreeVector* n = nullptr) const override;
0144 G4double DistanceToOut(const G4ThreeVector& p) const override;
0145
0146 G4GeometryType GetEntityType() const override;
0147
0148 G4ThreeVector GetPointOnSurface() const override;
0149
0150 G4VSolid* Clone() const override;
0151
0152 std::ostream& StreamInfo(std::ostream& os) const override;
0153
0154
0155
0156 void DescribeYourselfTo (G4VGraphicsScene& scene) const override;
0157 G4Polyhedron* CreatePolyhedron () const override;
0158
0159 G4Para(__void__&);
0160
0161
0162
0163
0164 G4Para(const G4Para& rhs);
0165 G4Para& operator=(const G4Para& rhs);
0166
0167
0168 private:
0169
0170 void CheckParameters();
0171
0172
0173 void MakePlanes();
0174
0175
0176 G4ThreeVector ApproxSurfaceNormal(const G4ThreeVector& p) const;
0177
0178
0179
0180
0181 private:
0182
0183 G4double halfCarTolerance;
0184 G4double fDx,fDy,fDz;
0185 G4double fTalpha,fTthetaCphi,fTthetaSphi;
0186 struct { G4double a,b,c,d; } fPlanes[4];
0187 };
0188
0189 #include "G4Para.icc"
0190
0191 #endif
0192
0193 #endif