Skip to main content

Module reverse

Module reverse 

Source
Expand description

reverse(&mut g) — flip point order in place.

Mirrors boost::geometry::reverse from boost/geometry/algorithms/reverse.hpp. Per-kind dispatch:

  • Linestring, Ring → reverse the backing Vec<P>
  • Polygon → reverse outer + every inner ring
  • MultiLinestring → reverse each member
  • MultiPolygon → reverse each member polygon
  • Point, Segment, Box, MultiPoint → no-op (Boost ships these as silent no-ops; the call sites that drive reverse are linear/areal)

reverse does NOT change the geometry_trait::PointOrder const-generic on Ring / Polygon — that is a type-level attribute. A clockwise-declared Ring mutated to traverse CCW will compute negative area; correct re-syncs the const generic with the stored order.

Functions§

reverse
Reverse the point order of g in place.