Struct cell_map::cell_map_file::CellMapFile [−][src]
pub struct CellMapFile<L, T> where
L: Layer, { pub num_layers: usize, pub layers: Vec<L>, pub cell_bounds: Bounds, pub cell_size: Vector2<f64>, pub cell_boundary_precision: f64, pub from_parent_angle_rad: f64, pub from_parent_translation: Vector2<f64>, pub from_parent_matrix: Affine2<f64>, pub data: Vec<Array2<T>>, }
Expand description
Represents a file that can be serialised and deserialised using serde.
Fields
num_layers: usize
Number of layers stored in the map
layers: Vec<L>
The order of layers in the map.
The index of a layer name in this vector matches the index of that layer in the data
member.
cell_bounds: Bounds
The bounds of the map
cell_size: Vector2<f64>
The size of each cell in the map, in parent-frame units.
cell_boundary_precision: f64
The precision used when calculating cell boundaries, relative to cell_size
.
from_parent_angle_rad: f64
The angle which rotates the parent frame into the map frame, in radians.
from_parent_translation: Vector2<f64>
The translation that goes from the parent frame to the map frame, in parent frame units.
from_parent_matrix: Affine2<f64>
The affine transformation matrix that converts from points in the parent frame to the map frame.
data: Vec<Array2<T>>
Stores each layer of the map as an ndarray::Array2<T>
.
Implementations
Writes the CellMapFile
to the given path, overwriting any existing file. The format of
the written file is JSON.
Trait Implementations
impl<'de, L, T> Deserialize<'de> for CellMapFile<L, T> where
L: Layer,
L: Deserialize<'de>,
T: Deserialize<'de>,
impl<'de, L, T> Deserialize<'de> for CellMapFile<L, T> where
L: Layer,
L: Deserialize<'de>,
T: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl<L, T> RefUnwindSafe for CellMapFile<L, T> where
L: RefUnwindSafe,
T: RefUnwindSafe,
impl<L, T> Send for CellMapFile<L, T> where
L: Send,
T: Send,
impl<L, T> Sync for CellMapFile<L, T> where
L: Sync,
T: Sync,
impl<L, T> Unpin for CellMapFile<L, T> where
L: Unpin,
impl<L, T> UnwindSafe for CellMapFile<L, T> where
L: UnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.