50 void EGS_Lattice::setMedia(
EGS_Input *,
int,
const int *) {
51 egsWarning(
"EGS_Lattice::setMedia: don't use this method. Use the\n"
52 " setMedia() methods of the geometry objects that make up this geometry\n");
55 void EGS_Lattice::setRelativeRho(
int start,
int end, EGS_Float rho) {
59 void EGS_Lattice::setRelativeRho(
EGS_Input *) {
60 egsWarning(
"EGS_Lattice::setRelativeRho(): don't use this method."
61 " Use the\n setRelativeRho methods of the geometry objects that make up"
65 void EGS_Lattice::setBScaling(
int start,
int end, EGS_Float bf) {
69 void EGS_Lattice::setBScaling(
EGS_Input *) {
70 egsWarning(
"EGS_Lattice::setBScaling(): don't use this method. "
71 "Use the\n setBScaling() methods of the geometry objects that make "
72 "up this geometry\n");
76 EGS_Float y, EGS_Float z,
const string &Name)
79 ind(i), a(x), b(y), c(z) {
80 type = base->getType();
81 type +=
" with a lattice of ";
82 type += sub->getType();
83 nreg = base->regions() + sub->regions();
85 maxStep = base->regions()+1000000*sub->regions();
88 EGS_Lattice::~EGS_Lattice() {
97 void EGS_Lattice::printInfo()
const {
102 sub->getType().c_str());
103 egsInformation(
" lattice region %d with an (x,y,z) spacing of (%d,%d,%d)",
105 egsInformation(
"=======================================================\n");
108 void EGS_Hexagonal_Lattice::setMedia(
EGS_Input *,
int,
const int *) {
109 egsWarning(
"EGS_Hexagonal_Lattice::setMedia: don't use this method. Use the\n"
110 " setMedia() methods of the geometry objects that make up this geometry\n");
113 void EGS_Hexagonal_Lattice::setRelativeRho(
int start,
int end, EGS_Float rho) {
117 void EGS_Hexagonal_Lattice::setRelativeRho(
EGS_Input *) {
118 egsWarning(
"EGS_Hexagonal_Lattice::setRelativeRho(): don't use this method."
119 " Use the\n setRelativeRho methods of the geometry objects that make up"
123 void EGS_Hexagonal_Lattice::setBScaling(
int start,
int end, EGS_Float bf) {
127 void EGS_Hexagonal_Lattice::setBScaling(
EGS_Input *) {
128 egsWarning(
"EGS_Hexagonal_Lattice::setBScaling(): don't use this method. "
129 "Use the\n setBScaling() methods of the geometry objects that make "
130 "up this geometry\n");
137 ind(i), a(x), d(4,0.0) {
138 type = base->getType();
139 type +=
" with a hexagonal lattice of ";
140 type += sub->getType();
141 gap = a*sqrt(3.0)/2.0;
142 nreg = base->regions() + sub->regions();
144 maxStep = base->regions()+1000000*sub->regions();
147 EGS_Hexagonal_Lattice::~EGS_Hexagonal_Lattice() {
156 void EGS_Hexagonal_Lattice::printInfo()
const {
161 sub->getType().c_str());
163 egsInformation(
"=======================================================\n");
173 egsWarning(
"createGeometry(lattice): base geometry must be defined\n"
174 " using 'base geometry = some_geom'?\n");
183 egsWarning(
"createGeometry(lattice): incorrect base geometry definition\n");
190 err = i->
getInput(
"base geometry",bgname);
193 egsWarning(
"createGeometry(lattice): missing/incorrect 'base geometry' input\n");
198 egsWarning(
"createGeometry(lattice): no geometry with name %s defined\n",
207 egsWarning(
"createGeometry(lattice): subgeometry must be defined\n"
208 " using 'subgeometry = some_geom'?\n");
217 egsWarning(
"createGeometry(lattice): incorrect subgeometry definition\n");
224 err = i->
getInput(
"subgeometry",bgname);
227 egsWarning(
"createGeometry(lattice): missing/incorrect 'subgeometry' input\n");
232 egsWarning(
"createGeometry(lattice): no geometry with name %s defined\n",
242 egsWarning(
"createGeometry(lattice): subgeometry index must be defined\n"
243 " using 'subgeometry index = some_index'\n");
247 err = i->
getInput(
"subgeometry index",ind);
250 egsWarning(
"createGeometry(lattice): missing/incorrect 'subgeometry index' input\n");
253 else if (ind < 0 || ind >= b->
regions()) {
254 egsWarning(
"createGeometry(lattice): subgeometry index %d"
255 " is not valid, must be a region in base geometry\n",ind);
261 vector<EGS_Float> space;
262 err = input->
getInput(
"spacing",space);
264 for (
int i=0; i < space.size(); i++) {
267 " is not valid, spacings must be greater than zero\n");
271 if (space.size() != 1 && space.size() != 3) {
273 " is not valid, input either one or three"
274 "x, y, and z spacings\n");
285 if (space.size() == 3) {
286 result =
new EGS_Lattice(b, s, ind, space[0], space[1], space[2]);
288 else if (input->
compare(
"hexagonal",type)) {
292 result =
new EGS_Lattice(b, s, ind, space[0], space[0], space[0]);
298 void EGS_Lattice::getLabelRegions(
const string &str, vector<int> ®s) {
301 int index = regs.size();
305 for (; index<regs.size(); index++) {
310 void EGS_Hexagonal_Lattice::getLabelRegions(
const string &str, vector<int> ®s) {
313 int index = regs.size();
317 for (; index<regs.size(); index++) {
virtual const string & getType() const =0
Get the geometry type.
int regions() const
Returns the number of local regions in this geometry.
int deref()
Decrease the reference count to this geometry.
virtual void printInfo() const
Print information about this geometry.
EGS_Float c
The center-to-center distance along x, y, and z.
Lattice geometries: header.
EGS_TransformedGeometry * sub
The sub geometry that could appear within base.
A class representing 3D vectors.
Global egspp functions header file.
EGS_GLIB_EXPORT EGS_BaseGeometry * createGeometry(EGS_Input *input)
Base geometry class. Every geometry class must be derived from EGS_BaseGeometry.
A Bravais, cubic, and hexagonal lattice geometryA geometry which embeds a lattice of one geometry (na...
EGS_BaseGeometry * base
The geometry within which the sub geometry appears.
static EGS_BaseGeometry * getGeometry(const string &Name)
Get a pointer to the geometry named Name.
virtual void getLabelRegions(const string &str, vector< int > ®s)
Get the list of all regions labeled with str.
EGS_InfoFunction EGS_EXPORT egsInformation
Always use this function for reporting the progress of a simulation and any other type of information...
EGS_Float a
The center-to-center distance to the nearest 12 neighbours.
void setName(EGS_Input *inp)
Set the name of the geometry from the input inp.
int ind
The region in base geom where we could encounter sub geom.
bool has_rho_scaling
Does this geometry have relative mass density scvaling?
int ind
The region in base geom where we could encounter sub geom.
static EGS_BaseGeometry * createSingleGeometry(EGS_Input *inp)
Create a single geometry from the input inp.
const string & getName() const
Get the name of this geometry.
EGS_TransformedGeometry * sub
The sub geometry that could appear within base.
int nreg
Number of local regions in this geometry.
EGS_BaseGeometry * base
The geometry within which the sub geometry appears.
EGS_InfoFunction EGS_EXPORT egsWarning
Always use this function for reporting warnings.