pub struct PointCloudHandle { /* private fields */ }Expand description
Handle for a registered point cloud.
This handle provides methods to add quantities and configure the
appearance of a point cloud. Methods return &Self to allow chaining.
§Example
use polyscope_rs::*;
init().unwrap();
register_point_cloud("pts", vec![Vec3::ZERO, Vec3::X])
.add_scalar_quantity("height", vec![0.0, 1.0])
.add_vector_quantity("velocity", vec![Vec3::X, Vec3::Y]);Implementations§
Source§impl PointCloudHandle
impl PointCloudHandle
Sourcepub fn add_scalar_quantity(&self, name: &str, values: Vec<f32>) -> &Self
pub fn add_scalar_quantity(&self, name: &str, values: Vec<f32>) -> &Self
Adds a scalar quantity to this point cloud.
Scalar quantities assign a single value to each point, visualized using a colormap. The values vector must have the same length as the number of points.
§Arguments
name- Name for this quantity (shown in UI)values- One scalar value per point
Sourcepub fn add_vector_quantity(&self, name: &str, vectors: Vec<Vec3>) -> &Self
pub fn add_vector_quantity(&self, name: &str, vectors: Vec<Vec3>) -> &Self
Adds a vector quantity to this point cloud.
Vector quantities display an arrow at each point. Vectors are automatically scaled based on scene size. The vectors array must have the same length as the number of points.
§Arguments
name- Name for this quantity (shown in UI)vectors- One 3D vector per point
Sourcepub fn add_color_quantity(&self, name: &str, colors: Vec<Vec3>) -> &Self
pub fn add_color_quantity(&self, name: &str, colors: Vec<Vec3>) -> &Self
Adds a color quantity to this point cloud.
Color quantities assign an RGB color to each point. The colors vector must have the same length as the number of points. Components should be in range [0, 1].
§Arguments
name- Name for this quantity (shown in UI)colors- One RGB color (Vec3) per point
Trait Implementations§
Source§impl Clone for PointCloudHandle
impl Clone for PointCloudHandle
Source§fn clone(&self) -> PointCloudHandle
fn clone(&self) -> PointCloudHandle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for PointCloudHandle
impl RefUnwindSafe for PointCloudHandle
impl Send for PointCloudHandle
impl Sync for PointCloudHandle
impl Unpin for PointCloudHandle
impl UnsafeUnpin for PointCloudHandle
impl UnwindSafe for PointCloudHandle
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more