pub struct PyVolumeRenderer {
pub data: Vec<f64>,
pub dims: [u32; 3],
pub bounds: [f64; 6],
pub transfer_function: PyTransferFunction,
pub ray_march: RayMarchSettings,
}Expand description
Volume renderer for 3D scalar fields.
Fields§
§data: Vec<f64>3D scalar field stored in [z][y][x] order, flattened.
dims: [u32; 3]Grid dimensions [nx, ny, nz].
bounds: [f64; 6]World-space bounding box [min_x, min_y, min_z, max_x, max_y, max_z].
transfer_function: PyTransferFunctionTransfer function for density → RGBA mapping.
ray_march: RayMarchSettingsRay marching settings.
Implementations§
Source§impl PyVolumeRenderer
impl PyVolumeRenderer
Sourcepub fn new(
data: Vec<f64>,
dims: [u32; 3],
bounds: [f64; 6],
transfer_function: PyTransferFunction,
) -> Self
pub fn new( data: Vec<f64>, dims: [u32; 3], bounds: [f64; 6], transfer_function: PyTransferFunction, ) -> Self
Create a volume renderer from a flat scalar field.
Sourcepub fn sample_at(&self, ix: u32, iy: u32, iz: u32) -> f64
pub fn sample_at(&self, ix: u32, iy: u32, iz: u32) -> f64
Sample the scalar field at a grid index (ix, iy, iz).
Sourcepub fn voxel_count(&self) -> u64
pub fn voxel_count(&self) -> u64
Compute the total number of voxels.
Trait Implementations§
Source§impl Clone for PyVolumeRenderer
impl Clone for PyVolumeRenderer
Source§fn clone(&self) -> PyVolumeRenderer
fn clone(&self) -> PyVolumeRenderer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PyVolumeRenderer
impl Debug for PyVolumeRenderer
Source§impl<'de> Deserialize<'de> for PyVolumeRenderer
impl<'de> Deserialize<'de> for PyVolumeRenderer
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PyVolumeRenderer
impl RefUnwindSafe for PyVolumeRenderer
impl Send for PyVolumeRenderer
impl Sync for PyVolumeRenderer
impl Unpin for PyVolumeRenderer
impl UnsafeUnpin for PyVolumeRenderer
impl UnwindSafe for PyVolumeRenderer
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.