blob: d6ef6f03424538dc36cdc0dcd2a712f7f56da13d [file] [log] [blame]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Polygon Concept</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="../../../index.html" title="Chapter&#160;1.&#160;Geometry 1.0">
<link rel="up" href="../concepts.html" title="Concepts">
<link rel="prev" href="concept_linestring.html" title="Linestring Concept">
<link rel="next" href="concept_multi_point.html" title="MultiPoint Concept">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="concept_linestring.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../concepts.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="concept_multi_point.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="geometry.reference.concepts.concept_polygon"></a><a class="link" href="concept_polygon.html" title="Polygon Concept">Polygon
Concept</a>
</h4></div></div></div>
<a name="geometry.reference.concepts.concept_polygon.description"></a><h6>
<a name="geometry.reference.concepts.concept_polygon.description-heading"></a>
<a class="link" href="concept_polygon.html#geometry.reference.concepts.concept_polygon.description">Description</a>
</h6>
<p>
The Polygon Concept describes the requirements for a polygon type. All
algorithms in Boost.Geometry will check any geometry arguments against
the concept requirements.
</p>
<p>
A polygon is <span class="emphasis"><em>A polygon is a planar surface defined by one exterior
boundary and zero or more interior boundaries.</em></span> (<a href="http://portal.opengeospatial.org/files/?artifact_id=25355" target="_top">opengeospatial</a>).
</p>
<p>
So the definition of a Boost.Geometry polygon differs a bit from e.g. Wiki,
where a polygon does not have holes. A polygon of Boost.Geometry is a polygon
with or without holes. <span class="emphasis"><em>(A polygon without holes is a <span class="emphasis"><em>helper
geometry</em></span> within Boost.Geometry, and referred to as a ring.)</em></span>
</p>
<a name="geometry.reference.concepts.concept_polygon.concept_definition"></a><h6>
<a name="geometry.reference.concepts.concept_polygon.concept_definition-heading"></a>
<a class="link" href="concept_polygon.html#geometry.reference.concepts.concept_polygon.concept_definition">Concept
Definition</a>
</h6>
<p>
The Polygon Concept is defined as following:
</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
there must be a specialization of <code class="computeroutput"><span class="identifier">traits</span><span class="special">::</span><span class="identifier">tag</span></code>
defining <code class="computeroutput"><span class="identifier">polygon_tag</span></code>
as type
</li>
<li class="listitem">
there must be a specialization of <code class="computeroutput"><span class="identifier">traits</span><span class="special">::</span><span class="identifier">ring_type</span></code>
defining the type of its exterior ring and interior rings as type
</li>
<li class="listitem">
this type defined by <code class="computeroutput"><span class="identifier">ring_type</span></code>
must fulfill the <a class="link" href="concept_ring.html" title="Ring Concept">Ring
Concept</a>
</li>
<li class="listitem">
there must be a specialization of <code class="computeroutput"><span class="identifier">traits</span><span class="special">::</span><span class="identifier">interior_type</span></code>
defining the type of the collection of its interior rings as type;
this collection itself must fulfill a Boost.Range Random Access Range
Concept
</li>
<li class="listitem">
there must be a specialization of <code class="computeroutput"><span class="identifier">traits</span><span class="special">::</span><span class="identifier">exterior_ring</span></code>
with two functions named <code class="computeroutput"><span class="identifier">get</span></code>,
returning the exterior ring, one being const, the other being non const
</li>
<li class="listitem">
there must be a specialization of <code class="computeroutput"><span class="identifier">traits</span><span class="special">::</span><span class="identifier">interior_rings</span></code>
with two functions named <code class="computeroutput"><span class="identifier">get</span></code>,
returning the interior rings, one being const, the other being non
const
</li>
</ul></div>
<a name="geometry.reference.concepts.concept_polygon.available_models"></a><h6>
<a name="geometry.reference.concepts.concept_polygon.available_models-heading"></a>
<a class="link" href="concept_polygon.html#geometry.reference.concepts.concept_polygon.available_models">Available
Models</a>
</h6>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
<a class="link" href="../models/model_polygon.html" title="model::polygon">polygon</a>
</li>
<li class="listitem">
a Boost.Polygon polygon_with_holes_data (requires <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">/</span><span class="identifier">geometries</span><span class="special">/</span><span class="identifier">adapted</span><span class="special">/</span><span class="identifier">boost_polygon</span><span class="special">/</span><span class="identifier">polygon</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>)
</li>
</ul></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2011 Barend Gehrels, Bruno Lalande, Mateusz Loskot<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="concept_linestring.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../concepts.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="concept_multi_point.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>