Chris@16: // Boost.Geometry (aka GGL, Generic Geometry Library) Chris@16: Chris@16: // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. Chris@16: // Copyright (c) 2008-2012 Barend Gehrels, Amsterdam, the Netherlands. Chris@16: // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. Chris@16: Chris@16: // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library Chris@16: // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. Chris@16: Chris@16: // Use, modification and distribution is subject to the Boost Software License, Chris@16: // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: Chris@16: #ifndef BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_RING_CONCEPT_HPP Chris@16: #define BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_RING_CONCEPT_HPP Chris@16: Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: #include Chris@16: Chris@16: Chris@16: namespace boost { namespace geometry { namespace concept Chris@16: { Chris@16: Chris@16: Chris@16: /*! Chris@16: \brief ring concept Chris@16: \ingroup concepts Chris@16: \par Formal definition: Chris@16: The ring concept is defined as following: Chris@16: - there must be a specialization of traits::tag defining ring_tag as type Chris@16: - it must behave like a Boost.Range Chris@16: - there can optionally be a specialization of traits::point_order defining the Chris@16: order or orientation of its points, clockwise or counterclockwise. Chris@16: - it must implement a std::back_insert_iterator Chris@16: (This is the same as the for the concept Linestring, and described there) Chris@16: Chris@16: \note to fulfill the concepts, no traits class has to be specialized to Chris@16: define the point type. Chris@16: */ Chris@16: template Chris@16: class Ring Chris@16: { Chris@16: #ifndef DOXYGEN_NO_CONCEPT_MEMBERS Chris@16: typedef typename point_type::type point_type; Chris@16: Chris@16: BOOST_CONCEPT_ASSERT( (concept::Point) ); Chris@16: BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept) ); Chris@16: Chris@16: public : Chris@16: Chris@16: BOOST_CONCEPT_USAGE(Ring) Chris@16: { Chris@16: Geometry* ring = 0; Chris@16: traits::clear::apply(*ring); Chris@16: traits::resize::apply(*ring, 0); Chris@16: point_type* point = 0; Chris@16: traits::push_back::apply(*ring, *point); Chris@16: } Chris@16: #endif Chris@16: }; Chris@16: Chris@16: Chris@16: /*! Chris@16: \brief (linear) ring concept (const version) Chris@16: \ingroup const_concepts Chris@16: \details The ConstLinearRing concept check the same as the Geometry concept, Chris@16: but does not check write access. Chris@16: */ Chris@16: template Chris@16: class ConstRing Chris@16: { Chris@16: #ifndef DOXYGEN_NO_CONCEPT_MEMBERS Chris@16: typedef typename point_type::type point_type; Chris@16: Chris@16: BOOST_CONCEPT_ASSERT( (concept::ConstPoint) ); Chris@16: BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept) ); Chris@16: Chris@16: Chris@16: public : Chris@16: Chris@16: BOOST_CONCEPT_USAGE(ConstRing) Chris@16: { Chris@16: } Chris@16: #endif Chris@16: }; Chris@16: Chris@16: }}} // namespace boost::geometry::concept Chris@16: Chris@16: Chris@16: #endif // BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_RING_CONCEPT_HPP