EGSnrc C++ class library  Report PIRS-898 (2021)
Iwan Kawrakow, Ernesto Mainegra-Hing, Frederic Tessier, Reid Townson and Blake Walters
Public Member Functions | Protected Attributes | List of all members
EGS_BoxShape Class Reference

A box shape. More...

#include <egs_shapes.h>

Inheritance diagram for EGS_BoxShape:
EGS_BaseShape EGS_Object

Public Member Functions

 EGS_BoxShape (const string &Name="", EGS_ObjectFactory *f=0)
 Create a box shape with unit size.
 
 EGS_BoxShape (EGS_Float A, const EGS_AffineTransform *t=0, const string &Name="", EGS_ObjectFactory *f=0)
 Create a cube with size A.
 
 EGS_BoxShape (EGS_Float Ax, EGS_Float Ay, EGS_Float Az, const EGS_AffineTransform *t=0, const string &Name="", EGS_ObjectFactory *f=0)
 Create a box shape with size Ax,Ay,Az.
 
 ~EGS_BoxShape ()
 Destructor. Does nothing.
 
EGS_Vector getPoint (EGS_RandomGenerator *rndm)
 Returns a point uniformely distributed within the box.
 
EGS_ObjectcreateObject (EGS_Input *)
 Create a box shape from the information pointed to by inp and return a pointer to it.
 
bool supportsDirectionMethod () const
 Returns true. (It is easy to implement the getPointSourceDirection() method for a box.)
 
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 the on the box surface. More...
 
EGS_Float area () const
 Returns the box 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_AffineTransformgetTransform () 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.
 
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 ax
 
EGS_Float ay
 
EGS_Float az
 The box size.
 
- Protected Attributes inherited from EGS_BaseShape
EGS_AffineTransformT
 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_ObjectFactoryfactory
 The factory this object belongs to.
 

Additional Inherited Members

- Static Public Member Functions inherited from EGS_BaseShape
static EGS_BaseShapecreateShape (EGS_Input *inp)
 Create a shape from the information pointed to by inp. More...
 
static EGS_BaseShapegetShape (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...
 

Detailed Description

A box shape.

Samples random points within a box of a given size or on the box surface. Specified in the input file via

:start shape:
    type = box
    box size = 1 or 3 inputs defining the box size
:stop shape:

Definition at line 356 of file egs_shapes.h.

Member Function Documentation

void EGS_BoxShape::getPointSourceDirection ( const EGS_Vector Xo,
EGS_RandomGenerator rndm,
EGS_Vector u,
EGS_Float &  wt 
)
virtual

Sets the direction u by picking a random point uniformely the on the box surface.

See Also
EGS_BaseShape::getPointSourceDirection()

Reimplemented from EGS_BaseShape.

Definition at line 415 of file egs_shapes.h.

References EGS_BaseShape::area(), EGS_RandomGenerator::getUniform(), EGS_Vector::x, EGS_Vector::y, and EGS_Vector::z.


The documentation for this class was generated from the following files: