Boost
C++ Libraries
...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
This is an older version of Boost and was released in 2024. The current version is 1.90.0.
Metafunction defining value as the point order (clockwise, counterclockwise) of the specified geometry type.
template<typename Geometry> struct point_order : public std::integral_constant< order_selector, core_dispatch::point_order< tag_t< Geometry >, util::remove_cptrref_t< Geometry > >::value > { // ... };
|
Parameter |
Description |
|---|---|
|
typename Geometry |
Any type fulfilling a Geometry Concept |
Either
#include <boost/geometry.hpp>
Or
#include <boost/geometry/core/point_order.hpp>
![]() |
Note |
|---|---|
The point order is defined for any geometry type, but only has a real meaning for areal geometry types (ring, polygon, multi_polygon) |
Compile time
Examine the expected point order of a polygon type
#include <iostream> #include <boost/geometry.hpp> #include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/geometries/point_xy.hpp> int main() { using point_type = boost::geometry::model::d2::point_xy<double>; using polygon_type = boost::geometry::model::polygon<point_type, false>; boost::geometry::order_selector order = boost::geometry::point_order<polygon_type>::value; std::cout << "order: " << order << std::endl << "(clockwise = " << boost::geometry::clockwise << ", counterclockwise = " << boost::geometry::counterclockwise << ") "<< std::endl; return 0; }
Output:
order: 2 (clockwise = 1, counterclockwise = 2)