[][src]Module gut::mesh::attrib

Attribute module. This specifies the interface required to read/write attributes from/to different mesh components.

Attribute API.

This module defines the API used to store and access attributes in meshes. Attributes are stored inside HashMap data structures, and are accessed through the variety of getters described below. The most efficient attribute access is through iterators which are standard slice iterators, so slice operations work on attribute data. Alternatively, individual attribute values can be accessed using get, get_ref and get_mut, but each call to such a getter icurs a cost for runtime type checking. Since the type of the attribute being stored is determined at runtime, you must provide the expected type and location of the attribute when retrieving values. This is done using a "turbofish"; for example to retrieve a 3 float array attribute stored at vertices we need to specify ::<[f32; 3], VertexIndex> to the appropriate accessor. See the Attrib trait for more details.

New Mesh Types

When defining new meshes, simply "derive" the Attrib trait. The custom derive will look for a field with type AttribDict<_> where _ corresponds to an index type identifying the location where the attribute lives. For example AttribDict<VertexIndex> is a HashMap that stores attributes at vertices of the mesh. Any topology index can be used there. See the implementations of TetMesh and TriMesh for more details.

Structs

Attribute

Mesh attribute type. This stores values that can be attached to mesh elements.

IntrinsicAttribute

An intrinsic attribute type. This differs from Attribute<I> in that it is explicitly typed and it is intended to be used for attributes that are "intrinsic" to the specific mesh type. For instance, the position attribute is intrinsic to polygonal or tetrahedral meshes and point clouds. Intrinsic attributes define the geometry of the mesh type.

Enums

Entry

A view into a single entry in a map, which may either be vacant or occupied.

Error

Error type specific to retrieving attributes from the attribute dictionary.

Traits

Attrib

Attribute interfaces for meshes. In order to derive this trait the mesh must have a field called attributes with type AttribDict.

AttribIndex

This trait provides an interface for the implementer of Attrib to access attributes associated with a specific topology within a mesh.

AttribPromote

Promote attributes from one topology to another.

Bytes

Helper trait to interpret a slice of bytes representing a sized type. Note: this trait is meant to be used transiently on the same platform, and so doesn't care about endianness. In other words, the slice of bytes generated by this trait should not be stored anywhere that outlives the lifetime of the program.

CellAttrib

Topology specific attribute implementation trait. This trait exists to allow one to access mesh attributes using the AttribIndex trait, and should never be used explicitly.

CellEdgeAttrib

Topology specific attribute implementation trait. This trait exists to allow one to access mesh attributes using the AttribIndex trait, and should never be used explicitly.

CellFaceAttrib

Topology specific attribute implementation trait. This trait exists to allow one to access mesh attributes using the AttribIndex trait, and should never be used explicitly.

CellVertexAttrib

Topology specific attribute implementation trait. This trait exists to allow one to access mesh attributes using the AttribIndex trait, and should never be used explicitly.

EdgeAttrib

Topology specific attribute implementation trait. This trait exists to allow one to access mesh attributes using the AttribIndex trait, and should never be used explicitly.

EdgeCellAttrib

Topology specific attribute implementation trait. This trait exists to allow one to access mesh attributes using the AttribIndex trait, and should never be used explicitly.

EdgeFaceAttrib

Topology specific attribute implementation trait. This trait exists to allow one to access mesh attributes using the AttribIndex trait, and should never be used explicitly.

EdgeVertexAttrib

Topology specific attribute implementation trait. This trait exists to allow one to access mesh attributes using the AttribIndex trait, and should never be used explicitly.

FaceAttrib

Topology specific attribute implementation trait. This trait exists to allow one to access mesh attributes using the AttribIndex trait, and should never be used explicitly.

FaceCellAttrib

Topology specific attribute implementation trait. This trait exists to allow one to access mesh attributes using the AttribIndex trait, and should never be used explicitly.

FaceEdgeAttrib

Topology specific attribute implementation trait. This trait exists to allow one to access mesh attributes using the AttribIndex trait, and should never be used explicitly.

FaceVertexAttrib

Topology specific attribute implementation trait. This trait exists to allow one to access mesh attributes using the AttribIndex trait, and should never be used explicitly.

MeshAttrib

Topology specific attribute implementation trait. This trait exists to allow one to access mesh attributes using the AttribIndex trait, and should never be used explicitly.

VertexAttrib

Topology specific attribute implementation trait. This trait exists to allow one to access mesh attributes using the AttribIndex trait, and should never be used explicitly.

VertexCellAttrib

Topology specific attribute implementation trait. This trait exists to allow one to access mesh attributes using the AttribIndex trait, and should never be used explicitly.

VertexEdgeAttrib

Topology specific attribute implementation trait. This trait exists to allow one to access mesh attributes using the AttribIndex trait, and should never be used explicitly.

VertexFaceAttrib

Topology specific attribute implementation trait. This trait exists to allow one to access mesh attributes using the AttribIndex trait, and should never be used explicitly.

Type Definitions

AttribDict

Attribute map indexed by I.