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

Converts this file into a CellMap.

Writes the CellMapFile to the given path, overwriting any existing file. The format of the written file is JSON.

Loads a CellMapFile from the given path, which points to a JSON file.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Performs the conversion.

Serialize this value into the given Serde serializer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

Checks if self is actually part of its subset T (and can be converted to it).

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

The inclusion map: converts self to the equivalent element of its superset.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.