Struct pasture_core::layout::PointAttributeDefinition
source · pub struct PointAttributeDefinition { /* private fields */ }
Expand description
A definition for a single point attribute of a point cloud. Point attributes are things like the position, GPS time, intensity etc. In Pasture, attributes are identified by a unique name together with the data type that a single record of the attribute is stored in. Attributes can be grouped into two categories: Built-in attributes (e.g. POSITION_3D, INTENSITY, GPS_TIME etc.) and custom attributes.
Implementations§
source§impl PointAttributeDefinition
impl PointAttributeDefinition
sourcepub const fn custom(
name: Cow<'static, str>,
datatype: PointAttributeDataType,
) -> Self
pub const fn custom( name: Cow<'static, str>, datatype: PointAttributeDataType, ) -> Self
Creates a new custom PointAttributeDefinition with the given name and data type
let custom_attribute = PointAttributeDefinition::custom(Cow::Borrowed("Custom"), PointAttributeDataType::F32);
sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
Returns the name of this PointAttributeDefinition
let custom_attribute = PointAttributeDefinition::custom(Cow::Borrowed("Custom"), PointAttributeDataType::F32);
let name = custom_attribute.name();
sourcepub const fn datatype(&self) -> PointAttributeDataType
pub const fn datatype(&self) -> PointAttributeDataType
Returns the datatype of this PointAttributeDefinition
let custom_attribute = PointAttributeDefinition::custom(Cow::Borrowed("Custom"), PointAttributeDataType::F32);
let datatype = custom_attribute.datatype();
sourcepub fn with_custom_datatype(&self, new_datatype: PointAttributeDataType) -> Self
pub fn with_custom_datatype(&self, new_datatype: PointAttributeDataType) -> Self
Returns a new PointAttributeDefinition based on this PointAttributeDefinition, but with a different datatype
let custom_position_attribute = attributes::POSITION_3D.with_custom_datatype(PointAttributeDataType::Vec3f32);
sourcepub fn at_offset_in_type(&self, offset: u64) -> PointAttributeMember
pub fn at_offset_in_type(&self, offset: u64) -> PointAttributeMember
Creates a PointAttributeMember
from the associated PointAttributeDefinition
by specifying an offset
of the attribute within a PointType
. This turns an abstract PointAttributeDefinition
into a concrete
PointAttributeMember
let custom_position_attribute = attributes::POSITION_3D.at_offset_in_type(8);
Trait Implementations§
source§impl Clone for PointAttributeDefinition
impl Clone for PointAttributeDefinition
source§fn clone(&self) -> PointAttributeDefinition
fn clone(&self) -> PointAttributeDefinition
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for PointAttributeDefinition
impl Debug for PointAttributeDefinition
source§impl Display for PointAttributeDefinition
impl Display for PointAttributeDefinition
source§impl FromIterator<PointAttributeDefinition> for PointLayout
impl FromIterator<PointAttributeDefinition> for PointLayout
source§fn from_iter<T: IntoIterator<Item = PointAttributeDefinition>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = PointAttributeDefinition>>(iter: T) -> Self
source§impl Hash for PointAttributeDefinition
impl Hash for PointAttributeDefinition
source§impl PartialEq for PointAttributeDefinition
impl PartialEq for PointAttributeDefinition
source§fn eq(&self, other: &PointAttributeDefinition) -> bool
fn eq(&self, other: &PointAttributeDefinition) -> bool
self
and other
values to be equal, and is used
by ==
.impl Eq for PointAttributeDefinition
impl StructuralPartialEq for PointAttributeDefinition
Auto Trait Implementations§
impl Freeze for PointAttributeDefinition
impl RefUnwindSafe for PointAttributeDefinition
impl Send for PointAttributeDefinition
impl Sync for PointAttributeDefinition
impl Unpin for PointAttributeDefinition
impl UnwindSafe for PointAttributeDefinition
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.