Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Boost.Geometry requires that your Point type is adapted to the Point Concept described here:</p> <p><a href="http://www.boost.org/doc/libs/1_54_0/libs/geometry/doc/html/geometry/reference/concepts/concept_point.html" rel="nofollow">http://www.boost.org/doc/libs/1_54_0/libs/geometry/doc/html/geometry/reference/concepts/concept_point.html</a></p> <p>Your derived type myPoint must also be adapted because it's a different type than your base type, model::pointer&lt;>. The reason for this is that the library allows to adapt legacy classes and use them as Geometries without the need for modification.</p> <p>To adapt it you must either use one of the registration macros or specialize all required traits by yourself. Besides the exmaple mentioned in the comment, see those:</p> <p><a href="http://www.boost.org/doc/libs/1_54_0/libs/geometry/doc/html/geometry/examples.html" rel="nofollow">http://www.boost.org/doc/libs/1_54_0/libs/geometry/doc/html/geometry/examples.html</a></p> <p>In the second one the Point type is adapted by manual specialization of all required traits, which is the most flexible approach. In your case this would look like this:</p> <pre><code>namespace boost { namespace geometry { namespace traits { template &lt;typename C, std::size_t D, typename S&gt; struct tag&lt; myPoint&lt;C, D, S&gt; &gt; { typedef point_tag type; }; template &lt;typename C, std::size_t D, typename S&gt; struct coordinate_type&lt; myPoint&lt;C, D, S&gt; &gt; { typedef C type; }; template &lt;typename C, std::size_t D, typename S&gt; struct coordinate_system&lt; myPoint&lt;C, D, S&gt; &gt; { typedef S type; }; template &lt;typename C, std::size_t D, typename S&gt; struct dimension&lt; myPoint&lt;C, D, S&gt; &gt; { static const std::size_t value = D; }; template &lt;typename C, std::size_t D, typename S, std::size_t I&gt; struct access&lt;myPoint&lt;C, D, S&gt;, I&gt; { static inline C get(myPoint&lt;C, D, S&gt; const&amp; p) { return p.template get&lt;I&gt;(); } static inline void set(myPoint&lt;C, D, S&gt; &amp; p, C const&amp; v) { p.template set&lt;I&gt;(v); } }; }}} </code></pre> <p>Just paste it after your Point definition and you're done.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload