EGSnrc C++ class library
Report PIRS-898 (2021)
Iwan Kawrakow, Ernesto Mainegra-Hing, Frederic Tessier, Reid Townson and Blake Walters
|
Base geometry class. Every geometry class must be derived from EGS_BaseGeometry. More...
#include <egs_base_geometry.h>
Public Member Functions | |
EGS_BaseGeometry (const string &Name) | |
Construct a geometry named Name. More... | |
virtual | ~EGS_BaseGeometry () |
Destructor. More... | |
bool | isConvex () const |
Is the geometry convex? More... | |
virtual int | inside (const EGS_Vector &x)=0 |
Returns the region index, if inside, or -1 if outside (obsolete) More... | |
virtual bool | isInside (const EGS_Vector &x)=0 |
Is the position x inside the geometry? More... | |
virtual int | isWhere (const EGS_Vector &x)=0 |
In which region is poisition x? More... | |
virtual int | howfar (int ireg, const EGS_Vector &x, const EGS_Vector &u, EGS_Float &t, int *newmed=0, EGS_Vector *normal=0)=0 |
Calculate the distance to a boundary from x along the direction u. More... | |
virtual EGS_Float | howfarToOutside (int ireg, const EGS_Vector &x, const EGS_Vector &u) |
virtual EGS_Float | hownear (int ireg, const EGS_Vector &x)=0 |
Calculate the distance to a boundary for position x in any direction. More... | |
virtual EGS_Float | getVolume (int ireg) |
Calculates the volume of region ireg. More... | |
virtual EGS_Float | getBound (int idir, int ind) |
Returns region boundaries in direction determined by idir. More... | |
virtual int | getNRegDir (int idir) |
int | regions () const |
Returns the number of local regions in this geometry. More... | |
virtual bool | isRealRegion (int ireg) const |
Returnes true if ireg is a real region, false otherwise. More... | |
virtual int | medium (int ireg) const |
Returns the medium index in region ireg. More... | |
virtual int | getMaxStep () const |
Returns the maximum number of steps through the geometry. More... | |
virtual int | computeIntersections (int ireg, int n, const EGS_Vector &x, const EGS_Vector &u, EGS_GeometryIntersections *isections) |
Calculates intersection distances to region boundaries. More... | |
void | setMedium (const string &Name) |
Set all regions to a medium with name Name. More... | |
void | setMedium (int start, int end, const string &Name, int delta=1) |
Set every delta'th region between start and end to the medium named Name. More... | |
void | setMedium (int imed) |
Set all regions to a medium with index imed. More... | |
void | setMedium (int istart, int iend, int imed, int delta=1) |
Set every delta'th region between start and end (inclusive) to imed. More... | |
void | setMedia (EGS_Input *inp) |
Set the media in the geometry from the input pointed to by inp. More... | |
bool | hasRhoScaling () const |
Does this geometry object have a mass density scaling feature? More... | |
virtual EGS_Float | getRelativeRho (int ireg) const |
Get the relative mass density in region ireg. More... | |
virtual void | setRelativeRho (int start, int end, EGS_Float rho) |
Set the relative mass density in regions. More... | |
virtual void | setRelativeRho (EGS_Input *) |
Set the relative mass density from an user input. More... | |
EGS_Float | getMediumRho (int ind) const |
virtual void | setApplication (EGS_Application *app) |
bool | hasBScaling () const |
Does this geometry object have a B field scaling feature? | |
virtual EGS_Float | getBScaling (int ireg) const |
Get the B field scaling factor in region ireg. | |
virtual void | setBScaling (int start, int end, EGS_Float bf) |
Set the B field scaling factor in regions. More... | |
virtual void | setBScaling (EGS_Input *) |
Set the B field scaling factor from an user input. More... | |
const string & | getName () const |
Get the name of this geometry. More... | |
virtual const string & | getType () const =0 |
Get the geometry type. More... | |
void | setDebug (bool deb) |
Turn debugging on. More... | |
void | setName (EGS_Input *inp) |
Set the name of the geometry from the input inp. More... | |
void | setBoundaryTolerance (EGS_Input *inp) |
Set the value of the boundary tolerance from the input inp. More... | |
void | setBoundaryTolerance (EGS_Float tol) |
Set the value of the boundary tolerance from argument. | |
virtual bool | hasBooleanProperty (int ireg, EGS_BPType prop) const |
Is the boolean property prop set for region ireg ? | |
virtual void | setBooleanProperty (EGS_BPType prop) |
Set the boolean properties of the entire geometry to prop. More... | |
virtual void | addBooleanProperty (int bit) |
Add a boolean property for the entire geometry by setting the bit'th bit. More... | |
virtual void | setBooleanProperty (EGS_BPType prop, int start, int end, int step=1) |
Set the boolean properties of every step'th region between start and end (inclusive) to prop. More... | |
virtual void | addBooleanProperty (int bit, int start, int end, int step=1) |
Add a boolean property to every step'th region between start and end (inclusive) by setting the bit'th bit. More... | |
virtual void | printInfo () const |
Print information about this geometry. More... | |
int | ref () |
Increase the reference count to this geometry. More... | |
int | deref () |
Decrease the reference count to this geometry. More... | |
EGS_Float | getBoundaryTolerance () |
Get the value of the boundary tolerance. | |
virtual void | getNumberRegions (const string &str, vector< int > ®s) |
Get a list of all the regions labeled with a number. | |
virtual void | getLabelRegions (const string &str, vector< int > ®s) |
Get the list of all regions labeled with str. | |
virtual const string & | getLabelName (const int i) |
Get the name of the i-th explicit label in the geometry. | |
virtual int | getLabelCount () |
Get the number of explicit labels in the geometry. | |
int | setLabels (EGS_Input *input) |
Set the labels from an input block. | |
int | setLabels (const string &inp) |
Set the labels from an input string. | |
Static Public Member Functions | |
static int | findRegion (EGS_Float xp, int np, const EGS_Float *p) |
Find the bin to which xp belongs, given np bin edges p. More... | |
static int | nMedia () |
Get the number of media registered so far by all geometries. More... | |
static const char * | getMediumName (int ind) |
Get the name of medium with index ind. More... | |
static int | addMedium (const string &medname) |
Add a medium or get the index of an existing medium. More... | |
static int | getMediumIndex (const string &medname) |
Get the index of a medium named medname. More... | |
static EGS_BaseGeometry * | createGeometry (EGS_Input *) |
Create a geometry (or geometries) from a given input. More... | |
static EGS_BaseGeometry * | createSingleGeometry (EGS_Input *inp) |
Create a single geometry from the input inp. More... | |
static void | clearGeometries () |
Clears (deletes) all geometries in the currently active geometry list. More... | |
static EGS_BaseGeometry * | getGeometry (const string &Name) |
Get a pointer to the geometry named Name. More... | |
static EGS_BaseGeometry ** | getGeometries () |
static int | getNGeometries () |
static string | getUniqueName () |
Get a unique geometry name. More... | |
static void | describeGeometries () |
Describes all existing geometries. More... | |
static void | setActiveGeometryList (int list) |
Set the currently active geometry list. More... | |
static int | getLastError () |
static void | resetErrorFlag () |
Protected Member Functions | |
virtual void | setMedia (EGS_Input *inp, int nmed, const int *med_ind) |
Set media. More... | |
Protected Attributes | |
int | nreg |
Number of local regions in this geometry. More... | |
string | name |
Name of this geometry. More... | |
short * | region_media |
Array of media indeces. More... | |
int | med |
Medium index. More... | |
bool | has_rho_scaling |
Does this geometry have relative mass density scvaling? More... | |
EGS_Float * | rhor |
Array with relative mass densities. More... | |
bool | has_B_scaling |
Does this geometry has B field scaling factor? More... | |
bool | has_Ref_rho |
EGS_Float * | bfactor |
Array with B field scaling factors. More... | |
EGS_Float | rhoRef |
Reference density for B field scaling. More... | |
int | nref |
Number of references to this geometry. More... | |
bool | debug |
Debugging flag. More... | |
bool | is_convex |
Is this geometry convex? More... | |
EGS_BPType | bproperty |
A bit mask of boolean properties for the entire geometry. More... | |
EGS_BPType * | bp_array |
An array of boolean properties on a region by region basis. More... | |
EGS_Float | boundaryTolerance |
Boundary tolerance for geometries that need it. | |
EGS_Float | halfBoundaryTolerance |
vector< label > | labels |
Labels. More... | |
EGS_Application * | app |
The application this object belongs to. | |
Static Protected Attributes | |
static int | error_flag = 0 |
Set to non-zero status if a geometry problem is encountered. | |
Base geometry class. Every geometry class must be derived from EGS_BaseGeometry.
The EGS_BaseGeometry class specifies the EGSnrc geometry interface. See the geometry module documentation for more details.
Definition at line 93 of file egs_base_geometry.h.
EGS_BaseGeometry::EGS_BaseGeometry | ( | const string & | Name | ) |
Construct a geometry named Name.
All geometries must have a unique name that is used to refer to them in the input file specifying the geometry.
Definition at line 429 of file egs_base_geometry.cpp.
References boundaryTolerance, egsFatal, and getUniqueName().
|
virtual |
Destructor.
If necessary, deallocates region_media. It also removes the geometry from the internally maintained static geometry list.
Definition at line 447 of file egs_base_geometry.cpp.
References bfactor, bp_array, has_B_scaling, has_rho_scaling, region_media, and rhor.
bool EGS_BaseGeometry::isConvex | ( | ) | const |
Is the geometry convex?
A "convex" geometry is a geometry for which there is a single segment on a line that intersects it, which is inside the geometry. Example of convex geometries are spheres, cylinders, etc. An examples of non-convex geometries is a torus or a prism with a non-convex polygon as a base. Derived gometry classes should set is_convex to false
if they are not convex. This method is needed, for instance, for N-dimensional geometries (the N-dimensional geometry logic only applies if all dimensions are convex or if there is a single concave dimension, which is also the last dimension.
Definition at line 124 of file egs_base_geometry.h.
Referenced by EGS_NDGeometry::EGS_NDGeometry(), and EGS_PrismT< T >::EGS_PrismT().
|
pure virtual |
Returns the region index, if inside, or -1 if outside (obsolete)
This method is obsolete, isInside() and isWhere() should be used instead.
|
pure virtual |
Is the position x inside the geometry?
This pure virtual method must be implemented by derived geometry classes to return true
, if the position x is inside the geomtry and false
otherwise.
Implemented in EGS_PlanesT< T >.
Referenced by volcor::findRegionsWithInscribed().
|
pure virtual |
In which region is poisition x?
This pure virtual method must be implemented by derived geometry classes to return the index of the region to which x belongs, if the position x is inside the geomtry and -1 otherwise.
Referenced by volcor::findRegionsWithInscribed(), EGS_SimpleApplication::run(), and EGS_Application::simulateSingleShower().
|
static |
Find the bin to which xp belongs, given np bin edges p.
This static method uses a binary search and is provided for the convenience of the various classes that need to find a region index in order to implement the isWhere() method (e.g. sets of planes, cylinders, etc.). Arguably, it should not be a member of the base geomtry class.
Definition at line 160 of file egs_base_geometry.h.
|
pure virtual |
Calculate the distance to a boundary from x along the direction u.
This is one of the 2 main geometry methods needed to implement the EGSnrc geometry specifcation (the other is hownear()). It must be implemented in derived geometry classes to calculate and return the following values, depending on ireg:
In both cases, if an intersection is found at d <= t, and if the pointer newmed is not null
, set it to the medium index in the new region. In the same way, if normal is not null
, set it to the normal vector at the intersection point. The normal is needed for visualization purpsoses only (i.e., normal is always null
in a normal simulation).
Referenced by computeIntersections(), EGS_SimpleApplication::run(), and EGS_Application::simulateSingleShower().
|
virtual |
Calculate the distance to the outer geometry boundary from x along the direction u.
The base geometry provides a generic implementation for this method that uses howfar(). However, geometries that can can compute the distance to their outer boundary more rapidly should provide their own implementation. The reason for adding this method (May 2007) is that we have already run into 2 situations (CBCT and PET), where it is advantegeous to have this method for implementing advanced variance reduction techniques.
Definition at line 381 of file egs_base_geometry.cpp.
|
pure virtual |
Calculate the distance to a boundary for position x in any direction.
This is the second main geometry method needed to implement the EGSnrc geometry specifcation (the other is howfar()). It must be implemented in derived classes to calculate the nearest distance to a boundary for position x in any direction assuming that x is in region ireg (if ireg >= 0) or that x is outside (if ireg < 0).
|
virtual |
Calculates the volume of region ireg.
Currently only implemented EGS_XYZGeometry, EGS_cSpheres, EGS_cSphericalShell, EGS_AEnvelope, and EGS_RZGeometry
Reimplemented in EGS_cSpheres, and EGS_RZGeometry.
Definition at line 239 of file egs_base_geometry.h.
|
virtual |
Returns region boundaries in direction determined by idir.
Currently only implemented in EGS_XYZGeometry, where idir=0–> X-boundaries, idir=1–> Y-boundaries, idir=2–> Z-boundaries
Reimplemented in EGS_cSpheres, and EGS_RZGeometry.
Definition at line 248 of file egs_base_geometry.h.
Referenced by EGS_cSpheres::getBound().
|
virtual |
Returns number of planar slabs/cylinders/etc in direction idir
Currently only implemented in EGS_XYZGeometry, where idir=0–> X-boundaries, idir=1–> Y-boundaries, idir=2–> Z-boundaries
Reimplemented in EGS_cSpheres, and EGS_RZGeometry.
Definition at line 257 of file egs_base_geometry.h.
Referenced by EGS_cSpheres::getNRegDir().
int EGS_BaseGeometry::regions | ( | ) | const |
Returns the number of local regions in this geometry.
The fact that this method is not virtual implies that derived geometry classes must set EGS_BaseGeometry::nreg to the number of regions in the geometry.
Definition at line 267 of file egs_base_geometry.h.
Referenced by EGS_NDGeometry::EGS_NDGeometry(), EGS_StackGeometry::EGS_StackGeometry(), and EGS_UnionGeometry::EGS_UnionGeometry().
|
virtual |
Returnes true if ireg is a real region, false otherwise.
This method is needed because of the region indexing style used by some composite geometries which results in a larger number of regions than actual regions. This method can be used in such cases to check if a region exists.
Definition at line 278 of file egs_base_geometry.h.
|
virtual |
Returns the medium index in region ireg.
If a re-implementation of this method is undertaken, it can be safely assumed that this method is only invoked with ireg inside the geometry (unless, of course, there is a bug)
Definition at line 288 of file egs_base_geometry.h.
Referenced by computeIntersections().
|
virtual |
Returns the maximum number of steps through the geometry.
This method is handy for detecting when a particle gets stuck at a boundary
Definition at line 297 of file egs_base_geometry.h.
|
virtual |
Calculates intersection distances to region boundaries.
For a given position x, direction u and region number ireg, this method returns the number of intersections with the geometry and distances, medium indeces and relative mass densities for all intersections, or, if this number is larger than the size n of isections, -1 (but the n intersections are still put in isections). If the position is outside, the method checks if the trajectory intersects the geometry and if yes, puts in the first element of isections the distance to the entry point and then finds all other intersections as in the case of x inside.
Definition at line 918 of file egs_base_geometry.cpp.
References getRelativeRho(), howfar(), EGS_GeometryIntersections::imed, EGS_GeometryIntersections::ireg, medium(), EGS_GeometryIntersections::rhof, EGS_GeometryIntersections::t, and veryFar.
void EGS_BaseGeometry::setMedium | ( | const string & | Name | ) |
Set all regions to a medium with name Name.
This method obtains a index for the medium named Name from an internally maintained list of media and sets the medium index in all regions in the geometry to this index.
Definition at line 480 of file egs_base_geometry.cpp.
References med, nreg, and region_media.
Referenced by EGS_NDGeometry::setMedia(), setMedia(), and setMedium().
void EGS_BaseGeometry::setMedium | ( | int | start, |
int | end, | ||
const string & | Name, | ||
int | delta = 1 |
||
) |
Set every delta'th region between start and end to the medium named Name.
This method is similar to the previous method but only sets the medium index in all regions between start and end (inclusive). Note that...
Definition at line 496 of file egs_base_geometry.cpp.
References setMedium().
void EGS_BaseGeometry::setMedium | ( | int | imed | ) |
Set all regions to a medium with index imed.
Note that...
Definition at line 340 of file egs_base_geometry.h.
void EGS_BaseGeometry::setMedium | ( | int | istart, |
int | iend, | ||
int | imed, | ||
int | delta = 1 |
||
) |
Set every delta'th region between start and end (inclusive) to imed.
This method is similar to setMedium(int,int,constr string &,int).
Definition at line 502 of file egs_base_geometry.cpp.
References med, nreg, and region_media.
void EGS_BaseGeometry::setMedia | ( | EGS_Input * | inp | ) |
Set the media in the geometry from the input pointed to by inp.
This method sets the media from a composite property 'media input' that has the key
and zero or more keys of the form
media = list of media
See PIRS-899 for more details.
set medium = first last medium_index
Definition at line 743 of file egs_base_geometry.cpp.
References EGS_Input::getInput(), EGS_Input::isA(), nMedia(), setBScaling(), setRelativeRho(), and EGS_Input::takeInputItem().
|
static |
Get the number of media registered so far by all geometries.
Returns the number of media registered sofar by all geometries. A static list of media names is maintained internally. Media names can be added using addMedium(), setMedium(int,int,const string&) or setMedium(const string&)
Definition at line 527 of file egs_base_geometry.cpp.
Referenced by EGS_SimpleApplication::EGS_SimpleApplication(), EGS_AdvancedApplication::helpInit(), and setMedia().
|
static |
Get the name of medium with index ind.
Returns a pointer to the character array holding the name of the medium with index ind or null
if there is no such medium index.
Definition at line 531 of file egs_base_geometry.cpp.
Referenced by EGS_SimpleApplication::EGS_SimpleApplication(), and EGS_AdvancedApplication::helpInit().
|
static |
Add a medium or get the index of an existing medium.
This function returns the index of a medium with the name medname in the static list of media names registered so far by all geometries. If a medium with name medname already exists, the index of this medium is returned. If no such medium name exists in the list, medname is first appended to the list and then its index is returned.
Definition at line 488 of file egs_base_geometry.cpp.
|
static |
Get the index of a medium named medname.
If medname is found in the list of media, its index is returned. Otherwise the return value is -1.
Definition at line 492 of file egs_base_geometry.cpp.
bool EGS_BaseGeometry::hasRhoScaling | ( | ) | const |
Does this geometry object have a mass density scaling feature?
Definition at line 401 of file egs_base_geometry.h.
Referenced by EGS_StackGeometry::EGS_StackGeometry(), EGS_UnionGeometry::EGS_UnionGeometry(), and EGS_AdvancedApplication::startNewParticle().
|
virtual |
Get the relative mass density in region ireg.
Definition at line 408 of file egs_base_geometry.h.
Referenced by computeIntersections(), and EGS_AdvancedApplication::startNewParticle().
|
virtual |
Set the relative mass density in regions.
Sets the relative mass density to rho in all regions between start and end (inclusive).
Definition at line 813 of file egs_base_geometry.cpp.
References has_rho_scaling, nreg, and rhor.
Referenced by setMedia(), and setRelativeRho().
|
virtual |
Set the relative mass density from an user input.
Looks for input
set relative density = start end rho
and sets the relative mass density to rho in all regions between start and end (inclusive).
Definition at line 835 of file egs_base_geometry.cpp.
References egsWarning, EGS_Input::getInput(), setRelativeRho(), and EGS_Input::takeInputItem().
|
virtual |
Set the B field scaling factor in regions.
Sets the B field scaling factor to bf in all regions between start and end (inclusive).
Definition at line 861 of file egs_base_geometry.cpp.
References bfactor, has_B_scaling, and nreg.
Referenced by setBScaling(), and setMedia().
|
virtual |
Set the B field scaling factor from an user input.
Looks for input
set B scaling = start end bfact
and sets the B field scaling factor to bfact in all regions between start and end (inclusive).
Definition at line 883 of file egs_base_geometry.cpp.
References egsWarning, EGS_Input::getInput(), rhoRef, setBScaling(), and EGS_Input::takeInputItem().
const string& EGS_BaseGeometry::getName | ( | ) | const |
Get the name of this geometry.
Every geometry must have a name and this method can be used to retrieve the name of a geometry.
Definition at line 496 of file egs_base_geometry.h.
Referenced by createGeometry(), EGS_SimpleApplication::EGS_SimpleApplication(), and printInfo().
|
pure virtual |
Get the geometry type.
This pure virtual function must be implemented in derived classes to return a short but descriptive geometry type string. getType() is used in printInfo() to describe a geometry.
Implemented in EGS_RZGeometry.
Referenced by EGS_RoundRectCylindersT< Tx, Ty >::EGS_RoundRectCylindersT(), EGS_SimpleApplication::EGS_SimpleApplication(), EGS_TransformedGeometry::EGS_TransformedGeometry(), and printInfo().
|
static |
Create a geometry (or geometries) from a given input.
This static function looks for geometry definition by quering for a composite property geometry definition
. Every individual geometry definition is contained in a geometry definition
child property geometry
. The return value of this function is the geometry specified with
simulation geometry = name of an existing geometry
if such input exists or the last constructed geometry. If the input inp does not contain any valid geometry definitions, null
is returned.
Note that the geometry definition
property is removed from the input inp by this method.
Definition at line 547 of file egs_base_geometry.cpp.
References egsFatal, egsWarning, EGS_Input::getInput(), getName(), EGS_Input::isA(), and EGS_Input::takeInputItem().
Referenced by createGeometry(), EGS_SimpleApplication::EGS_SimpleApplication(), and EGS_Application::initGeometry().
|
static |
Create a single geometry from the input inp.
The input pointed to by inp must contain all information necessary to construct a geometry. The minimum information necessary is
library = the name of a geometry library
The library name should not include platform specific prefixes and file extensions. This function attemtps to dynamically load the library specified by the
name = the name of this geometry
library
key and to resolve the geometry creation function createGeometry
that a geometry library must provide. If this succeeds, the geometry created by createGeometry
using the input pointed to by inp is returned (if the input is not sufficient or valid to create the desired geometry, createGeometry will return null
).
Definition at line 543 of file egs_base_geometry.cpp.
Referenced by setName().
|
static |
Clears (deletes) all geometries in the currently active geometry list.
This function deletes all geometries in the currently active list of geometries and also clears the internally maintained list of media.
Definition at line 464 of file egs_base_geometry.cpp.
void EGS_BaseGeometry::setDebug | ( | bool | deb | ) |
Turn debugging on.
This is mainly useful in the development process of a new geometry. It sets the protected data member debug to deb.
Definition at line 560 of file egs_base_geometry.h.
|
static |
Get a pointer to the geometry named Name.
This function returns a pointer to the geometry named Name, if a geometry with such a name exists in the static list of geometries, or null
if no such geometry exists.
Definition at line 468 of file egs_base_geometry.cpp.
Referenced by EGS_FanoSource::EGS_FanoSource(), and EGS_IsotropicSource::EGS_IsotropicSource().
|
static |
Get a unique geometry name.
This function is used to create a unique name for a nameless geometry. Normally geometry names should be specified explicitely when constructing geometries.
Definition at line 603 of file egs_base_geometry.cpp.
Referenced by EGS_BaseGeometry(), and setName().
void EGS_BaseGeometry::setName | ( | EGS_Input * | inp | ) |
Set the name of the geometry from the input inp.
This method looks for a key name
in the input pointed to by inp and sets the name of the geometry to the value of the name
key. Derived geometry classes should always call this function to set their name from the input provided to the geometry creation function.
Definition at line 609 of file egs_base_geometry.cpp.
References createSingleGeometry(), egsWarning, EGS_Input::getInput(), getUniqueName(), EGS_Input::setContentFromString(), and EGS_Input::takeInputItem().
void EGS_BaseGeometry::setBoundaryTolerance | ( | EGS_Input * | inp | ) |
Set the value of the boundary tolerance from the input inp.
This method looks for a key tolerance
in the input pointed to by inp and sets the boundary tolerance of the geometry to the value of the tolerance
key. Derived geometry classes should call this function to set their boundary tolerance from the input provided to the geometry creation function.
Definition at line 717 of file egs_base_geometry.cpp.
References boundaryTolerance, egsWarning, and EGS_Input::getInput().
|
virtual |
Set the boolean properties of the entire geometry to prop.
Definition at line 964 of file egs_base_geometry.cpp.
References bp_array, and bproperty.
Referenced by setBooleanProperty().
|
virtual |
Add a boolean property for the entire geometry by setting the bit'th bit.
Definition at line 972 of file egs_base_geometry.cpp.
References bp_array, bproperty, egsWarning, and nreg.
Referenced by addBooleanProperty().
|
virtual |
Set the boolean properties of every step'th region between start and end (inclusive) to prop.
Definition at line 987 of file egs_base_geometry.cpp.
References bp_array, nreg, and setBooleanProperty().
|
virtual |
Add a boolean property to every step'th region between start and end (inclusive) by setting the bit'th bit.
Definition at line 1011 of file egs_base_geometry.cpp.
References addBooleanProperty(), bp_array, egsWarning, and nreg.
|
virtual |
Print information about this geometry.
The default implementation of this function outputs a separation line, the geometry type (as returned by getType() ), the geometry name ( as returned by getName() ) and the number of regions in the geometry using egsInformation(). Derived geometry classes should first call the base class implementation of printInfo() and then add additional useful infromation to the output using egsInformation().
Definition at line 726 of file egs_base_geometry.cpp.
References egsInformation, getName(), getType(), hasBScaling(), and nreg.
Referenced by EGS_Application::describeSimulation().
|
static |
Describes all existing geometries.
This static function outputs information about all currently existing geometries using their printInfo() method
Definition at line 736 of file egs_base_geometry.cpp.
References egsInformation.
Referenced by EGS_SimpleApplication::EGS_SimpleApplication().
int EGS_BaseGeometry::ref | ( | ) |
Increase the reference count to this geometry.
Composite geometries that use other geometries should increase their reference count using this method. This is needed to prevent a geometry being destructed that is still in use by some other geometry.
Definition at line 678 of file egs_base_geometry.h.
Referenced by EGS_StackGeometry::EGS_StackGeometry(), EGS_UnionGeometry::EGS_UnionGeometry(), and EGS_Application::initGeometry().
int EGS_BaseGeometry::deref | ( | ) |
Decrease the reference count to this geometry.
Composite geometries should use this method to decrease the reference count to other geometries they use when destructed and delete the geometry, if the return value of this function is 0.
Definition at line 690 of file egs_base_geometry.h.
Referenced by EGS_Application::~EGS_Application(), and EGS_SimpleApplication::~EGS_SimpleApplication().
|
static |
Set the currently active geometry list.
Definition at line 405 of file egs_base_geometry.cpp.
Referenced by EGS_AdvancedApplication::helpInit(), EGS_Application::initGeometry(), and EGS_Application::~EGS_Application().
|
protectedvirtual |
Set media.
This function repeaditley takes set media
keys from the input pointed to by inp and assigns media indeces using the indeces stored in med_ind. Used internally by setMedia(EGS_Input *) but left as a protected method just in case it may be useful to derived geometry classes.
Reimplemented in EGS_FastEnvelope, EGS_EnvelopeGeometry, EGS_NDGeometry, EGS_AEnvelope, EGS_SmartEnvelope, EGS_UnionGeometry, and EGS_TransformedGeometry.
Definition at line 787 of file egs_base_geometry.cpp.
References egsWarning, EGS_Input::getInput(), med, setMedium(), and EGS_Input::takeInputItem().
|
protected |
Number of local regions in this geometry.
Must be set by derived geometry classes to be equal to the number of regions
Definition at line 741 of file egs_base_geometry.h.
Referenced by addBooleanProperty(), EGS_IPlanes::EGS_IPlanes(), EGS_NDGeometry::EGS_NDGeometry(), EGS_PlanesT< T >::EGS_PlanesT(), EGS_PyramidT< T >::EGS_PyramidT(), EGS_StackGeometry::EGS_StackGeometry(), EGS_UnionGeometry::EGS_UnionGeometry(), EGS_cSpheres::getBound(), EGS_cSpheres::getNRegDir(), EGS_RZGeometry::getVolume(), EGS_cSpheres::getVolume(), printInfo(), setBooleanProperty(), setBScaling(), EGS_DeformedXYZ::setDeformations(), setMedium(), and setRelativeRho().
|
protected |
Name of this geometry.
Every geometry needs a name, so that it can be refered to by other geometries or objects.
Definition at line 748 of file egs_base_geometry.h.
|
protected |
Array of media indeces.
This array is only allocated if the geometry has more than 1 region and not all regions have the same medium index and contains the media indeces of all regions in such cases.
Definition at line 756 of file egs_base_geometry.h.
Referenced by setMedium(), and ~EGS_BaseGeometry().
|
protected |
Medium index.
This variable holds the medium index for geometries that have a single region or geometries with multiple regions filled with the same medium.
Definition at line 764 of file egs_base_geometry.h.
Referenced by EGS_NDGeometry::setMedia(), setMedia(), and setMedium().
|
protected |
Does this geometry have relative mass density scvaling?
Definition at line 770 of file egs_base_geometry.h.
Referenced by EGS_StackGeometry::EGS_StackGeometry(), EGS_UnionGeometry::EGS_UnionGeometry(), setRelativeRho(), and ~EGS_BaseGeometry().
|
protected |
Array with relative mass densities.
Definition at line 775 of file egs_base_geometry.h.
Referenced by setRelativeRho(), and ~EGS_BaseGeometry().
|
protected |
Does this geometry has B field scaling factor?
Definition at line 780 of file egs_base_geometry.h.
Referenced by EGS_StackGeometry::EGS_StackGeometry(), EGS_UnionGeometry::EGS_UnionGeometry(), setBScaling(), and ~EGS_BaseGeometry().
|
protected |
Array with B field scaling factors.
Definition at line 785 of file egs_base_geometry.h.
Referenced by setBScaling(), and ~EGS_BaseGeometry().
|
protected |
Reference density for B field scaling.
Definition at line 790 of file egs_base_geometry.h.
Referenced by setBScaling().
|
protected |
Number of references to this geometry.
Definition at line 796 of file egs_base_geometry.h.
|
protected |
Debugging flag.
This is handy during the development of a new geometry.
Definition at line 812 of file egs_base_geometry.h.
|
protected |
Is this geometry convex?
By default this data member is set to true
. This should be overwritten by derived geometry classes that are not convex.
Definition at line 822 of file egs_base_geometry.h.
Referenced by EGS_NDGeometry::EGS_NDGeometry(), EGS_PyramidT< T >::EGS_PyramidT(), EGS_StackGeometry::EGS_StackGeometry(), and EGS_UnionGeometry::EGS_UnionGeometry().
|
protected |
A bit mask of boolean properties for the entire geometry.
Can be set using setBoolenProperty() or addBooleanProperty()
Definition at line 828 of file egs_base_geometry.h.
Referenced by addBooleanProperty(), and setBooleanProperty().
|
protected |
An array of boolean properties on a region by region basis.
Only allocated if neede (i.e. not all regions in a geometry have the same boolean properties.
Definition at line 835 of file egs_base_geometry.h.
Referenced by addBooleanProperty(), setBooleanProperty(), and ~EGS_BaseGeometry().
|
protected |
Labels.
This variable holds the list of labels for the geometry. Each label consists of a name and a list of regions numbers associated with this label name.
Labels can be associated to regions by using the set label = name r1 r2 r3 ...
input when defining a geometry. This method returns a list of all regions associated with this label in the geometry. Notably, for compound geometries the labels can be defined locally, but this method returns the global region numbers in the final geometry. Labels are therefore useful to determine region numbers in complicated geometrical constructs. They are also useful to track region numbers upon modyfying the geometry.
Definition at line 858 of file egs_base_geometry.h.
Referenced by getLabelRegions(), and setLabels().