#[non_exhaustive]pub struct TransparentVolumeMeshItem {
pub id: ProjectedTetId,
pub pick_id: u64,
pub volume_mesh_data: Option<Arc<VolumeMeshData>>,
pub density: f32,
pub scalar_range: Option<(f32, f32)>,
pub threshold_min: f32,
pub threshold_max: f32,
pub appearance: AppearanceSettings,
pub selected: bool,
pub boundary_mesh_id: Option<MeshId>,
}Expand description
A transparent unstructured volume mesh rendered via projected tetrahedra.
Created by uploading a VolumeMeshData with
[ViewportGpuResources::upload_projected_tet_mesh] and submitting the returned
ProjectedTetId each frame.
§Picking
Set pick_id to a non-zero value and provide volume_mesh_data to enable cell-level
picking via renderer.pick() and renderer.pick_rect(). volume_mesh_data must be
the same data passed to upload_projected_tet_mesh for this item.
§Selection highlight
Set selected = true to draw an object-level outline ring around this mesh.
Also supply boundary_mesh_id with the MeshId returned by
upload_volume_mesh_data
for the same geometry; the outline pass uses that boundary surface to compute
the silhouette. Without boundary_mesh_id the selected flag has no visual effect.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: ProjectedTetIdHandle to the uploaded projected-tet mesh.
pick_id: u64Pick ID returned when a cell in this mesh is hit.
0 means this mesh is not pickable. Set to a non-zero value alongside
volume_mesh_data to enable cell picking.
volume_mesh_data: Option<Arc<VolumeMeshData>>CPU mesh data for cell picking.
Must match the data passed to upload_projected_tet_mesh for id.
None disables cell-level picking regardless of pick_id.
density: f32Beer-Lambert extinction coefficient (world-space units).
Higher values make the volume more opaque. Typical range: 0.1 to 5.0.
scalar_range: Option<(f32, f32)>Override the auto-detected scalar range [min, max] used to normalize colourmap lookup.
None uses the range computed at upload time.
threshold_min: f32Scalar threshold range. Tetrahedra whose scalar value falls outside
[threshold_min, threshold_max] are discarded by the shader and not rendered.
Operates on raw (un-normalized) scalar values, the same units as the data
passed to upload_projected_tet_mesh. Default: no clipping (all tets rendered).
threshold_max: f32Upper scalar threshold. See threshold_min.
appearance: AppearanceSettingsPer-item appearance overrides (hidden, unlit, opacity, wireframe).
selected: boolDraw a selection outline ring around this mesh when true.
Requires boundary_mesh_id to be set; see the type-level docs.
boundary_mesh_id: Option<MeshId>Boundary surface mesh used for the selection outline mask pass.
Pass the MeshId returned by upload_volume_mesh_data for the same
geometry. The mesh positions are assumed to be in world space (identity
model matrix).
Implementations§
Source§impl TransparentVolumeMeshItem
impl TransparentVolumeMeshItem
Sourcepub fn new(id: ProjectedTetId) -> Self
pub fn new(id: ProjectedTetId) -> Self
Create a visible item with default density of 1.0 and auto scalar range.
Trait Implementations§
Source§impl Clone for TransparentVolumeMeshItem
impl Clone for TransparentVolumeMeshItem
Source§fn clone(&self) -> TransparentVolumeMeshItem
fn clone(&self) -> TransparentVolumeMeshItem
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for TransparentVolumeMeshItem
impl RefUnwindSafe for TransparentVolumeMeshItem
impl Send for TransparentVolumeMeshItem
impl Sync for TransparentVolumeMeshItem
impl Unpin for TransparentVolumeMeshItem
impl UnsafeUnpin for TransparentVolumeMeshItem
impl UnwindSafe for TransparentVolumeMeshItem
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>, which can then be
downcast into Box<dyn 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>, which 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> DowncastSend for T
impl<T> DowncastSend for T
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
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>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.