Macro pasture_core::attributes [−][src]
Create an iterator over multiple attributes within a PointBuffer
. This macro uses some special syntax to determine the attributes
and their types:
attributes!{ ATTRIBUTE_1_EXPR => ATTRIBUTE_1_TYPE, ATTRIBUTE_2_EXPR => ATTRIBUTE_2_TYPE, ..., buffer }
ATTRIBUTE_X_EXPR
must be an expression that evaluates to a &PointAttributeDefinition
and ATTRIBUTE_X_TYPE
must be the Pasture
PrimitiveType
that the attribute will be returned as. The type must match the type that the attribute is stored with inside buffer
.
The iterator will then return tuples of the type:
(ATTRIBUTE_1_TYPE, ATTRIBUTE_2_TYPE, ...)
Note: Currently, a maximum of 4 attributes at the same time are supported.
Panics
Panics if any of the attributes are not contained within the buffer
.
Panics if, for any attribute, the desired type does not match the PointAttributeDataType
of that attribute.