Struct gut::io::vtk::model::DataArrayBase [−]
Expand description
A named array of elements.
This is stored as contiguous chunks of components represening and element described by
elem
.
Fields
name: String
The name of the data array.
elem: E
The type of element stored by the data
storage buffer.
data: IOBuffer
A contiguous typed storage buffer.
This stores the actual attribute values in an appropriately typed vector.
Implementations
impl<E> DataArrayBase<E>
impl<E> DataArrayBase<E>
pub fn scalar_type(&self) -> ScalarType
pub fn scalar_type(&self) -> ScalarType
Returns the scalar data type stored by the underlying buffer.
Returns the number of elements stored by this data array.
This is equal to self.len() / self.num_comp()
.
Returns the raw length of the underlying buffer.
This is equal to self.num_elem() * self.num_comp()
.
pub fn with_vec<T>(self, data: Vec<T, Global>) -> DataArrayBase<E> where
T: 'static + ToPrimitive,
pub fn with_vec<T>(self, data: Vec<T, Global>) -> DataArrayBase<E> where
T: 'static + ToPrimitive,
Assigns data from a Vec
to this attribute.
If T
is not one of the types supported by IOBuffer
, then the given vector will be
converted into a Vec<f64>
before being assigned. This makes with_vec
more forgiving
than with_data
.
Use this only when the type T
is not known ahead of time, otherwise use with_data
.
If the data was previously already set, it will be overwritten with the one given in this function.
pub fn with_buf(self, data: IOBuffer) -> DataArrayBase<E>
pub fn with_buf(self, data: IOBuffer) -> DataArrayBase<E>
Assigns data from an IOBuffer
to this attribute.
If the data was previously already set, it will be overwritten with the one given in this function.
pub fn with_data(self, new_data: impl Into<IOBuffer>) -> DataArrayBase<E>
pub fn with_data(self, new_data: impl Into<IOBuffer>) -> DataArrayBase<E>
Sets the data of this data array to the given buffer.
If the data was previously already set, it will be overwritten with the one given in this function.
impl DataArrayBase<ElementType>
impl DataArrayBase<ElementType>
pub fn scalars_with_lookup(
name: impl Into<String>,
num_comp: u32,
lookup_table: impl Into<String>
) -> DataArrayBase<ElementType>
pub fn scalars_with_lookup(
name: impl Into<String>,
num_comp: u32,
lookup_table: impl Into<String>
) -> DataArrayBase<ElementType>
Constructs an empty scalars array with the given lookup table.
pub fn scalars(
name: impl Into<String>,
num_comp: u32
) -> DataArrayBase<ElementType>
pub fn scalars(
name: impl Into<String>,
num_comp: u32
) -> DataArrayBase<ElementType>
Constructs an empty scalars array.
pub fn color_scalars(
name: impl Into<String>,
num_comp: u32
) -> DataArrayBase<ElementType>
pub fn color_scalars(
name: impl Into<String>,
num_comp: u32
) -> DataArrayBase<ElementType>
Constructs an empty color scalars array.
pub fn lookup_table(name: impl Into<String>) -> DataArrayBase<ElementType>
pub fn lookup_table(name: impl Into<String>) -> DataArrayBase<ElementType>
Constructs an empty lookup table.
pub fn vectors(name: impl Into<String>) -> DataArrayBase<ElementType>
pub fn vectors(name: impl Into<String>) -> DataArrayBase<ElementType>
Constructs an empty vectors array.
pub fn normals(name: impl Into<String>) -> DataArrayBase<ElementType>
pub fn normals(name: impl Into<String>) -> DataArrayBase<ElementType>
Constructs an empty normals array.
pub fn tensors(name: impl Into<String>) -> DataArrayBase<ElementType>
pub fn tensors(name: impl Into<String>) -> DataArrayBase<ElementType>
Constructs an empty tensors array.
pub fn tcoords(
name: impl Into<String>,
num_comp: u32
) -> DataArrayBase<ElementType>
pub fn tcoords(
name: impl Into<String>,
num_comp: u32
) -> DataArrayBase<ElementType>
Constructs an empty texture coordinates array with the given dimensionality.
pub fn new(name: impl Into<String>, num_comp: u32) -> DataArrayBase<ElementType>
pub fn new(name: impl Into<String>, num_comp: u32) -> DataArrayBase<ElementType>
Constructs an empty generic array with the given number of components.
impl DataArrayBase<u32>
impl DataArrayBase<u32>
Trait Implementations
impl<E> Clone for DataArrayBase<E> where
E: Clone,
impl<E> Clone for DataArrayBase<E> where
E: Clone,
pub fn clone(&self) -> DataArrayBase<E>
pub fn clone(&self) -> DataArrayBase<E>
Returns a copy of the value. Read more
Performs copy-assignment from source
. Read more
impl<E> Debug for DataArrayBase<E> where
E: Debug,
impl<E> Debug for DataArrayBase<E> where
E: Debug,
impl Default for DataArrayBase<u32>
impl Default for DataArrayBase<u32>
pub fn default() -> DataArrayBase<u32>
pub fn default() -> DataArrayBase<u32>
Returns the “default value” for a type. Read more
impl Default for DataArrayBase<ElementType>
impl Default for DataArrayBase<ElementType>
pub fn default() -> DataArrayBase<ElementType>
pub fn default() -> DataArrayBase<ElementType>
Returns the “default value” for a type. Read more
impl From<IOBuffer> for DataArrayBase<ElementType>
impl From<IOBuffer> for DataArrayBase<ElementType>
pub fn from(buf: IOBuffer) -> DataArrayBase<ElementType>
pub fn from(buf: IOBuffer) -> DataArrayBase<ElementType>
Performs the conversion.
impl<E> PartialEq<DataArrayBase<E>> for DataArrayBase<E> where
E: PartialEq<E>,
impl<E> PartialEq<DataArrayBase<E>> for DataArrayBase<E> where
E: PartialEq<E>,
pub fn eq(&self, other: &DataArrayBase<E>) -> bool
pub fn eq(&self, other: &DataArrayBase<E>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
pub fn ne(&self, other: &DataArrayBase<E>) -> bool
pub fn ne(&self, other: &DataArrayBase<E>) -> bool
This method tests for !=
.
impl<E> StructuralPartialEq for DataArrayBase<E>
Auto Trait Implementations
impl<E> RefUnwindSafe for DataArrayBase<E> where
E: RefUnwindSafe,
impl<E> Send for DataArrayBase<E> where
E: Send,
impl<E> Sync for DataArrayBase<E> where
E: Sync,
impl<E> Unpin for DataArrayBase<E> where
E: Unpin,
impl<E> UnwindSafe for DataArrayBase<E> where
E: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> CloneBytes for T where
T: 'static + Clone,
impl<T> CloneBytes for T where
T: 'static + Clone,
pub unsafe fn clone_bytes(
src: &[MaybeUninit<u8>]
) -> Box<[MaybeUninit<u8>], Global>
pub unsafe fn clone_from_bytes(
dst: &mut [MaybeUninit<u8>],
src: &[MaybeUninit<u8>]
)
pub unsafe fn clone_into_raw_bytes(
src: &[MaybeUninit<u8>],
dst: &mut [MaybeUninit<u8>]
)
impl<T> DebugBytes for T where
T: 'static + Debug,
impl<T> DebugBytes for T where
T: 'static + Debug,
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: 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
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub 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. Read more
pub unsafe fn drop_bytes(bytes: &mut [MaybeUninit<u8>])
type Output = <I as GetIndex<'a, S>>::Output
fn at(&self, idx: I) -> Self::Output
fn at(&self, idx: I) -> Self::Output
Return a value at the given index. This is provided as the checked
version of get
that will panic if the equivalent get
call is None
,
which typically means that the given index is out of bounds. Read more
unsafe fn at_unchecked(&self, idx: I) -> Self::Output
unsafe fn at_unchecked(&self, idx: I) -> Self::Output
Return a value at the given index. This is provided as the unchecked
version of get
that has undefined behavior when the index is out of bounds. Read more
type Output = <I as IsolateIndex<S>>::Output
pub unsafe fn isolate_unchecked(self, idx: I) -> <S as Isolate<I>>::Output
pub fn try_isolate(self, idx: I) -> Option<<S as Isolate<I>>::Output>
impl<T> PartialEqBytes for T where
T: 'static + PartialEq<T>,
impl<T> PartialEqBytes for T where
T: 'static + PartialEq<T>,
pub unsafe fn eq_bytes(a: &[MaybeUninit<u8>], b: &[MaybeUninit<u8>]) -> bool
impl<T, N> PushArrayToVec<N> for T where
T: Clone,
N: Array<T>,
impl<T, N> PushArrayToVec<N> for T where
T: Clone,
N: Array<T>,
pub fn push_to_vec(element: <N as Array<T>>::Array, set: &mut Vec<T, Global>)
pub fn push_to_vec(element: <N as Array<T>>::Array, set: &mut Vec<T, Global>)
This method tells this type how it can be pushed to a Vec
as an array.
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.