pub struct PointAttribute { /* private fields */ }Expand description
Typed attribute values attached to points in a point cloud or mesh.
Attribute data is stored in a contiguous byte buffer. Point ids either map directly to attribute value ids, or through an explicit point-to-value map when multiple points share or reorder attribute entries.
Implementations§
Source§impl PointAttribute
impl PointAttribute
Sourcepub fn init(
&mut self,
attribute_type: GeometryAttributeType,
num_components: u8,
data_type: DataType,
normalized: bool,
num_attribute_values: usize,
)
pub fn init( &mut self, attribute_type: GeometryAttributeType, num_components: u8, data_type: DataType, normalized: bool, num_attribute_values: usize, )
Initializes the attribute and allocates storage for its values.
Sourcepub fn try_init(
&mut self,
attribute_type: GeometryAttributeType,
num_components: u8,
data_type: DataType,
normalized: bool,
num_attribute_values: usize,
) -> Result<(), DracoError>
pub fn try_init( &mut self, attribute_type: GeometryAttributeType, num_components: u8, data_type: DataType, normalized: bool, num_attribute_values: usize, ) -> Result<(), DracoError>
Fallibly initializes the attribute and allocates storage for its values.
Sourcepub fn mapped_index(&self, point_index: PointIndex) -> AttributeValueIndex
pub fn mapped_index(&self, point_index: PointIndex) -> AttributeValueIndex
Maps a point id to the corresponding attribute value id.
Sourcepub fn resize_unique_entries(
&mut self,
num_attribute_values: usize,
) -> Result<(), DracoError>
pub fn resize_unique_entries( &mut self, num_attribute_values: usize, ) -> Result<(), DracoError>
Resizes the unique attribute value storage.
Sourcepub fn buffer_mut(&mut self) -> &mut DataBuffer
pub fn buffer_mut(&mut self) -> &mut DataBuffer
Returns the mutable raw attribute value buffer.
Sourcepub fn attribute_type(&self) -> GeometryAttributeType
pub fn attribute_type(&self) -> GeometryAttributeType
Returns the semantic attribute type.
Sourcepub fn set_unique_id(&mut self, id: u32)
pub fn set_unique_id(&mut self, id: u32)
Sets the stable Draco unique id.
Sourcepub fn set_attribute_type(&mut self, attribute_type: GeometryAttributeType)
pub fn set_attribute_type(&mut self, attribute_type: GeometryAttributeType)
Sets the semantic attribute type.
Sourcepub fn set_data_type(&mut self, data_type: DataType)
pub fn set_data_type(&mut self, data_type: DataType)
Sets the scalar data type.
Sourcepub fn set_num_components(&mut self, num_components: u8)
pub fn set_num_components(&mut self, num_components: u8)
Sets the number of scalar components per value.
Sourcepub fn set_identity_mapping(&mut self)
pub fn set_identity_mapping(&mut self)
Uses point ids directly as attribute value ids.
Sourcepub fn set_explicit_mapping(&mut self, num_points: usize)
pub fn set_explicit_mapping(&mut self, num_points: usize)
Allocates an explicit point-to-attribute-value map.
Sourcepub fn set_point_map_entry(
&mut self,
point_index: PointIndex,
entry_index: AttributeValueIndex,
)
pub fn set_point_map_entry( &mut self, point_index: PointIndex, entry_index: AttributeValueIndex, )
Sets one point-to-attribute-value map entry.
Sourcepub fn try_set_point_map_entry(
&mut self,
point_index: PointIndex,
entry_index: AttributeValueIndex,
) -> Result<(), DracoError>
pub fn try_set_point_map_entry( &mut self, point_index: PointIndex, entry_index: AttributeValueIndex, ) -> Result<(), DracoError>
Fallibly sets one point-to-attribute-value map entry.
Sourcepub fn set_attribute_transform_data(&mut self, data: AttributeTransformData)
pub fn set_attribute_transform_data(&mut self, data: AttributeTransformData)
Stores transform metadata associated with this attribute.
Sourcepub fn attribute_transform_data(&self) -> Option<&AttributeTransformData>
pub fn attribute_transform_data(&self) -> Option<&AttributeTransformData>
Returns transform metadata associated with this attribute, if present.
Sourcepub fn normalized(&self) -> bool
pub fn normalized(&self) -> bool
Returns whether integer data should be interpreted as normalized.
Sourcepub fn num_components(&self) -> u8
pub fn num_components(&self) -> u8
Returns the number of scalar components per value.
Sourcepub fn byte_stride(&self) -> i64
pub fn byte_stride(&self) -> i64
Returns the byte stride between consecutive values.
Trait Implementations§
Source§impl Clone for PointAttribute
impl Clone for PointAttribute
Source§fn clone(&self) -> PointAttribute
fn clone(&self) -> PointAttribute
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more