Skip to main content

PointCloud

Struct PointCloud 

Source
pub struct PointCloud { /* private fields */ }
Expand description

Point cloud geometry with typed attributes and optional metadata.

Implementations§

Source§

impl PointCloud

Source

pub fn new() -> Self

Creates an empty point cloud.

Source

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

Sets the number of logical points.

Source

pub fn add_attribute(&mut self, attribute: PointAttribute) -> i32

Adds an attribute and assigns it a unique id matching its attribute id.

Source

pub fn add_attribute_preserve_unique_id( &mut self, attribute: PointAttribute, ) -> i32

Adds an attribute while preserving its existing unique id.

Source

pub fn set_attribute(&mut self, att_id: i32, attribute: PointAttribute)

Places an attribute at att_id, growing the attribute list if needed.

Mirrors C++ PointCloud::SetAttribute: the attribute’s unique id is set to att_id. Any vacancies created when growing the list are filled with empty attributes.

Source

pub fn num_attributes(&self) -> i32

Returns the number of attributes.

Source

pub fn attribute_id_by_unique_id(&self, unique_id: u32) -> i32

Returns the attribute id for the given Draco unique id, or -1.

Mirrors C++ PointCloud::GetAttributeIdByUniqueId.

Source

pub fn attribute_by_unique_id(&self, unique_id: u32) -> Option<&PointAttribute>

Returns the attribute with the given Draco unique id.

Mirrors C++ PointCloud::GetAttributeByUniqueId.

Source

pub fn attribute(&self, att_id: i32) -> &PointAttribute

Returns an attribute by attribute id.

Source

pub fn try_attribute(&self, att_id: i32) -> Result<&PointAttribute, DracoError>

Fallibly returns an attribute by attribute id.

Source

pub fn attribute_mut(&mut self, att_id: i32) -> &mut PointAttribute

Returns a mutable attribute by attribute id.

Source

pub fn try_attribute_mut( &mut self, att_id: i32, ) -> Result<&mut PointAttribute, DracoError>

Fallibly returns a mutable attribute by attribute id.

Source

pub fn named_attribute_id(&self, att_type: GeometryAttributeType) -> i32

Returns the first attribute id with the requested semantic type, or -1.

Source

pub fn named_attribute( &self, att_type: GeometryAttributeType, ) -> Option<&PointAttribute>

Returns the first attribute with the requested semantic type.

Source

pub fn num_points(&self) -> usize

Returns the number of logical points.

Source

pub fn metadata(&self) -> Option<&GeometryMetadata>

Returns geometry metadata, if present.

Source

pub fn metadata_mut(&mut self) -> Option<&mut GeometryMetadata>

Returns mutable geometry metadata, if present.

Source

pub fn metadata_or_insert(&mut self) -> &mut GeometryMetadata

Returns geometry metadata, inserting an empty block when absent.

Source

pub fn set_metadata(&mut self, metadata: Option<GeometryMetadata>)

Replaces geometry metadata.

Source

pub fn attribute_metadata_by_unique_id( &self, attribute_unique_id: u32, ) -> Option<&AttributeMetadata>

Finds per-attribute metadata by Draco attribute unique id.

Source

pub fn attribute_metadata_by_string_entry( &self, entry_name: &str, entry_value: &str, ) -> Option<&AttributeMetadata>

Finds per-attribute metadata by a string metadata entry.

Source

pub fn set_attribute_metadata( &mut self, att_id: i32, metadata: Metadata, ) -> Result<(), DracoError>

Sets metadata for an attribute id.

Trait Implementations§

Source§

impl Clone for PointCloud

Source§

fn clone(&self) -> PointCloud

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 PointCloud

Source§

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

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

impl Default for PointCloud

Source§

fn default() -> PointCloud

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.