T get_minimum_coordinate(unsigned i) const { return min_pt[i]; }
const LinAl::Vector<T, D> &get_maximum_point() const { return max_pt; }
T get_maximum_coordinate(unsigned i) const { return max_pt[i]; }
- bool is_empty() const { return empty; }
+ bool is_empty() const { return empty && !negated; }
+ bool is_space() const { return empty && negated; }
bool is_negated() const { return negated; }
};
{
for(unsigned i=0; i<D; ++i)
{
- result_min[i] = std::max(bb1.get_minimum_coordinate(i), bb1.get_minimum_coordinate(i));
- result_max[i] = std::min(bb1.get_minimum_coordinate(i), bb1.get_minimum_coordinate(i));
+ result_min[i] = std::max(bb1.get_minimum_coordinate(i), bb2.get_minimum_coordinate(i));
+ result_max[i] = std::min(bb1.get_maximum_coordinate(i), bb2.get_maximum_coordinate(i));
if(result_min[i]>result_max[i])
return BoundingBox<T, D>();
}
LinAl::Vector<T, D> result_max;
for(unsigned i=0; i<D; ++i)
{
- result_min[i] = std::min(bb1.get_minimum_coordinate(i), bb1.get_minimum_coordinate(i));
- result_max[i] = std::max(bb1.get_minimum_coordinate(i), bb1.get_minimum_coordinate(i));
+ result_min[i] = std::min(bb1.get_minimum_coordinate(i), bb2.get_minimum_coordinate(i));
+ result_max[i] = std::max(bb1.get_maximum_coordinate(i), bb2.get_maximum_coordinate(i));
}
return BoundingBox<T, D>(result_min, result_max);