45 string EGS_StackGeometry::type =
"EGS_StackGeometry";
49 if (geoms.size() < 2)
egsFatal(
"EGS_StackGeometry::EGS_StackGeometry: "
50 " less than 2 geometries is not mermitted\n");
55 for (
int j=0; j<ng; j++) {
67 for (
int j=0; j<ng; j++) {
82 EGS_StackGeometry::~EGS_StackGeometry() {
83 for (
int j=0; j<ng; j++)
90 void EGS_StackGeometry::printInfo()
const {
94 g[j]->
getName().c_str(),g[j]->getType().c_str());
96 "=======================================================\n");
99 void EGS_StackGeometry::setMedia(
EGS_Input *,
int,
const int *) {
100 egsWarning(
"EGS_StackGeometry::setMedia: don't use this method. Use the\n"
101 " setMedia() methods of the geometry objects that make up this geometry\n");
104 void EGS_StackGeometry::setRelativeRho(
int start,
int end, EGS_Float rho) {
108 void EGS_StackGeometry::setRelativeRho(
EGS_Input *) {
109 egsWarning(
"EGS_StackGeometry::setRelativeRho(): don't use this method.\n"
110 " Use the setRelativeRho methods of the geometry objects that make up"
114 void EGS_StackGeometry::setBScaling(
int start,
int end, EGS_Float rho) {
118 void EGS_StackGeometry::setBScaling(
EGS_Input *) {
119 egsWarning(
"EGS_StackGeometry::setBScaling(): don't use this method.\n"
120 " Use the setBScaling methods of the geometry objects that make up"
128 egsWarning(
"createGeometry(stack): null input?\n");
131 vector<string> gnames;
132 vector<EGS_BaseGeometry *> geoms;
133 int err = input->
getInput(
"geometries",gnames);
134 if (err || gnames.size() < 2) {
135 egsWarning(
"createGeometry(stack): missing/wrong 'geometries' input\n");
138 for (
unsigned int j=0; j<gnames.size(); j++) {
140 if (!gj)
egsWarning(
"createGeometry(stack): no geometry named %s "
141 " defined\n",gnames[j].c_str());
146 if (geoms.size() < 2) {
147 egsWarning(
"createGeometry(stack): must have at least 2 geometries\n");
155 err = input->
getInput(
"tolerance",tol);
163 void EGS_StackGeometry::getLabelRegions(
const string &str, vector<int> ®s) {
165 vector<int> local_regs;
168 for (
int i=0; i<ng; i++) {
171 for (
int j=0; j<local_regs.size(); j++) {
172 regs.push_back(i*nmax + local_regs[j]);
Base geometry class. Every geometry class must be derived from EGS_BaseGeometry.
int deref()
Decrease the reference count to this geometry.
virtual void getLabelRegions(const string &str, vector< int > ®s)
Get the list of all regions labeled with str.
int nreg
Number of local regions in this geometry.
bool has_B_scaling
Does this geometry has B field scaling factor?
bool is_convex
Is this geometry convex?
bool has_rho_scaling
Does this geometry have relative mass density scvaling?
bool hasBScaling() const
Does this geometry object have a B field scaling feature?
void setName(EGS_Input *inp)
Set the name of the geometry from the input inp.
const string & getName() const
Get the name of this geometry.
bool hasRhoScaling() const
Does this geometry object have a mass density scaling feature?
int regions() const
Returns the number of local regions in this geometry.
int setLabels(EGS_Input *input)
Set the labels from an input block.
virtual void printInfo() const
Print information about this geometry.
int ref()
Increase the reference count to this geometry.
static EGS_BaseGeometry * getGeometry(const string &Name)
Get a pointer to the geometry named Name.
void setBoundaryTolerance(EGS_Input *inp)
Set the value of the boundary tolerance from the input inp.
EGS_StackGeometry(const vector< EGS_BaseGeometry * > &geoms, const string &Name="")
Construct a geometry stack from the vector of geometries geom.
Global egspp functions header file.
EGS_GLIB_EXPORT EGS_BaseGeometry * createGeometry(EGS_Input *input)
A geometry stack: header.
EGS_InfoFunction EGS_EXPORT egsInformation
Always use this function for reporting the progress of a simulation and any other type of information...
EGS_InfoFunction EGS_EXPORT egsFatal
Always use this function for reporting fatal errors.
const EGS_Float epsilon
The epsilon constant for floating point comparisons.
EGS_InfoFunction EGS_EXPORT egsWarning
Always use this function for reporting warnings.