pub trait Quantity:
Any
+ Send
+ Sync {
// Required methods
fn as_any(&self) -> &dyn Any;
fn as_any_mut(&mut self) -> &mut dyn Any;
fn name(&self) -> &str;
fn structure_name(&self) -> &str;
fn kind(&self) -> QuantityKind;
fn is_enabled(&self) -> bool;
fn set_enabled(&mut self, enabled: bool);
fn build_ui(&mut self, ui: &dyn Any);
fn refresh(&mut self);
fn data_size(&self) -> usize;
// Provided method
fn clear_gpu_resources(&mut self) { ... }
}Expand description
Data associated with a structure that can be visualized.
Quantities are attached to structures and represent data like:
- Scalar fields (temperature, pressure, etc.)
- Vector fields (velocity, normals, etc.)
- Colors
- UV parameterizations
Required Methods§
Sourcefn 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.
Sourcefn structure_name(&self) -> &str
fn structure_name(&self) -> &str
Returns the name of the parent structure.
Sourcefn kind(&self) -> QuantityKind
fn kind(&self) -> QuantityKind
Returns the kind of this quantity.
Sourcefn is_enabled(&self) -> bool
fn is_enabled(&self) -> bool
Returns whether this quantity is currently enabled/visible.
Sourcefn set_enabled(&mut self, enabled: bool)
fn set_enabled(&mut self, enabled: bool)
Sets the enabled state of this quantity.
Provided Methods§
Sourcefn 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.