1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>Box Concept</title> 5<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css"> 6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 7<link rel="home" href="../../../index.html" title="Chapter 1. Geometry"> 8<link rel="up" href="../concepts.html" title="Concepts"> 9<link rel="prev" href="concept_multi_polygon.html" title="MultiPolygon Concept"> 10<link rel="next" href="concept_ring.html" title="Ring Concept"> 11</head> 12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 13<table cellpadding="2" width="100%"><tr> 14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td> 15<td align="center"><a href="../../../../../../../index.html">Home</a></td> 16<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td> 17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> 18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> 19<td align="center"><a href="../../../../../../../more/index.htm">More</a></td> 20</tr></table> 21<hr> 22<div class="spirit-nav"> 23<a accesskey="p" href="concept_multi_polygon.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_ring.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> 24</div> 25<div class="section"> 26<div class="titlepage"><div><div><h4 class="title"> 27<a name="geometry.reference.concepts.concept_box"></a><a class="link" href="concept_box.html" title="Box Concept">Box Concept</a> 28</h4></div></div></div> 29<h6> 30<a name="geometry.reference.concepts.concept_box.h0"></a> 31 <span class="phrase"><a name="geometry.reference.concepts.concept_box.description"></a></span><a class="link" href="concept_box.html#geometry.reference.concepts.concept_box.description">Description</a> 32 </h6> 33<p> 34 The Box Concept describes the requirements for a box type. All algorithms 35 in Boost.Geometry will check any geometry arguments against the concept 36 requirements. 37 </p> 38<p> 39 A box is a geometry with (usually) two or three dimensions, having its 40 axis aligned to the coordinate system. 41 </p> 42<p> 43 The box is not one of the basic types in Boost.Geometry (point, linestring, 44 polygon) but it is a <span class="emphasis"><em>helper type</em></span>. The main reasons 45 for the box existance are its usefulness for indexing (a spatial index, 46 or splitting a geometry into monotonic sections) and it is the output of 47 the <a class="link" href="../algorithms/envelope.html" title="envelope">envelope</a> 48 algorithm. 49 </p> 50<p> 51 Therefore, a box is axis aligned (the envelope is also called aabb, axis 52 aligned bounding box). 53 </p> 54<h6> 55<a name="geometry.reference.concepts.concept_box.h1"></a> 56 <span class="phrase"><a name="geometry.reference.concepts.concept_box.concept_definition"></a></span><a class="link" href="concept_box.html#geometry.reference.concepts.concept_box.concept_definition">Concept 57 Definition</a> 58 </h6> 59<p> 60 The Box Concept is defined as following: 61 </p> 62<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> 63<li class="listitem"> 64 there must be a specialization of <code class="computeroutput"><span class="identifier">traits</span><span class="special">::</span><span class="identifier">tag</span></code>, 65 defining <code class="computeroutput"><span class="identifier">box_tag</span></code> as 66 type 67 </li> 68<li class="listitem"> 69 there must be a specialization of <code class="computeroutput"><span class="identifier">traits</span><span class="special">::</span><span class="identifier">point_type</span></code> 70 to define the underlying point type (even if it does not consist of 71 points, it should define this type, to indicate the points it can work 72 with) 73 </li> 74<li class="listitem"> 75 there must be a specialization of <code class="computeroutput"><span class="identifier">traits</span><span class="special">::</span><span class="identifier">indexed_access</span></code>, 76 per index (<code class="computeroutput"><span class="identifier">min_corner</span></code>, 77 <code class="computeroutput"><span class="identifier">max_corner</span></code>) and per 78 dimension, with two functions: 79 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; "> 80<li class="listitem"> 81 <code class="computeroutput"><span class="identifier">get</span></code> to get a 82 coordinate value 83 </li> 84<li class="listitem"> 85 <code class="computeroutput"><span class="identifier">set</span></code> to set a 86 coordinate value (this one is not checked for ConstBox) 87 </li> 88</ul></div> 89 </li> 90</ul></div> 91<h6> 92<a name="geometry.reference.concepts.concept_box.h2"></a> 93 <span class="phrase"><a name="geometry.reference.concepts.concept_box.available_models"></a></span><a class="link" href="concept_box.html#geometry.reference.concepts.concept_box.available_models">Available 94 Models</a> 95 </h6> 96<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"> 97 <a class="link" href="../models/model_box.html" title="model::box">model::box</a> 98 </li></ul></div> 99</div> 100<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 101<td align="left"></td> 102<td align="right"><div class="copyright-footer">Copyright © 2009-2019 Barend Gehrels, Bruno Lalande, Mateusz Loskot, Adam 103 Wulkiewicz, Oracle and/or its affiliates<p> 104 Distributed under the Boost Software License, Version 1.0. (See accompanying 105 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>) 106 </p> 107</div></td> 108</tr></table> 109<hr> 110<div class="spirit-nav"> 111<a accesskey="p" href="concept_multi_polygon.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_ring.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> 112</div> 113</body> 114</html> 115