[−][src]Struct mercator_db::space::Space
A reference space, defined by its name and coordinate system.
Methods
impl Space[src]
pub fn new<S>(name: S, system: CoordinateSystem) -> Self where
S: Into<String>, [src]
S: Into<String>,
Instantiate a new space.
Parameters
-
name: Id of the reference space. -
system: Coordinate system defintion of the reference space
pub fn universe() -> &'static Self[src]
Returns the Universe Space.
This space contains all of the spaces, and allows us to connect them between each others.
pub fn change_base(
position: &Position,
from: &Space,
to: &Space
) -> Result<Position, String>[src]
position: &Position,
from: &Space,
to: &Space
) -> Result<Position, String>
Transform a position from space from into a position in space to.
Parameters
-
position: Position to transform, expressed as encoded coordinates. -
from: Space in whichpositionis defined. -
to: Target space in whichpositionshould be expressed.
pub fn name(&self) -> &String[src]
Id of the reference space.
pub fn origin(&self) -> &Position[src]
Origin of the space, expressed in Universe.
pub fn axes(&self) -> &Vec<Axis>[src]
Axes definition of the space.
pub fn bounding_box(&self) -> (Position, Position)[src]
Returns the bounding box enclosing the whole space.
pub fn volume(&self) -> f64[src]
Total volume of the reference space.
pub fn decode(&self, position: &Position) -> Result<Vec<f64>, String>[src]
Decode coordinates expressed in the current space, to their values within the axes definitions.
Parameters
position: expressed in encoded coordinates within the current space.
Return value
The decoded position within the space.
pub fn encode(&self, position: &[f64]) -> Result<Position, String>[src]
Encode a position expressed in the current space within the axes value ranges.
Parameters
position: expressed in the current space.
Return value
The encoded coordinates within the space.
Trait Implementations
impl Clone for Space[src]
impl Debug for Space[src]
impl<'de> Deserialize<'de> for Space[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, [src]
__D: Deserializer<'de>,
impl<'_> From<&'_ Space> for Space[src]
impl<'_> From<&'_ Space> for Space[src]
impl PartialEq<Space> for Space[src]
impl Record<String> for Space[src]
impl Serialize for Space[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer, [src]
__S: Serializer,
impl StructuralPartialEq for Space[src]
Auto Trait Implementations
impl RefUnwindSafe for Space
impl Send for Space
impl Sync for Space
impl Unpin for Space
impl UnwindSafe for Space
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>, [src]
T: Deserialize<'de>,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,