174 void EGS_Octree::printInfo()
const {
176 egsInformation(
" bounding box minimum = %g %g %g\n", bbxmin, bbymin, bbzmin);
177 egsInformation(
" bounding box maximum = %g %g %g\n", bbxmax, bbymax, bbzmax);
178 egsInformation(
" bounding box resolution = %d %d %d\n", nx, ny, nz);
182 egsInformation(
" octree average cell size = %.2f\n", nLeafMax/(
float)nLeaf);
184 egsInformation(
" octree cell savings = %.1f%c\n", 100*(1-(
float)nLeaf/nLeafMax),percent);
185 egsInformation(
"=======================================================\n");
188 string EGS_Octree::type(
"EGS_Octree");
190 static char EGS_OCTREE_LOCAL eoctree_message1[] =
"createGeometry(octree): %s\n";
191 static char EGS_OCTREE_LOCAL eoctree_message2[] =
"null input?";
194 static char EGS_OCTREE_LOCAL eoctree_message5[] =
"wrong/missing 'min' or input?";
195 static char EGS_OCTREE_LOCAL eoctree_message6[] =
"expecting 3 float inputs for 'box min' input";
196 static char EGS_OCTREE_LOCAL eoctree_message7[] =
"wrong/missing 'max' or input?";
197 static char EGS_OCTREE_LOCAL eoctree_message8[] =
"expecting 3 float inputs for 'max max' input";
198 static char EGS_OCTREE_LOCAL eoctree_message9[] =
"wrong or missing 'resolution' input?";
199 static char EGS_OCTREE_LOCAL eoctree_message10[] =
"expecting 3 integer inputs for 'resolution' input";
200 static char EGS_OCTREE_LOCAL eoctree_message11[] =
"wrong or missing 'discard child' input?";
201 static char EGS_OCTREE_LOCAL eoctree_message12[] =
"expecting 'yes' or 'no' for 'discard child' input";
202 static char EGS_OCTREE_LOCAL eoctree_message13[] =
"missing or wrong 'child geometry' input";
203 static char EGS_OCTREE_LOCAL eoctree_message14[] =
"undefined child geometry";
204 static char EGS_OCTREE_LOCAL eoctree_message15[] =
"you need to define at least one octree box";
205 static char EGS_OCTREE_LOCAL eoctree_message16[] =
"wrong 'prune tree' input?";
206 static char EGS_OCTREE_LOCAL eoctree_message17[] =
"expecting 'yes' or 'no' for 'prune tree' input?";
207 static char EGS_OCTREE_LOCAL eoctree_key0[] =
"octree box";
208 static char EGS_OCTREE_LOCAL eoctree_key1[] =
"box min";
209 static char EGS_OCTREE_LOCAL eoctree_key2[] =
"box max";
210 static char EGS_OCTREE_LOCAL eoctree_key3[] =
"resolution";
211 static char EGS_OCTREE_LOCAL eoctree_key4[] =
"child geometry";
212 static char EGS_OCTREE_LOCAL eoctree_key5[] =
"discard child";
213 static char EGS_OCTREE_LOCAL eoctree_key6[] =
"prune tree";
223 egsWarning(eoctree_message1,eoctree_message2);
228 vector<EGS_Octree_bbox> vBox;
233 int err = i->
getInput(eoctree_key1, v);
235 egsWarning(eoctree_message1, eoctree_message5);
239 egsWarning(eoctree_message1, eoctree_message6);
247 egsWarning(eoctree_message1, eoctree_message7);
251 egsWarning(eoctree_message1, eoctree_message8);
258 err = i->
getInput(eoctree_key3, bboxRes);
260 egsWarning(eoctree_message1, eoctree_message9);
263 if (bboxRes.size() != 3) {
264 egsWarning(eoctree_message1, eoctree_message10);
271 if (vBox.size() < 1) {
272 egsWarning(eoctree_message1, eoctree_message15);
277 bool discardChild =
true;
280 int err = input->
getInput(eoctree_key5, discard);
282 egsWarning(eoctree_message1, eoctree_message11);
285 if (discard.find(
"yes")==string::npos && discard.find(
"no")==string::npos) {
286 egsWarning(eoctree_message1, eoctree_message12);
289 if (discard.find(
"no")!=string::npos) {
290 discardChild =
false;
295 bool pruneTree =
true;
298 int err = input->
getInput(eoctree_key6, prune);
300 egsWarning(eoctree_message1, eoctree_message16);
303 if (prune.find(
"yes")==string::npos && prune.find(
"no")==string::npos) {
304 egsWarning(eoctree_message1, eoctree_message17);
307 if (prune.find(
"no")!=string::npos) {
315 int err = input->
getInput(eoctree_key4, gname);
317 egsWarning(eoctree_message1, eoctree_message13);
323 egsWarning(eoctree_message1, eoctree_message14);
An octree geometry: header.
virtual void printInfo() const
Print information about this geometry.
A class representing 3D vectors.
int setLabels(EGS_Input *input)
Set the labels from an input block.
EGS_GLIB_EXPORT EGS_BaseGeometry * createGeometry(EGS_Input *input)
Base geometry class. Every geometry class must be derived from EGS_BaseGeometry.
void setBoundaryTolerance(EGS_Input *inp)
Set the value of the boundary tolerance from the input inp.
static EGS_BaseGeometry * getGeometry(const string &Name)
Get a pointer to the geometry named Name.
EGS_InfoFunction EGS_EXPORT egsInformation
Always use this function for reporting the progress of a simulation and any other type of information...
void setName(EGS_Input *inp)
Set the name of the geometry from the input inp.
int nreg
Number of local regions in this geometry.
EGS_InfoFunction EGS_EXPORT egsWarning
Always use this function for reporting warnings.