Geant4 Cross Reference |
1 // 2 // ******************************************************************** 3 // * License and Disclaimer * 4 // * * 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. * 10 // * * 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitation of liability. * 17 // * * 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************************************** 25 // 26 // G4Orb 27 // 28 // Class description: 29 // 30 // A G4Orb is a simple case of G4Sphere. It has only: 31 // fRmax outer radius 32 33 // 20.08.03 V.Grichine - created 34 // 08.08.17 E.Tcherniaev - revised 35 // -------------------------------------------------------------------- 36 #ifndef G4ORB_HH 37 #define G4ORB_HH 38 39 #include "G4GeomTypes.hh" 40 41 #if defined(G4GEOM_USE_USOLIDS) 42 #define G4GEOM_USE_UORB 1 43 #endif 44 45 #if defined(G4GEOM_USE_UORB) 46 #define G4UOrb G4Orb 47 #include "G4UOrb.hh" 48 #else 49 50 #include <CLHEP/Units/PhysicalConstants.h> 51 52 #include "G4CSGSolid.hh" 53 #include "G4Polyhedron.hh" 54 55 class G4Orb : public G4CSGSolid 56 { 57 public: 58 59 G4Orb(const G4String& pName, G4double pRmax); 60 61 ~G4Orb() override; 62 63 // Accessors and modifiers 64 65 inline G4double GetRadius() const; 66 inline G4double GetRadialTolerance() const; 67 68 inline void SetRadius(G4double newRmax); 69 70 // Methods for solid 71 72 inline G4double GetCubicVolume() override; 73 inline G4double GetSurfaceArea() override; 74 75 void ComputeDimensions( G4VPVParameterisation* p, 76 const G4int n, 77 const G4VPhysicalVolume* pRep) override; 78 79 void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const override; 80 81 G4bool CalculateExtent(const EAxis pAxis, 82 const G4VoxelLimits& pVoxelLimit, 83 const G4AffineTransform& pTransform, 84 G4double& pmin, G4double& pmax) const override; 85 86 EInside Inside(const G4ThreeVector& p) const override; 87 88 G4ThreeVector SurfaceNormal( const G4ThreeVector& p) const override; 89 90 G4double DistanceToIn(const G4ThreeVector& p, 91 const G4ThreeVector& v) const override; 92 93 G4double DistanceToIn(const G4ThreeVector& p) const override; 94 95 G4double DistanceToOut(const G4ThreeVector& p, 96 const G4ThreeVector& v, 97 const G4bool calcNorm = false, 98 G4bool* validNorm = nullptr, 99 G4ThreeVector* n = nullptr) const override; 100 101 G4double DistanceToOut(const G4ThreeVector& p) const override; 102 103 G4GeometryType GetEntityType() const override; 104 105 G4ThreeVector GetPointOnSurface() const override; 106 107 G4VSolid* Clone() const override; 108 109 std::ostream& StreamInfo(std::ostream& os) const override; 110 111 // Visualisation functions 112 113 void DescribeYourselfTo (G4VGraphicsScene& scene) const override; 114 G4VisExtent GetExtent () const override; 115 G4Polyhedron* CreatePolyhedron () const override; 116 117 G4Orb(__void__&); 118 // Fake default constructor for usage restricted to direct object 119 // persistency for clients requiring preallocation of memory for 120 // persistifiable objects 121 122 G4Orb(const G4Orb& rhs); 123 G4Orb& operator=(const G4Orb& rhs); 124 // Copy constructor and assignment operator 125 126 protected: 127 128 void Initialize(); 129 130 private: 131 132 G4double fRmax = 0.0; 133 G4double halfRmaxTol = 0.0; 134 G4double sqrRmaxPlusTol = 0.0, sqrRmaxMinusTol = 0.0; 135 }; 136 137 #include "G4Orb.icc" 138 139 #endif 140 141 #endif 142