1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>Point 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="../concepts.html" title="Concepts"> 10<link rel="next" href="concept_linestring.html" title="Linestring 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="../concepts.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_linestring.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_point"></a><a class="link" href="concept_point.html" title="Point Concept">Point Concept</a> 28</h4></div></div></div> 29<h6> 30<a name="geometry.reference.concepts.concept_point.h0"></a> 31 <span class="phrase"><a name="geometry.reference.concepts.concept_point.description"></a></span><a class="link" href="concept_point.html#geometry.reference.concepts.concept_point.description">Description</a> 32 </h6> 33<p> 34 The Point Concept describes the requirements for a point type. All algorithms 35 in Boost.Geometry will check any geometry arguments against the concept 36 requirements. 37 </p> 38<p> 39 A point is <span class="emphasis"><em>an entity that has a location in space or on a plane, 40 but has no extent</em></span> (<a href="http://en.wikipedia.org/wiki/Point_(geometry)" target="_top">wiki</a>). 41 The point is the most basic geometry of Boost.Geometry, most other geometries 42 consist of points. <span class="emphasis"><em>(Exceptions are box and segment, which might 43 consist of two points but that is not necessarily the case.)</em></span> 44 </p> 45<h6> 46<a name="geometry.reference.concepts.concept_point.h1"></a> 47 <span class="phrase"><a name="geometry.reference.concepts.concept_point.concept_definition"></a></span><a class="link" href="concept_point.html#geometry.reference.concepts.concept_point.concept_definition">Concept 48 Definition</a> 49 </h6> 50<p> 51 The Point Concept is defined as following: 52 </p> 53<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> 54<li class="listitem"> 55 there must be a specialization of <code class="computeroutput"><span class="identifier">traits</span><span class="special">::</span><span class="identifier">tag</span></code>, 56 defining <code class="computeroutput"><span class="identifier">point_tag</span></code> 57 as type 58 </li> 59<li class="listitem"> 60 there must be a specialization of <code class="computeroutput"><span class="identifier">traits</span><span class="special">::</span><span class="identifier">coordinate_type</span></code>, 61 defining the type of its coordinates 62 </li> 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">coordinate_system</span></code>, 65 defining its coordinate system (cartesian, spherical, etc) 66 </li> 67<li class="listitem"> 68 there must be a specialization of <code class="computeroutput"><span class="identifier">traits</span><span class="special">::</span><span class="identifier">dimension</span></code>, 69 defining its number of dimensions (2, 3, ...) (hint: derive it conveniently 70 from <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">int_</span><span class="special"><</span><span class="identifier">X</span><span class="special">></span></code> 71 for X Dimensional) 72 </li> 73<li class="listitem"> 74 there must be a specialization of <code class="computeroutput"><span class="identifier">traits</span><span class="special">::</span><span class="identifier">access</span></code>, 75 per dimension, with two functions: 76 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; "> 77<li class="listitem"> 78 <code class="computeroutput"><span class="identifier">get</span></code> to get a 79 coordinate value 80 </li> 81<li class="listitem"> 82 <code class="computeroutput"><span class="identifier">set</span></code> to set a 83 coordinate value (this one is not checked for ConstPoint) 84 </li> 85</ul></div> 86 </li> 87</ul></div> 88<h6> 89<a name="geometry.reference.concepts.concept_point.h2"></a> 90 <span class="phrase"><a name="geometry.reference.concepts.concept_point.available_models"></a></span><a class="link" href="concept_point.html#geometry.reference.concepts.concept_point.available_models">Available 91 Models</a> 92 </h6> 93<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> 94<li class="listitem"> 95 <a class="link" href="../models/model_point.html" title="model::point">model::point</a> 96 </li> 97<li class="listitem"> 98 <a class="link" href="../models/model_d2_point_xy.html" title="model::d2::point_xy">model::d2::point_xy</a> 99 </li> 100<li class="listitem"> 101 a lat long point (currently in an extension) 102 </li> 103<li class="listitem"> 104 <a class="link" href="../adapted/c_array.html" title="C array">C array</a> 105 </li> 106<li class="listitem"> 107 <a class="link" href="../adapted/std_array.html" title="C++11 Array Container">C++ array container</a> 108 </li> 109<li class="listitem"> 110 <a class="link" href="../adapted/boost_array.html" title="Boost.Array">Boost.Array</a> 111 </li> 112<li class="listitem"> 113 <a class="link" href="../adapted/boost_fusion.html" title="Boost.Fusion">Boost.Fusion</a> 114 </li> 115<li class="listitem"> 116 <a class="link" href="../adapted/boost_polygon.html" title="Boost.Polygon">Boost.Polygon</a> 117 </li> 118<li class="listitem"> 119 <a class="link" href="../adapted/boost_tuple.html" title="Boost.Tuple">Boost.Tuple</a> 120 </li> 121<li class="listitem"> 122 other point types, adapted e.g. using one of the <a class="link" href="../adapted.html" title="Adapted models">registration 123 macro's</a> 124 </li> 125</ul></div> 126</div> 127<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 128<td align="left"></td> 129<td align="right"><div class="copyright-footer">Copyright © 2009-2019 Barend Gehrels, Bruno Lalande, Mateusz Loskot, Adam 130 Wulkiewicz, Oracle and/or its affiliates<p> 131 Distributed under the Boost Software License, Version 1.0. (See accompanying 132 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>) 133 </p> 134</div></td> 135</tr></table> 136<hr> 137<div class="spirit-nav"> 138<a accesskey="p" href="../concepts.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_linestring.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> 139</div> 140</body> 141</html> 142