pub struct Scatter3Plot {
pub points: Vec<Vec3>,
pub colors: Vec<Vec4>,
pub point_size: f32,
pub point_sizes: Option<Vec<f32>>,
pub label: Option<String>,
pub visible: bool,
/* private fields */
}Expand description
GPU-accelerated scatter3 plot for MATLAB semantics.
Fields§
§points: Vec<Vec3>Point positions in 3D space.
colors: Vec<Vec4>Per-point RGBA colors.
point_size: f32Marker size in pixels.
point_sizes: Option<Vec<f32>>Optional per-point marker sizes.
label: Option<String>Legend label.
visible: boolVisibility flag.
Implementations§
Source§impl Scatter3Plot
impl Scatter3Plot
Sourcepub fn new(points: Vec<Vec3>) -> Result<Self, String>
pub fn new(points: Vec<Vec3>) -> Result<Self, String>
Create a new scatter3 plot. Colors default to a blue colormap.
Sourcepub fn from_gpu_buffer(
buffer: GpuVertexBuffer,
point_count: usize,
color: Vec4,
point_size: f32,
bounds: BoundingBox,
) -> Self
pub fn from_gpu_buffer( buffer: GpuVertexBuffer, point_count: usize, color: Vec4, point_size: f32, bounds: BoundingBox, ) -> Self
Build a scatter plot directly from a GPU vertex buffer, bypassing CPU copies.
Sourcepub fn with_color(self, color: Vec4) -> Self
pub fn with_color(self, color: Vec4) -> Self
Override all point colors with a single RGBA value.
Sourcepub fn with_colors(self, colors: Vec<Vec4>) -> Result<Self, String>
pub fn with_colors(self, colors: Vec<Vec4>) -> Result<Self, String>
Supply per-point colors. Length must match the number of points.
Sourcepub fn with_label<S: Into<String>>(self, label: S) -> Self
pub fn with_label<S: Into<String>>(self, label: S) -> Self
Set the legend label.
Sourcepub fn with_point_size(self, size: f32) -> Self
pub fn with_point_size(self, size: f32) -> Self
Set marker size in pixels.
Sourcepub fn set_visible(&mut self, visible: bool)
pub fn set_visible(&mut self, visible: bool)
Enable or disable visibility.
Sourcepub fn with_gpu_vertices(
self,
buffer: GpuVertexBuffer,
point_count: usize,
) -> Self
pub fn with_gpu_vertices( self, buffer: GpuVertexBuffer, point_count: usize, ) -> Self
Attach a GPU-resident vertex buffer that already encodes this point cloud in the renderer’s vertex format. When provided, the renderer can skip per-frame uploads and reuse the supplied buffer directly.
Sourcepub fn set_point_sizes(&mut self, sizes: Vec<f32>)
pub fn set_point_sizes(&mut self, sizes: Vec<f32>)
Supply per-point sizes in pixels.
Sourcepub fn estimated_memory_usage(&self) -> usize
pub fn estimated_memory_usage(&self) -> usize
Estimate memory required for this plot.
Sourcepub fn render_data(&mut self) -> RenderData
pub fn render_data(&mut self) -> RenderData
Generate render data for the renderer.
Sourcepub fn bounds(&mut self) -> BoundingBox
pub fn bounds(&mut self) -> BoundingBox
Compute the axis-aligned bounding box.
Trait Implementations§
Source§impl Clone for Scatter3Plot
impl Clone for Scatter3Plot
Source§fn clone(&self) -> Scatter3Plot
fn clone(&self) -> Scatter3Plot
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 Scatter3Plot
impl !RefUnwindSafe for Scatter3Plot
impl Send for Scatter3Plot
impl Sync for Scatter3Plot
impl Unpin for Scatter3Plot
impl UnsafeUnpin for Scatter3Plot
impl !UnwindSafe for Scatter3Plot
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