Crate dear_implot3d

Crate dear_implot3d 

Source
Expand description

Dear ImPlot3D - Rust bindings (high level)

Safe wrapper over dear-implot3d-sys, designed to integrate with dear-imgui-rs. Mirrors dear-implot design: context + Ui facade, builder-style helpers, optional mint inputs.

§Quick Start

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);

if let Some(_token) = plot_ui.begin_plot("3D Plot").build() {
    let xs = [0.0, 1.0, 2.0];
    let ys = [0.0, 1.0, 0.0];
    let zs = [0.0, 0.5, 1.0];
    plot_ui.plot_line_f32("Line", &xs, &ys, &zs, Line3DFlags::NONE);
}

§Features

  • mint: Enable support for mint math types (Point3, Vector3)

§Architecture

This crate follows the same design patterns as dear-implot:

  • Plot3DContext: Manages the ImPlot3D context (create once)
  • Plot3DUi: Per-frame access to plotting functions
  • RAII tokens: Plot3DToken automatically calls EndPlot on drop
  • Builder pattern: Fluent API for configuring plots
  • Type-safe flags: Using bitflags! for compile-time safety

Modules§

meshes
Predefined mesh data for common 3D shapes
plots
Modular plot types for ImPlot3D

Structs§

Axis3DFlags
Axis flags (per-axis)
Context
An imgui context.
Image3DByAxesBuilder
Image by axes builder
Image3DByCornersBuilder
Image by corners builder
Image3DFlags
Image flags
Item3DFlags
Item flags (common to plot items)
Line3DFlags
Line flags
Mesh3DBuilder
Mesh plot builder
Mesh3DFlags
Mesh flags
Plot3DBuilder
Plot builder for configuring the 3D plot
Plot3DContext
Plot3D context wrapper
Plot3DFlags
Flags for ImPlot3D plot configuration
Plot3DToken
RAII token that ends the plot on drop
Plot3DUi
Per-frame access helper mirroring dear-implot
Quad3DFlags
Quad flags
Scatter3DFlags
Scatter flags
Surface3DBuilder
Surface (grid) plot builder (f32 variant)
Surface3DFlags
Surface flags
Triangle3DFlags
Triangle flags
Ui
Represents the Dear ImGui user interface for one frame

Enums§

Axis3D
3D axis selector (X/Y/Z)
Marker3D
Plot3DCond
Condition for setup calls (match ImGuiCond)

Traits§

ImPlot3DExt
Ui extension for obtaining a Plot3DUi

Functions§

colormap_count
colormap_index_by_name
Look up a colormap index by its name; returns -1 if not found
colormap_name
colormap_size
Get number of keys (colors) in a given colormap index
get_colormap_color
Get a color from the current colormap at index
get_style_colormap_index
Get current default colormap index set in ImPlot3D style
get_style_colormap_name
Get current default colormap name (if index valid)
next_colormap_color
Get next colormap color (advances internal counter)
pop_colormap
pop_style_color
pop_style_var
Pop style variable(s)
push_colormap_index
push_colormap_name
push_style_color
push_style_var_f32
Push a style variable (float variant)
push_style_var_i32
Push a style variable (int variant)
push_style_var_vec2
Push a style variable (Vec2 variant)
set_next_fill_style
set_next_line_style
set_next_marker_style
set_style_colormap_by_name
Convenience: set default colormap by name (no-op if name is invalid)
set_style_colormap_index
Permanently set the default colormap used by ImPlot3D (persists across plots/frames)
show_all_demos
Show upstream ImPlot3D demos (from C++ demo)
show_demo_window
Show the main ImPlot3D demo window (C++ upstream)
show_demo_window_with_flag
Show the main ImPlot3D demo window with a visibility flag
show_metrics_window
Show the ImPlot3D metrics/debugger window
show_metrics_window_with_flag
Show the ImPlot3D metrics/debugger window with a visibility flag
show_style_editor
Show the ImPlot3D style editor window
style_colors_auto
style_colors_classic
style_colors_dark
style_colors_light