75 #ifndef SLIP_BOX2D_HPP
76 #define SLIP_BOX2D_HPP
85 #include <boost/serialization/access.hpp>
86 #include <boost/serialization/split_member.hpp>
87 #include <boost/serialization/version.hpp>
115 template <
typename CoordType>
147 Box2d(
const CoordType& x11,
148 const CoordType& x12,
149 const CoordType& x21,
150 const CoordType& x22);
158 Box2d(
const CoordType& xc,
178 const CoordType& w2);
228 const CoordType& x12,
229 const CoordType& x21,
230 const CoordType& x22);
238 std::string
name()
const;
244 CoordType
area()
const;
250 CoordType
width()
const;
259 friend class boost::serialization::access;
260 template<
class Archive>
261 void save(Archive & ar,
const unsigned int version)
const
263 ar & boost::serialization::base_object<slip::Box<CoordType,2> >(*this);
265 template<
class Archive>
266 void load(Archive & ar,
const unsigned int version)
268 ar & boost::serialization::base_object<slip::Box<CoordType,2> >(*this);
270 BOOST_SERIALIZATION_SPLIT_MEMBER()
276 template<
typename CoordType>
282 template<
typename CoordType>
286 Box<CoordType,2>(p1,p2)
289 template<
typename CoordType>
292 const CoordType& x12,
293 const CoordType& x21,
294 const CoordType& x22):
298 template<
typename CoordType>
306 template<
typename CoordType>
310 Box<CoordType,2>(
Point2d<CoordType>(pc[0]-w,pc[1]-w),
Point2d<CoordType>(pc[0]+w,pc[1]+w))
314 template<
typename CoordType>
318 const CoordType& w2):
319 Box<CoordType,2>(
Point2d<CoordType>(pc[0]-w1,pc[1]-w2),
Point2d<CoordType>(pc[0]+w1,pc[1]+w2))
323 template<
typename CoordType>
327 template<
typename CoordType>
331 template<
typename CoordType>
336 template<
typename CoordType>
340 template<
typename CoordType>
344 template<
typename CoordType>
349 template<
typename CoordType>
352 const CoordType& x12,
353 const CoordType& x21,
354 const CoordType& x22)
368 template<
typename CoordType>
372 template<
typename CoordType>
376 template<
typename CoordType>
382 #endif //SLIP_BOX2D_HPP
void set_coord(const CoordType &x11, const CoordType &x12, const CoordType &x21, const CoordType &x22)
Mutator of the coordinates of the Box2d.
Provides a class to modelize the difference of slip::Point2d.
CoordType height() const
compute the height of the Box2d.
Box2d()
Constructs a Box2d.
CoordType width() const
compute the width of the Box2d.
Provides an abstract class to manipulate nd box.
Point< CoordType, 2 > & upper_left()
Accessor/Mutator of the upper_left point (p1) of Box2d.
This is a Box2d class, a specialized version of slip::Box<CoordType,DIM> with DIM = 2...
This is a point2d class, a specialized version of Point<CoordType,DIM> with DIM = 2...
CoordType area() const
compute the area of the Box2d.
Point< CoordType, 2 > & bottom_right()
Accessor/Mutator of the bottom_right point (p2) of Box2d.
Define an abstract Box structure.
Provides a class to modelize 2d points.
std::string name() const
Returns the name of the class.