pub struct PointCloud { /* private fields */ }Expand description
A point cloud structure.
Implementations§
Source§impl PointCloud
impl PointCloud
Sourcepub fn num_points(&self) -> usize
pub fn num_points(&self) -> usize
Returns the number of points.
Sourcepub fn update_points(&mut self, points: Vec<Vec3>)
pub fn update_points(&mut self, points: Vec<Vec3>)
Updates the point positions.
Sourcepub fn add_scalar_quantity(
&mut self,
name: impl Into<String>,
values: Vec<f32>,
) -> &mut Self
pub fn add_scalar_quantity( &mut self, name: impl Into<String>, values: Vec<f32>, ) -> &mut Self
Adds a scalar quantity to this point cloud.
Sourcepub fn add_vector_quantity(
&mut self,
name: impl Into<String>,
vectors: Vec<Vec3>,
) -> &mut Self
pub fn add_vector_quantity( &mut self, name: impl Into<String>, vectors: Vec<Vec3>, ) -> &mut Self
Adds a vector quantity to this point cloud.
Sourcepub fn add_color_quantity(
&mut self,
name: impl Into<String>,
colors: Vec<Vec3>,
) -> &mut Self
pub fn add_color_quantity( &mut self, name: impl Into<String>, colors: Vec<Vec3>, ) -> &mut Self
Adds a color quantity to this point cloud.
Sourcepub fn init_gpu_resources(
&mut self,
device: &Device,
bind_group_layout: &BindGroupLayout,
camera_buffer: &Buffer,
)
pub fn init_gpu_resources( &mut self, device: &Device, bind_group_layout: &BindGroupLayout, camera_buffer: &Buffer, )
Initializes GPU resources for this point cloud.
Sourcepub fn render_data(&self) -> Option<&PointCloudRenderData>
pub fn render_data(&self) -> Option<&PointCloudRenderData>
Returns the render data if initialized.
Sourcepub fn init_pick_resources(
&mut self,
device: &Device,
pick_bind_group_layout: &BindGroupLayout,
camera_buffer: &Buffer,
global_start: u32,
)
pub fn init_pick_resources( &mut self, device: &Device, pick_bind_group_layout: &BindGroupLayout, camera_buffer: &Buffer, global_start: u32, )
Initializes GPU resources for pick rendering.
Sourcepub fn pick_bind_group(&self) -> Option<&BindGroup>
pub fn pick_bind_group(&self) -> Option<&BindGroup>
Returns the pick bind group if initialized.
Sourcepub fn update_pick_uniforms(&self, queue: &Queue)
pub fn update_pick_uniforms(&self, queue: &Queue)
Updates pick uniforms (e.g., when point radius changes).
Sourcepub fn set_point_radius(&mut self, radius: f32)
pub fn set_point_radius(&mut self, radius: f32)
Sets the point radius.
Sourcepub fn point_radius(&self) -> f32
pub fn point_radius(&self) -> f32
Gets the point radius.
Sourcepub fn set_base_color(&mut self, color: Vec3)
pub fn set_base_color(&mut self, color: Vec3)
Sets the base color.
Sourcepub fn base_color(&self) -> Vec4
pub fn base_color(&self) -> Vec4
Gets the base color.
Sourcepub fn active_color_quantity(&self) -> Option<&PointCloudColorQuantity>
pub fn active_color_quantity(&self) -> Option<&PointCloudColorQuantity>
Returns the currently active color quantity, if any.
Sourcepub fn active_scalar_quantity(&self) -> Option<&PointCloudScalarQuantity>
pub fn active_scalar_quantity(&self) -> Option<&PointCloudScalarQuantity>
Returns the currently active scalar quantity, if any.
Sourcepub fn active_vector_quantity(&self) -> Option<&PointCloudVectorQuantity>
pub fn active_vector_quantity(&self) -> Option<&PointCloudVectorQuantity>
Returns the currently active vector quantity, if any.
Sourcepub fn active_vector_quantity_mut(
&mut self,
) -> Option<&mut PointCloudVectorQuantity>
pub fn active_vector_quantity_mut( &mut self, ) -> Option<&mut PointCloudVectorQuantity>
Returns a mutable reference to the active vector quantity.
Sourcepub fn build_egui_ui(&mut self, ui: &mut Ui, available_materials: &[&str])
pub fn build_egui_ui(&mut self, ui: &mut Ui, available_materials: &[&str])
Builds the egui UI for this point cloud.
Sourcepub fn update_gpu_buffers(&self, queue: &Queue, color_maps: &ColorMapRegistry)
pub fn update_gpu_buffers(&self, queue: &Queue, color_maps: &ColorMapRegistry)
Updates GPU buffers based on current state.
Trait Implementations§
Source§impl HasQuantities for PointCloud
impl HasQuantities for PointCloud
Source§fn add_quantity(&mut self, quantity: Box<dyn Quantity>)
fn add_quantity(&mut self, quantity: Box<dyn Quantity>)
Source§fn get_quantity_mut(&mut self, name: &str) -> Option<&mut Box<dyn Quantity>>
fn get_quantity_mut(&mut self, name: &str) -> Option<&mut Box<dyn Quantity>>
Source§fn remove_quantity(&mut self, name: &str) -> Option<Box<dyn Quantity>>
fn remove_quantity(&mut self, name: &str) -> Option<Box<dyn Quantity>>
Source§fn quantities(&self) -> &[Box<dyn Quantity>]
fn quantities(&self) -> &[Box<dyn Quantity>]
Source§fn num_quantities(&self) -> usize
fn num_quantities(&self) -> usize
Source§impl Structure for PointCloud
impl Structure for PointCloud
Source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Any for downcasting.Source§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
PointCloud”, “SurfaceMesh”).Source§fn bounding_box(&self) -> Option<(Vec3, Vec3)>
fn bounding_box(&self) -> Option<(Vec3, Vec3)>
Source§fn length_scale(&self) -> f32
fn length_scale(&self) -> f32
Source§fn set_transform(&mut self, transform: Mat4)
fn set_transform(&mut self, transform: Mat4)
Source§fn is_enabled(&self) -> bool
fn is_enabled(&self) -> bool
Source§fn set_enabled(&mut self, enabled: bool)
fn set_enabled(&mut self, enabled: bool)
Source§fn material(&self) -> &str
fn material(&self) -> &str
Source§fn set_material(&mut self, material: &str)
fn set_material(&mut self, material: &str)
Source§fn draw(&self, _ctx: &mut dyn RenderContext)
fn draw(&self, _ctx: &mut dyn RenderContext)
Source§fn draw_pick(&self, _ctx: &mut dyn RenderContext)
fn draw_pick(&self, _ctx: &mut dyn RenderContext)
Source§fn build_pick_ui(&self, _ui: &dyn Any, _pick: &PickResult)
fn build_pick_ui(&self, _ui: &dyn Any, _pick: &PickResult)
ImGui UI for a picked element.Source§fn clear_gpu_resources(&mut self)
fn clear_gpu_resources(&mut self)
Source§fn center_bounding_box(&mut self)
fn center_bounding_box(&mut self)
Source§fn reset_transform(&mut self)
fn reset_transform(&mut self)
Auto Trait Implementations§
impl Freeze for PointCloud
impl !RefUnwindSafe for PointCloud
impl Send for PointCloud
impl Sync for PointCloud
impl Unpin for PointCloud
impl !UnwindSafe for PointCloud
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> 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