• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>Segment 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_ring.html" title="Ring Concept">
10<link rel="next" href="../constants.html" title="Constants">
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_ring.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="../constants.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_segment"></a><a class="link" href="concept_segment.html" title="Segment Concept">Segment
28        Concept</a>
29</h4></div></div></div>
30<h6>
31<a name="geometry.reference.concepts.concept_segment.h0"></a>
32          <span class="phrase"><a name="geometry.reference.concepts.concept_segment.description"></a></span><a class="link" href="concept_segment.html#geometry.reference.concepts.concept_segment.description">Description</a>
33        </h6>
34<p>
35          The Segment Concept describes the requirements for a segment type. All
36          algorithms in Boost.Geometry will check any geometry arguments against
37          the concept requirements.
38        </p>
39<h6>
40<a name="geometry.reference.concepts.concept_segment.h1"></a>
41          <span class="phrase"><a name="geometry.reference.concepts.concept_segment.concept_definition"></a></span><a class="link" href="concept_segment.html#geometry.reference.concepts.concept_segment.concept_definition">Concept
42          Definition</a>
43        </h6>
44<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
45<li class="listitem">
46              there must be a specialization of <code class="computeroutput"><span class="identifier">traits</span><span class="special">::</span><span class="identifier">tag</span></code>
47              defining <code class="computeroutput"><span class="identifier">segment_tag</span></code>
48              as type
49            </li>
50<li class="listitem">
51              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>
52              to define the underlying point type (even if it does not consist of
53              points, it should define this type, to indicate the points it can work
54              with)
55            </li>
56<li class="listitem">
57              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>,
58              per index and per dimension, with two functions:
59              <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; ">
60<li class="listitem">
61                    <code class="computeroutput"><span class="identifier">get</span></code> to get a
62                    coordinate value
63                  </li>
64<li class="listitem">
65                    <code class="computeroutput"><span class="identifier">set</span></code> to set a
66                    coordinate value (this one is not checked for ConstSegment)
67                  </li>
68</ul></div>
69            </li>
70</ul></div>
71<div class="note"><table border="0" summary="Note">
72<tr>
73<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../../../doc/src/images/note.png"></td>
74<th align="left">Note</th>
75</tr>
76<tr><td align="left" valign="top"><p>
77            The segment concept is similar to the box concept, defining using another
78            tag. However, the box concept assumes the index as <code class="computeroutput"><span class="identifier">min_corner</span></code>,
79            <code class="computeroutput"><span class="identifier">max_corner</span></code>, while for
80            the segment concept, there is no assumption.
81          </p></td></tr>
82</table></div>
83<h6>
84<a name="geometry.reference.concepts.concept_segment.h2"></a>
85          <span class="phrase"><a name="geometry.reference.concepts.concept_segment.available_models"></a></span><a class="link" href="concept_segment.html#geometry.reference.concepts.concept_segment.available_models">Available
86          Models</a>
87        </h6>
88<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
89<li class="listitem">
90              <a class="link" href="../models/model_segment.html" title="model::segment">model::segment</a>
91            </li>
92<li class="listitem">
93              <a class="link" href="../models/model_referring_segment.html" title="model::referring_segment">referring
94              segment</a>
95            </li>
96</ul></div>
97</div>
98<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
99<td align="left"></td>
100<td align="right"><div class="copyright-footer">Copyright © 2009-2019 Barend Gehrels, Bruno Lalande, Mateusz Loskot, Adam
101      Wulkiewicz, Oracle and/or its affiliates<p>
102        Distributed under the Boost Software License, Version 1.0. (See accompanying
103        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>)
104      </p>
105</div></td>
106</tr></table>
107<hr>
108<div class="spirit-nav">
109<a accesskey="p" href="concept_ring.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="../constants.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
110</div>
111</body>
112</html>
113