pub struct Point<T: CoordinateScalar, const D: usize, Cs: CoordinateSystem = Cartesian> { /* private fields */ }Expand description
Default Point — a [T; D] array plus a phantom CS tag.
Mirrors boost::geometry::model::point<CoordinateType, DimensionCount, CoordinateSystem> from boost/geometry/geometries/point.hpp. The
#[repr(transparent)] annotation guarantees the in-memory layout
matches the underlying [T; D], so callers can safely treat the
point as an array of coordinates when interfacing with FFI or SIMD
code — the same invariant Boost relies on for its
m_values[DimensionCount] member.
Implementations§
Source§impl<T: CoordinateScalar, Cs: CoordinateSystem> Point<T, 1, Cs>
impl<T: CoordinateScalar, Cs: CoordinateSystem> Point<T, 1, Cs>
Source§impl<T: CoordinateScalar, Cs: CoordinateSystem> Point<T, 2, Cs>
impl<T: CoordinateScalar, Cs: CoordinateSystem> Point<T, 2, Cs>
Sourcepub const fn new(v0: T, v1: T) -> Self
pub const fn new(v0: T, v1: T) -> Self
Construct a 2-D point.
Mirrors the two-argument point(v0, v1) constructor at
boost/geometry/geometries/point.hpp:151-167.
Sourcepub const fn x(&self) -> T
pub const fn x(&self) -> T
Return the x ordinate.
Mirrors model::d2::point_xy::x() const from
geometries/point_xy.hpp:67-68.
Sourcepub const fn y(&self) -> T
pub const fn y(&self) -> T
Return the y ordinate.
Mirrors model::d2::point_xy::y() const from
geometries/point_xy.hpp:71-72.
Source§impl<T: CoordinateScalar, Cs: CoordinateSystem> Point<T, 3, Cs>
impl<T: CoordinateScalar, Cs: CoordinateSystem> Point<T, 3, Cs>
Sourcepub const fn new(v0: T, v1: T, v2: T) -> Self
pub const fn new(v0: T, v1: T, v2: T) -> Self
Construct a 3-D point.
Mirrors the three-argument point(v0, v1, v2) constructor at
boost/geometry/geometries/point.hpp:169-185.
Sourcepub const fn x(&self) -> T
pub const fn x(&self) -> T
Return the x ordinate.
Mirrors model::d3::point_xyz::x() const from
geometries/point_xyz.hpp:55-56.
Sourcepub const fn y(&self) -> T
pub const fn y(&self) -> T
Return the y ordinate.
Mirrors model::d3::point_xyz::y() const from
geometries/point_xyz.hpp:59-60.
Sourcepub const fn z(&self) -> T
pub const fn z(&self) -> T
Return the z ordinate.
Mirrors model::d3::point_xyz::z() const from
geometries/point_xyz.hpp:63-64.
Sourcepub fn set_x(&mut self, value: T)
pub fn set_x(&mut self, value: T)
Set the x ordinate.
Mirrors the setter overload model::d3::point_xyz::x(v) from
geometries/point_xyz.hpp:67-68. Rust uses a distinct name because
it has no inherent-method overloading.
Trait Implementations§
Source§impl<T: Clone + CoordinateScalar, const D: usize, Cs: Clone + CoordinateSystem> Clone for Point<T, D, Cs>
impl<T: Clone + CoordinateScalar, const D: usize, Cs: Clone + CoordinateSystem> Clone for Point<T, D, Cs>
impl<T: Copy + CoordinateScalar, const D: usize, Cs: Copy + CoordinateSystem> Copy for Point<T, D, Cs>
Source§impl<T: Debug + CoordinateScalar, const D: usize, Cs: Debug + CoordinateSystem> Debug for Point<T, D, Cs>
impl<T: Debug + CoordinateScalar, const D: usize, Cs: Debug + CoordinateSystem> Debug for Point<T, D, Cs>
Source§impl<T: CoordinateScalar, const D: usize, Cs: CoordinateSystem> Default for Point<T, D, Cs>
impl<T: CoordinateScalar, const D: usize, Cs: CoordinateSystem> Default for Point<T, D, Cs>
impl<T: Eq + CoordinateScalar, const D: usize, Cs: Eq + CoordinateSystem> Eq for Point<T, D, Cs>
Source§impl<T: CoordinateScalar, const D: usize, Cs: CoordinateSystem> Geometry for Point<T, D, Cs>
Tag this concrete type as a Point. Mirrors the
traits::tag<model::point<...>> specialisation at
boost/geometry/geometries/point.hpp:241-244.
impl<T: CoordinateScalar, const D: usize, Cs: CoordinateSystem> Geometry for Point<T, D, Cs>
Tag this concrete type as a Point. Mirrors the
traits::tag<model::point<...>> specialisation at
boost/geometry/geometries/point.hpp:241-244.
Source§impl<T: PartialEq + CoordinateScalar, const D: usize, Cs: PartialEq + CoordinateSystem> PartialEq for Point<T, D, Cs>
impl<T: PartialEq + CoordinateScalar, const D: usize, Cs: PartialEq + CoordinateSystem> PartialEq for Point<T, D, Cs>
Source§impl<T: CoordinateScalar, const D: usize, Cs: CoordinateSystem> Point for Point<T, D, Cs>
Wire the Point concept up. Collapses the four trait specialisations
at boost/geometry/geometries/point.hpp:246-299
(coordinate_type, coordinate_system, dimension, access)
into one Rust impl.
impl<T: CoordinateScalar, const D: usize, Cs: CoordinateSystem> Point for Point<T, D, Cs>
Wire the Point concept up. Collapses the four trait specialisations
at boost/geometry/geometries/point.hpp:246-299
(coordinate_type, coordinate_system, dimension, access)
into one Rust impl.