pub struct VolumeGridNodeScalarQuantity { /* private fields */ }Expand description
A scalar quantity defined at grid nodes.
Implementations§
Source§impl VolumeGridNodeScalarQuantity
impl VolumeGridNodeScalarQuantity
Sourcepub fn new(
name: impl Into<String>,
structure_name: impl Into<String>,
values: Vec<f32>,
node_dim: UVec3,
bound_min: Vec3,
bound_max: Vec3,
) -> Self
pub fn new( name: impl Into<String>, structure_name: impl Into<String>, values: Vec<f32>, node_dim: UVec3, bound_min: Vec3, bound_max: Vec3, ) -> Self
Creates a new node scalar quantity.
Sourcepub fn set_color_map(&mut self, name: impl Into<String>) -> &mut Self
pub fn set_color_map(&mut self, name: impl Into<String>) -> &mut Self
Sets the color map name.
Sourcepub fn data_range(&self) -> (f32, f32)
pub fn data_range(&self) -> (f32, f32)
Gets the data range.
Sourcepub fn set_data_range(&mut self, min: f32, max: f32) -> &mut Self
pub fn set_data_range(&mut self, min: f32, max: f32) -> &mut Self
Sets the data range.
Sourcepub fn viz_mode(&self) -> VolumeGridVizMode
pub fn viz_mode(&self) -> VolumeGridVizMode
Gets the current visualization mode.
Sourcepub fn set_viz_mode(&mut self, mode: VolumeGridVizMode) -> &mut Self
pub fn set_viz_mode(&mut self, mode: VolumeGridVizMode) -> &mut Self
Sets the visualization mode.
Sourcepub fn isosurface_level(&self) -> f32
pub fn isosurface_level(&self) -> f32
Gets the isosurface level.
Sourcepub fn set_isosurface_level(&mut self, level: f32) -> &mut Self
pub fn set_isosurface_level(&mut self, level: f32) -> &mut Self
Sets the isosurface level (invalidates cache).
Sourcepub fn isosurface_color(&self) -> Vec3
pub fn isosurface_color(&self) -> Vec3
Gets the isosurface color.
Sourcepub fn set_isosurface_color(&mut self, color: Vec3) -> &mut Self
pub fn set_isosurface_color(&mut self, color: Vec3) -> &mut Self
Sets the isosurface color.
Sourcepub fn isosurface_dirty(&self) -> bool
pub fn isosurface_dirty(&self) -> bool
Returns whether the isosurface needs re-extraction.
Sourcepub fn gridcube_dirty(&self) -> bool
pub fn gridcube_dirty(&self) -> bool
Returns whether the gridcube needs GPU re-init.
Sourcepub fn extract_isosurface(&mut self) -> &McmMesh
pub fn extract_isosurface(&mut self) -> &McmMesh
Extracts the isosurface mesh using marching cubes.
MC output vertices are in grid index space: vertex (i,j,k) has coords
that need swizzle(z,y,x) * grid_spacing + bound_min to transform to world space.
Sourcepub fn isosurface_mesh(&self) -> Option<&McmMesh>
pub fn isosurface_mesh(&self) -> Option<&McmMesh>
Returns the cached isosurface mesh, if available.
Sourcepub fn gridcube_render_data(&self) -> Option<&GridcubeRenderData>
pub fn gridcube_render_data(&self) -> Option<&GridcubeRenderData>
Returns the gridcube render data.
Sourcepub fn gridcube_render_data_mut(&mut self) -> Option<&mut GridcubeRenderData>
pub fn gridcube_render_data_mut(&mut self) -> Option<&mut GridcubeRenderData>
Returns a mutable reference to the gridcube render data.
Sourcepub fn set_gridcube_render_data(&mut self, data: GridcubeRenderData)
pub fn set_gridcube_render_data(&mut self, data: GridcubeRenderData)
Sets the gridcube render data.
Sourcepub fn isosurface_render_data(&self) -> Option<&IsosurfaceRenderData>
pub fn isosurface_render_data(&self) -> Option<&IsosurfaceRenderData>
Returns the isosurface render data.
Sourcepub fn isosurface_render_data_mut(
&mut self,
) -> Option<&mut IsosurfaceRenderData>
pub fn isosurface_render_data_mut( &mut self, ) -> Option<&mut IsosurfaceRenderData>
Returns a mutable reference to the isosurface render data.
Sourcepub fn set_isosurface_render_data(&mut self, data: IsosurfaceRenderData)
pub fn set_isosurface_render_data(&mut self, data: IsosurfaceRenderData)
Sets the isosurface render data.
Sourcepub fn clear_isosurface_render_data(&mut self)
pub fn clear_isosurface_render_data(&mut self)
Clears the isosurface render data (e.g. when isovalue yields empty mesh).
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 pick resources for this quantity.
Requires that gridcube_render_data is already initialized (needs the position buffer).
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,
model: [[f32; 4]; 4],
cube_size_factor: f32,
)
pub fn update_pick_uniforms( &self, queue: &Queue, model: [[f32; 4]; 4], cube_size_factor: f32, )
Updates the pick uniform buffer with current model transform and cube size factor.
Sourcepub fn num_pick_elements(&self) -> u32
pub fn num_pick_elements(&self) -> u32
Returns the number of pick elements (= number of gridcube instances).
Sourcepub fn pick_total_vertices(&self) -> u32
pub fn pick_total_vertices(&self) -> u32
Returns the total vertices for the pick draw call.
Sourcepub fn register_as_mesh_requested(&self) -> bool
pub fn register_as_mesh_requested(&self) -> bool
Returns whether the user has requested registering the isosurface as a mesh.
Sourcepub fn clear_register_as_mesh_request(&mut self)
pub fn clear_register_as_mesh_request(&mut self)
Clears the register-as-mesh request flag.
Sourcepub fn build_egui_ui(&mut self, ui: &mut Ui, colormap_names: &[&str])
pub fn build_egui_ui(&mut self, ui: &mut Ui, colormap_names: &[&str])
Builds egui UI for this quantity.
Trait Implementations§
Source§impl Quantity for VolumeGridNodeScalarQuantity
impl Quantity for VolumeGridNodeScalarQuantity
Source§fn structure_name(&self) -> &str
fn structure_name(&self) -> &str
Source§fn kind(&self) -> QuantityKind
fn kind(&self) -> QuantityKind
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 clear_gpu_resources(&mut self)
fn clear_gpu_resources(&mut self)
Source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Any for downcasting.Auto Trait Implementations§
impl Freeze for VolumeGridNodeScalarQuantity
impl !RefUnwindSafe for VolumeGridNodeScalarQuantity
impl Send for VolumeGridNodeScalarQuantity
impl Sync for VolumeGridNodeScalarQuantity
impl Unpin for VolumeGridNodeScalarQuantity
impl UnsafeUnpin for VolumeGridNodeScalarQuantity
impl !UnwindSafe for VolumeGridNodeScalarQuantity
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