#[non_exhaustive]pub struct FrameData {
pub camera: CameraFrame,
pub scene: SceneFrame,
pub viewport: ViewportFrame,
pub interaction: InteractionFrame,
pub effects: EffectsFrame,
pub overlays: OverlayFrame,
}Expand description
All data needed to render one frame of the viewport.
Fields are grouped by responsibility. Build the sub-objects you need,
leave others at their Default, then call prepare() followed by
paint() or paint_to().
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.camera: CameraFrameCamera state, viewport size, and viewport slot.
scene: SceneFrameWorld-space scene content (surfaces, point clouds, glyphs, etc.).
viewport: ViewportFrameViewport presentation settings (background, grid, axes indicator).
interaction: InteractionFrameInteraction and selection visualization (gizmo, outline, x-ray).
effects: EffectsFrameGlobal rendering effects (lighting, clipping, post-process).
overlays: OverlayFrameSemantic overlays rendered after post-processing (labels, scalar bars, rulers).
Implementations§
Source§impl FrameData
impl FrameData
Sourcepub fn new(camera: CameraFrame, scene: SceneFrame) -> Self
pub fn new(camera: CameraFrame, scene: SceneFrame) -> Self
Build frame data from the required camera and scene groups.
Sourcepub fn from_scene(
camera: CameraFrame,
scene: &mut Scene,
selection: &Selection,
) -> Self
pub fn from_scene( camera: CameraFrame, scene: &mut Scene, selection: &Selection, ) -> Self
Build frame data from a camera, scene, and selection in one call.
This is the preferred constructor for the common single-viewport path. It collects render items, stamps the scene and selection generation counters, and leaves viewport chrome and effects at their defaults.
Override individual settings with the builder methods:
let frame = FrameData::from_scene(
CameraFrame::from_camera(&camera, [w, h]),
&mut scene,
&selection,
)
.with_background([0.1, 0.1, 0.12, 1.0])
.with_lighting(lighting);Sourcepub fn with_background(self, colour: [f32; 4]) -> Self
pub fn with_background(self, colour: [f32; 4]) -> Self
Set the viewport background clear colour.
Sourcepub fn with_lighting(self, lighting: LightingSettings) -> Self
pub fn with_lighting(self, lighting: LightingSettings) -> Self
Override the per-frame lighting configuration.
Sourcepub fn with_post_process(self, post: PostProcessSettings) -> Self
pub fn with_post_process(self, post: PostProcessSettings) -> Self
Override the post-processing settings.
Sourcepub fn with_ground_plane(self, ground: GroundPlane) -> Self
pub fn with_ground_plane(self, ground: GroundPlane) -> Self
Override the ground plane configuration.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FrameData
impl RefUnwindSafe for FrameData
impl Send for FrameData
impl Sync for FrameData
impl Unpin for FrameData
impl UnsafeUnpin for FrameData
impl UnwindSafe for FrameData
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> 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.