Skip to main content

PointAttribute

Struct PointAttribute 

Source
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

Source

pub fn new() -> Self

Creates an empty attribute with an invalid semantic type.

Source

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.

Source

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.

Source

pub fn mapped_index(&self, point_index: PointIndex) -> AttributeValueIndex

Maps a point id to the corresponding attribute value id.

Source

pub fn size(&self) -> usize

Returns the number of unique attribute values.

Source

pub fn resize_unique_entries( &mut self, num_attribute_values: usize, ) -> Result<(), DracoError>

Resizes the unique attribute value storage.

Source

pub fn buffer(&self) -> &DataBuffer

Returns the raw attribute value buffer.

Source

pub fn buffer_mut(&mut self) -> &mut DataBuffer

Returns the mutable raw attribute value buffer.

Source

pub fn attribute_type(&self) -> GeometryAttributeType

Returns the semantic attribute type.

Source

pub fn unique_id(&self) -> u32

Returns the stable Draco unique id.

Source

pub fn set_unique_id(&mut self, id: u32)

Sets the stable Draco unique id.

Source

pub fn set_attribute_type(&mut self, attribute_type: GeometryAttributeType)

Sets the semantic attribute type.

Source

pub fn set_data_type(&mut self, data_type: DataType)

Sets the scalar data type.

Source

pub fn set_num_components(&mut self, num_components: u8)

Sets the number of scalar components per value.

Source

pub fn set_identity_mapping(&mut self)

Uses point ids directly as attribute value ids.

Source

pub fn set_explicit_mapping(&mut self, num_points: usize)

Allocates an explicit point-to-attribute-value map.

Source

pub fn set_point_map_entry( &mut self, point_index: PointIndex, entry_index: AttributeValueIndex, )

Sets one point-to-attribute-value map entry.

Source

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.

Source

pub fn set_attribute_transform_data(&mut self, data: AttributeTransformData)

Stores transform metadata associated with this attribute.

Source

pub fn attribute_transform_data(&self) -> Option<&AttributeTransformData>

Returns transform metadata associated with this attribute, if present.

Source

pub fn data_type(&self) -> DataType

Returns the scalar data type.

Source

pub fn normalized(&self) -> bool

Returns whether integer data should be interpreted as normalized.

Source

pub fn num_components(&self) -> u8

Returns the number of scalar components per value.

Source

pub fn byte_stride(&self) -> i64

Returns the byte stride between consecutive values.

Trait Implementations§

Source§

impl Clone for PointAttribute

Source§

fn clone(&self) -> PointAttribute

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PointAttribute

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PointAttribute

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.