Skip to main content

Plot3DContext

Struct Plot3DContext 

Source
pub struct Plot3DContext { /* private fields */ }
Expand description

Plot3D context wrapper

This manages the ImPlot3D context lifetime. Create one instance per application and keep it alive for the duration of your program.

§Example

use dear_imgui_rs::*;
use dear_implot3d::*;

let mut imgui_ctx = Context::create();
let plot3d_ctx = Plot3DContext::create(&imgui_ctx);

// In your main loop:
let ui = imgui_ctx.frame();
let plot_ui = plot3d_ctx.get_plot_ui(&ui);

Implementations§

Source§

impl Plot3DContext

Source

pub fn try_create(imgui: &Context) -> ImGuiResult<Self>

Try to create a new ImPlot3D context.

This should be called once after creating your ImGui context.

Source

pub fn create(imgui: &Context) -> Self

Create a new ImPlot3D context (panics on error).

Source

pub unsafe fn current() -> Option<Self>

Get the current ImPlot3D context as a non-owning raw-context wrapper.

Returns None if no context is current.

§Safety

The returned value does not own the current ImPlot3D context and cannot prove that the associated ImGui context remains alive. The caller must ensure the raw ImPlot3D and ImGui contexts outlive the returned wrapper and are used on the same thread/context stack.

Source

pub fn set_as_current(&self)

Set this context as the current ImPlot3D context.

Source

pub fn raw_style_mut() -> *mut ImPlot3DStyle

Get a raw pointer to the current ImPlot3D style

This is an advanced function for direct style manipulation. Prefer using the safe style functions in the style module.

Source

pub unsafe fn raw(&self) -> *mut ImPlot3DContext

Get the raw ImPlot3D context pointer.

§Safety

The caller must ensure the pointer is used safely and not stored beyond the lifetime of this context wrapper.

Source

pub fn get_plot_ui<'ui>(&self, ui: &'ui Ui) -> Plot3DUi<'ui>

Get a per-frame plotting interface

Call this once per frame to get access to plotting functions. The returned Plot3DUi is tied to the lifetime of the Ui frame.

Trait Implementations§

Source§

impl Drop for Plot3DContext

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more