Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4Orb.hh
Go to the documentation of this file.
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
51
52#include "G4CSGSolid.hh"
53#include "G4Polyhedron.hh"
54
55class 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;
67
68 inline void SetRadius(G4double newRmax);
69
70 // Methods for solid
71
72 inline G4double GetCubicVolume() override;
73 inline G4double GetSurfaceArea() override;
74
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
91 const G4ThreeVector& v) const override;
92
93 G4double DistanceToIn(const G4ThreeVector& p) const override;
94
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
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
Definition G4Orb.hh:56
G4Polyhedron * CreatePolyhedron() const override
Definition G4Orb.cc:455
G4double GetSurfaceArea() override
void Initialize()
Definition G4Orb.cc:111
G4Orb(const G4Orb &rhs)
void ComputeDimensions(G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep) override
Definition G4Orb.cc:134
G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const override
Definition G4Orb.cc:275
void SetRadius(G4double newRmax)
EInside Inside(const G4ThreeVector &p) const override
Definition G4Orb.cc:253
G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pmin, G4double &pmax) const override
Definition G4Orb.cc:170
~G4Orb() override
G4double GetRadialTolerance() const
G4double GetCubicVolume() override
G4double GetRadius() const
std::ostream & StreamInfo(std::ostream &os) const override
Definition G4Orb.cc:418
G4Orb(const G4String &pName, G4double pRmax)
Definition G4Orb.cc:55
G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=nullptr, G4ThreeVector *n=nullptr) const override
Definition G4Orb.cc:330
G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const override
Definition G4Orb.cc:264
G4ThreeVector GetPointOnSurface() const override
Definition G4Orb.cc:436
G4GeometryType GetEntityType() const override
Definition G4Orb.cc:400
G4VisExtent GetExtent() const override
Definition G4Orb.cc:450
void DescribeYourselfTo(G4VGraphicsScene &scene) const override
Definition G4Orb.cc:445
G4VSolid * Clone() const override
Definition G4Orb.cc:409
G4Orb & operator=(const G4Orb &rhs)
Definition G4Orb.cc:87
void BoundingLimits(G4ThreeVector &pMin, G4ThreeVector &pMax) const override
Definition G4Orb.cc:145
EAxis
Definition geomdefs.hh:54
EInside
Definition geomdefs.hh:67