EGSnrc C++ class library
Report PIRS-898 (2021)
Iwan Kawrakow, Ernesto Mainegra-Hing, Frederic Tessier, Reid Townson and Blake Walters
|
A spherical shell shape. More...
#include <egs_spherical_shell.h>
Public Member Functions | |
EGS_SphericalShellShape (EGS_Float ri, EGS_Float ro, int hemisph=0, EGS_Float halfangle=0, const EGS_Vector &Xo=EGS_Vector(0, 0, 0), const string &Name="", EGS_ObjectFactory *f=0) | |
Construct a sphere of radius r with midpoint Xo. | |
EGS_Vector | getPoint (EGS_RandomGenerator *rndm) |
Returns a random point within the spherical shell. | |
bool | supportsDirectionMethod () const |
Returns true . (It is easy to implement the getPointSourceDirection() method for a sphere.) | |
void | getPointSourceDirection (const EGS_Vector &Xo, EGS_RandomGenerator *rndm, EGS_Vector &u, EGS_Float &wt) |
Sets the direction u by picking a random point uniformely on the sphere surface. More... | |
EGS_Float | area () const |
Returns the sphere surface area. | |
Public Member Functions inherited from EGS_BaseShape | |
EGS_BaseShape (const string &Name="", EGS_ObjectFactory *f=0) | |
Construct a shape named Name. | |
virtual | ~EGS_BaseShape () |
Destructor. Deletes T if it is not null . | |
virtual EGS_Vector | getRandomPoint (EGS_RandomGenerator *rndm) |
Returns a random 3D vector. More... | |
void | setTransformation (EGS_Input *inp) |
Set the transformation attached to this shape. More... | |
void | setTransformation (EGS_AffineTransform *t) |
Set the transformation attached to this shape. More... | |
const EGS_AffineTransform * | getTransform () const |
Get a pointer to the affine transformation attached to this shape. | |
Public Member Functions inherited from EGS_Object | |
EGS_Object (const string &Name="", EGS_ObjectFactory *f=0) | |
Create an EGS_Object named Name belonging to the object factory f. More... | |
EGS_Object (EGS_Input *inp, EGS_ObjectFactory *f=0) | |
Create an EGS_Object from the information pointed to by inp that belongs to object factory f. More... | |
const string & | getObjectName () const |
Get the object name. | |
void | setObjectName (const string &Name) |
Set the object name to Name. | |
const string & | getObjectType () const |
Get the object type. | |
virtual EGS_Object * | createObject (EGS_Input *inp) |
Create an object from the infromation pointed to by inp. More... | |
void | setName (EGS_Input *inp) |
Set the name of the object from the information provided by inp. More... | |
int | ref () |
Increase the reference count to this object. | |
int | deref () |
Decrease the reference count to this object. | |
void | setFactory (EGS_ObjectFactory *f) |
Set the factory to which the object belongs. More... | |
Protected Attributes | |
EGS_Float | r_inner |
EGS_Float | r_outer |
EGS_Float | sgn |
The sphere radius. | |
int | hemisphere |
EGS_Float | half_angle |
Half angle of conical section. | |
EGS_Vector | xo |
The sphere midpoint. | |
Protected Attributes inherited from EGS_BaseShape | |
EGS_AffineTransform * | T |
The affine transformation attached to the shape. | |
Protected Attributes inherited from EGS_Object | |
string | name |
The object name. | |
string | otype |
The object type. | |
int | nref |
Number of references to the object. | |
EGS_ObjectFactory * | factory |
The factory this object belongs to. | |
Additional Inherited Members | |
Static Public Member Functions inherited from EGS_BaseShape | |
static EGS_BaseShape * | createShape (EGS_Input *inp) |
Create a shape from the information pointed to by inp. More... | |
static EGS_BaseShape * | getShape (const string &Name) |
Get a pointer to the shape named Name. More... | |
Static Public Member Functions inherited from EGS_Object | |
static string | getUniqueName (const EGS_Object *o=0) |
Create and return a unique object name. More... | |
static void | deleteObject (EGS_Object *o) |
Delete an object. More... | |
A spherical shell shape.
Samples random points within a spherical shell.
A sample input block is given below
:start shape: library = egs_spherical_shell midpoint = 0, 0, 0 inner radius = 0.5 outer radius = 1 hemisphere = 1 # optional half angle = 35 # optional :stop shape:
If hemisphere
is 1 or -1 the shell will be truncated at the z = 0 plane with points being sampled with positive z if hemisphere
is 1 and negative z if hemisphere
is -1;
If half angle
is specified (in degrees) the random points will be sampled within a spherical shell truncated by a conical section with the half angle specified. If half angle
is negative the points will sampled with negative z coordinates.
Definition at line 101 of file egs_spherical_shell.h.
|
virtual |
Sets the direction u by picking a random point uniformely on the sphere surface.
Reimplemented from EGS_BaseShape.
Definition at line 102 of file egs_spherical_shell.cpp.
References EGS_RandomGenerator::getAzimuth(), EGS_RandomGenerator::getUniform(), EGS_BaseShape::T, EGS_Vector::x, xo, EGS_Vector::y, and EGS_Vector::z.