Skip to main content

Point

Struct Point 

Source
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>

Source

pub const fn new(v0: T) -> Self

Construct a 1-D point.

Mirrors the single-argument point(v0) constructor at boost/geometry/geometries/point.hpp:133-149.

Source§

impl<T: CoordinateScalar, Cs: CoordinateSystem> Point<T, 2, Cs>

Source

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.

Source

pub const fn x(&self) -> T

Return the x ordinate.

Mirrors model::d2::point_xy::x() const from geometries/point_xy.hpp:67-68.

Source

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

pub fn set_x(&mut self, value: T)

Set the x ordinate.

Mirrors the setter overload model::d2::point_xy::x(v) from geometries/point_xy.hpp:75-76. Rust uses a distinct method name because it has no inherent-method overloading.

Source

pub fn set_y(&mut self, value: T)

Set the y ordinate.

Mirrors the setter overload model::d2::point_xy::y(v) from geometries/point_xy.hpp:79-80.

Source§

impl<T: CoordinateScalar, Cs: CoordinateSystem> Point<T, 3, Cs>

Source

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.

Source

pub const fn x(&self) -> T

Return the x ordinate.

Mirrors model::d3::point_xyz::x() const from geometries/point_xyz.hpp:55-56.

Source

pub const fn y(&self) -> T

Return the y ordinate.

Mirrors model::d3::point_xyz::y() const from geometries/point_xyz.hpp:59-60.

Source

pub const fn z(&self) -> T

Return the z ordinate.

Mirrors model::d3::point_xyz::z() const from geometries/point_xyz.hpp:63-64.

Source

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.

Source

pub fn set_y(&mut self, value: T)

Set the y ordinate.

Mirrors the setter overload model::d3::point_xyz::y(v) from geometries/point_xyz.hpp:71-72.

Source

pub fn set_z(&mut self, value: T)

Set the z ordinate.

Mirrors the setter overload model::d3::point_xyz::z(v) from geometries/point_xyz.hpp:75-76.

Trait Implementations§

Source§

impl<T: Clone + CoordinateScalar, const D: usize, Cs: Clone + CoordinateSystem> Clone for Point<T, D, Cs>

Source§

fn clone(&self) -> Point<T, D, Cs>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

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>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: CoordinateScalar, const D: usize, Cs: CoordinateSystem> Default for Point<T, D, Cs>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

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.

Source§

type Kind = PointTag

One of the *Tag types from geometry_tag. Read more
Source§

type Point = Point<T, D, Cs>

The point type this geometry is built from. For a value modelling Point, this is Self. Read more
Source§

impl<T: PartialEq + CoordinateScalar, const D: usize, Cs: PartialEq + CoordinateSystem> PartialEq for Point<T, D, Cs>

Source§

fn eq(&self, other: &Point<T, D, Cs>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
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.

Source§

const DIM: usize = D

The number of dimensions. Read more
Source§

type Scalar = T

The scalar coordinate type. Read more
Source§

type Cs = Cs

The coordinate system this point lives in. Read more
Source§

fn get<const DIDX: usize>(&self) -> T

Read coordinate D. Read more
Source§

impl<T: CoordinateScalar, const D: usize, Cs: CoordinateSystem> PointMut for Point<T, D, Cs>

Source§

fn set<const DIDX: usize>(&mut self, value: T)

Write coordinate D. Read more
Source§

impl<A, const D: usize, OldCs, T, Cs> RebindGeometry<T, Cs> for Point<A, D, OldCs>

Source§

type Output = Point<T, D, Cs>

The corresponding rebound stock model.
Source§

impl<T: PartialEq + CoordinateScalar, const D: usize, Cs: PartialEq + CoordinateSystem> StructuralPartialEq for Point<T, D, Cs>

Auto Trait Implementations§

§

impl<T, const D: usize, Cs> Freeze for Point<T, D, Cs>
where T: Freeze,

§

impl<T, const D: usize, Cs> RefUnwindSafe for Point<T, D, Cs>

§

impl<T, const D: usize, Cs> Send for Point<T, D, Cs>
where T: Send, Cs: Send,

§

impl<T, const D: usize, Cs> Sync for Point<T, D, Cs>
where T: Sync, Cs: Sync,

§

impl<T, const D: usize, Cs> Unpin for Point<T, D, Cs>
where T: Unpin, Cs: Unpin,

§

impl<T, const D: usize, Cs> UnsafeUnpin for Point<T, D, Cs>
where T: UnsafeUnpin,

§

impl<T, const D: usize, Cs> UnwindSafe for Point<T, D, Cs>
where T: UnwindSafe, Cs: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> SameAs<T> for T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.