~ubuntu-branches/debian/sid/boost1.49/sid

« back to all changes in this revision

Viewing changes to boost/geometry/multi/algorithms/envelope.hpp

  • Committer: Package Import Robot
  • Author(s): Steve M. Robbins
  • Date: 2012-02-26 00:31:44 UTC
  • Revision ID: package-import@ubuntu.com-20120226003144-eaytp12cbf6ubpms
Tags: upstream-1.49.0
ImportĀ upstreamĀ versionĀ 1.49.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Boost.Geometry (aka GGL, Generic Geometry Library)
 
2
 
 
3
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
 
4
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
 
5
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
 
6
 
 
7
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
 
8
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
 
9
 
 
10
// Use, modification and distribution is subject to the Boost Software License,
 
11
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 
12
// http://www.boost.org/LICENSE_1_0.txt)
 
13
 
 
14
#ifndef BOOST_GEOMETRY_MULTI_ALGORITHMS_ENVELOPE_HPP
 
15
#define BOOST_GEOMETRY_MULTI_ALGORITHMS_ENVELOPE_HPP
 
16
 
 
17
#include <vector>
 
18
 
 
19
#include <boost/range/metafunctions.hpp>
 
20
 
 
21
 
 
22
#include <boost/geometry/core/exterior_ring.hpp>
 
23
#include <boost/geometry/algorithms/envelope.hpp>
 
24
 
 
25
#include <boost/geometry/multi/core/point_type.hpp>
 
26
 
 
27
 
 
28
namespace boost { namespace geometry
 
29
{
 
30
 
 
31
#ifndef DOXYGEN_NO_DETAIL
 
32
 
 
33
namespace detail { namespace envelope
 
34
{
 
35
 
 
36
 
 
37
template<typename MultiLinestring, typename Box>
 
38
struct envelope_multi_linestring
 
39
{
 
40
    static inline void apply(MultiLinestring const& mp, Box& mbr)
 
41
    {
 
42
        assign_inverse(mbr);
 
43
        for (typename boost::range_iterator<MultiLinestring const>::type
 
44
                    it = mp.begin();
 
45
            it != mp.end();
 
46
            ++it)
 
47
        {
 
48
            envelope_range_additional(*it, mbr);
 
49
        }
 
50
    }
 
51
};
 
52
 
 
53
 
 
54
// version for multi_polygon: outer ring's of all polygons
 
55
template<typename MultiPolygon, typename Box>
 
56
struct envelope_multi_polygon
 
57
{
 
58
    static inline void apply(MultiPolygon const& mp, Box& mbr)
 
59
    {
 
60
        assign_inverse(mbr);
 
61
        for (typename boost::range_const_iterator<MultiPolygon>::type
 
62
                    it = mp.begin();
 
63
            it != mp.end();
 
64
            ++it)
 
65
        {
 
66
            envelope_range_additional(exterior_ring(*it), mbr);
 
67
        }
 
68
    }
 
69
};
 
70
 
 
71
 
 
72
}} // namespace detail::envelope
 
73
 
 
74
#endif
 
75
 
 
76
 
 
77
#ifndef DOXYGEN_NO_DISPATCH
 
78
namespace dispatch
 
79
{
 
80
 
 
81
template
 
82
<
 
83
    typename Multi, typename Box,
 
84
    typename StrategyLess, typename StrategyGreater
 
85
>
 
86
struct envelope<multi_point_tag, box_tag, Multi, Box, StrategyLess, StrategyGreater>
 
87
    : detail::envelope::envelope_range<Multi, Box>
 
88
{};
 
89
 
 
90
template
 
91
<
 
92
    typename Multi, typename Box,
 
93
    typename StrategyLess, typename StrategyGreater
 
94
>
 
95
struct envelope<multi_linestring_tag, box_tag, Multi, Box, StrategyLess, StrategyGreater>
 
96
    : detail::envelope::envelope_multi_linestring<Multi, Box>
 
97
{};
 
98
 
 
99
 
 
100
template
 
101
<
 
102
    typename Multi, typename Box,
 
103
    typename StrategyLess, typename StrategyGreater
 
104
>
 
105
struct envelope<multi_polygon_tag, box_tag, Multi, Box, StrategyLess, StrategyGreater>
 
106
    : detail::envelope::envelope_multi_polygon<Multi, Box>
 
107
{};
 
108
 
 
109
 
 
110
} // namespace dispatch
 
111
#endif
 
112
 
 
113
 
 
114
}} // namespace boost::geometry
 
115
 
 
116
 
 
117
#endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_ENVELOPE_HPP