Enum ElementType

Source
pub enum ElementType {
    ColorScalars(u32),
    LookupTable,
    Scalars {
        num_comp: u32,
        lookup_table: Option<String>,
    },
    Vectors,
    Normals,
    TCoords(u32),
    Tensors,
    Generic(u32),
}
Expand description

The type of element being represented inside a DataArray.

This is used to identify attribute types used by the Legacy VTK format, Additionally, this type is used to tag active XML DataArrays as one of Scalars, Vectors, Normals, Tensors, and TCoords as appropriate.

If an XML DataArray is marked tagged by any variant other than Generic (or Legacy only types like ColorScalars and LookupTable) then it is considered active. If there is more than one tagged attribute with the same type, then the first one is considered active.

Variants§

§

ColorScalars(u32)

Color Scalars represent floats in the range 0 to 1.

The number of components per element is represented by the associated integer value.

Identifies the COLOR_SCALARS legacy attribute. This is a legacy only type.

§

LookupTable

A lookup table element is 4 color components: red, green, blue and alpha.

Identifies the LOOKUP_TABLE legacy attribute. This is a legacy only type.

§

Scalars

A scalar field of 1, 2, 3 or 4 components.

An associated lookup table can be specified corresponding to another attribute.

Identifies the SCALARS legacy attribute.

Fields

§num_comp: u32

Number of components per element.

§lookup_table: Option<String>

The name of an optional lookup table. Legacy only.

§

Vectors

Vectors are triplets of x, y and z components.

Identifies the VECTORS legacy attribute.

§

Normals

Normals are triplets of x, y and z components representing a normal vector.

Normals are assumed to be unit length (normalized).

Identifies the NORMALS legacy attribute.

§

TCoords(u32)

Texture coordinates can be 1, 2 or 3 dimensions.

Identifies the TEXTURE_COORDINATES legacy attribute.

§

Tensors

Tensors are 3x3 matrices.

These are given in full row major form:

    t_00, t_01, t_02,
    t_10, t_11, t_12,
    t_20, t_21, t_22,

Note that symmetry is assumed (t_ij == t_ji).

Identifies the TENSORS legacy attribute.

§

Generic(u32)

Generic element with any number of components.

This element type is used to identify fields in the Legacy format.

Implementations§

Source§

impl ElementType

Source

pub fn num_comp(&self) -> u32

Returns the number of components for this element as a 32 bit integer.

Trait Implementations§

Source§

impl Clone for ElementType

Source§

fn clone(&self) -> ElementType

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ElementType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ElementType

Source§

fn default() -> ElementType

Returns the “default value” for a type. Read more
Source§

impl PartialEq for ElementType

Source§

fn eq(&self, other: &ElementType) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ElementType

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.