Added boost header

This commit is contained in:
Christophe Riccio
2012-01-08 01:26:07 +00:00
parent 9c3faaca40
commit c7d752cdf8
8946 changed files with 1732316 additions and 0 deletions

View File

@@ -0,0 +1,324 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
// Copyright (c) 2008-2011 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_GEOMETRY_CORE_ACCESS_HPP
#define BOOST_GEOMETRY_CORE_ACCESS_HPP
#include <cstddef>
#include <boost/mpl/assert.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/concept_check.hpp>
#include <boost/geometry/core/coordinate_type.hpp>
#include <boost/geometry/core/point_type.hpp>
#include <boost/geometry/core/tag.hpp>
namespace boost { namespace geometry
{
/// Index of minimum corner of the box.
int const min_corner = 0;
/// Index of maximum corner of the box.
int const max_corner = 1;
namespace traits
{
/*!
\brief Traits class which gives access (get,set) to points.
\ingroup traits
\par Geometries:
/// @li point
\par Specializations should provide, per Dimension
/// @li static inline T get(G const&)
/// @li static inline void set(G&, T const&)
\tparam Geometry geometry-type
\tparam Dimension dimension to access
*/
template <typename Geometry, std::size_t Dimension, typename Enable = void>
struct access
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_IMPLEMENTED_FOR_THIS_POINT_TYPE, (types<Geometry>)
);
};
/*!
\brief Traits class defining "get" and "set" to get
and set point coordinate values
\tparam Geometry geometry (box, segment)
\tparam Index index (min_corner/max_corner for box, 0/1 for segment)
\tparam Dimension dimension
\par Geometries:
- box
- segment
\par Specializations should provide:
- static inline T get(G const&)
- static inline void set(G&, T const&)
\ingroup traits
*/
template <typename Geometry, std::size_t Index, std::size_t Dimension>
struct indexed_access {};
} // namespace traits
#ifndef DOXYGEN_NO_DISPATCH
namespace core_dispatch
{
template
<
typename Tag,
typename Geometry,
typename
CoordinateType, std::size_t Dimension
>
struct access
{
//static inline T get(G const&) {}
//static inline void set(G& g, T const& value) {}
};
template
<
typename Tag,
typename Geometry,
typename CoordinateType,
std::size_t Index,
std::size_t Dimension
>
struct indexed_access
{
//static inline T get(G const&) {}
//static inline void set(G& g, T const& value) {}
};
template <typename Point, typename CoordinateType, std::size_t Dimension>
struct access<point_tag, Point, CoordinateType, Dimension>
{
static inline CoordinateType get(Point const& point)
{
return traits::access<Point, Dimension>::get(point);
}
static inline void set(Point& p, CoordinateType const& value)
{
traits::access<Point, Dimension>::set(p, value);
}
};
template
<
typename Box,
typename CoordinateType,
std::size_t Index,
std::size_t Dimension
>
struct indexed_access<box_tag, Box, CoordinateType, Index, Dimension>
{
static inline CoordinateType get(Box const& box)
{
return traits::indexed_access<Box, Index, Dimension>::get(box);
}
static inline void set(Box& b, CoordinateType const& value)
{
traits::indexed_access<Box, Index, Dimension>::set(b, value);
}
};
template
<
typename Segment,
typename CoordinateType,
std::size_t Index,
std::size_t Dimension
>
struct indexed_access<segment_tag, Segment, CoordinateType, Index, Dimension>
{
static inline CoordinateType get(Segment const& segment)
{
return traits::indexed_access<Segment, Index, Dimension>::get(segment);
}
static inline void set(Segment& segment, CoordinateType const& value)
{
traits::indexed_access<Segment, Index, Dimension>::set(segment, value);
}
};
} // namespace core_dispatch
#endif // DOXYGEN_NO_DISPATCH
#ifndef DOXYGEN_NO_DETAIL
namespace detail
{
// Two dummy tags to distinguish get/set variants below.
// They don't have to be specified by the user. The functions are distinguished
// by template signature also, but for e.g. GCC this is not enough. So give them
// a different signature.
struct signature_getset_dimension {};
struct signature_getset_index_dimension {};
} // namespace detail
#endif // DOXYGEN_NO_DETAIL
/*!
\brief Get coordinate value of a geometry (usually a point)
\details \details_get_set
\ingroup get
\tparam Dimension \tparam_dimension_required
\tparam Geometry \tparam_geometry (usually a Point Concept)
\param geometry \param_geometry (usually a point)
\param dummy \qbk_skip
\return The coordinate value of specified dimension of specified geometry
\qbk{[include reference/core/get_point.qbk]}
*/
template <std::size_t Dimension, typename Geometry>
inline typename coordinate_type<Geometry>::type get(Geometry const& geometry
, detail::signature_getset_dimension* dummy = 0
)
{
boost::ignore_unused_variable_warning(dummy);
typedef typename boost::remove_const<Geometry>::type ncg_type;
typedef core_dispatch::access
<
typename tag<Geometry>::type,
ncg_type,
typename coordinate_type<ncg_type>::type,
Dimension
> coord_access_type;
return coord_access_type::get(geometry);
}
/*!
\brief Set coordinate value of a geometry (usually a point)
\details \details_get_set
\tparam Dimension \tparam_dimension_required
\tparam Geometry \tparam_geometry (usually a Point Concept)
\param geometry geometry to assign coordinate to
\param geometry \param_geometry (usually a point)
\param value The coordinate value to set
\param dummy \qbk_skip
\ingroup set
\qbk{[include reference/core/set_point.qbk]}
*/
template <std::size_t Dimension, typename Geometry>
inline void set(Geometry& geometry
, typename coordinate_type<Geometry>::type const& value
, detail::signature_getset_dimension* dummy = 0
)
{
boost::ignore_unused_variable_warning(dummy);
typedef typename boost::remove_const<Geometry>::type ncg_type;
typedef core_dispatch::access
<
typename tag<Geometry>::type,
ncg_type,
typename coordinate_type<ncg_type>::type,
Dimension
> coord_access_type;
coord_access_type::set(geometry, value);
}
/*!
\brief get coordinate value of a Box or Segment
\details \details_get_set
\tparam Index \tparam_index_required
\tparam Dimension \tparam_dimension_required
\tparam Geometry \tparam_box_or_segment
\param geometry \param_geometry
\param dummy \qbk_skip
\return coordinate value
\ingroup get
\qbk{distinguish,with index}
\qbk{[include reference/core/get_box.qbk]}
*/
template <std::size_t Index, std::size_t Dimension, typename Geometry>
inline typename coordinate_type<Geometry>::type get(Geometry const& geometry
, detail::signature_getset_index_dimension* dummy = 0
)
{
boost::ignore_unused_variable_warning(dummy);
typedef typename boost::remove_const<Geometry>::type ncg_type;
typedef core_dispatch::indexed_access
<
typename tag<Geometry>::type,
ncg_type,
typename coordinate_type<ncg_type>::type,
Index,
Dimension
> coord_access_type;
return coord_access_type::get(geometry);
}
/*!
\brief set coordinate value of a Box / Segment
\details \details_get_set
\tparam Index \tparam_index_required
\tparam Dimension \tparam_dimension_required
\tparam Geometry \tparam_box_or_segment
\param geometry geometry to assign coordinate to
\param geometry \param_geometry
\param value The coordinate value to set
\param dummy \qbk_skip
\ingroup set
\qbk{distinguish,with index}
\qbk{[include reference/core/set_box.qbk]}
*/
template <std::size_t Index, std::size_t Dimension, typename Geometry>
inline void set(Geometry& geometry
, typename coordinate_type<Geometry>::type const& value
, detail::signature_getset_index_dimension* dummy = 0
)
{
boost::ignore_unused_variable_warning(dummy);
typedef typename boost::remove_const<Geometry>::type ncg_type;
typedef core_dispatch::indexed_access
<
typename tag<Geometry>::type, ncg_type,
typename coordinate_type<ncg_type>::type,
Index,
Dimension
> coord_access_type;
coord_access_type::set(geometry, value);
}
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_CORE_ACCESS_HPP

View File

@@ -0,0 +1,180 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_GEOMETRY_CORE_CLOSURE_HPP
#define BOOST_GEOMETRY_CORE_CLOSURE_HPP
#include <boost/mpl/assert.hpp>
#include <boost/mpl/int.hpp>
#include <boost/range.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/geometry/core/ring_type.hpp>
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/core/tags.hpp>
namespace boost { namespace geometry
{
/*!
\brief Enumerates options for defining if polygons are open or closed
\ingroup enum
\details The enumeration closure_selector describes options for if a polygon is
open or closed. In a closed polygon the very first point (per ring) should
be equal to the very last point.
The specific closing property of a polygon type is defined by the closure
metafunction. The closure metafunction defines a value, which is one of the
values enumerated in the closure_selector
\qbk{
[heading See also]
[link geometry.reference.core.closure The closure metafunction]
}
*/
enum closure_selector
{
/// Rings are open: first point and last point are different, algorithms
/// close them explicitly on the fly
open = 0,
/// Rings are closed: first point and last point must be the same
closed = 1,
/// (Not yet implemented): algorithms first figure out if ring must be
/// closed on the fly
closure_undertermined = -1
};
namespace traits
{
/*!
\brief Traits class indicating if points within a
ring or (multi)polygon are closed (last point == first point),
open or not known.
\ingroup traits
\par Geometries:
- ring
\tparam G geometry
*/
template <typename G>
struct closure
{
static const closure_selector value = closed;
};
} // namespace traits
#ifndef DOXYGEN_NO_DETAIL
namespace core_detail { namespace closure
{
struct closed
{
static const closure_selector value = geometry::closed;
};
/// Metafunction to define the minimum size of a ring:
/// 3 for open rings, 4 for closed rings
template <closure_selector Closure>
struct minimum_ring_size {};
template <>
struct minimum_ring_size<geometry::closed> : boost::mpl::int_<4> {};
template <>
struct minimum_ring_size<geometry::open> : boost::mpl::int_<3> {};
}} // namespace detail::point_order
#endif // DOXYGEN_NO_DETAIL
#ifndef DOXYGEN_NO_DISPATCH
namespace core_dispatch
{
template <typename Tag, typename Geometry>
struct closure
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
, (types<Geometry>)
);
};
template <typename Box>
struct closure<point_tag, Box> : public core_detail::closure::closed {};
template <typename Box>
struct closure<box_tag, Box> : public core_detail::closure::closed {};
template <typename Box>
struct closure<segment_tag, Box> : public core_detail::closure::closed {};
template <typename LineString>
struct closure<linestring_tag, LineString>
: public core_detail::closure::closed {};
template <typename Ring>
struct closure<ring_tag, Ring>
{
static const closure_selector value
= geometry::traits::closure<Ring>::value;
};
// Specialization for polygon: the closure is the closure of its rings
template <typename Polygon>
struct closure<polygon_tag, Polygon>
{
static const closure_selector value = core_dispatch::closure
<
ring_tag,
typename ring_type<polygon_tag, Polygon>::type
>::value ;
};
} // namespace core_dispatch
#endif // DOXYGEN_NO_DISPATCH
/*!
\brief \brief_meta{value, closure (clockwise\, counterclockwise),
\meta_geometry_type}
\tparam Geometry \tparam_geometry
\ingroup core
\qbk{[include reference/core/closure.qbk]}
*/
template <typename Geometry>
struct closure
{
static const closure_selector value = core_dispatch::closure
<
typename tag<Geometry>::type,
typename boost::remove_const<Geometry>::type
>::value;
};
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_CORE_CLOSURE_HPP

View File

@@ -0,0 +1,126 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
// Copyright (c) 2008-2011 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_GEOMETRY_CORE_COORDINATE_DIMENSION_HPP
#define BOOST_GEOMETRY_CORE_COORDINATE_DIMENSION_HPP
#include <cstddef>
#include <boost/mpl/assert.hpp>
#include <boost/mpl/equal_to.hpp>
#include <boost/static_assert.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/geometry/core/point_type.hpp>
namespace boost { namespace geometry
{
namespace traits
{
/*!
\brief Traits class indicating the number of dimensions of a point
\par Geometries:
- point
\par Specializations should provide:
- value (should be derived from boost::mpl::int_<D>
\ingroup traits
*/
template <typename Point, typename Enable = void>
struct dimension
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_IMPLEMENTED_FOR_THIS_POINT_TYPE, (types<Point>)
);
};
} // namespace traits
#ifndef DOXYGEN_NO_DISPATCH
namespace core_dispatch
{
// Base class derive from its own specialization of point-tag
template <typename T, typename G>
struct dimension : dimension<point_tag, typename point_type<T, G>::type> {};
template <typename P>
struct dimension<point_tag, P> : traits::dimension<P> {};
} // namespace core_dispatch
#endif
/*!
\brief \brief_meta{value, number of coordinates (the number of axes of any geometry), \meta_point_type}
\tparam Geometry \tparam_geometry
\ingroup core
\qbk{[include reference/core/coordinate_dimension.qbk]}
*/
template <typename Geometry>
struct dimension
: core_dispatch::dimension
<
typename tag<Geometry>::type,
typename boost::remove_const<Geometry>::type
>
{};
/*!
\brief assert_dimension, enables compile-time checking if coordinate dimensions are as expected
\ingroup utility
*/
template <typename Geometry, int Dimensions>
inline void assert_dimension()
{
BOOST_STATIC_ASSERT((
boost::mpl::equal_to
<
geometry::dimension<Geometry>,
boost::mpl::int_<Dimensions>
>::type::value
));
}
/*!
\brief assert_dimension, enables compile-time checking if coordinate dimensions are as expected
\ingroup utility
*/
template <typename Geometry, int Dimensions>
inline void assert_dimension_less_equal()
{
BOOST_STATIC_ASSERT(( dimension<Geometry>::type::value <= Dimensions ));
}
template <typename Geometry, int Dimensions>
inline void assert_dimension_greater_equal()
{
BOOST_STATIC_ASSERT(( dimension<Geometry>::type::value >= Dimensions ));
}
/*!
\brief assert_dimension_equal, enables compile-time checking if coordinate dimensions of two geometries are equal
\ingroup utility
*/
template <typename G1, typename G2>
inline void assert_dimension_equal()
{
BOOST_STATIC_ASSERT(( dimension<G1>::type::value == dimension<G2>::type::value ));
}
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_CORE_COORDINATE_DIMENSION_HPP

View File

@@ -0,0 +1,97 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
// Copyright (c) 2008-2011 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_GEOMETRY_CORE_COORDINATE_SYSTEM_HPP
#define BOOST_GEOMETRY_CORE_COORDINATE_SYSTEM_HPP
#include <boost/mpl/assert.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/geometry/core/point_type.hpp>
namespace boost { namespace geometry
{
namespace traits
{
/*!
\brief Traits class defining the coordinate system of a point, important for strategy selection
\ingroup traits
\par Geometries:
- point
\par Specializations should provide:
- typedef CS type; (cs::cartesian, cs::spherical, etc)
*/
template <typename Point, typename Enable = void>
struct coordinate_system
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_IMPLEMENTED_FOR_THIS_POINT_TYPE, (types<Point>)
);
};
} // namespace traits
#ifndef DOXYGEN_NO_DISPATCH
namespace core_dispatch
{
template <typename GeometryTag, typename G>
struct coordinate_system
{
typedef typename point_type<GeometryTag, G>::type P;
// Call its own specialization on point-tag
typedef typename coordinate_system<point_tag, P>::type type;
};
template <typename P>
struct coordinate_system<point_tag, P>
{
typedef typename traits::coordinate_system<P>::type type;
};
} // namespace core_dispatch
#endif
/*!
\brief \brief_meta{type, coordinate system (cartesian\, spherical\, etc), \meta_point_type}
\tparam Geometry \tparam_geometry
\ingroup core
\qbk{[include reference/core/coordinate_system.qbk]}
*/
template <typename Geometry>
struct coordinate_system
{
typedef typename boost::remove_const<Geometry>::type ncg;
typedef typename core_dispatch::coordinate_system
<
typename tag<Geometry>::type,
ncg
>::type type;
};
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_CORE_COORDINATE_SYSTEM_HPP

View File

@@ -0,0 +1,102 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
// Copyright (c) 2008-2011 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_GEOMETRY_CORE_COORDINATE_TYPE_HPP
#define BOOST_GEOMETRY_CORE_COORDINATE_TYPE_HPP
#include <boost/mpl/assert.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/geometry/core/point_type.hpp>
#include <boost/geometry/util/promote_floating_point.hpp>
namespace boost { namespace geometry
{
namespace traits
{
/*!
\brief Traits class which indicate the coordinate type (double,float,...) of a point
\ingroup traits
\par Geometries:
- point
\par Specializations should provide:
- typedef T type; (double,float,int,etc)
*/
template <typename Point, typename Enable = void>
struct coordinate_type
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_IMPLEMENTED_FOR_THIS_POINT_TYPE, (types<Point>)
);
};
} // namespace traits
#ifndef DOXYGEN_NO_DISPATCH
namespace core_dispatch
{
template <typename GeometryTag, typename Geometry>
struct coordinate_type
{
typedef typename point_type<GeometryTag, Geometry>::type point_type;
// Call its own specialization on point-tag
typedef typename coordinate_type<point_tag, point_type>::type type;
};
template <typename Point>
struct coordinate_type<point_tag, Point>
{
typedef typename traits::coordinate_type<Point>::type type;
};
} // namespace core_dispatch
#endif // DOXYGEN_NO_DISPATCH
/*!
\brief \brief_meta{type, coordinate type (int\, float\, double\, etc), \meta_point_type}
\tparam Geometry \tparam_geometry
\ingroup core
\qbk{[include reference/core/coordinate_type.qbk]}
*/
template <typename Geometry>
struct coordinate_type
{
typedef typename core_dispatch::coordinate_type
<
typename tag<Geometry>::type,
typename boost::remove_const<Geometry>::type
>::type type;
};
template <typename Geometry>
struct fp_coordinate_type
{
typedef typename promote_floating_point
<
typename coordinate_type<Geometry>::type
>::type type;
};
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_CORE_COORDINATE_TYPE_HPP

220
test/external/boost/geometry/core/cs.hpp vendored Normal file
View File

@@ -0,0 +1,220 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_GEOMETRY_CORE_CS_HPP
#define BOOST_GEOMETRY_CORE_CS_HPP
#include <cstddef>
#include <boost/type_traits.hpp>
#include <boost/geometry/core/coordinate_system.hpp>
#include <boost/geometry/core/tags.hpp>
namespace boost { namespace geometry
{
/*!
\brief Unit of plane angle: Degrees
\details Tag defining the unit of plane angle for spherical coordinate systems.
This tag specifies that coordinates are defined in degrees (-180 .. 180).
It has to be specified for some coordinate systems.
\qbk{[include reference/core/degree_radian.qbk]}
*/
struct degree {};
/*!
\brief Unit of plane angle: Radians
\details Tag defining the unit of plane angle for spherical coordinate systems.
This tag specifies that coordinates are defined in radians (-PI .. PI).
It has to be specified for some coordinate systems.
\qbk{[include reference/core/degree_radian.qbk]}
*/
struct radian {};
namespace cs
{
/*!
\brief Cartesian coordinate system
\details Defines the Cartesian or rectangular coordinate system
where points are defined in 2 or 3 (or more)
dimensions and usually (but not always) known as x,y,z
\see http://en.wikipedia.org/wiki/Cartesian_coordinate_system
\ingroup cs
*/
struct cartesian {};
/*!
\brief Geographic coordinate system, in degree or in radian
\details Defines the geographic coordinate system where points
are defined in two angles and usually
known as lat,long or lo,la or phi,lambda
\see http://en.wikipedia.org/wiki/Geographic_coordinate_system
\ingroup cs
\note might be moved to extensions/gis/geographic
*/
template<typename DegreeOrRadian>
struct geographic
{
typedef DegreeOrRadian units;
};
/*!
\brief Spherical (polar) coordinate system, in degree or in radian
\details Defines the spherical coordinate system where points are
defined in two angles
and an optional radius usually known as r, theta, phi
\par Coordinates:
- coordinate 0:
0 <= phi < 2pi is the angle between the positive x-axis and the
line from the origin to the P projected onto the xy-plane.
- coordinate 1:
0 <= theta <= pi is the angle between the positive z-axis and the
line formed between the origin and P.
- coordinate 2 (if specified):
r >= 0 is the distance from the origin to a given point P.
\see http://en.wikipedia.org/wiki/Spherical_coordinates
\ingroup cs
*/
template<typename DegreeOrRadian>
struct spherical
{
typedef DegreeOrRadian units;
};
/*!
\brief Spherical equatorial coordinate system, in degree or in radian
\details This one resembles the geographic coordinate system, and has latitude
up from zero at the equator, to 90 at the pole
(opposite to the spherical(polar) coordinate system).
Used in astronomy and in GIS (but there is also the geographic)
\see http://en.wikipedia.org/wiki/Spherical_coordinates
\ingroup cs
*/
template<typename DegreeOrRadian>
struct spherical_equatorial
{
typedef DegreeOrRadian units;
};
/*!
\brief Polar coordinate system
\details Defines the polar coordinate system "in which each point
on a plane is determined by an angle and a distance"
\see http://en.wikipedia.org/wiki/Polar_coordinates
\ingroup cs
*/
template<typename DegreeOrRadian>
struct polar
{
typedef DegreeOrRadian units;
};
} // namespace cs
namespace traits
{
/*!
\brief Traits class defining coordinate system tag, bound to coordinate system
\ingroup traits
\tparam CoordinateSystem coordinate system
*/
template <typename CoordinateSystem>
struct cs_tag
{
};
#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
template<typename DegreeOrRadian>
struct cs_tag<cs::geographic<DegreeOrRadian> >
{
typedef geographic_tag type;
};
template<typename DegreeOrRadian>
struct cs_tag<cs::spherical<DegreeOrRadian> >
{
typedef spherical_polar_tag type;
};
template<typename DegreeOrRadian>
struct cs_tag<cs::spherical_equatorial<DegreeOrRadian> >
{
typedef spherical_equatorial_tag type;
};
template<>
struct cs_tag<cs::cartesian>
{
typedef cartesian_tag type;
};
#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
} // namespace traits
/*!
\brief Meta-function returning coordinate system tag (cs family) of any geometry
\ingroup core
*/
template <typename G>
struct cs_tag
{
typedef typename traits::cs_tag
<
typename geometry::coordinate_system<G>::type
>::type type;
};
/*!
\brief Meta-function to verify if a coordinate system is radian
\ingroup core
*/
template <typename CoordinateSystem>
struct is_radian : boost::true_type {};
#ifndef DOXYGEN_NO_SPECIALIZATIONS
// Specialization for any degree coordinate systems
template <template<typename> class CoordinateSystem>
struct is_radian< CoordinateSystem<degree> > : boost::false_type
{
};
#endif // DOXYGEN_NO_SPECIALIZATIONS
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_CORE_CS_HPP

View File

@@ -0,0 +1,34 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_GEOMETRY_CORE_EXCEPTION_HPP
#define BOOST_GEOMETRY_CORE_EXCEPTION_HPP
#include <exception>
namespace boost { namespace geometry
{
/*!
\brief Base exception class for Boost.Geometry algorithms
\ingroup core
\details This class is never thrown. All exceptions thrown in Boost.Geometry
are derived from exception, so it might be convenient to catch it.
*/
class exception : public std::exception
{};
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_CORE_EXCEPTION_HPP

View File

@@ -0,0 +1,144 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_GEOMETRY_CORE_EXTERIOR_RING_HPP
#define BOOST_GEOMETRY_CORE_EXTERIOR_RING_HPP
#include <boost/mpl/assert.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/geometry/core/ring_type.hpp>
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/core/tags.hpp>
#include <boost/geometry/util/add_const_if_c.hpp>
namespace boost { namespace geometry
{
namespace traits
{
/*!
\brief Traits class defining access to exterior_ring of a polygon
\details Should define const and non const access
\ingroup traits
\tparam Polygon the polygon type
\par Geometries:
- polygon
\par Specializations should provide:
- static inline RING& get(POLY& )
- static inline RING const& get(POLY const& )
*/
template <typename Polygon>
struct exterior_ring
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_IMPLEMENTED_FOR_THIS_POLYGON_TYPE
, (types<Polygon>)
);
};
} // namespace traits
#ifndef DOXYGEN_NO_DISPATCH
namespace core_dispatch
{
template <typename Tag, typename Geometry>
struct exterior_ring
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
, (types<Geometry>)
);
};
template <typename Polygon>
struct exterior_ring<polygon_tag, Polygon>
{
static
typename geometry::ring_return_type<Polygon>::type
apply(typename add_const_if_c
<
boost::is_const<Polygon>::type::value,
Polygon
>::type& polygon)
{
return traits::exterior_ring
<
typename boost::remove_const<Polygon>::type
>::get(polygon);
}
};
} // namespace core_dispatch
#endif // DOXYGEN_NO_DISPATCH
/*!
\brief Function to get the exterior_ring ring of a polygon
\ingroup exterior_ring
\note OGC compliance: instead of ExteriorRing
\tparam P polygon type
\param polygon the polygon to get the exterior ring from
\return a reference to the exterior ring
*/
template <typename Polygon>
inline typename ring_return_type<Polygon>::type exterior_ring(Polygon& polygon)
{
return core_dispatch::exterior_ring
<
typename tag<Polygon>::type,
Polygon
>::apply(polygon);
}
/*!
\brief Function to get the exterior ring of a polygon (const version)
\ingroup exterior_ring
\note OGC compliance: instead of ExteriorRing
\tparam Polygon polygon type
\param polygon the polygon to get the exterior ring from
\return a const reference to the exterior ring
\qbk{distinguish,const version}
*/
template <typename Polygon>
inline typename ring_return_type<Polygon const>::type exterior_ring(
Polygon const& polygon)
{
return core_dispatch::exterior_ring
<
typename tag<Polygon>::type,
Polygon const
>::apply(polygon);
}
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_CORE_EXTERIOR_RING_HPP

View File

@@ -0,0 +1,94 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_GEOMETRY_CORE_GEOMETRY_ID_HPP
#define BOOST_GEOMETRY_CORE_GEOMETRY_ID_HPP
#include <boost/mpl/assert.hpp>
#include <boost/mpl/int.hpp>
#include <boost/type_traits.hpp>
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/core/tags.hpp>
namespace boost { namespace geometry
{
#ifndef DOXYGEN_NO_DISPATCH
namespace core_dispatch
{
template <typename GeometryTag>
struct geometry_id
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
, (types<GeometryTag>)
);
};
template <>
struct geometry_id<point_tag> : boost::mpl::int_<1> {};
template <>
struct geometry_id<linestring_tag> : boost::mpl::int_<2> {};
template <>
struct geometry_id<polygon_tag> : boost::mpl::int_<3> {};
template <>
struct geometry_id<segment_tag> : boost::mpl::int_<92> {};
template <>
struct geometry_id<ring_tag> : boost::mpl::int_<93> {};
template <>
struct geometry_id<box_tag> : boost::mpl::int_<94> {};
} // namespace core_dispatch
#endif
/*!
\brief Meta-function returning the id of a geometry type
\details The meta-function geometry_id defines a numerical ID (based on
boost::mpl::int_<...> ) for each geometry concept. A numerical ID is
sometimes useful, and within Boost.Geometry it is used for the
reverse_dispatch metafuntion.
\note Used for e.g. reverse meta-function
\ingroup core
*/
template <typename Geometry>
struct geometry_id : core_dispatch::geometry_id<typename tag<Geometry>::type>
{};
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_CORE_GEOMETRY_ID_HPP

View File

@@ -0,0 +1,139 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_GEOMETRY_CORE_INTERIOR_RINGS_HPP
#define BOOST_GEOMETRY_CORE_INTERIOR_RINGS_HPP
#include <cstddef>
#include <boost/mpl/assert.hpp>
#include <boost/range.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/core/tags.hpp>
#include <boost/geometry/core/interior_type.hpp>
namespace boost { namespace geometry
{
namespace traits
{
/*!
\brief Traits class defining access to interior_rings of a polygon
\details defines access (const and non const) to interior ring
\ingroup traits
\par Geometries:
- polygon
\par Specializations should provide:
- static inline INTERIOR& get(POLY&)
- static inline const INTERIOR& get(POLY const&)
\tparam Geometry geometry
*/
template <typename Geometry>
struct interior_rings
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
, (types<Geometry>)
);
};
} // namespace traits
#ifndef DOXYGEN_NO_DISPATCH
namespace core_dispatch
{
template
<
typename GeometryTag,
typename Geometry
>
struct interior_rings {};
template <typename Polygon>
struct interior_rings<polygon_tag, Polygon>
{
static inline
typename geometry::interior_return_type<Polygon>::type
apply(Polygon& polygon)
{
return traits::interior_rings
<
typename boost::remove_const<Polygon>::type
>::get(polygon);
}
};
} // namespace core_dispatch
#endif
/*!
\brief Function to get the interior rings of a polygon (non const version)
\ingroup interior_rings
\note OGC compliance: instead of InteriorRingN
\tparam Polygon polygon type
\param polygon the polygon to get the interior rings from
\return the interior rings (possibly a reference)
*/
template <typename Polygon>
inline typename interior_return_type<Polygon>::type interior_rings(Polygon& polygon)
{
return core_dispatch::interior_rings
<
typename tag<Polygon>::type,
Polygon
>::apply(polygon);
}
/*!
\brief Function to get the interior rings of a polygon (const version)
\ingroup interior_rings
\note OGC compliance: instead of InteriorRingN
\tparam Polygon polygon type
\param polygon the polygon to get the interior rings from
\return the interior rings (possibly a const reference)
\qbk{distinguish,const version}
*/
template <typename Polygon>
inline typename interior_return_type<Polygon const>::type interior_rings(
Polygon const& polygon)
{
return core_dispatch::interior_rings
<
typename tag<Polygon>::type,
Polygon const
>::apply(polygon);
}
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_CORE_INTERIOR_RINGS_HPP

View File

@@ -0,0 +1,161 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_GEOMETRY_CORE_INTERIOR_TYPE_HPP
#define BOOST_GEOMETRY_CORE_INTERIOR_TYPE_HPP
#include <boost/mpl/assert.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/core/tags.hpp>
namespace boost { namespace geometry
{
namespace traits
{
/*!
\brief Traits class indicating interior container type of a polygon
\details defines inner container type, so the container containing
the interior rings
\ingroup traits
\par Geometries:
- polygon
\par Specializations should provide:
- typedef X type ( e.g. std::vector&lt;myring&lt;P&gt;&gt; )
\tparam Geometry geometry
*/
template <typename Geometry>
struct interior_const_type
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
, (types<Geometry>)
);
};
template <typename Geometry>
struct interior_mutable_type
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
, (types<Geometry>)
);
};
} // namespace traits
#ifndef DOXYGEN_NO_DISPATCH
namespace core_dispatch
{
template <typename GeometryTag, typename Geometry>
struct interior_return_type
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
, (types<Geometry>)
);
};
template <typename Polygon>
struct interior_return_type<polygon_tag, Polygon>
{
typedef typename boost::remove_const<Polygon>::type nc_polygon_type;
typedef typename mpl::if_
<
boost::is_const<Polygon>,
typename traits::interior_const_type<nc_polygon_type>::type,
typename traits::interior_mutable_type<nc_polygon_type>::type
>::type type;
};
template <typename GeometryTag, typename Geometry>
struct interior_type
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
, (types<Geometry>)
);
};
template <typename Polygon>
struct interior_type<polygon_tag, Polygon>
{
typedef typename boost::remove_reference
<
typename interior_return_type<polygon_tag, Polygon>::type
>::type type;
};
} // namespace core_dispatch
#endif
/*!
\brief \brief_meta{type, interior_type (container type
of inner rings), \meta_geometry_type}
\details Interior rings should be organized as a container
(std::vector, std::deque, boost::array) with
Boost.Range support. This metafunction defines the type
of the container.
\tparam Geometry A type fullfilling the Polygon or MultiPolygon concept.
\ingroup core
\qbk{[include reference/core/interior_type.qbk]}
*/
template <typename Geometry>
struct interior_type
{
typedef typename core_dispatch::interior_type
<
typename tag<Geometry>::type,
Geometry
>::type type;
};
template <typename Geometry>
struct interior_return_type
{
typedef typename core_dispatch::interior_return_type
<
typename tag<Geometry>::type,
Geometry
>::type type;
};
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_CORE_INTERIOR_TYPE_HPP

View File

@@ -0,0 +1,60 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_GEOMETRY_CORE_IS_AREAL_HPP
#define BOOST_GEOMETRY_CORE_IS_AREAL_HPP
#include <boost/type_traits.hpp>
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/core/tags.hpp>
namespace boost { namespace geometry
{
#ifndef DOXYGEN_NO_DISPATCH
namespace core_dispatch
{
template <typename GeometryTag> struct is_areal : boost::false_type {};
template <> struct is_areal<ring_tag> : boost::true_type {};
template <> struct is_areal<box_tag> : boost::true_type {};
template <> struct is_areal<polygon_tag> : boost::true_type {};
} // namespace core_dispatch
#endif
/*!
\brief Meta-function defining "true" for areal types (box, (multi)polygon, ring),
\note Used for tag dispatching and meta-function finetuning
\note Also a "ring" has areal properties within Boost.Geometry
\ingroup core
*/
template <typename Geometry>
struct is_areal : core_dispatch::is_areal<typename tag<Geometry>::type>
{};
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_CORE_IS_AREAL_HPP

View File

@@ -0,0 +1,98 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_GEOMETRY_CORE_MUTABLE_RANGE_HPP
#define BOOST_GEOMETRY_CORE_MUTABLE_RANGE_HPP
#include <cstddef>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/range.hpp>
namespace boost { namespace geometry
{
namespace traits
{
/*!
\brief Metafunction to define the argument passed to the three
traits classes clear, push_back and resize
\ingroup mutable_range
*/
template <typename Range>
struct rvalue_type
{
typedef typename boost::remove_reference<Range>::type& type;
};
/*!
\brief Traits class to clear a geometry
\ingroup mutable_range
*/
template <typename Range>
struct clear
{
static inline void apply(typename rvalue_type<Range>::type range)
{
range.clear();
}
};
/*!
\brief Traits class to append a point to a range (ring, linestring, multi*)
\ingroup mutable_range
*/
template <typename Range>
struct push_back
{
typedef typename boost::range_value
<
typename boost::remove_reference<Range>::type
>::type item_type;
static inline void apply(typename rvalue_type<Range>::type range,
item_type const& item)
{
range.push_back(item);
}
};
/*!
\brief Traits class to append a point to a range (ring, linestring, multi*)
\ingroup mutable_range
*/
template <typename Range>
struct resize
{
static inline void apply(typename rvalue_type<Range>::type range,
std::size_t new_size)
{
range.resize(new_size);
}
};
} // namespace traits
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_CORE_MUTABLE_RANGE_HPP

View File

@@ -0,0 +1,162 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_GEOMETRY_CORE_POINT_ORDER_HPP
#define BOOST_GEOMETRY_CORE_POINT_ORDER_HPP
#include <boost/mpl/assert.hpp>
#include <boost/range.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/geometry/core/ring_type.hpp>
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/core/tags.hpp>
namespace boost { namespace geometry
{
/*!
\brief Enumerates options for the order of points within polygons
\ingroup enum
\details The enumeration order_selector describes options for the order of
points within a polygon. Polygons can be ordered either clockwise or
counterclockwise. The specific order of a polygon type is defined by the
point_order metafunction. The point_order metafunction defines a value,
which is one of the values enumerated in the order_selector
\qbk{
[heading See also]
[link geometry.reference.core.point_order The point_order metafunction]
}
*/
enum order_selector
{
/// Points are ordered clockwise
clockwise = 1,
/// Points are ordered counter clockwise
counterclockwise = 2,
/// Points might be stored in any order, algorithms will determine it on the
/// fly (not yet supported)
order_undetermined = 0
};
namespace traits
{
/*!
\brief Traits class indicating the order of contained points within a
ring or (multi)polygon, clockwise, counter clockwise or not known.
\ingroup traits
\tparam Ring ring
*/
template <typename Ring>
struct point_order
{
static const order_selector value = clockwise;
};
} // namespace traits
#ifndef DOXYGEN_NO_DETAIL
namespace detail { namespace point_order
{
struct clockwise
{
static const order_selector value = geometry::clockwise;
};
}} // namespace detail::point_order
#endif // DOXYGEN_NO_DETAIL
#ifndef DOXYGEN_NO_DISPATCH
namespace core_dispatch
{
template <typename Tag, typename Geometry>
struct point_order
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
, (types<Geometry>)
);
};
template <typename Point>
struct point_order<point_tag, Point>
: public detail::point_order::clockwise {};
template <typename Segment>
struct point_order<segment_tag, Segment>
: public detail::point_order::clockwise {};
template <typename Box>
struct point_order<box_tag, Box>
: public detail::point_order::clockwise {};
template <typename LineString>
struct point_order<linestring_tag, LineString>
: public detail::point_order::clockwise {};
template <typename Ring>
struct point_order<ring_tag, Ring>
{
static const order_selector value
= geometry::traits::point_order<Ring>::value;
};
// Specialization for polygon: the order is the order of its rings
template <typename Polygon>
struct point_order<polygon_tag, Polygon>
{
static const order_selector value = core_dispatch::point_order
<
ring_tag,
typename ring_type<polygon_tag, Polygon>::type
>::value ;
};
} // namespace core_dispatch
#endif // DOXYGEN_NO_DISPATCH
/*!
\brief \brief_meta{value, point order (clockwise\, counterclockwise),
\meta_geometry_type}
\tparam Geometry \tparam_geometry
\ingroup core
\qbk{[include reference/core/point_order.qbk]}
*/
template <typename Geometry>
struct point_order
{
static const order_selector value = core_dispatch::point_order
<
typename tag<Geometry>::type,
typename boost::remove_const<Geometry>::type
>::value;
};
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_CORE_POINT_ORDER_HPP

View File

@@ -0,0 +1,130 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_GEOMETRY_CORE_POINT_TYPE_HPP
#define BOOST_GEOMETRY_CORE_POINT_TYPE_HPP
#include <boost/mpl/assert.hpp>
#include <boost/range.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/geometry/core/ring_type.hpp>
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/core/tags.hpp>
namespace boost { namespace geometry
{
namespace traits
{
/*!
\brief Traits class indicating the type of contained points
\ingroup traits
\par Geometries:
- all geometries except point
\par Specializations should provide:
- typedef P type (where P should fulfil the Point concept)
\tparam Geometry geometry
*/
template <typename Geometry>
struct point_type
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_IMPLEMENTED_FOR_THIS_POINT_TYPE, (types<Geometry>)
);
};
} // namespace traits
#ifndef DOXYGEN_NO_DISPATCH
namespace core_dispatch
{
template <typename Tag, typename Geometry>
struct point_type
{
// Default: call traits to get point type
typedef typename boost::remove_const
<
typename traits::point_type<Geometry>::type
>::type type;
};
// Specialization for point: the point itself
template <typename Point>
struct point_type<point_tag, Point>
{
typedef Point type;
};
// Specializations for linestring/ring, via boost::range
template <typename Linestring>
struct point_type<linestring_tag, Linestring>
{
typedef typename boost::range_value<Linestring>::type type;
};
template <typename Ring>
struct point_type<ring_tag, Ring>
{
typedef typename boost::range_value<Ring>::type type;
};
// Specialization for polygon: the point-type is the point-type of its rings
template <typename Polygon>
struct point_type<polygon_tag, Polygon>
{
typedef typename point_type
<
ring_tag,
typename ring_type<polygon_tag, Polygon>::type
>::type type;
};
} // namespace core_dispatch
#endif // DOXYGEN_NO_DISPATCH
/*!
\brief \brief_meta{type, point_type, \meta_geometry_type}
\tparam Geometry \tparam_geometry
\ingroup core
\qbk{[include reference/core/point_type.qbk]}
*/
template <typename Geometry>
struct point_type
{
typedef typename boost::remove_const<Geometry>::type ncg;
typedef typename core_dispatch::point_type
<
typename tag<Geometry>::type,
ncg
>::type type;
};
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_CORE_POINT_TYPE_HPP

View File

@@ -0,0 +1,152 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_GEOMETRY_CORE_RADIAN_ACCESS_HPP
#define BOOST_GEOMETRY_CORE_RADIAN_ACCESS_HPP
#include <cstddef>
#include <boost/numeric/conversion/cast.hpp>
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/cs.hpp>
#include <boost/geometry/core/coordinate_type.hpp>
#include <boost/geometry/util/math.hpp>
namespace boost { namespace geometry
{
#ifndef DOXYGEN_NO_DETAIL
namespace detail
{
template<std::size_t Dimension, typename Geometry>
struct degree_radian_converter
{
typedef typename fp_coordinate_type<Geometry>::type coordinate_type;
static inline coordinate_type get(Geometry const& geometry)
{
return boost::numeric_cast
<
coordinate_type
>(geometry::get<Dimension>(geometry) * geometry::math::d2r);
}
static inline void set(Geometry& geometry, coordinate_type const& radians)
{
geometry::set<Dimension>(geometry, boost::numeric_cast
<
coordinate_type
>(radians * geometry::math::r2d));
}
};
// Default, radian (or any other coordinate system) just works like "get"
template <std::size_t Dimension, typename Geometry, typename DegreeOrRadian>
struct radian_access
{
typedef typename fp_coordinate_type<Geometry>::type coordinate_type;
static inline coordinate_type get(Geometry const& geometry)
{
return geometry::get<Dimension>(geometry);
}
static inline void set(Geometry& geometry, coordinate_type const& radians)
{
geometry::set<Dimension>(geometry, radians);
}
};
// Specialize, any "degree" coordinate system will be converted to radian
// but only for dimension 0,1 (so: dimension 2 and heigher are untouched)
template
<
typename Geometry,
template<typename> class CoordinateSystem
>
struct radian_access<0, Geometry, CoordinateSystem<degree> >
: degree_radian_converter<0, Geometry>
{};
template
<
typename Geometry,
template<typename> class CoordinateSystem
>
struct radian_access<1, Geometry, CoordinateSystem<degree> >
: degree_radian_converter<1, Geometry>
{};
} // namespace detail
#endif // DOXYGEN_NO_DETAIL
/*!
\brief get coordinate value of a point, result is in Radian
\details Result is in Radian, even if source coordinate system
is in Degrees
\return coordinate value
\ingroup get
\tparam Dimension dimension
\tparam Geometry geometry
\param geometry geometry to get coordinate value from
\note Only applicable to coordinate systems templatized by units,
e.g. spherical or geographic coordinate systems
*/
template <std::size_t Dimension, typename Geometry>
inline typename fp_coordinate_type<Geometry>::type get_as_radian(Geometry const& geometry)
{
return detail::radian_access<Dimension, Geometry,
typename coordinate_system<Geometry>::type>::get(geometry);
}
/*!
\brief set coordinate value (in radian) to a point
\details Coordinate value will be set correctly, if coordinate system of
point is in Degree, Radian value will be converted to Degree
\ingroup set
\tparam Dimension dimension
\tparam Geometry geometry
\param geometry geometry to assign coordinate to
\param radians coordinate value to assign
\note Only applicable to coordinate systems templatized by units,
e.g. spherical or geographic coordinate systems
*/
template <std::size_t Dimension, typename Geometry>
inline void set_from_radian(Geometry& geometry,
typename fp_coordinate_type<Geometry>::type const& radians)
{
detail::radian_access<Dimension, Geometry,
typename coordinate_system<Geometry>::type>::set(geometry, radians);
}
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_CORE_RADIAN_ACCESS_HPP

View File

@@ -0,0 +1,67 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_GEOMETRY_CORE_REVERSE_DISPATCH_HPP
#define BOOST_GEOMETRY_CORE_REVERSE_DISPATCH_HPP
#include <cstddef>
#include <boost/type_traits.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/greater.hpp>
#include <boost/geometry/core/geometry_id.hpp>
namespace boost { namespace geometry
{
#ifndef DOXYGEN_NO_DETAIL
namespace detail
{
// Different geometries: reverse_dispatch if second ID < first ID
template <std::size_t GeometryId1, std::size_t GeometryId2>
struct reverse_dispatch : boost::mpl::if_c
<
(GeometryId1 > GeometryId2),
boost::true_type,
boost::false_type
>
{};
// Same geometry: never reverse_dispatch
template <std::size_t GeometryId>
struct reverse_dispatch<GeometryId, GeometryId> : boost::false_type {};
} // namespace detail
#endif // DOXYGEN_NO_DETAIL
template <typename Geometry1, typename Geometry2>
struct reverse_dispatch : detail::reverse_dispatch
<
geometry_id<Geometry1>::type::value,
geometry_id<Geometry2>::type::value
>
{};
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_CORE_REVERSE_DISPATCH_HPP

View File

@@ -0,0 +1,170 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_GEOMETRY_CORE_RING_TYPE_HPP
#define BOOST_GEOMETRY_CORE_RING_TYPE_HPP
#include <boost/mpl/assert.hpp>
#include <boost/mpl/if.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/core/tags.hpp>
namespace boost { namespace geometry
{
namespace traits
{
/*!
\brief Traits class to indicate ring-type of a polygon's exterior ring/interior rings
\ingroup traits
\par Geometries:
- polygon
\par Specializations should provide:
- typedef XXX type ( e.g. ring<P> )
\tparam Geometry geometry
*/
template <typename Geometry>
struct ring_const_type
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
, (types<Geometry>)
);
};
template <typename Geometry>
struct ring_mutable_type
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
, (types<Geometry>)
);
};
} // namespace traits
#ifndef DOXYGEN_NO_DISPATCH
namespace core_dispatch
{
template <typename GeometryTag, typename Geometry>
struct ring_return_type
{};
template <typename LineString>
struct ring_return_type<linestring_tag, LineString>
{
typedef LineString& type;
};
template <typename Ring>
struct ring_return_type<ring_tag, Ring>
{
typedef Ring& type;
};
template <typename Polygon>
struct ring_return_type<polygon_tag, Polygon>
{
typedef typename boost::remove_const<Polygon>::type nc_polygon_type;
typedef typename mpl::if_
<
boost::is_const<Polygon>,
typename traits::ring_const_type<nc_polygon_type>::type,
typename traits::ring_mutable_type<nc_polygon_type>::type
>::type type;
};
template <typename GeometryTag, typename Geometry>
struct ring_type
{};
template <typename Ring>
struct ring_type<ring_tag, Ring>
{
typedef Ring type;
};
template <typename Polygon>
struct ring_type<polygon_tag, Polygon>
{
typedef typename boost::remove_reference
<
typename ring_return_type<polygon_tag, Polygon>::type
>::type type;
};
} // namespace core_dispatch
#endif
/*!
\brief \brief_meta{type, ring_type, \meta_geometry_type}
\details A polygon contains one exterior ring
and zero or more interior rings (holes).
This metafunction retrieves the type of the rings.
Exterior ring and each of the interior rings all have the same ring_type.
\tparam Geometry A type fullfilling the Ring, Polygon or MultiPolygon concept.
\ingroup core
\qbk{[include reference/core/ring_type.qbk]}
*/
template <typename Geometry>
struct ring_type
{
typedef typename core_dispatch::ring_type
<
typename tag<Geometry>::type,
Geometry
>::type type;
};
template <typename Geometry>
struct ring_return_type
{
typedef typename core_dispatch::ring_return_type
<
typename tag<Geometry>::type,
Geometry
>::type type;
};
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_CORE_RING_TYPE_HPP

View File

@@ -0,0 +1,70 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_GEOMETRY_CORE_TAG_HPP
#define BOOST_GEOMETRY_CORE_TAG_HPP
#include <boost/mpl/assert.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/geometry/core/tags.hpp>
namespace boost { namespace geometry
{
namespace traits
{
/*!
\brief Traits class to attach a tag to a geometry
\details All geometries should implement a traits::tag<G>::type metafunction to indicate their
own geometry type.
\ingroup traits
\par Geometries:
- all geometries
\par Specializations should provide:
- typedef XXX_tag type; (point_tag, box_tag, ...)
\tparam Geometry geometry
*/
template <typename Geometry, typename Enable = void>
struct tag
{
typedef void type;
};
} // namespace traits
/*!
\brief \brief_meta{type, tag, \meta_geometry_type}
\details With Boost.Geometry, tags are the driving force of the tag dispatching
mechanism. The tag metafunction is therefore used in every free function.
\tparam Geometry \tparam_geometry
\ingroup core
\qbk{[include reference/core/tag.qbk]}
*/
template <typename Geometry>
struct tag
{
typedef typename traits::tag
<
typename boost::remove_const<Geometry>::type
>::type type;
};
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_CORE_TAG_HPP

View File

@@ -0,0 +1,84 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_GEOMETRY_CORE_TAG_CAST_HPP
#define BOOST_GEOMETRY_CORE_TAG_CAST_HPP
#include <boost/mpl/if.hpp>
#include <boost/type_traits.hpp>
namespace boost { namespace geometry
{
/*!
\brief Metafunction defining a type being either the specified tag, or one
of the specified basetags if the type inherits from them.
\details Tags can inherit each other. A multi_point inherits, for example,
both the multi_tag and the pointlike tag. Often behaviour can be shared
between different geometry types. A tag, found by the metafunction tag,
can be casted to a more basic tag, and then dispatched by that tag.
\ingroup core
\tparam Tag The tag to be casted to one of the base tags
\tparam BaseTag First base tag
\tparam BaseTag2 Optional second base tag
\tparam BaseTag3 Optional third base tag
\tparam BaseTag4 Optional fourth base tag
\tparam BaseTag5 Optional fifth base tag
\tparam BaseTag6 Optional sixth base tag
\tparam BaseTag7 Optional seventh base tag
\qbk{[include reference/core/tag_cast.qbk]}
*/
template
<
typename Tag,
typename BaseTag,
typename BaseTag2 = void,
typename BaseTag3 = void,
typename BaseTag4 = void,
typename BaseTag5 = void,
typename BaseTag6 = void,
typename BaseTag7 = void
>
struct tag_cast
{
typedef typename boost::mpl::if_
<
typename boost::is_base_of<BaseTag, Tag>::type,
BaseTag,
// Try next one in line:
typename tag_cast
<
Tag, BaseTag2, BaseTag3, BaseTag4,
BaseTag5, BaseTag6, BaseTag7, void
>::type
>::type type;
};
#ifndef DOXYGEN_NO_SPECIALIZATIONS
// Specialization for last one
template <typename Tag>
struct tag_cast<Tag, void, void, void, void, void, void, void>
{
// If not found, take specified tag, so do not cast
typedef Tag type;
};
#endif // DOXYGEN_NO_SPECIALIZATIONS
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_CORE_TAG_CAST_HPP

View File

@@ -0,0 +1,94 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_GEOMETRY_CORE_TAGS_HPP
#define BOOST_GEOMETRY_CORE_TAGS_HPP
namespace boost { namespace geometry
{
// Tags defining strategies linked to coordinate systems
/// Tag used for casting spherical/geographic coordinate systems
struct spherical_tag {};
/// Tag indicating Cartesian coordinate system family (cartesian,epsg)
struct cartesian_tag {};
/// Tag indicating Spherical polar coordinate system family
struct spherical_polar_tag : spherical_tag {};
/// Tag indicating Spherical equatorial coordinate system family
struct spherical_equatorial_tag : spherical_tag {};
/// Tag indicating Geographic coordinate system family (geographic)
struct geographic_tag : spherical_tag {};
// Tags defining tag hierarchy
/// For single-geometries (point, linestring, polygon, box, ring, segment)
struct single_tag {};
/// For multiple-geometries (multi_point, multi_linestring, multi_polygon)
struct multi_tag {};
/// For point-like types (point, multi_point)
struct pointlike_tag {};
/// For linear types (linestring, multi-linestring, segment)
struct linear_tag {};
/// For areal types (polygon, multi_polygon, box, ring)
struct areal_tag {};
// Subset of areal types (polygon, multi_polygon, ring)
struct polygonal_tag : areal_tag {};
/// For volume types (also box (?), polyhedron)
struct volumetric_tag {};
// Tags defining geometry types
/// "default" tag
struct geometry_not_recognized_tag {};
/// OGC Point identifying tag
struct point_tag : single_tag, pointlike_tag {};
/// OGC Linestring identifying tag
struct linestring_tag : single_tag, linear_tag {};
/// OGC Polygon identifying tag
struct polygon_tag : single_tag, polygonal_tag {};
/// Convenience (linear) ring identifying tag
struct ring_tag : single_tag, polygonal_tag {};
/// Convenience 2D or 3D box (mbr / aabb) identifying tag
struct box_tag : single_tag, areal_tag {};
/// Convenience segment (2-points) identifying tag
struct segment_tag : single_tag, linear_tag {};
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_CORE_TAGS_HPP

View File

@@ -0,0 +1,88 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_GEOMETRY_CORE_TOPOLOGICAL_DIMENSION_HPP
#define BOOST_GEOMETRY_CORE_TOPOLOGICAL_DIMENSION_HPP
#include <boost/mpl/int.hpp>
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/core/tags.hpp>
namespace boost { namespace geometry
{
#ifndef DOXYGEN_NO_DISPATCH
namespace core_dispatch
{
template <typename GeometryTag>
struct top_dim {};
template <>
struct top_dim<point_tag> : boost::mpl::int_<0> {};
template <>
struct top_dim<linestring_tag> : boost::mpl::int_<1> {};
template <>
struct top_dim<segment_tag> : boost::mpl::int_<1> {};
// ring: topological dimension of two, but some people say: 1 !!
template <>
struct top_dim<ring_tag> : boost::mpl::int_<2> {};
template <>
struct top_dim<box_tag> : boost::mpl::int_<2> {};
template <>
struct top_dim<polygon_tag> : boost::mpl::int_<2> {};
} // namespace core_dispatch
#endif
/*!
\brief Meta-function returning the topological dimension of a geometry
\details The topological dimension defines a point as 0-dimensional,
a linestring as 1-dimensional,
and a ring or polygon as 2-dimensional.
\see http://www.math.okstate.edu/mathdept/dynamics/lecnotes/node36.html
\ingroup core
*/
template <typename Geometry>
struct topological_dimension
: core_dispatch::top_dim<typename tag<Geometry>::type> {};
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_CORE_TOPOLOGICAL_DIMENSION_HPP