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§
Source§impl<L, T> CellMapFile<L, T>where
L: Layer,
impl<L, T> CellMapFile<L, T>where
L: Layer,
Source§impl<L, T> CellMapFile<L, T>
impl<L, T> CellMapFile<L, T>
Sourcepub fn write_json<P: AsRef<Path>>(&self, path: P) -> Result<(), Error>
pub fn write_json<P: AsRef<Path>>(&self, path: P) -> Result<(), Error>
Writes the CellMapFile
to the given path, overwriting any existing file. The format of
the written file is JSON.
Source§impl<L, T> CellMapFile<L, T>
impl<L, T> CellMapFile<L, T>
Trait Implementations§
Source§impl<L, T: Clone> Clone for CellMapFile<L, T>
impl<L, T: Clone> Clone for CellMapFile<L, T>
Source§fn clone(&self) -> CellMapFile<L, T>
fn clone(&self) -> CellMapFile<L, T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<L, T: Debug> Debug for CellMapFile<L, T>
impl<L, T: Debug> Debug for CellMapFile<L, T>
Source§impl<'de, L, T> Deserialize<'de> for CellMapFile<L, T>
impl<'de, L, T> Deserialize<'de> for CellMapFile<L, T>
Source§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>,
Source§impl<L, T> From<CellMap<L, T>> for CellMapFile<L, T>
impl<L, T> From<CellMap<L, T>> for CellMapFile<L, T>
Source§impl<L, T> Serialize for CellMapFile<L, T>
impl<L, T> Serialize for CellMapFile<L, T>
Auto Trait Implementations§
impl<L, T> Freeze for CellMapFile<L, T>
impl<L, T> RefUnwindSafe for CellMapFile<L, T>where
L: RefUnwindSafe,
T: RefUnwindSafe,
impl<L, T> Send for CellMapFile<L, T>
impl<L, T> Sync for CellMapFile<L, T>
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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.