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
mintmath 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:
Plot3DTokenautomatically callsEndPloton drop - Builder pattern: Fluent API for configuring plots
- Type-safe flags: Using
bitflags!for compile-time safety
Modules§
Structs§
- Axis3D
Flags - Axis flags (per-axis)
- Context
- An imgui context.
- Image3D
ByAxes Builder - Image by axes builder
- Image3D
ByCorners Builder - Image by corners builder
- Image3D
Flags - Image flags
- Item3D
Flags - Item flags (common to plot items)
- Line3D
Flags - Line flags
- Mesh3D
Builder - Mesh plot builder
- Mesh3D
Flags - Mesh flags
- Plot3D
Builder - Plot builder for configuring the 3D plot
- Plot3D
Context - Plot3D context wrapper
- Plot3D
Flags - Flags for ImPlot3D plot configuration
- Plot3D
Token - RAII token that ends the plot on drop
- Plot3D
Ui - Per-frame access helper mirroring
dear-implot - Quad3D
Flags - Quad flags
- Scatter3D
Flags - Scatter flags
- Surface3D
Builder - Surface (grid) plot builder (f32 variant)
- Surface3D
Flags - Surface flags
- Triangle3D
Flags - Triangle flags
- Ui
- Represents the Dear ImGui user interface for one frame
Enums§
- Axis3D
- 3D axis selector (X/Y/Z)
- Marker3D
- Plot3D
Cond - Condition for setup calls (match ImGuiCond)
Traits§
- ImPlot3D
Ext - 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