173 lines
5.5 KiB
Plaintext
173 lines
5.5 KiB
Plaintext
[/============================================================================
|
|
Boost.Geometry (aka GGL, Generic Geometry Library)
|
|
|
|
Copyright (c) 2007-2013 Barend Gehrels, Amsterdam, the Netherlands.
|
|
Copyright (c) 2008-2013 Bruno Lalande, Paris, France.
|
|
Copyright (c) 2009-2013 Mateusz Loskot, London, UK.
|
|
|
|
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)
|
|
=============================================================================/]
|
|
|
|
|
|
[/ Generated by doxygen_xml2qbk 1.1.1, don't change, will be overwritten automatically]
|
|
[/ Generated from doxy/doxygen_output/xml/group__centroid.xml]
|
|
[section:centroid_3_with_strategy centroid (with strategy)]
|
|
|
|
'''<indexterm><primary>centroid</primary></indexterm>'''
|
|
Calculates the centroid of a geometry using the specified strategy.
|
|
|
|
[heading Description]
|
|
The free function centroid calculates the geometric center (or: center of mass) of a geometry. Reasons to specify a strategy include: use another coordinate system for calculations; construct the strategy beforehand (e.g. with the radius of the Earth); select a strategy when there are more than one available for a calculation.
|
|
|
|
[heading Synopsis]
|
|
``template<typename Geometry, typename Point, typename Strategy>
|
|
void centroid(Geometry const & geometry, Point & c, Strategy const & strategy)``
|
|
|
|
[heading Parameters]
|
|
|
|
[table
|
|
[[Type] [Concept] [Name] [Description] ]
|
|
[[Geometry const &] [Any type fulfilling a Geometry Concept ] [geometry] [A model of the specified concept ]]
|
|
[[Point &] [Any type fulfilling a Point Concept ] [c] [A model of the specified Point Concept which is set to the centroid ]]
|
|
[[Strategy const &] [Any type fulfilling a Centroid Strategy Concept ] [strategy] [The strategy which will be used for centroid calculations]]
|
|
]
|
|
|
|
|
|
[heading Header]
|
|
Either
|
|
|
|
`#include <boost/geometry.hpp>`
|
|
|
|
|
|
Or
|
|
|
|
`#include <boost/geometry/algorithms/centroid.hpp>`
|
|
|
|
[include reference/algorithms/centroid.qbk]
|
|
[include reference/algorithms/centroid_strategies.qbk]
|
|
|
|
|
|
[endsect]
|
|
|
|
[section:centroid_2 centroid]
|
|
|
|
'''<indexterm><primary>centroid</primary></indexterm>'''
|
|
Calculates the centroid of a geometry.
|
|
|
|
[heading Description]
|
|
The free function centroid calculates the geometric center (or: center of mass) of a geometry. It uses the default strategy, based on the coordinate system of the geometry.
|
|
|
|
[heading Synopsis]
|
|
``template<typename Geometry, typename Point>
|
|
void centroid(Geometry const & geometry, Point & c)``
|
|
|
|
[heading Parameters]
|
|
|
|
[table
|
|
[[Type] [Concept] [Name] [Description] ]
|
|
[[Geometry const &] [Any type fulfilling a Geometry Concept ] [geometry] [A model of the specified concept ]]
|
|
[[Point &] [Any type fulfilling a Point Concept ] [c] [The calculated centroid will be assigned to this point reference]]
|
|
]
|
|
|
|
|
|
[heading Header]
|
|
Either
|
|
|
|
`#include <boost/geometry.hpp>`
|
|
|
|
|
|
Or
|
|
|
|
`#include <boost/geometry/algorithms/centroid.hpp>`
|
|
|
|
[include reference/algorithms/centroid.qbk]
|
|
[heading Example]
|
|
[centroid]
|
|
[centroid_output]
|
|
|
|
|
|
[endsect]
|
|
|
|
[section:return_centroid_1 return_centroid]
|
|
|
|
'''<indexterm><primary>return_centroid</primary></indexterm>'''
|
|
Calculates the centroid of a geometry.
|
|
|
|
[heading Description]
|
|
The free function centroid calculates the geometric center (or: center of mass) of a geometry. This version with the return\u005f prefix returns the centroid, and a template parameter must therefore be specified in the call..
|
|
|
|
[heading Synopsis]
|
|
``template<typename Point, typename Geometry>
|
|
Point return_centroid(Geometry const & geometry)``
|
|
|
|
[heading Parameters]
|
|
|
|
[table
|
|
[[Type] [Concept] [Name] [Description] ]
|
|
[[Point] [Any type fulfilling a Point Concept ] [ - ] [Must be specified]]
|
|
[[Geometry const &] [Any type fulfilling a Geometry Concept ] [geometry] [A model of the specified concept ]]
|
|
]
|
|
|
|
|
|
[heading Returns]
|
|
The calculated centroid
|
|
|
|
[heading Header]
|
|
Either
|
|
|
|
`#include <boost/geometry.hpp>`
|
|
|
|
|
|
Or
|
|
|
|
`#include <boost/geometry/algorithms/centroid.hpp>`
|
|
|
|
[include reference/algorithms/centroid.qbk]
|
|
|
|
|
|
[endsect]
|
|
|
|
[section:return_centroid_2_with_strategy return_centroid (with strategy)]
|
|
|
|
'''<indexterm><primary>return_centroid</primary></indexterm>'''
|
|
Calculates the centroid of a geometry using the specified strategy.
|
|
|
|
[heading Description]
|
|
The free function centroid calculates the geometric center (or: center of mass) of a geometry. This version with the return\u005f prefix returns the centroid, and a template parameter must therefore be specified in the call.. Reasons to specify a strategy include: use another coordinate system for calculations; construct the strategy beforehand (e.g. with the radius of the Earth); select a strategy when there are more than one available for a calculation.
|
|
|
|
[heading Synopsis]
|
|
``template<typename Point, typename Geometry, typename Strategy>
|
|
Point return_centroid(Geometry const & geometry, Strategy const & strategy)``
|
|
|
|
[heading Parameters]
|
|
|
|
[table
|
|
[[Type] [Concept] [Name] [Description] ]
|
|
[[Point] [Any type fulfilling a Point Concept ] [ - ] [Must be specified]]
|
|
[[Geometry const &] [Any type fulfilling a Geometry Concept ] [geometry] [A model of the specified concept ]]
|
|
[[Strategy const &] [Any type fulfilling a centroid Strategy Concept ] [strategy] [The strategy which will be used for centroid calculations ]]
|
|
]
|
|
|
|
|
|
[heading Returns]
|
|
The calculated centroid
|
|
|
|
[heading Header]
|
|
Either
|
|
|
|
`#include <boost/geometry.hpp>`
|
|
|
|
|
|
Or
|
|
|
|
`#include <boost/geometry/algorithms/centroid.hpp>`
|
|
|
|
[include reference/algorithms/centroid.qbk]
|
|
[include reference/algorithms/centroid_strategies.qbk]
|
|
|
|
|
|
[endsect]
|
|
|