[−][src]Enum mercator_db::space::Shape
Known shapes descriptions
Variants
Point(Position)A singular point in space.
HyperSphere(Position, Coordinate)A sphere in space.
Hyperrectangle whose faces have one of the axis as a normal.
Methods
impl Shape[src]
pub fn rebase(&self, from: &Space, to: &Space) -> Result<Shape, String>[src]
Convert the encoded coordinates between two reference spaces.
The resulting shape is expressed in encoded coordinates in the target space.
Parameters
-
from: Current reference space of the shape. -
to: Target reference space.
pub fn decode(&self, space: &Space) -> Result<Shape, String>[src]
Decode the coordinates of the shape.
The encoded coordinates of the shapes are expressed in the provided space.
Parameters
space: Reference space of the shape. It is used to decode the encoded coordinates into positions.
Return value
The shape with decoded positions within the space.
pub fn encode(&self, space: &Space) -> Result<Shape, String>[src]
Encode the positions of the shape.
The positions of the shapes are expressed in the provided space.
Parameters
space: Reference space of the shape. It is used to encode the positions into encoded coordinates.
Return value
The shape with encoded coordinates within the space.
pub fn get_mbb(&self) -> (Position, Position)[src]
Compute the minimum bounding box of the shape.
This is an hyperrectangle whose faces are perpendicular to an axis of the space, and which minimally covers the shape.
pub fn contains(&self, position: &Position) -> bool[src]
pub fn rasterise(&self) -> Result<Vec<Position>, String>[src]
Transform a Shape into a list of Position which approximate
the shape.
pub fn rasterise_from(&self, space: &Space) -> Result<Vec<Position>, String>[src]
Transform a Shape into a list of Position which approximate
the shape, in absolute, or Universe positions.
Parameters
space: Reference space in which the shape is expressed.
pub fn volume(&self) -> f64[src]
Compute the volume.
Trait Implementations
impl Clone for Shape[src]
impl Debug for Shape[src]
impl<'de> Deserialize<'de> for Shape[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, [src]
__D: Deserializer<'de>,
impl Serialize for Shape[src]
Auto Trait Implementations
impl RefUnwindSafe for Shape
impl Send for Shape
impl Sync for Shape
impl Unpin for Shape
impl UnwindSafe for Shape
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>,