pub struct VolumeMeshItem {
pub mesh_id: MeshId,
pub face_to_cell: Vec<u32>,
pub model: [[f32; 4]; 4],
pub selected: bool,
pub appearance: AppearanceSettings,
pub material: Material,
pub active_attribute: Option<AttributeRef>,
pub scalar_range: Option<(f32, f32)>,
pub colourmap_id: Option<ColourmapId>,
pub pick_id: PickId,
}Expand description
Render item for an opaque volume mesh uploaded via
upload_volume_mesh_data.
Wraps the MeshId produced by boundary extraction together with the
face-to-cell mapping so consumers can recover cell-level identity from
face-level pick hits. Call to_render_item each
frame to produce the SceneRenderItem submitted to the renderer.
let (mesh_id, face_to_cell) = resources.upload_volume_mesh_data(&device, &data)?;
let item = VolumeMeshItem::new(mesh_id, face_to_cell);
// Each frame:
scene_frame.surfaces = SurfaceSubmission::Flat(vec![item.to_render_item()].into());Fields§
§mesh_id: MeshIdGPU mesh slot for the extracted boundary surface.
face_to_cell: Vec<u32>Maps each boundary triangle to its originating cell index.
face_to_cell[face_index] is the cell index in the original
VolumeMeshData::cells array.
Use this to convert a SubObjectRef::Face
pick hit into a cell index.
model: [[f32; 4]; 4]World-space model matrix. Default: identity.
selected: boolWhether this object is selected. Default: false.
appearance: AppearanceSettingsPer-item appearance overrides (hidden, unlit, opacity, wireframe).
material: MaterialPer-object material.
active_attribute: Option<AttributeRef>Named scalar or colour attribute to colour by.
scalar_range: Option<(f32, f32)>Explicit scalar range (min, max). None = auto-range from upload.
colourmap_id: Option<ColourmapId>Colourmap for scalar colouring.
pick_id: PickIdGPU pick identifier. PickId::NONE = not pickable.
Implementations§
Source§impl VolumeMeshItem
impl VolumeMeshItem
Sourcepub fn new(mesh_id: MeshId, face_to_cell: Vec<u32>) -> Self
pub fn new(mesh_id: MeshId, face_to_cell: Vec<u32>) -> Self
Create a new item from the mesh ID and face-to-cell map returned by
upload_volume_mesh_data.
Sourcepub fn to_render_item(&self) -> SceneRenderItem
pub fn to_render_item(&self) -> SceneRenderItem
Build the SceneRenderItem that the renderer consumes.
The volume mesh renders through the standard surface pipeline; this
method copies the per-frame fields into a SceneRenderItem.
Sourcepub fn cell_for_face(&self, face_index: u32) -> Option<u32>
pub fn cell_for_face(&self, face_index: u32) -> Option<u32>
Look up the cell index for a boundary face hit.
Returns None if face_index is out of range.
Sourcepub fn update_mesh(&mut self, mesh_id: MeshId, face_to_cell: Vec<u32>)
pub fn update_mesh(&mut self, mesh_id: MeshId, face_to_cell: Vec<u32>)
Replace the mesh ID and face-to-cell map, for example after a clipped
re-upload via
replace_clipped_volume_mesh_data.
Trait Implementations§
Source§impl Clone for VolumeMeshItem
impl Clone for VolumeMeshItem
Source§fn clone(&self) -> VolumeMeshItem
fn clone(&self) -> VolumeMeshItem
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 VolumeMeshItem
impl RefUnwindSafe for VolumeMeshItem
impl Send for VolumeMeshItem
impl Sync for VolumeMeshItem
impl Unpin for VolumeMeshItem
impl UnsafeUnpin for VolumeMeshItem
impl UnwindSafe for VolumeMeshItem
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.