Enum vtkio::model::ElementType[][src]

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

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 of Scalars

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

impl ElementType[src]

pub fn num_comp(&self) -> u32[src]

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

Trait Implementations

impl Clone for ElementType[src]

impl Debug for ElementType[src]

impl Default for ElementType[src]

impl PartialEq<ElementType> for ElementType[src]

impl StructuralPartialEq for ElementType[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.