Macro pasture_core::attributes_ref[][src]

macro_rules! attributes_ref {
    ($attr1:expr => $t1:ty, $attr2:expr => $t2:ty, $buffer:expr) => { ... };
    ($attr1:expr => $t1:ty, $attr2:expr => $t2:ty, $attr3:expr => $t3:ty, $buffer:expr) => { ... };
    ($attr1:expr => $t1:ty, $attr2:expr => $t2:ty, $attr3:expr => $t3:ty, $attr4:expr => $t4:ty, $buffer:expr) => { ... };
}

Create an iterator over references to multiple attributes within a PointBuffer. Requires that the buffer implements PerAttributePointBuffer. This macro uses some special syntax to determine the attributes and their types:

attributes_ref!{ 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 reference will be returned as. The type must match the type that the attribute is stored with in the buffer. The iterator will then return tuples of the form:

(&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.