Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:35:27

0001 // Boost.Geometry (aka GGL, Generic Geometry Library)
0002 
0003 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
0004 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
0005 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
0006 
0007 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
0008 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
0009 
0010 // Use, modification and distribution is subject to the Boost Software License,
0011 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0012 // http://www.boost.org/LICENSE_1_0.txt)
0013 
0014 
0015 #ifndef BOOST_GEOMETRY_GEOMETRIES_REGISTER_BOX_HPP
0016 #define BOOST_GEOMETRY_GEOMETRIES_REGISTER_BOX_HPP
0017 
0018 
0019 #ifndef DOXYGEN_NO_SPECIALIZATIONS
0020 
0021 
0022 #define BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_ACCESS(Box, Point, MinCorner, MaxCorner) \
0023 template <size_t D> \
0024 struct indexed_access<Box, min_corner, D> \
0025 { \
0026     typedef typename coordinate_type<Point>::type ct; \
0027     static inline ct get(Box const& b) \
0028     { return geometry::get<D>(b. MinCorner);  } \
0029     static inline void set(Box& b, ct const& value) \
0030     { geometry::set<D>(b. MinCorner, value);  } \
0031 }; \
0032 template <size_t D> \
0033 struct indexed_access<Box, max_corner, D> \
0034 { \
0035     typedef typename coordinate_type<Point>::type ct; \
0036     static inline ct get(Box const& b) \
0037     { return geometry::get<D>(b. MaxCorner);  } \
0038     static inline void set(Box& b, ct const& value) \
0039     { geometry::set<D>(b. MaxCorner, value);  } \
0040 };
0041 
0042 
0043 #define BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_ACCESS_TEMPLATED(Box, MinCorner, MaxCorner) \
0044 template <typename P, size_t D> \
0045 struct indexed_access<Box<P>, min_corner, D> \
0046 { \
0047     typedef typename coordinate_type<P>::type ct; \
0048     static inline ct get(Box<P> const& b) \
0049     { return geometry::get<D>(b. MinCorner);  } \
0050     static inline void set(Box<P>& b, ct const& value) \
0051     { geometry::set<D>(b. MinCorner, value);  } \
0052 }; \
0053 template <typename P, size_t D> \
0054 struct indexed_access<Box<P>, max_corner, D> \
0055 { \
0056     typedef typename coordinate_type<P>::type ct; \
0057     static inline ct get(Box<P> const& b) \
0058     { return geometry::get<D>(b. MaxCorner);  } \
0059     static inline void set(Box<P>& b, ct const& value) \
0060     { geometry::set<D>(b. MaxCorner, value);  } \
0061 };
0062 
0063 
0064 #define BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_ACCESS_4VALUES(Box, Point, Left, Bottom, Right, Top) \
0065 template <> struct indexed_access<Box, min_corner, 0> \
0066 { \
0067     typedef coordinate_type<Point>::type ct; \
0068     static inline ct get(Box const& b) { return b. Left;  } \
0069     static inline void set(Box& b, ct const& value) { b. Left = value; } \
0070 }; \
0071 template <> struct indexed_access<Box, min_corner, 1> \
0072 { \
0073     typedef coordinate_type<Point>::type ct; \
0074     static inline ct get(Box const& b) { return b. Bottom;  } \
0075     static inline void set(Box& b, ct const& value) { b. Bottom = value; } \
0076 }; \
0077 template <> struct indexed_access<Box, max_corner, 0> \
0078 { \
0079     typedef coordinate_type<Point>::type ct; \
0080     static inline ct get(Box const& b) { return b. Right;  } \
0081     static inline void set(Box& b, ct const& value) { b. Right = value; } \
0082 }; \
0083 template <> struct indexed_access<Box, max_corner, 1> \
0084 { \
0085     typedef coordinate_type<Point>::type ct; \
0086     static inline ct get(Box const& b) { return b. Top; } \
0087     static inline void set(Box& b, ct const& value) { b. Top = value; } \
0088 };
0089 
0090 
0091 
0092 
0093 #define BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_TRAITS(Box, PointType) \
0094     template<> struct tag<Box > { typedef box_tag type; }; \
0095     template<> struct point_type<Box > { typedef PointType type; };
0096 
0097 #define BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_TRAITS_TEMPLATED(Box) \
0098     template<typename P> struct tag<Box<P> > { typedef box_tag type; }; \
0099     template<typename P> struct point_type<Box<P> > { typedef P type; };
0100 
0101 #endif // DOXYGEN_NO_SPECIALIZATIONS
0102 
0103 
0104 
0105 /*!
0106 \brief \brief_macro{box}
0107 \ingroup register
0108 \details \details_macro{BOOST_GEOMETRY_REGISTER_BOX, box} The
0109     box may contain template parameters, which must be specified then.
0110 \param Box \param_macro_type{Box}
0111 \param Point Point type on which box is based. Might be two or three-dimensional
0112 \param MinCorner minimum corner (should be public member or method)
0113 \param MaxCorner maximum corner (should be public member or method)
0114 
0115 \qbk{
0116 [heading Example]
0117 [register_box]
0118 [register_box_output]
0119 }
0120 */
0121 #define BOOST_GEOMETRY_REGISTER_BOX(Box, Point, MinCorner, MaxCorner) \
0122 namespace boost { namespace geometry { namespace traits {  \
0123     BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_TRAITS(Box, Point) \
0124     BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_ACCESS(Box, Point, MinCorner, MaxCorner) \
0125 }}}
0126 
0127 
0128 /*!
0129 \brief \brief_macro{box}
0130 \ingroup register
0131 \details \details_macro{BOOST_GEOMETRY_REGISTER_BOX_TEMPLATED, box}
0132     \details_macro_templated{box, point}
0133 \param Box \param_macro_type{Box}
0134 \param MinCorner minimum corner (should be public member or method)
0135 \param MaxCorner maximum corner (should be public member or method)
0136 
0137 \qbk{
0138 [heading Example]
0139 [register_box_templated]
0140 [register_box_templated_output]
0141 }
0142 */
0143 #define BOOST_GEOMETRY_REGISTER_BOX_TEMPLATED(Box, MinCorner, MaxCorner) \
0144 namespace boost { namespace geometry { namespace traits {  \
0145     BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_TRAITS_TEMPLATED(Box) \
0146     BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_ACCESS_TEMPLATED(Box, MinCorner, MaxCorner) \
0147 }}}
0148 
0149 /*!
0150 \brief \brief_macro{box}
0151 \ingroup register
0152 \details \details_macro{BOOST_GEOMETRY_REGISTER_BOX_2D_4VALUES, box}
0153 \param Box \param_macro_type{Box}
0154 \param Point Point type reported as point_type by box. Must be two dimensional.
0155     Note that these box tyeps do not contain points, but they must have a
0156     related point_type
0157 \param Left Left side (must be public member or method)
0158 \param Bottom Bottom side (must be public member or method)
0159 \param Right Right side (must be public member or method)
0160 \param Top Top side (must be public member or method)
0161 
0162 \qbk{
0163 [heading Example]
0164 [register_box_2d_4values]
0165 [register_box_2d_4values_output]
0166 }
0167 */
0168 #define BOOST_GEOMETRY_REGISTER_BOX_2D_4VALUES(Box, Point, Left, Bottom, Right, Top) \
0169 namespace boost { namespace geometry { namespace traits {  \
0170     BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_TRAITS(Box, Point) \
0171     BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_ACCESS_4VALUES(Box, Point, Left, Bottom, Right, Top) \
0172 }}}
0173 
0174 
0175 
0176 // CONST versions are for boxes probably not that common. Postponed.
0177 
0178 
0179 #endif // BOOST_GEOMETRY_GEOMETRIES_REGISTER_BOX_HPP