45 while (first != last && (*first)->
is_empty()) {
46 if ((*first)->is_infinite()) {
59 for (bvi = first; bvi != last; ++bvi) {
60 if ((*bvi)->is_infinite()) {
69 if (!(*first)->around_other(
this, first, last)) {
81 write(ostream &out,
int indent_level)
const {
82 indent(out, indent_level) << *
this <<
"\n";
162 if (strcmp(str.c_str(),
"default") == 0) {
165 }
else if (strcmp(str.c_str(),
"best") == 0) {
168 }
else if (strcmp(str.c_str(),
"fastest") == 0) {
171 }
else if (strcmp(str.c_str(),
"sphere") == 0) {
174 }
else if (strcmp(str.c_str(),
"box") == 0) {
185 bool BoundingVolume::
187 return extend_by_finite(sphere);
194 bool BoundingVolume::
196 return extend_by_finite(box);
203 bool BoundingVolume::
205 return extend_by_finite(hexahedron);
212 bool BoundingVolume::
214 return extend_by_geometric(line);
221 bool BoundingVolume::
223 return extend_by_geometric(plane);
230 bool BoundingVolume::
232 return extend_by_geometric(unionv);
239 bool BoundingVolume::
241 return extend_by_geometric(intersection);
247 bool BoundingVolume::
249 return extend_by_geometric(volume);
255 bool BoundingVolume::
257 mathutil_cat.warning()
258 << get_type() <<
"::extend_by_geometric() called with " << volume->get_type() <<
"\n";
267 bool BoundingVolume::
269 return around_finite(first, last);
276 bool BoundingVolume::
278 return around_finite(first, last);
285 bool BoundingVolume::
287 return around_finite(first, last);
294 bool BoundingVolume::
296 return around_geometric(first, last);
303 bool BoundingVolume::
305 return around_geometric(first, last);
312 bool BoundingVolume::
314 return around_geometric(first, last);
321 bool BoundingVolume::
323 return around_geometric(first, last);
329 bool BoundingVolume::
331 return around_geometric(first, last);
337 bool BoundingVolume::
339 mathutil_cat.warning()
340 << get_type() <<
"::extend_by_geometric() called with " << first[0]->get_type() <<
"\n";
351 return contains_finite(sphere);
360 return contains_finite(box);
369 return contains_finite(hexahedron);
378 return contains_geometric(line);
387 return contains_geometric(plane);
396 return unionv->other_contains_union(
this);
405 return intersection->other_contains_intersection(
this);
413 return contains_geometric(volume);
421 mathutil_cat.warning()
422 << get_type() <<
"::contains_geometric() called with " << volume->get_type() <<
"\n";
423 return IF_dont_understand;
427 operator << (ostream &out, BoundingVolume::BoundsType type) {
429 case BoundingVolume::BT_default:
430 return out <<
"default";
432 case BoundingVolume::BT_best:
433 return out <<
"best";
435 case BoundingVolume::BT_fastest:
436 return out <<
"fastest";
438 case BoundingVolume::BT_sphere:
439 return out <<
"sphere";
441 case BoundingVolume::BT_box:
446 <<
"Invalid BoundingVolume::BoundsType value: " << (int)type <<
"\n";
447 nassertr(
false, out);
452 operator >> (istream &in, BoundingVolume::BoundsType &type) {
456 if (type == BoundingVolume::BT_default) {
457 mathutil_cat->error()
458 <<
"Invalid BoundingVolume::BoundsType string: " << word <<
"\n";