[−][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 |
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 |
AttribIndex | This trait provides an interface for the implementer of |
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 |
CellEdgeAttrib | Topology specific attribute implementation trait. This trait exists to allow one to
access mesh attributes using the |
CellFaceAttrib | Topology specific attribute implementation trait. This trait exists to allow one to
access mesh attributes using the |
CellVertexAttrib | Topology specific attribute implementation trait. This trait exists to allow one to
access mesh attributes using the |
EdgeAttrib | Topology specific attribute implementation trait. This trait exists to allow one to
access mesh attributes using the |
EdgeCellAttrib | Topology specific attribute implementation trait. This trait exists to allow one to
access mesh attributes using the |
EdgeFaceAttrib | Topology specific attribute implementation trait. This trait exists to allow one to
access mesh attributes using the |
EdgeVertexAttrib | Topology specific attribute implementation trait. This trait exists to allow one to
access mesh attributes using the |
FaceAttrib | Topology specific attribute implementation trait. This trait exists to allow one to
access mesh attributes using the |
FaceCellAttrib | Topology specific attribute implementation trait. This trait exists to allow one to
access mesh attributes using the |
FaceEdgeAttrib | Topology specific attribute implementation trait. This trait exists to allow one to
access mesh attributes using the |
FaceVertexAttrib | Topology specific attribute implementation trait. This trait exists to allow one to
access mesh attributes using the |
MeshAttrib | Topology specific attribute implementation trait. This trait exists to allow one to
access mesh attributes using the |
VertexAttrib | Topology specific attribute implementation trait. This trait exists to allow one to
access mesh attributes using the |
VertexCellAttrib | Topology specific attribute implementation trait. This trait exists to allow one to
access mesh attributes using the |
VertexEdgeAttrib | Topology specific attribute implementation trait. This trait exists to allow one to
access mesh attributes using the |
VertexFaceAttrib | Topology specific attribute implementation trait. This trait exists to allow one to
access mesh attributes using the |
Type Definitions
AttribDict | Attribute map indexed by |