Enum vtkio::model::Attribute [−][src]
Data structure that stores a VTK attribute.
Variants
DataArray(DataArray)
A data array with any number of components.
This is the standard way to represent data in XML formats.
It is also used to represent VECTORS
, NORMALS
, TEXTURE_COORDINATES
, LOOKUP_TABLE
s,
COLOR_SCALARS
and TENSORS
in the legacy VTK format, each of which are identified by the
elem
field in the DataArray
struct.
Field attribute.
Essentially an array of arrays of any size. This can be used to represent data for alternative topologies that don’t correspond to the current data set, like UV coordinate topology with seams.
This is a Legacy only attribute type.
Fields of Field
name: String
data_array: Vec<FieldArray>
Implementations
impl Attribute
[src]
pub fn name(&self) -> &str
[src]
Get the name of this attribute.
pub fn scalars_with_lookup(
name: impl Into<String>,
num_comp: u32,
lookup_table: impl Into<String>
) -> Attribute
[src]
name: impl Into<String>,
num_comp: u32,
lookup_table: impl Into<String>
) -> Attribute
Constructs a new scalars attribute with an associated lookup table.
pub fn scalars(name: impl Into<String>, num_comp: u32) -> Attribute
[src]
Constructs a new scalars attribute.
pub fn color_scalars(name: impl Into<String>, num_comp: u32) -> Attribute
[src]
Constructs a new color scalars attribute.
pub fn lookup_table(name: impl Into<String>) -> Attribute
[src]
Constructs a new lookup table attribute.
pub fn vectors(name: impl Into<String>) -> Attribute
[src]
Constructs a new vectors attribute.
pub fn normals(name: impl Into<String>) -> Attribute
[src]
Constructs a new normals attribute.
pub fn tensors(name: impl Into<String>) -> Attribute
[src]
Constructs a new tensors attribute.
pub fn tcoords(name: impl Into<String>, num_comp: u32) -> Attribute
[src]
Constructs a new texture coordinates attribute with the given dimensionality.
pub fn generic(name: impl Into<String>, num_comp: u32) -> Attribute
[src]
Constructs a new generic attribute with the given number of components.
pub fn field(name: impl Into<String>) -> Attribute
[src]
Constructs a new field attribute with the given name.
pub fn with_data(self, new_data: impl Into<IOBuffer>) -> Self
[src]
Sets the data of this attribute to the given buffer.
If this attribute is a Field
, then nothing is changed.
If the data was previously already set, it will be overwritten with the one given in this function.
pub fn with_field_data(
self,
arrays: impl IntoIterator<Item = FieldArray>
) -> Self
[src]
self,
arrays: impl IntoIterator<Item = FieldArray>
) -> Self
Adds a vector of FieldArray
s to this field attribute.
If this attribute is not a Field
, then nothing is changed.
Examples
If it is more convenient to construct all field arrays individually, one can collect them all at once as follows
use vtkio::model::{Attribute, FieldArray}; let field_arrays = vec![ FieldArray::new("A", 1), FieldArray::new("B", 2), FieldArray::new("C", 5), ]; let field = Attribute::field("Data").with_field_data(field_arrays);
pub fn add_field_data(self, data: impl Into<FieldArray>) -> Self
[src]
Adds a field array to the field attribute.
If this attribute is not a Field
, then nothing is changed.
Examples
One can collect a number of field arrays into a field attribute using with a sequence of
calls to add_field_data
.
use vtkio::model::{Attribute, FieldArray}; let field = Attribute::field("Data") .add_field_data(FieldArray::new("A", 1)) .add_field_data(FieldArray::new("B", 2)) .add_field_data(FieldArray::new("C", 5));
Trait Implementations
impl Clone for Attribute
[src]
impl Debug for Attribute
[src]
impl PartialEq<Attribute> for Attribute
[src]
impl StructuralPartialEq for Attribute
[src]
Auto Trait Implementations
impl RefUnwindSafe for Attribute
impl Send for Attribute
impl Sync for Attribute
impl Unpin for Attribute
impl UnwindSafe for Attribute
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>,