Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** 25 // 22 // >> 23 // >> 24 // $Id: G4Para.hh,v 1.9 2003/06/16 16:53:23 gunter Exp $ >> 25 // GEANT4 tag $Name: geant4-06-00 $ >> 26 // >> 27 // >> 28 // -------------------------------------------------------------------- >> 29 // GEANT 4 class header file >> 30 // 26 // G4Para 31 // G4Para 27 // 32 // 28 // Class description: 33 // Class description: 29 // 34 // 30 // A G4Parallepiped, essentially a box with 35 // A G4Parallepiped, essentially a box with half lengths dx,dy,dz 31 // `skewed' so that there are angles theta & 36 // `skewed' so that there are angles theta & phi of the polar line 32 // joining the faces at +-dz in z, and alpha 37 // joining the faces at +-dz in z, and alpha formed by the y axis 33 // and the plane joinng the centre of the fa 38 // and the plane joinng the centre of the faces G4Parallel to the 34 // z-x plane at -dy and +dy. 39 // z-x plane at -dy and +dy. 35 // 40 // 36 // A G4Para is defined by: 41 // A G4Para is defined by: 37 // dx,dy,dz - Half-length in x,y,z 42 // dx,dy,dz - Half-length in x,y,z 38 // alpha - Angle formed by the y axis and 43 // alpha - Angle formed by the y axis and by the plane joining 39 // the centre of the faces G4Para 44 // the centre of the faces G4Parallel to the z-x plane 40 // at -dy and +dy 45 // at -dy and +dy 41 // theta - Polar angle of the line joinin 46 // theta - Polar angle of the line joining the centres of the 42 // faces at -dz and +dz in z 47 // faces at -dz and +dz in z 43 // phi - Azimuthal angle of the line jo 48 // phi - Azimuthal angle of the line joining the centres of the 44 // faces at -dz and +dz in z 49 // faces at -dz and +dz in z 45 // Member data: 50 // Member data: 46 // 51 // 47 // Note that the angles parameters are not s 52 // Note that the angles parameters are not stored - precomputed trig is 48 // stored instead. 53 // stored instead. 49 // 54 // 50 // fDx Half-length in x 55 // fDx Half-length in x 51 // fDy Half-length in y 56 // fDy Half-length in y 52 // fDz Half-length in z 57 // fDz Half-length in z 53 // 58 // 54 // fTalpha Tan of alpha 59 // fTalpha Tan of alpha 55 // fTthetaCphi Tan theta * Cos phi 60 // fTthetaCphi Tan theta * Cos phi 56 // fTthetaSphi Tan theta * Sin phi 61 // fTthetaSphi Tan theta * Sin phi 57 62 >> 63 // History: 58 // 21.3.94 P.Kent Old C++ code converted to to 64 // 21.3.94 P.Kent Old C++ code converted to tolerant geometry 59 // 31.10.96 V.Grichine Modifications according 65 // 31.10.96 V.Grichine Modifications according G4Box/Tubs before to commit >> 66 // 18.11.99 V.Grichine , kUndefined was added to ESide 60 // ------------------------------------------- 67 // -------------------------------------------------------------------- 61 #ifndef G4PARA_HH << 62 #define G4PARA_HH << 63 << 64 #include "G4GeomTypes.hh" << 65 68 66 #if defined(G4GEOM_USE_USOLIDS) << 69 #ifndef G4Para_HH 67 #define G4GEOM_USE_UPARA 1 << 70 #define G4Para_HH 68 #endif << 69 << 70 #if defined(G4GEOM_USE_UPARA) << 71 #define G4UPara G4Para << 72 #include "G4UPara.hh" << 73 #else << 74 71 75 #include "G4CSGSolid.hh" 72 #include "G4CSGSolid.hh" 76 #include "G4Polyhedron.hh" << 77 73 78 class G4Para : public G4CSGSolid 74 class G4Para : public G4CSGSolid 79 { 75 { 80 public: // with description 76 public: // with description 81 77 82 G4Para(const G4String& pName, 78 G4Para(const G4String& pName, 83 G4double pDx, G4double pDy, G 79 G4double pDx, G4double pDy, G4double pDz, 84 G4double pAlpha, G4double pTh 80 G4double pAlpha, G4double pTheta, G4double pPhi); 85 << 81 86 G4Para(const G4String& pName, 82 G4Para(const G4String& pName, 87 const G4ThreeVector pt[8]); 83 const G4ThreeVector pt[8]); 88 84 89 ~G4Para() override; << 85 virtual ~G4Para(); 90 << 86 91 // Accessors << 87 // Accessors 92 88 93 inline G4double GetZHalfLength() const; 89 inline G4double GetZHalfLength() const; 94 inline G4ThreeVector GetSymAxis() const; 90 inline G4ThreeVector GetSymAxis() const; 95 inline G4double GetYHalfLength() const; 91 inline G4double GetYHalfLength() const; 96 inline G4double GetXHalfLength() const; 92 inline G4double GetXHalfLength() const; 97 inline G4double GetTanAlpha() const; 93 inline G4double GetTanAlpha() const; 98 << 94 99 inline G4double GetAlpha() const; << 95 // Modifiers 100 inline G4double GetTheta() const; << 101 inline G4double GetPhi() const; << 102 // Obtain (re)computed values of original << 103 << 104 // Modifiers << 105 96 106 inline void SetXHalfLength(G4double val); 97 inline void SetXHalfLength(G4double val); 107 inline void SetYHalfLength(G4double val); 98 inline void SetYHalfLength(G4double val); 108 inline void SetZHalfLength(G4double val); 99 inline void SetZHalfLength(G4double val); 109 inline void SetAlpha(G4double alpha); 100 inline void SetAlpha(G4double alpha); 110 inline void SetTanAlpha(G4double val); 101 inline void SetTanAlpha(G4double val); 111 inline void SetThetaAndPhi(G4double pTheta << 102 inline void SetThetaAndPhi(double pTheta, double pPhi); 112 << 113 void SetAllParameters(G4double pDx, G4doub << 114 G4double pAlpha, G4d << 115 << 116 // Methods of solid << 117 << 118 G4double GetCubicVolume() override; << 119 G4double GetSurfaceArea() override; << 120 103 >> 104 void SetAllParameters(G4double pDx, G4double pDy, G4double pDz, >> 105 G4double pAlpha, G4double pTheta, G4double pPhi); >> 106 >> 107 // Other methods of solid >> 108 121 void ComputeDimensions(G4VPVParameterisati 109 void ComputeDimensions(G4VPVParameterisation* p, 122 const G4int n, 110 const G4int n, 123 const G4VPhysicalVo << 111 const G4VPhysicalVolume* pRep); 124 << 125 void BoundingLimits(G4ThreeVector& pMin, G << 126 112 127 G4bool CalculateExtent(const EAxis pAxis, 113 G4bool CalculateExtent(const EAxis pAxis, 128 const G4VoxelLimits 114 const G4VoxelLimits& pVoxelLimit, 129 const G4AffineTrans 115 const G4AffineTransform& pTransform, 130 G4double& pMi << 116 G4double& pMin, G4double& pMax) const; 131 << 117 132 EInside Inside(const G4ThreeVector& p) con << 118 EInside Inside(const G4ThreeVector& p) const; 133 119 134 G4ThreeVector SurfaceNormal( const G4Three << 120 G4ThreeVector SurfaceNormal( const G4ThreeVector& p) const; 135 121 136 G4double DistanceToIn(const G4ThreeVector& 122 G4double DistanceToIn(const G4ThreeVector& p, 137 const G4ThreeVector& << 123 const G4ThreeVector& v) const; 138 G4double DistanceToIn(const G4ThreeVector& << 124 G4double DistanceToIn(const G4ThreeVector& p) const; 139 << 125 140 G4double DistanceToOut(const G4ThreeVector 126 G4double DistanceToOut(const G4ThreeVector& p, const G4ThreeVector& v, 141 const G4bool calcNo << 127 const G4bool calcNorm=G4bool(false), 142 G4bool* valid << 128 G4bool *validNorm=0, G4ThreeVector *n=0) const; 143 G4ThreeVector << 129 G4double DistanceToOut(const G4ThreeVector& p) const; 144 G4double DistanceToOut(const G4ThreeVector << 145 << 146 G4GeometryType GetEntityType() const overr << 147 << 148 G4ThreeVector GetPointOnSurface() const ov << 149 << 150 G4bool IsFaceted() const override; << 151 130 152 G4VSolid* Clone() const override; << 131 G4GeometryType GetEntityType() const; 153 132 154 std::ostream& StreamInfo(std::ostream& os) << 133 std::ostream& StreamInfo(std::ostream& os) const; 155 134 156 // Visualisation functions << 135 // Visualisation functions 157 136 158 void DescribeYourselfTo (G4VGraph << 137 void DescribeYourselfTo (G4VGraphicsScene& scene) const; 159 G4Polyhedron* CreatePolyhedron () const << 138 G4Polyhedron* CreatePolyhedron () const; >> 139 G4NURBS* CreateNURBS () const; 160 140 161 G4Para(__void__&); << 141 protected: // without description 162 // Fake default constructor for usage re << 163 // persistency for clients requiring pre << 164 // persistifiable objects << 165 142 166 G4Para(const G4Para& rhs); << 143 G4ThreeVectorList* 167 G4Para& operator=(const G4Para& rhs); << 144 CreateRotatedVertices(const G4AffineTransform& pTransform) const; 168 // Copy constructor and assignment opera << 169 145 170 private: 146 private: 171 147 172 void CheckParameters(); << 173 // Check parameters << 174 << 175 void MakePlanes(); << 176 // Set side planes << 177 << 178 G4ThreeVector ApproxSurfaceNormal(const G4 << 179 // Algorithm for SurfaceNormal() followi << 180 // specification for points not on the s << 181 << 182 << 183 private: << 184 << 185 G4double halfCarTolerance; << 186 G4double fDx,fDy,fDz; 148 G4double fDx,fDy,fDz; 187 G4double fTalpha,fTthetaCphi,fTthetaSphi; 149 G4double fTalpha,fTthetaCphi,fTthetaSphi; 188 struct { G4double a,b,c,d; } fPlanes[4]; << 189 }; 150 }; 190 151 191 #include "G4Para.icc" 152 #include "G4Para.icc" 192 << 193 #endif << 194 153 195 #endif 154 #endif 196 155