1 // Boost.Geometry (aka GGL, Generic Geometry Library)
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.
7 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
8 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
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)
14 #ifndef BOOST_GEOMETRY_ALGORITHMS_MAKE_HPP
15 #define BOOST_GEOMETRY_ALGORITHMS_MAKE_HPP
17 #include <boost/geometry/algorithms/assign.hpp>
19 #include <boost/geometry/geometries/concepts/check.hpp>
21 namespace boost { namespace geometry
24 #ifndef DOXYGEN_NO_DETAIL
25 namespace detail { namespace make
29 \brief Construct a geometry
31 \tparam Geometry \tparam_geometry
32 \tparam Range \tparam_range_point
33 \param range \param_range_point
34 \return The constructed geometry, here: a linestring or a ring
36 \qbk{distinguish, with a range}
39 [make_with_range] [make_with_range_output]
42 \* [link geometry.reference.algorithms.assign.assign_points assign]
45 template <typename Geometry, typename Range>
46 inline Geometry make_points(Range const& range)
48 concepts::check<Geometry>();
51 geometry::append(geometry, range);
55 }} // namespace detail::make
56 #endif // DOXYGEN_NO_DETAIL
59 \brief Construct a geometry
62 \note It does not work with array-point types, like int[2]
63 \tparam Geometry \tparam_geometry
64 \tparam Type \tparam_numeric to specify the coordinates
67 \return The constructed geometry, here: a 2D point
69 \qbk{distinguish, 2 coordinate values}
72 [make_2d_point] [make_2d_point_output]
75 \* [link geometry.reference.algorithms.assign.assign_values_3_2_coordinate_values assign]
78 template <typename Geometry, typename Type>
79 inline Geometry make(Type const& c1, Type const& c2)
81 concepts::check<Geometry>();
86 typename tag<Geometry>::type,
88 geometry::dimension<Geometry>::type::value
89 >::apply(geometry, c1, c2);
94 \brief Construct a geometry
96 \tparam Geometry \tparam_geometry
97 \tparam Type \tparam_numeric to specify the coordinates
101 \return The constructed geometry, here: a 3D point
103 \qbk{distinguish, 3 coordinate values}
106 [make_3d_point] [make_3d_point_output]
109 \* [link geometry.reference.algorithms.assign.assign_values_4_3_coordinate_values assign]
112 template <typename Geometry, typename Type>
113 inline Geometry make(Type const& c1, Type const& c2, Type const& c3)
115 concepts::check<Geometry>();
120 typename tag<Geometry>::type,
122 geometry::dimension<Geometry>::type::value
123 >::apply(geometry, c1, c2, c3);
127 template <typename Geometry, typename Type>
128 inline Geometry make(Type const& c1, Type const& c2, Type const& c3, Type const& c4)
130 concepts::check<Geometry>();
135 typename tag<Geometry>::type,
137 geometry::dimension<Geometry>::type::value
138 >::apply(geometry, c1, c2, c3, c4);
147 \brief Construct a box with inverse infinite coordinates
149 \details The make_inverse function initializes a 2D or 3D box with large coordinates, the
150 min corner is very large, the max corner is very small. This is useful e.g. in combination
151 with the expand function, to determine the bounding box of a series of geometries.
152 \tparam Geometry \tparam_geometry
153 \return The constructed geometry, here: a box
157 [make_inverse] [make_inverse_output]
160 \* [link geometry.reference.algorithms.assign.assign_inverse assign_inverse]
163 template <typename Geometry>
164 inline Geometry make_inverse()
166 concepts::check<Geometry>();
169 dispatch::assign_inverse
171 typename tag<Geometry>::type,
178 \brief Construct a geometry with its coordinates initialized to zero
180 \details The make_zero function initializes a 2D or 3D point or box with coordinates of zero
181 \tparam Geometry \tparam_geometry
182 \return The constructed and zero-initialized geometry
184 template <typename Geometry>
185 inline Geometry make_zero()
187 concepts::check<Geometry>();
190 dispatch::assign_zero
192 typename tag<Geometry>::type,
198 }} // namespace boost::geometry
200 #endif // BOOST_GEOMETRY_ALGORITHMS_MAKE_HPP