Geant4
9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4BREPSolidSphere.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
//
27
// $Id$
28
//
29
// ----------------------------------------------------------------------
30
// Class G4BREPSolidSphere
31
//
32
// Class description:
33
//
34
// Definition of a generic BREP sphere:
35
//
36
// G4BREPSolidSphere(const G4String& name,
37
// const G4Vector3D& origin,
38
// const G4Vector3D& xhat,
39
// const G4Vector3D& zhat,
40
// G4double radius)
41
42
// Authors: J.Sulkimo, P.Urban.
43
// Revisions by: L.Broglia, G.Cosmo.
44
// ----------------------------------------------------------------------
45
#ifndef __G4BREPSolidSphere
46
#define __G4BREPSolidSphere
47
48
#include "
G4BREPSolid.hh
"
49
50
class
G4BREPSolidSphere
:
public
G4BREPSolid
51
{
52
53
public
:
// with description
54
55
G4BREPSolidSphere
(
const
G4String
& name,
56
const
G4Vector3D
& origin,
57
const
G4Vector3D
& xhat,
58
const
G4Vector3D
& zhat,
59
G4double
radius);
60
// Constructor defining the sphere through its spherical surfaces.
61
62
~G4BREPSolidSphere
();
63
// Empty destructor.
64
65
EInside
Inside
(
register
const
G4ThreeVector
& Pt)
const
;
66
// Determines if the point Pt is inside, outside or on the surface
67
// of the solid.
68
69
G4ThreeVector
SurfaceNormal
(
const
G4ThreeVector
&)
const
;
70
// Calculates the normal of the surface at a point on the surface
71
// The sense of the normal depends on the sense of the surface.
72
73
G4double
DistanceToIn
(
const
G4ThreeVector
&)
const
;
74
// Calculates the shortest distance ("safety") from a point
75
// outside the solid to any boundary of this solid.
76
// Return 0 if the point is already inside.
77
78
G4double
DistanceToIn
(
register
const
G4ThreeVector
& Pt,
79
register
const
G4ThreeVector
& V)
const
;
80
// Calculates the distance from a point Pt outside the solid
81
// to the solid's boundary along a specified direction vector V.
82
// Note: Intersections with boundaries less than the tolerance must
83
// be ignored if the direction is away from the boundary.
84
85
G4double
DistanceToOut
(
register
const
G4ThreeVector
& Pt,
86
register
const
G4ThreeVector
& V,
87
const
G4bool
calcNorm=
false
,
88
G4bool
*validNorm=0,
G4ThreeVector
*n=0)
const
;
89
// Calculates the distance from a point inside the solid to the solid`s
90
// boundary along a specified direction vector.
91
// Return 0 if the point is already outside.
92
// Note: If the shortest distance to a boundary is less than the
93
// tolerance, it is ignored. This allows for a point within a
94
// tolerant boundary to leave immediately.
95
96
G4double
DistanceToOut
(
const
G4ThreeVector
&)
const
;
97
// Calculates the shortest distance ("safety") from a point inside the
98
// solid to any boundary of this solid.
99
// Return 0 if the point is already outside.
100
101
G4VSolid
*
Clone
()
const
;
102
// Returns a pointer of a dynamically allocated copy of the solid.
103
104
std::ostream&
StreamInfo
(std::ostream& os)
const
;
105
// Streams solid contents to output stream.
106
107
public
:
// without description
108
109
G4BREPSolidSphere
(__void__&);
110
// Fake default constructor for usage restricted to direct object
111
// persistency for clients requiring preallocation of memory for
112
// persistifiable objects.
113
114
inline
void
SphReset
() {
active
=1; }
115
116
G4BREPSolidSphere
(
const
G4BREPSolidSphere
& rhs);
117
G4BREPSolidSphere
&
operator=
(
const
G4BREPSolidSphere
& rhs);
118
// Copy constructor and assignment operator.
119
120
private
:
121
122
void
InitializeSphere();
123
124
private
:
125
126
struct
G4BREPSphereParams
127
{
128
G4Vector3D
origin;
129
G4Vector3D
xhat;
130
G4Vector3D
zhat;
131
G4double
radius;
132
} constructorParams;
133
};
134
135
#endif
G4BREPSolid.hh
G4double
double G4double
Definition:
G4Types.hh:64
G4bool
bool G4bool
Definition:
G4Types.hh:67
CLHEP::Hep3Vector
Definition:
ThreeVector.h:41
G4BREPSolidSphere
Definition:
G4BREPSolidSphere.hh:51
G4BREPSolidSphere::SphReset
void SphReset()
Definition:
G4BREPSolidSphere.hh:114
G4BREPSolidSphere::SurfaceNormal
G4ThreeVector SurfaceNormal(const G4ThreeVector &) const
Definition:
G4BREPSolidSphere.cc:124
G4BREPSolidSphere::StreamInfo
std::ostream & StreamInfo(std::ostream &os) const
Definition:
G4BREPSolidSphere.cc:193
G4BREPSolidSphere::~G4BREPSolidSphere
~G4BREPSolidSphere()
Definition:
G4BREPSolidSphere.cc:61
G4BREPSolidSphere::Clone
G4VSolid * Clone() const
Definition:
G4BREPSolidSphere.cc:188
G4BREPSolidSphere::operator=
G4BREPSolidSphere & operator=(const G4BREPSolidSphere &rhs)
Definition:
G4BREPSolidSphere.cc:77
G4BREPSolidSphere::Inside
EInside Inside(register const G4ThreeVector &Pt) const
Definition:
G4BREPSolidSphere.cc:115
G4BREPSolidSphere::DistanceToIn
G4double DistanceToIn(const G4ThreeVector &) const
Definition:
G4BREPSolidSphere.cc:132
G4BREPSolidSphere::DistanceToOut
G4double DistanceToOut(register const G4ThreeVector &Pt, register const G4ThreeVector &V, const G4bool calcNorm=false, G4bool *validNorm=0, G4ThreeVector *n=0) const
Definition:
G4BREPSolidSphere.cc:156
G4BREPSolid
Definition:
G4BREPSolid.hh:51
G4BREPSolid::active
G4int active
Definition:
G4BREPSolid.hh:227
G4String
Definition:
G4String.hh:105
G4VSolid
Definition:
G4VSolid.hh:89
HepGeom::Vector3D< G4double >
EInside
EInside
Definition:
geomdefs.hh:58
geant4-v9.6.0
source
geometry
solids
BREPS
include
G4BREPSolidSphere.hh
Generated by
1.9.6