pub struct SurfacePlot {Show 18 fields
pub x_data: Vec<f64>,
pub y_data: Vec<f64>,
pub z_data: Option<Vec<Vec<f64>>>,
pub colormap: ColorMap,
pub shading_mode: ShadingMode,
pub wireframe: bool,
pub alpha: f32,
pub flatten_z: bool,
pub image_mode: bool,
pub color_limits: Option<(f64, f64)>,
pub color_grid: Option<Vec<Vec<Vec4>>>,
pub lighting_enabled: bool,
pub ambient_strength: f32,
pub diffuse_strength: f32,
pub specular_strength: f32,
pub shininess: f32,
pub label: Option<String>,
pub visible: bool,
/* private fields */
}Expand description
High-performance GPU-accelerated 3D surface plot
Fields§
§x_data: Vec<f64>Grid data (Z values at X,Y coordinates)
y_data: Vec<f64>§z_data: Option<Vec<Vec<f64>>>§colormap: ColorMapSurface properties
shading_mode: ShadingMode§wireframe: bool§alpha: f32§flatten_z: boolIf true, render Z at 0 (flat), but color-map using Z values
image_mode: boolIf true, this flattened surface should behave like a 2D image for camera/UI decisions.
color_limits: Option<(f64, f64)>Optional color limits override for mapping Z -> color (caxis)
color_grid: Option<Vec<Vec<Vec4>>>Optional per-vertex color grid (for RGB images); if set, overrides colormap mapping
lighting_enabled: boolLighting and material
ambient_strength: f32§diffuse_strength: f32§specular_strength: f32§shininess: f32§label: Option<String>Metadata
visible: boolImplementations§
Source§impl SurfacePlot
impl SurfacePlot
Sourcepub fn new(
x_data: Vec<f64>,
y_data: Vec<f64>,
z_data: Vec<Vec<f64>>,
) -> Result<Self, String>
pub fn new( x_data: Vec<f64>, y_data: Vec<f64>, z_data: Vec<Vec<f64>>, ) -> Result<Self, String>
Create a new surface plot from meshgrid data
Sourcepub fn from_gpu_buffer(
x_len: usize,
y_len: usize,
buffer: GpuVertexBuffer,
vertex_count: usize,
bounds: BoundingBox,
) -> Self
pub fn from_gpu_buffer( x_len: usize, y_len: usize, buffer: GpuVertexBuffer, vertex_count: usize, bounds: BoundingBox, ) -> Self
Create a surface plot backed by a GPU vertex buffer.
Sourcepub fn from_function<F>(
x_range: (f64, f64),
y_range: (f64, f64),
resolution: (usize, usize),
func: F,
) -> Result<Self, String>
pub fn from_function<F>( x_range: (f64, f64), y_range: (f64, f64), resolution: (usize, usize), func: F, ) -> Result<Self, String>
Create surface from a function
Sourcepub fn with_colormap(self, colormap: ColorMap) -> Self
pub fn with_colormap(self, colormap: ColorMap) -> Self
Set color mapping
Sourcepub fn with_shading(self, shading: ShadingMode) -> Self
pub fn with_shading(self, shading: ShadingMode) -> Self
Set shading mode
Sourcepub fn with_wireframe(self, enabled: bool) -> Self
pub fn with_wireframe(self, enabled: bool) -> Self
Enable/disable wireframe
Sourcepub fn with_alpha(self, alpha: f32) -> Self
pub fn with_alpha(self, alpha: f32) -> Self
Set transparency
Sourcepub fn with_flatten_z(self, enabled: bool) -> Self
pub fn with_flatten_z(self, enabled: bool) -> Self
Render surface flat in Z while mapping colors from Z values (for imagesc/imshow)
pub fn with_image_mode(self, enabled: bool) -> Self
Sourcepub fn with_color_limits(self, limits: Option<(f64, f64)>) -> Self
pub fn with_color_limits(self, limits: Option<(f64, f64)>) -> Self
Override color mapping limits (caxis)
Sourcepub fn set_color_limits(&mut self, limits: Option<(f64, f64)>)
pub fn set_color_limits(&mut self, limits: Option<(f64, f64)>)
Mutably set color mapping limits (caxis)
Sourcepub fn with_color_grid(self, grid: Vec<Vec<Vec4>>) -> Self
pub fn with_color_grid(self, grid: Vec<Vec<Vec4>>) -> Self
Provide explicit per-vertex colors (RGB[A])
Sourcepub fn with_label<S: Into<String>>(self, label: S) -> Self
pub fn with_label<S: Into<String>>(self, label: S) -> Self
Set plot label for legends
Sourcepub fn bounds(&mut self) -> BoundingBox
pub fn bounds(&mut self) -> BoundingBox
Get the bounding box of the surface
Sourcepub fn statistics(&self) -> SurfaceStatistics
pub fn statistics(&self) -> SurfaceStatistics
Get plot statistics for debugging
Sourcepub fn estimated_memory_usage(&self) -> usize
pub fn estimated_memory_usage(&self) -> usize
Estimate memory usage in bytes
Sourcepub fn render_data(&mut self) -> RenderData
pub fn render_data(&mut self) -> RenderData
Generate complete render data for the graphics pipeline
Trait Implementations§
Source§impl Clone for SurfacePlot
impl Clone for SurfacePlot
Source§fn clone(&self) -> SurfacePlot
fn clone(&self) -> SurfacePlot
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 SurfacePlot
impl !RefUnwindSafe for SurfacePlot
impl Send for SurfacePlot
impl Sync for SurfacePlot
impl Unpin for SurfacePlot
impl UnsafeUnpin for SurfacePlot
impl !UnwindSafe for SurfacePlot
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> 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