geometry_trait/point_order.rs
1//! The [`PointOrder`] enum: vertex traversal direction of a ring.
2//!
3//! Mirrors `boost::geometry::order_selector` from
4//! `boost/geometry/core/point_order.hpp`. The Rust port drops the
5//! `order_undetermined` variant — like `closure_undetermined`, Boost
6//! itself flags it "(not yet supported)" in the same header.
7
8/// Vertex traversal direction of a ring's boundary.
9///
10/// Mirrors `boost::geometry::order_selector` from
11/// `boost/geometry/core/point_order.hpp`.
12///
13/// # Examples
14///
15/// ```
16/// use geometry_trait::PointOrder;
17/// assert_ne!(PointOrder::Clockwise, PointOrder::CounterClockwise);
18/// ```
19#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
20pub enum PointOrder {
21 /// Points are ordered clockwise.
22 ///
23 /// Mirrors `boost::geometry::clockwise` (value `1`) from
24 /// `boost/geometry/core/point_order.hpp`. This is the Boost
25 /// default (`traits::point_order<G>::value = clockwise`), and the
26 /// default returned by [`crate::Ring::point_order`].
27 Clockwise,
28 /// Points are ordered counter-clockwise.
29 ///
30 /// Mirrors `boost::geometry::counterclockwise` (value `2`) from
31 /// `boost/geometry/core/point_order.hpp`.
32 CounterClockwise,
33}