175 void EGS_Octree::printInfo()
const {
177 egsInformation(
" bounding box minimum = %g %g %g\n", bbxmin, bbymin, bbzmin);
178 egsInformation(
" bounding box maximum = %g %g %g\n", bbxmax, bbymax, bbzmax);
179 egsInformation(
" bounding box resolution = %d %d %d\n", nx, ny, nz);
183 egsInformation(
" octree average cell size = %.2f\n", nLeafMax/(
float)nLeaf);
185 egsInformation(
" octree cell savings = %.1f%c\n", 100*(1-(
float)nLeaf/nLeafMax),percent);
186 egsInformation(
"=======================================================\n");
189 string EGS_Octree::type(
"EGS_Octree");
191 static char EGS_OCTREE_LOCAL eoctree_message1[] =
"createGeometry(octree): %s\n";
192 static char EGS_OCTREE_LOCAL eoctree_message2[] =
"null input?";
195 static char EGS_OCTREE_LOCAL eoctree_message5[] =
"wrong/missing 'min' or input?";
196 static char EGS_OCTREE_LOCAL eoctree_message6[] =
"expecting 3 float inputs for 'box min' input";
197 static char EGS_OCTREE_LOCAL eoctree_message7[] =
"wrong/missing 'max' or input?";
198 static char EGS_OCTREE_LOCAL eoctree_message8[] =
"expecting 3 float inputs for 'max max' input";
199 static char EGS_OCTREE_LOCAL eoctree_message9[] =
"wrong or missing 'resolution' input?";
200 static char EGS_OCTREE_LOCAL eoctree_message10[] =
"expecting 3 integer inputs for 'resolution' input";
201 static char EGS_OCTREE_LOCAL eoctree_message11[] =
"wrong or missing 'discard child' input?";
202 static char EGS_OCTREE_LOCAL eoctree_message12[] =
"expecting 'yes' or 'no' for 'discard child' input";
203 static char EGS_OCTREE_LOCAL eoctree_message13[] =
"missing or wrong 'child geometry' input";
204 static char EGS_OCTREE_LOCAL eoctree_message14[] =
"undefined child geometry";
205 static char EGS_OCTREE_LOCAL eoctree_message15[] =
"you need to define at least one octree box";
206 static char EGS_OCTREE_LOCAL eoctree_message16[] =
"wrong 'prune tree' input?";
207 static char EGS_OCTREE_LOCAL eoctree_message17[] =
"expecting 'yes' or 'no' for 'prune tree' input?";
208 static char EGS_OCTREE_LOCAL eoctree_key0[] =
"octree box";
209 static char EGS_OCTREE_LOCAL eoctree_key1[] =
"box min";
210 static char EGS_OCTREE_LOCAL eoctree_key2[] =
"box max";
211 static char EGS_OCTREE_LOCAL eoctree_key3[] =
"resolution";
212 static char EGS_OCTREE_LOCAL eoctree_key4[] =
"child geometry";
213 static char EGS_OCTREE_LOCAL eoctree_key5[] =
"discard child";
214 static char EGS_OCTREE_LOCAL eoctree_key6[] =
"prune tree";
224 egsWarning(eoctree_message1,eoctree_message2);
229 vector<EGS_Octree_bbox> vBox;
234 int err = i->
getInput(eoctree_key1, v);
236 egsWarning(eoctree_message1, eoctree_message5);
240 egsWarning(eoctree_message1, eoctree_message6);
248 egsWarning(eoctree_message1, eoctree_message7);
252 egsWarning(eoctree_message1, eoctree_message8);
259 err = i->
getInput(eoctree_key3, bboxRes);
261 egsWarning(eoctree_message1, eoctree_message9);
264 if (bboxRes.size() != 3) {
265 egsWarning(eoctree_message1, eoctree_message10);
272 if (vBox.size() < 1) {
273 egsWarning(eoctree_message1, eoctree_message15);
278 bool discardChild =
true;
281 int err = input->
getInput(eoctree_key5, discard);
283 egsWarning(eoctree_message1, eoctree_message11);
286 if (discard.find(
"yes")==string::npos && discard.find(
"no")==string::npos) {
287 egsWarning(eoctree_message1, eoctree_message12);
290 if (discard.find(
"no")!=string::npos) {
291 discardChild =
false;
296 bool pruneTree =
true;
299 int err = input->
getInput(eoctree_key6, prune);
301 egsWarning(eoctree_message1, eoctree_message16);
304 if (prune.find(
"yes")==string::npos && prune.find(
"no")==string::npos) {
305 egsWarning(eoctree_message1, eoctree_message17);
308 if (prune.find(
"no")!=string::npos) {
316 int err = input->
getInput(eoctree_key4, gname);
318 egsWarning(eoctree_message1, eoctree_message13);
324 egsWarning(eoctree_message1, eoctree_message14);
Base geometry class. Every geometry class must be derived from EGS_BaseGeometry.
int nreg
Number of local regions in this geometry.
void setName(EGS_Input *inp)
Set the name of the geometry from the input inp.
int setLabels(EGS_Input *input)
Set the labels from an input block.
virtual void printInfo() const
Print information about 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.
A class representing 3D vectors.
EGS_GLIB_EXPORT EGS_BaseGeometry * createGeometry(EGS_Input *input)
An octree geometry: 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 egsWarning
Always use this function for reporting warnings.