Geant4 11.1.1
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: // with description
58
59 G4Orb(const G4String& pName, G4double pRmax);
60
61 ~G4Orb();
62
63 // Accessors and modifiers
64
65 inline G4double GetRadius() const;
67
68 inline void SetRadius(G4double newRmax);
69
70 // Methods for solid
71
74
76 const G4int n,
77 const G4VPhysicalVolume* pRep);
78
79 void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
80
81 G4bool CalculateExtent(const EAxis pAxis,
82 const G4VoxelLimits& pVoxelLimit,
83 const G4AffineTransform& pTransform,
84 G4double& pmin, G4double& pmax) const;
85
86 EInside Inside(const G4ThreeVector& p) const;
87
89
91 const G4ThreeVector& v) const;
92
93 G4double DistanceToIn(const G4ThreeVector& p) const;
94
96 const G4ThreeVector& v,
97 const G4bool calcNorm = false,
98 G4bool* validNorm = nullptr,
99 G4ThreeVector* n = nullptr) const;
100
101 G4double DistanceToOut(const G4ThreeVector& p) const;
102
104
106
107 G4VSolid* Clone() const;
108
109 std::ostream& StreamInfo(std::ostream& os) const;
110
111 // Visualisation functions
112
113 void DescribeYourselfTo (G4VGraphicsScene& scene) const;
114 G4VisExtent GetExtent () const;
116
117 public: // without description
118
119 G4Orb(__void__&);
120 // Fake default constructor for usage restricted to direct object
121 // persistency for clients requiring preallocation of memory for
122 // persistifiable objects
123
124 G4Orb(const G4Orb& rhs);
125 G4Orb& operator=(const G4Orb& rhs);
126 // Copy constructor and assignment operator
127
128 protected:
129
130 void Initialize();
131
132 private:
133
134 G4double fRmax = 0.0;
135 G4double halfRmaxTol = 0.0;
136 G4double sqrRmaxPlusTol = 0.0, sqrRmaxMinusTol = 0.0;
137};
138
139#include "G4Orb.icc"
140
141#endif
142
143#endif
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
Definition: G4Orb.hh:56
void Initialize()
Definition: G4Orb.cc:117
G4double GetSurfaceArea()
void SetRadius(G4double newRmax)
G4ThreeVector GetPointOnSurface() const
Definition: G4Orb.cc:442
G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const
Definition: G4Orb.cc:270
void ComputeDimensions(G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
Definition: G4Orb.cc:140
G4VSolid * Clone() const
Definition: G4Orb.cc:415
G4double GetRadialTolerance() const
G4double GetRadius() const
EInside Inside(const G4ThreeVector &p) const
Definition: G4Orb.cc:259
G4GeometryType GetEntityType() const
Definition: G4Orb.cc:406
~G4Orb()
Definition: G4Orb.cc:75
G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const
Definition: G4Orb.cc:281
G4Polyhedron * CreatePolyhedron() const
Definition: G4Orb.cc:461
void DescribeYourselfTo(G4VGraphicsScene &scene) const
Definition: G4Orb.cc:451
void BoundingLimits(G4ThreeVector &pMin, G4ThreeVector &pMax) const
Definition: G4Orb.cc:151
std::ostream & StreamInfo(std::ostream &os) const
Definition: G4Orb.cc:424
G4double GetCubicVolume()
G4VisExtent GetExtent() const
Definition: G4Orb.cc:456
G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pmin, G4double &pmax) const
Definition: G4Orb.cc:176
G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=nullptr, G4ThreeVector *n=nullptr) const
Definition: G4Orb.cc:336
G4Orb & operator=(const G4Orb &rhs)
Definition: G4Orb.cc:93
EAxis
Definition: geomdefs.hh:54
EInside
Definition: geomdefs.hh:67