Struct dexterior_visuals::Painter
source · pub struct Painter<'a, 'ctx: 'a> { /* private fields */ }
Expand description
The main user interface for drawing graphics.
See Animation
and the crate examples for usage.
Implementations§
source§impl<'a, 'ctx: 'a> Painter<'a, 'ctx>
impl<'a, 'ctx: 'a> Painter<'a, 'ctx>
sourcepub fn set_color_map(&mut self, name: &str)
pub fn set_color_map(&mut self, name: &str)
Set the active color map by name.
If the given name is not found in the loaded maps, does not change the map.
sourcepub fn set_color_map_index(&mut self, idx: usize)
pub fn set_color_map_index(&mut self, idx: usize)
Set the active color map by its index in the array of loaded maps.
sourcepub fn set_color_map_range(&mut self, range: Range<f32>)
pub fn set_color_map_range(&mut self, range: Range<f32>)
Set the range of values that gets mapped onto the active color map. Values outside the range are clamped to its ends.
If the color map is never set, the range is computed as the minimum and maximum of the given values whenever a renderer using the color map is called. This is usually undesirable as it will change the range when the simulation state changes, so setting a constant value is recommended.
sourcepub fn vertex_colors(&mut self, c: &Cochain<0, Primal>)
pub fn vertex_colors(&mut self, c: &Cochain<0, Primal>)
Draw a primal 0-cochain by coloring mesh vertices according to the active color map and interpolating colors for the triangles between.
sourcepub fn vertex_colors_dual(&mut self, c: &Cochain<2, Primal>)
pub fn vertex_colors_dual(&mut self, c: &Cochain<2, Primal>)
Draw a dual 2-cochain by setting its values as colors at the corresponding primal mesh vertices.
sourcepub fn triangle_colors(&mut self, c: &Cochain<2, Primal>)
pub fn triangle_colors(&mut self, c: &Cochain<2, Primal>)
Draw a primal 2-cochain as flat-colored triangles.
sourcepub fn triangle_colors_dual(&mut self, c: &Cochain<0, Dual>)
pub fn triangle_colors_dual(&mut self, c: &Cochain<0, Dual>)
Draw a dual 0-cochain as flat colors on the corresponding primal mesh triangles.
sourcepub fn velocity_arrows(&mut self, c: &Cochain<1, Primal>, params: ArrowParams)
pub fn velocity_arrows(&mut self, c: &Cochain<1, Primal>, params: ArrowParams)
Draw a primal 1-cochain representing a velocity in the edge tangent direction as arrows interpolated at triangle barycenters.
sourcepub fn flux_arrows(&mut self, c: &Cochain<1, Primal>, params: ArrowParams)
pub fn flux_arrows(&mut self, c: &Cochain<1, Primal>, params: ArrowParams)
Draw a primal 1-cochain representing a flux in the edge normal direction as arrows interpolated at triangle barycenters.
sourcepub fn wireframe(&mut self, params: WireframeParams)
pub fn wireframe(&mut self, params: WireframeParams)
Draw a wireframe model of the simulation mesh.
sourcepub fn axes_2d(&mut self, params: AxesParams)
pub fn axes_2d(&mut self, params: AxesParams)
Draw a set of axes around the mesh.
sourcepub fn line_list(&mut self, params: LineParams, points: &[Vector3<f64>])
pub fn line_list(&mut self, params: LineParams, points: &[Vector3<f64>])
Draw a list of line segments.
Every two points in points
define a distinct segment,
with a gap left between them.
sourcepub fn line_strip(&mut self, params: LineParams, points: &[Vector3<f64>])
pub fn line_strip(&mut self, params: LineParams, points: &[Vector3<f64>])
Draw a strip of line segments.
Every point in points
is connected
to both the next and previous one with a line segments.
Auto Trait Implementations§
impl<'a, 'ctx> !RefUnwindSafe for Painter<'a, 'ctx>
impl<'a, 'ctx> !Send for Painter<'a, 'ctx>
impl<'a, 'ctx> !Sync for Painter<'a, 'ctx>
impl<'a, 'ctx> Unpin for Painter<'a, 'ctx>
impl<'a, 'ctx> !UnwindSafe for Painter<'a, 'ctx>
Blanket Implementations§
source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
source§impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
source§fn arrays_from(colors: C) -> T
fn arrays_from(colors: C) -> T
source§impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
source§fn arrays_into(self) -> C
fn arrays_into(self) -> C
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, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
source§fn components_from(colors: C) -> T
fn components_from(colors: C) -> T
source§impl<T> FromAngle<T> for T
impl<T> FromAngle<T> for T
source§fn from_angle(angle: T) -> T
fn from_angle(angle: T) -> T
angle
.source§impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
source§fn from_stimulus(other: U) -> T
fn from_stimulus(other: U) -> T
other
into Self
, while performing the appropriate scaling,
rounding and clamping.source§impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
source§fn into_angle(self) -> U
fn into_angle(self) -> U
T
.source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
source§fn into_color(self) -> U
fn into_color(self) -> U
source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
source§impl<T> IntoStimulus<T> for T
impl<T> IntoStimulus<T> for T
source§fn into_stimulus(self) -> T
fn into_stimulus(self) -> T
self
into T
, while performing the appropriate scaling,
rounding and clamping.§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§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).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.source§impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
§type Error = <C as TryFromComponents<T>>::Error
type Error = <C as TryFromComponents<T>>::Error
try_into_colors
fails to cast.source§fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
OutOfBounds
error is returned which contains
the unclamped color. Read more