pub struct MeshVertexVectorQuantity { /* private fields */ }Expand description
A vertex vector quantity on a surface mesh.
Implementations§
Source§impl MeshVertexVectorQuantity
impl MeshVertexVectorQuantity
Sourcepub fn new(
name: impl Into<String>,
structure_name: impl Into<String>,
vectors: Vec<Vec3>,
) -> Self
pub fn new( name: impl Into<String>, structure_name: impl Into<String>, vectors: Vec<Vec3>, ) -> Self
Creates a new vertex vector quantity.
Sourcepub fn length_scale(&self) -> f32
pub fn length_scale(&self) -> f32
Gets the length scale.
Sourcepub fn set_length_scale(&mut self, scale: f32)
pub fn set_length_scale(&mut self, scale: f32)
Sets the length scale.
Sourcepub fn set_radius(&mut self, r: f32)
pub fn set_radius(&mut self, r: f32)
Sets the radius.
Sourcepub fn auto_scale(&mut self, structure_length_scale: f32)
pub fn auto_scale(&mut self, structure_length_scale: f32)
Auto-scales length and radius based on the structure’s bounding box diagonal and the average vector magnitude, so arrows are proportionally visible.
Target: effective arrow length ≈ 2% of bbox diagonal, radius = 1/10 of length.
Sourcepub fn init_gpu_resources(
&mut self,
device: &Device,
bind_group_layout: &BindGroupLayout,
camera_buffer: &Buffer,
base_positions: &[Vec3],
)
pub fn init_gpu_resources( &mut self, device: &Device, bind_group_layout: &BindGroupLayout, camera_buffer: &Buffer, base_positions: &[Vec3], )
Initializes GPU resources for this vector quantity.
Sourcepub fn render_data(&self) -> Option<&VectorRenderData>
pub fn render_data(&self) -> Option<&VectorRenderData>
Returns the render data if initialized.
Sourcepub fn update_uniforms(&self, queue: &Queue, model: &Mat4)
pub fn update_uniforms(&self, queue: &Queue, model: &Mat4)
Updates GPU uniforms with the given model transform.
Sourcepub fn build_egui_ui(&mut self, ui: &mut Ui) -> bool
pub fn build_egui_ui(&mut self, ui: &mut Ui) -> bool
Builds the egui UI for this quantity.
Trait Implementations§
Source§impl Quantity for MeshVertexVectorQuantity
impl Quantity for MeshVertexVectorQuantity
Source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Returns a mutable reference to self as
Any for downcasting.Source§fn structure_name(&self) -> &str
fn structure_name(&self) -> &str
Returns the name of the parent structure.
Source§fn kind(&self) -> QuantityKind
fn kind(&self) -> QuantityKind
Returns the kind of this quantity.
Source§fn is_enabled(&self) -> bool
fn is_enabled(&self) -> bool
Returns whether this quantity is currently enabled/visible.
Source§fn set_enabled(&mut self, enabled: bool)
fn set_enabled(&mut self, enabled: bool)
Sets the enabled state of this quantity.
Source§fn clear_gpu_resources(&mut self)
fn clear_gpu_resources(&mut self)
Clears GPU render resources so they can be re-initialized with a new device.
impl VertexQuantity for MeshVertexVectorQuantity
Auto Trait Implementations§
impl Freeze for MeshVertexVectorQuantity
impl !RefUnwindSafe for MeshVertexVectorQuantity
impl Send for MeshVertexVectorQuantity
impl Sync for MeshVertexVectorQuantity
impl Unpin for MeshVertexVectorQuantity
impl UnsafeUnpin for MeshVertexVectorQuantity
impl !UnwindSafe for MeshVertexVectorQuantity
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> 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>
Converts
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>
Converts
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