From e7ab06ee2911cf1d248221fb1d4021f720992e7c Mon Sep 17 00:00:00 2001 From: Egutierrez Date: Sat, 25 Apr 2026 21:48:29 +0200 Subject: [PATCH] chore(vendor): vendorear ImPlot3D v0.4 como submodulo + target CMake - submodule cpp/vendor/implot3d -> github.com/brenocq/implot3d, pinned commit 41ae3e447c0de20ecab95d38a4b4dc0835a3efc2 (v0.4). - target CMake `implot3d` parejo a `implot` (3 sources: implot3d.cpp, implot3d_items.cpp, implot3d_meshes.cpp). - fn_framework linkea implot3d para que cualquier app pueda usar las funciones viz/*_3d sin configurar nada extra. - VENDORING.md externo (no tocamos el README upstream). Issue 0028. --- .gitmodules | 3 +++ cpp/CMakeLists.txt | 14 ++++++++++- cpp/vendor/implot3d | 1 + cpp/vendor/implot3d.VENDORING.md | 41 ++++++++++++++++++++++++++++++++ 4 files changed, 58 insertions(+), 1 deletion(-) create mode 160000 cpp/vendor/implot3d create mode 100644 cpp/vendor/implot3d.VENDORING.md diff --git a/.gitmodules b/.gitmodules index 4d0c24d7..f02dec2b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -11,3 +11,6 @@ [submodule "cpp/vendor/glfw"] path = cpp/vendor/glfw url = https://github.com/glfw/glfw.git +[submodule "cpp/vendor/implot3d"] + path = cpp/vendor/implot3d + url = https://github.com/brenocq/implot3d.git diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index fde4edb9..84747b76 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -33,6 +33,18 @@ add_library(implot STATIC target_include_directories(implot PUBLIC ${IMPLOT_DIR}) target_link_libraries(implot PUBLIC imgui) +# --- Vendor: ImPlot3D --- +# Pinned to v0.4 (commit 41ae3e447c0de20ecab95d38a4b4dc0835a3efc2). +# See cpp/vendor/implot3d.VENDORING.md for update procedure. +set(IMPLOT3D_DIR ${CMAKE_CURRENT_SOURCE_DIR}/vendor/implot3d) +add_library(implot3d STATIC + ${IMPLOT3D_DIR}/implot3d.cpp + ${IMPLOT3D_DIR}/implot3d_items.cpp + ${IMPLOT3D_DIR}/implot3d_meshes.cpp +) +target_include_directories(implot3d PUBLIC ${IMPLOT3D_DIR}) +target_link_libraries(implot3d PUBLIC imgui) + # --- Vendor: Tracy (optional) --- if(TRACY_ENABLE) set(TRACY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/vendor/tracy) @@ -102,7 +114,7 @@ target_include_directories(fn_framework PUBLIC target_compile_definitions(fn_framework PUBLIC FN_CPP_ROOT="${CMAKE_CURRENT_SOURCE_DIR}" ) -target_link_libraries(fn_framework PUBLIC imgui implot) +target_link_libraries(fn_framework PUBLIC imgui implot implot3d) if(TRACY_ENABLE) target_link_libraries(fn_framework PUBLIC tracy) endif() diff --git a/cpp/vendor/implot3d b/cpp/vendor/implot3d new file mode 160000 index 00000000..41ae3e44 --- /dev/null +++ b/cpp/vendor/implot3d @@ -0,0 +1 @@ +Subproject commit 41ae3e447c0de20ecab95d38a4b4dc0835a3efc2 diff --git a/cpp/vendor/implot3d.VENDORING.md b/cpp/vendor/implot3d.VENDORING.md new file mode 100644 index 00000000..34ccb626 --- /dev/null +++ b/cpp/vendor/implot3d.VENDORING.md @@ -0,0 +1,41 @@ +# ImPlot3D — vendoring notes + +3D plotting library for Dear ImGui by Breno Cunha Queiroz, sister project to +[ImPlot](https://github.com/epezent/implot). + +- **Upstream:** https://github.com/brenocq/implot3d +- **License:** MIT (see `cpp/vendor/implot3d/LICENSE`) +- **Version:** v0.4 +- **Pinned commit:** `41ae3e447c0de20ecab95d38a4b4dc0835a3efc2` + (2026-04-05, _"chore: bump version to v0.4"_) + +The vendor lives as a git submodule in `cpp/vendor/implot3d` and is checked +out at the pinned commit above. + +## Files compiled into the `implot3d` CMake target + +- `implot3d.cpp` +- `implot3d_items.cpp` +- `implot3d_meshes.cpp` + +`implot3d_demo.cpp` and the contents of `example/` are intentionally left +out of the build — kept for reference only. + +## Update procedure + +```bash +cd cpp/vendor/implot3d +git fetch origin +git checkout +cd ../../.. +git add cpp/vendor/implot3d +# Update the pinned commit in this file. +git commit -m "chore(vendor): bump implot3d to " +``` + +## Used by + +- `cpp/functions/viz/surface_plot_3d.cpp` — `ImPlot3D::PlotSurface` +- `cpp/functions/viz/scatter_3d.cpp` — `ImPlot3D::PlotScatter` +- `cpp/framework/app_base.cpp` — creates/destroys the ImPlot3D context + alongside the ImPlot one.