Struct vtkio::model::DataArrayBase [−][src]
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>
[src]
pub fn scalar_type(&self) -> ScalarType
[src]
Returns the scalar data type stored by the underlying buffer.
pub fn num_elem(&self) -> usize
[src]
Returns the number of elements stored by this data array.
This is equal to self.len() / self.num_comp()
.
pub fn len(&self) -> usize
[src]
Returns the raw length of the underlying buffer.
This is equal to self.num_elem() * self.num_comp()
.
pub fn is_empty(&self) -> bool
[src]
Returns true
if this data array is empty and false
otherwise.
pub fn with_vec<T: ToPrimitive + 'static>(self, data: Vec<T>) -> Self
[src]
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) -> Self
[src]
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>) -> Self
[src]
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>
[src]
pub fn scalars_with_lookup(
name: impl Into<String>,
num_comp: u32,
lookup_table: impl Into<String>
) -> Self
[src]
name: impl Into<String>,
num_comp: u32,
lookup_table: impl Into<String>
) -> Self
Constructs an empty scalars array with the given lookup table.
pub fn scalars(name: impl Into<String>, num_comp: u32) -> Self
[src]
Constructs an empty scalars array.
pub fn color_scalars(name: impl Into<String>, num_comp: u32) -> Self
[src]
Constructs an empty color scalars array.
pub fn lookup_table(name: impl Into<String>) -> Self
[src]
Constructs an empty lookup table.
pub fn vectors(name: impl Into<String>) -> Self
[src]
Constructs an empty vectors array.
pub fn normals(name: impl Into<String>) -> Self
[src]
Constructs an empty normals array.
pub fn tensors(name: impl Into<String>) -> Self
[src]
Constructs an empty tensors array.
pub fn tcoords(name: impl Into<String>, num_comp: u32) -> Self
[src]
Constructs an empty texture coordinates array with the given dimensionality.
pub fn new(name: impl Into<String>, num_comp: u32) -> Self
[src]
Constructs an empty generic array with the given number of components.
pub fn num_comp(&self) -> usize
[src]
Returns the number of components per element.
This is equal to self.len() / self.num_elem()
.
impl DataArrayBase<u32>
[src]
pub fn new(name: impl Into<String>, num_comp: u32) -> FieldArray
[src]
Constructs an empty field array with the given number of components.
pub fn num_comp(&self) -> usize
[src]
Returns the number of components per element.
This is equal to self.len() / self.num_elem()
.
Trait Implementations
impl<E: Clone> Clone for DataArrayBase<E>
[src]
fn clone(&self) -> DataArrayBase<E>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<E: Debug> Debug for DataArrayBase<E>
[src]
impl<E: PartialEq> PartialEq<DataArrayBase<E>> for DataArrayBase<E>
[src]
fn eq(&self, other: &DataArrayBase<E>) -> bool
[src]
fn ne(&self, other: &DataArrayBase<E>) -> bool
[src]
impl<E> StructuralPartialEq for DataArrayBase<E>
[src]
Auto Trait Implementations
impl<E> RefUnwindSafe for DataArrayBase<E> where
E: RefUnwindSafe,
E: RefUnwindSafe,
impl<E> Send for DataArrayBase<E> where
E: Send,
E: Send,
impl<E> Sync for DataArrayBase<E> where
E: Sync,
E: Sync,
impl<E> Unpin for DataArrayBase<E> where
E: Unpin,
E: Unpin,
impl<E> UnwindSafe for DataArrayBase<E> where
E: UnwindSafe,
E: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,