Skip to main content

Point

Struct Point 

Source
pub struct Point<T, const D: usize, Cs = 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, Cs> Point<T, 1, Cs>

Source

pub const fn new(v0: T) -> Point<T, 1, Cs>

Construct a 1-D point.

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

Source§

impl<T, Cs> Point<T, 2, Cs>

Source

pub const fn new(v0: T, v1: T) -> Point<T, 2, Cs>

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, Cs> Point<T, 3, Cs>

Source

pub const fn new(v0: T, v1: T, v2: T) -> Point<T, 3, Cs>

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, const D: usize, Cs> 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, const D: usize, Cs> ClosestPointsStrategy<Point<T, D, Cs>, Point<T, D, Cs>> for CartesianClosestPoints

Source§

type Out = Point<T, D, Cs>

The point type the closest-pair is returned as.
Source§

fn closest_points( &self, a: &Point<T, D, Cs>, b: &Point<T, D, Cs>, ) -> (<CartesianClosestPoints as ClosestPointsStrategy<Point<T, D, Cs>, Point<T, D, Cs>>>::Out, <CartesianClosestPoints as ClosestPointsStrategy<Point<T, D, Cs>, Point<T, D, Cs>>>::Out)

Return (pa, pb) where pa lies on a, pb lies on b, and the distance |pa − pb| is minimal over the two geometries. Read more
Source§

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

Source§

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

Source§

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

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

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

Source§

fn default() -> Point<T, D, Cs>

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

impl<'de, T, const D: usize, Cs> Deserialize<'de> for Point<T, D, Cs>

Available on crate feature serde only.
Source§

fn deserialize<De>( deserializer: De, ) -> Result<Point<T, D, Cs>, <De as Deserializer<'de>>::Error>
where De: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

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

Source§

impl<T, const D: usize, Cs> 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<Cs> Indexable for Point<f64, 2, Cs>
where Cs: CoordinateSystem,

Source§

fn bounds(&self) -> Bounds

The value’s axis-aligned bounding box.
Source§

impl<T, const D: usize, Cs> 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, const D: usize, Cs> 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, const D: usize, Cs> 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, const D: usize, Cs> Serialize for Point<T, D, Cs>

Available on crate feature serde only.
Source§

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

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

Auto Trait Implementations§

§

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

§

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; D]: Send, PhantomData<Cs>: Send,

§

impl<T, const D: usize, Cs> Sync for Point<T, D, Cs>
where [T; D]: Sync, PhantomData<Cs>: Sync,

§

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

§

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

§

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

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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

impl<P> TurnPoint for P
where P: PointMut + Default + Copy,