Derive Macro pasture_derive::PointType [−][src]
#[derive(PointType)] { // Attributes available to this derive: #[pasture] }
Custom derive
macro that implements the PointType
trait for the type that it is applied to.
Any that that wants to implement PointType
using this derive
macro must fulfill the following requirements:
- It must be at least one of
#[repr(C)]
and#[repr(packed)]
- All its members may only be Pasture primitive types
- Each member must contain an attribute
#[pasture(X)]
, whereX
is either one of the builtin attributes explained below, orattribute = "name"
for a custom attribute namedname
- No two members may share the same attribute name
Builtin attributes
To associate a member of a custom PointType
with one of the builtin point attributes in Pasture, use the #[pasture(X)]
attribute, where X
is one of:
BUILTIN_POSITION_3D
corresponding to the POSITION_3D attributeBUILTIN_INTENSITY
corresponding to the INTENSITY attributeBUILTIN_RETURN_NUMBER
corresponding to the RETURN_NUMBER attributeBUILTIN_NUMBER_OF_RETURNS
corresponding to the NUMBER_OF_RETURNS attributeBUILTIN_CLASSIFICATION_FLAGS
corresponding to the CLASSIFICATION_FLAGS attributeBUILTIN_SCANNER_CHANNEL
corresponding to the SCANNER_CHANNEL attributeBUILTIN_SCAN_DIRECTION_FLAG
corresponding to the SCAN_DIRECTION_FLAG attributeBUILTIN_EDGE_OF_FLIGHT_LINE
corresponding to the EDGE_OF_FLIGHT_LINE attributeBUILTIN_CLASSIFICATION
corresponding to the CLASSIFICATION attributeBUILTIN_SCAN_ANGLE_RANK
corresponding to the SCAN_ANGLE_RANK attributeBUILTIN_SCAN_ANGLE
corresponding to the SCAN_ANGLE attributeBUILTIN_USER_DATA
corresponding to the USER_DATA attributeBUILTIN_POINT_SOURCE_ID
corresponding to the POINT_SOURCE_ID attributeBUILTIN_COLOR_RGB
corresponding to the COLOR_RGB attributeBUILTIN_GPS_TIME
corresponding to the GPS_TIME attributeBUILTIN_NIR
corresponding to the NIR attributeBUILTIN_WAVE_PACKET_DESCRIPTOR_INDEX
corresponding to the WAVE_PACKET_DESCRIPTOR_INDEX attributeBUILTIN_WAVEFORM_DATA_OFFSET
corresponding to the WAVEFORM_DATA_OFFSET attributeBUILTIN_WAVEFORM_PACKET_SIZE
corresponding to the WAVEFORM_PACKET_SIZE attributeBUILTIN_RETURN_POINT_WAVEFORM_LOCATION
corresponding to the RETURN_POINT_WAVEFORM_LOCATION attributeBUILTIN_WAVEFORM_PARAMETERS
corresponding to the WAVEFORM_PARAMETERS attribute
Custom attributes
To associate a member of a custom PointType
with a point attribute with custom name
, use the #[pasture(attribute = "name")]
attribute