plotters::coord::ranged3d

Struct Cartesian3d

Source
pub struct Cartesian3d<X: Ranged, Y: Ranged, Z: Ranged> { /* private fields */ }
Expand description

A 3D cartesian coordinate system

Implementations§

Source§

impl<X: Ranged, Y: Ranged, Z: Ranged> Cartesian3d<X, Y, Z>

Source

pub fn with_projection<SX: Into<X>, SY: Into<Y>, SZ: Into<Z>, F: FnOnce(ProjectionMatrixBuilder) -> ProjectionMatrix>( logic_x: SX, logic_y: SY, logic_z: SZ, (actual_x, actual_y): (Range<i32>, Range<i32>), build_projection_matrix: F, ) -> Self

Creates a Cartesian3d object with the given projection.

Source

pub fn set_coord_pixel_range( &mut self, actual_x: Range<i32>, actual_y: Range<i32>, coord_size: (i32, i32, i32), ) -> &mut Self

Sets the pixel sizes and projections according to the given ranges.

Source

pub fn set_projection<F: FnOnce(ProjectionMatrixBuilder) -> ProjectionMatrix>( &mut self, actual_x: Range<i32>, actual_y: Range<i32>, f: F, ) -> &mut Self

Set the projection matrix

Source

pub fn new<SX: Into<X>, SY: Into<Y>, SZ: Into<Z>>( logic_x: SX, logic_y: SY, logic_z: SZ, (actual_x, actual_y): (Range<i32>, Range<i32>), ) -> Self

Create a new coordinate

Source

pub fn projection(&self) -> &ProjectionMatrix

Get the projection matrix

Source

pub fn map_3d( &self, x: &X::ValueType, y: &Y::ValueType, z: &Z::ValueType, ) -> (i32, i32, i32)

Do not project, only transform the guest coordinate system

Source

pub fn projected_depth( &self, x: &X::ValueType, y: &Y::ValueType, z: &Z::ValueType, ) -> i32

Get the depth of the projection

Trait Implementations§

Source§

impl<X: Clone + Ranged, Y: Clone + Ranged, Z: Clone + Ranged> Clone for Cartesian3d<X, Y, Z>

Source§

fn clone(&self) -> Cartesian3d<X, Y, Z>

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<X: Ranged, Y: Ranged, Z: Ranged> CoordTranslate for Cartesian3d<X, Y, Z>

Source§

type From = (<X as Ranged>::ValueType, <Y as Ranged>::ValueType, <Z as Ranged>::ValueType)

Specifies the object to be translated from
Source§

fn translate(&self, coord: &Self::From) -> BackendCoord

Translate the guest coordinate to the guest coordinate
Source§

fn depth(&self, coord: &Self::From) -> i32

Get the Z-value of current coordinate

Auto Trait Implementations§

§

impl<X, Y, Z> Freeze for Cartesian3d<X, Y, Z>
where X: Freeze, Y: Freeze, Z: Freeze,

§

impl<X, Y, Z> RefUnwindSafe for Cartesian3d<X, Y, Z>

§

impl<X, Y, Z> Send for Cartesian3d<X, Y, Z>
where X: Send, Y: Send, Z: Send,

§

impl<X, Y, Z> Sync for Cartesian3d<X, Y, Z>
where X: Sync, Y: Sync, Z: Sync,

§

impl<X, Y, Z> Unpin for Cartesian3d<X, Y, Z>
where X: Unpin, Y: Unpin, Z: Unpin,

§

impl<X, Y, Z> UnwindSafe for Cartesian3d<X, Y, Z>
where X: UnwindSafe, Y: UnwindSafe, Z: 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, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> 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.

Layout§

Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.