Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::geometry::concept::Point< Geometry > Class Template Reference

Point concept. More...

#include <point_concept.hpp>

Public Member Functions

 BOOST_CONCEPT_USAGE (Point)
 BCCL macro to apply the Point concept. More...
 

Detailed Description

template<typename Geometry>
class boost::geometry::concept::Point< Geometry >

Point concept.

Formal definition:
The point concept is defined as following:
  • there must be a specialization of traits::tag defining point_tag as type
  • there must be a specialization of traits::coordinate_type defining the type of its coordinates
  • there must be a specialization of traits::coordinate_system defining its coordinate system (cartesian, spherical, etc)
  • there must be a specialization of traits::dimension defining its number of dimensions (2, 3, ...) (derive it conveniently from boost::mpl::int_<X> for X-D)
  • there must be a specialization of traits::access, per dimension, with two functions:
    • get to get a coordinate value
    • set to set a coordinate value (this one is not checked for ConstPoint)
Example:

A legacy point, defining the necessary specializations to fulfil to the concept.

Suppose that the following point is defined:

It can then be adapted to the concept as following:

Note that it is done like above to show the system. Users will normally use the registration macro.

Example:

A read-only legacy point, using a macro to fulfil to the ConstPoint concept. It cannot be modified by the library but can be used in all algorithms where points are not modified.

The point looks like the following:

It uses the macro as following:

Member Function Documentation

template<typename Geometry >
boost::geometry::concept::Point< Geometry >::BOOST_CONCEPT_USAGE ( Point< Geometry >  )
inline

BCCL macro to apply the Point concept.


The documentation for this class was generated from the following file: