26 #ifndef MLN_ACCU_SHAPE_BBOX_HH
27 # define MLN_ACCU_SHAPE_BBOX_HH
33 # include <mln/core/site_set/box.hh>
34 # include <mln/core/concept/meta_accumulator.hh>
35 # include <mln/accu/internal/base.hh>
65 void take(
const P&
p);
109 # ifndef MLN_INCLUDE_ONLY
114 template <
typename P>
121 template <
typename P>
129 template <
typename P>
139 template <
typename P>
151 for (
unsigned i = 0; i < P::dim; ++i)
152 if (p[i] < b_.pmin()[i])
154 else if (p[i] > b_.pmax()[i])
158 template <
typename P>
163 if (! other.is_valid_)
168 if (! this->is_valid_)
176 const box<P>& o_b = other.b_;
177 for (
unsigned i = 0; i < P::dim; ++i)
179 if (o_b.pmin()[i] < b_.pmin()[i])
180 b_.pmin()[i] = o_b.pmin()[i];
181 if (o_b.pmax()[i] > b_.pmax()[i])
182 b_.pmax()[i] = o_b.pmax()[i];
186 template <
typename P>
196 if (! this->is_valid_)
203 for (
unsigned i = 0; i < P::dim; ++i)
205 if (b.pmin()[i] < b_.pmin()[i])
206 b_.pmin()[i] = b.pmin()[i];
207 if (b.pmax()[i] > b_.pmax()[i])
208 b_.pmax()[i] = b.pmax()[i];
212 template <
typename P>
221 template <
typename P>
231 # endif // ! MLN_INCLUDE_ONLY
238 #endif // ! MLN_ACCU_SHAPE_BBOX_HH