pub struct GridDescriptor<T: CoordsFloat> { /* private fields */ }
Available on crate feature
utils
only.Expand description
Grid description used to generate maps via the map builder.
The user must specify two out of these three characteristics:
n_cells: [usize; 3]
– The number of cells per axislen_per_cell: [T; 3]
– The dimensions of cells per axislens: [T; 3]
– The dimensions of the grid per axis
§Generics
T: CoordsFloat
– Generic type of the future map object.
Implementations§
Source§impl<T: CoordsFloat> GridDescriptor<T>
impl<T: CoordsFloat> GridDescriptor<T>
Sourcepub fn len_per_cell(self, len_per_cell: [T; 3]) -> Self
pub fn len_per_cell(self, len_per_cell: [T; 3]) -> Self
Set values for all dimensions
Sourcepub fn len_per_cell_x(self, len_per_cell: T) -> Self
pub fn len_per_cell_x(self, len_per_cell: T) -> Self
Set x-axis value
Sourcepub fn len_per_cell_y(self, len_per_cell: T) -> Self
pub fn len_per_cell_y(self, len_per_cell: T) -> Self
Set y-axis value
Sourcepub fn len_per_cell_z(self, len_per_cell: T) -> Self
pub fn len_per_cell_z(self, len_per_cell: T) -> Self
Set z-axis value
Sourcepub fn origin(self, origin: Vertex2<T>) -> Self
pub fn origin(self, origin: Vertex2<T>) -> Self
Set origin (most bottom-left vertex) of the grid
Sourcepub fn split_quads(self, split: bool) -> Self
pub fn split_quads(self, split: bool) -> Self
Indicate whether to split quads of the grid
Trait Implementations§
Source§impl<T: Clone + CoordsFloat> Clone for GridDescriptor<T>
impl<T: Clone + CoordsFloat> Clone for GridDescriptor<T>
Source§fn clone(&self) -> GridDescriptor<T>
fn clone(&self) -> GridDescriptor<T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T: Default + CoordsFloat> Default for GridDescriptor<T>
impl<T: Default + CoordsFloat> Default for GridDescriptor<T>
Source§fn default() -> GridDescriptor<T>
fn default() -> GridDescriptor<T>
Returns the “default value” for a type. Read more
Source§impl<T: CoordsFloat> From<GridDescriptor<T>> for CMapBuilder<T>
impl<T: CoordsFloat> From<GridDescriptor<T>> for CMapBuilder<T>
Create a CMapBuilder
from a GridDescriptor
.
This implementation is roughly equivalent to the following:
// setup grid descriptor
let gridd = GridDescriptor::default();
// ...
// `CMapBuilder::from(gridd)`, or:
let builder = CMapBuilder::<f64>::default().grid_descriptor(gridd);
Source§fn from(value: GridDescriptor<T>) -> Self
fn from(value: GridDescriptor<T>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<T> Freeze for GridDescriptor<T>where
T: Freeze,
impl<T> RefUnwindSafe for GridDescriptor<T>where
T: RefUnwindSafe,
impl<T> Send for GridDescriptor<T>
impl<T> Sync for GridDescriptor<T>
impl<T> Unpin for GridDescriptor<T>where
T: Unpin,
impl<T> UnwindSafe for GridDescriptor<T>where
T: UnwindSafe,
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.