84 #include <boost/serialization/access.hpp>
85 #include <boost/serialization/split_member.hpp>
86 #include <boost/serialization/version.hpp>
91 template <
typename CoordType, std::
size_t DIM>
94 template <
typename CoordType, std::
size_t DIM>
97 template <
typename CoordType, std::
size_t DIM>
100 template <
typename CoordType, std::
size_t DIM>
101 std::ostream& operator<<(std::ostream & out, const Box<CoordType,DIM>& b);
119 template <
typename CoordType, std::
size_t DIM>
148 Box(
const self& other);
165 std::string
name()
const;
196 void swap(
self& other);
208 friend std::ostream& operator<< <>(std::ostream & out,
const self& b);
264 friend class boost::serialization::access;
265 template<
class Archive>
266 void save(Archive & ar,
const unsigned int version)
const
271 template<
class Archive>
272 void load(Archive & ar,
const unsigned int version)
277 BOOST_SERIALIZATION_SPLIT_MEMBER()
286 template<
typename CoordType,std::
size_t DIM>
291 template<
typename CoordType,std::
size_t DIM>
294 p1_(other.p1_),p2_(other.p2_)
297 template<
typename CoordType,std::
size_t DIM>
304 template<
typename CoordType,std::
size_t DIM>
310 this->p1_ = other.
p1_;
311 this->p2_ = other.
p2_;
316 template<
typename CoordType,std::
size_t DIM>
322 template<
typename CoordType,std::
size_t DIM>
326 assert(this->is_consistent());
327 bool inf = std::lexicographical_compare((p.
coord()).begin(),(p.
coord()).end(),(p1_.coord()).begin(),(p1_.coord()).end(),std::greater_equal<CoordType>());
328 bool sup = std::lexicographical_compare((p.
coord()).begin(),(p.
coord()).end(),(p2_.coord()).begin(),(p2_.coord()).end(),std::less_equal<CoordType>());
332 template<
typename CoordType,std::
size_t DIM>
340 template<
typename CoordType,std::
size_t DIM>
346 if(first_negative ==(diff.
coord()).end())
352 template<
typename CoordType,std::
size_t DIM>
356 (this->p1_).swap(other.
p1_);
357 (this->p2_).swap(other.
p2_);
360 template<
typename CoordType,std::
size_t DIM>
362 std::ostream& operator<<(std::ostream & out, const Box<CoordType,DIM>& b)
364 out<<
"[ "<<b.p1_<<
","<<b.p2_<<
" ]";
368 template<
typename CoordType,std::
size_t DIM>
372 return (this->p1_ == other.
p1_) && (this->p2_ == other.
p2_);
375 template<
typename CoordType,std::
size_t DIM>
379 return (this->p1_ != other.
p1_) || (this->p2_ != other.
p2_);
385 #endif //SLIP_BOX_HPP
void load(Archive &ar, const unsigned int version)
const value_type & const_reference
const block< value_type, DIM > & coord() const
Return the coordinates of the DPoint.
bool operator==(const self &other) const
compare two Box.
const block< value_type, DIM > & coord() const
Return the coordinates of the Point.
void save(Archive &ar, const unsigned int version) const
Define an abstract Point structure.
Provides a class to manipulate 1d static and generic arrays.
Point< CoordType, DIM > point_type
Box()
Default constructor (protected to avoid default construction)
Define an abstract DPoint structure.
bool is_consistent() const
verify if the window is consistent, that is to say if the first point p1 has the smaller coordinates ...
Define an abstract Box structure.
bool contains(const point_type &p) const
Returns true if the box contains the point p.
self & operator=(const self &other)
Assign a Box.
const value_type * const_boxer
const_pointer const_iterator
bool operator!=(const self &other) const
compare two Box.
DPoint< CoordType, DIM > dpoint_type
void translate(const dpoint_type &dp)
Translate the window along the deplacement dp the dimensions of the window are conserved.
void swap(self &other)
Swaps two Box.
std::string name() const
Returns the name of the class.