1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- #ifndef BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_MULTI_POLYGON_CONCEPT_HPP
- #define BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_MULTI_POLYGON_CONCEPT_HPP
- #include <boost/concept_check.hpp>
- #include <boost/range/concepts.hpp>
- #include <boost/range/value_type.hpp>
- #include <boost/geometry/geometries/concepts/concept_type.hpp>
- #include <boost/geometry/geometries/concepts/polygon_concept.hpp>
- namespace boost { namespace geometry { namespace concepts
- {
- template <typename Geometry>
- class MultiPolygon
- {
- #ifndef DOXYGEN_NO_CONCEPT_MEMBERS
- typedef typename boost::range_value<Geometry>::type polygon_type;
- BOOST_CONCEPT_ASSERT( (concepts::Polygon<polygon_type>) );
- BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<Geometry>) );
- public :
- BOOST_CONCEPT_USAGE(MultiPolygon)
- {
- Geometry* mp = 0;
- traits::clear<Geometry>::apply(*mp);
- traits::resize<Geometry>::apply(*mp, 0);
-
- polygon_type* poly = 0;
- traits::push_back<Geometry>::apply(*mp, std::move(*poly));
- }
- #endif
- };
- template <typename Geometry>
- class ConstMultiPolygon
- {
- #ifndef DOXYGEN_NO_CONCEPT_MEMBERS
- typedef typename boost::range_value<Geometry>::type polygon_type;
- BOOST_CONCEPT_ASSERT( (concepts::ConstPolygon<polygon_type>) );
- BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<Geometry>) );
- public :
- BOOST_CONCEPT_USAGE(ConstMultiPolygon)
- {
- }
- #endif
- };
- template <typename Geometry>
- struct concept_type<Geometry, multi_polygon_tag>
- {
- using type = MultiPolygon<Geometry>;
- };
- template <typename Geometry>
- struct concept_type<Geometry const, multi_polygon_tag>
- {
- using type = ConstMultiPolygon<Geometry>;
- };
- }}}
- #endif
|