Using default constructor when returning unbounded boxes.

This commit is contained in:
Patrick Shriwise 2019-07-18 13:02:08 -05:00
parent 6d97188413
commit 07c9083446
2 changed files with 6 additions and 6 deletions

View file

@ -207,9 +207,9 @@ Universe::to_hdf5(hid_t universes_group) const
}
BoundingBox Universe::bounding_box() const {
BoundingBox bbox = {INFTY, -INFTY, INFTY, -INFTY, INFTY, -INFTY};
BoundingBox bbox;
if (cells_.size() == 0) {
bbox = {-INFTY, INFTY, -INFTY, -INFTY, INFTY};
return {};
} else {
for (const auto& cell : cells_) {
auto& c = model::cells[cell];

View file

@ -653,7 +653,7 @@ BoundingBox SurfaceXCylinder::bounding_box(bool pos_side) const {
if (!pos_side) {
return {-INFTY, INFTY, y0_ - radius_, y0_ + radius_, z0_ - radius_, z0_ + radius_};
} else {
return {-INFTY, INFTY, -INFTY, INFTY, -INFTY, INFTY};
return {};
}
}
//==============================================================================
@ -693,7 +693,7 @@ BoundingBox SurfaceYCylinder::bounding_box(bool pos_side) const {
if (!pos_side) {
return {x0_ - radius_, x0_ + radius_, -INFTY, INFTY, z0_ - radius_, z0_ + radius_};
} else {
return {-INFTY, INFTY, -INFTY, INFTY, -INFTY, INFTY};
return {};
}
}
@ -734,7 +734,7 @@ BoundingBox SurfaceZCylinder::bounding_box(bool pos_side) const {
if (!pos_side) {
return {x0_ - radius_, x0_ + radius_, y0_ - radius_, y0_ + radius_, -INFTY, INFTY};
} else {
return {-INFTY, INFTY, -INFTY, INFTY, -INFTY, INFTY};
return {};
}
}
@ -813,7 +813,7 @@ BoundingBox SurfaceSphere::bounding_box(bool pos_side) const {
y0_ - radius_, y0_ + radius_,
z0_ - radius_, z0_ + radius_};
} else {
return {-INFTY, INFTY, -INFTY, INFTY, -INFTY, INFTY};
return {};
}
}