Skip to content

Dear imgui node editor - example#30

Open
luca-heltai wants to merge 1 commit into
mainfrom
dear-imgui
Open

Dear imgui node editor - example#30
luca-heltai wants to merge 1 commit into
mainfrom
dear-imgui

Conversation

@luca-heltai

Copy link
Copy Markdown
Collaborator

I asked codex 5.2 to write a minimal node editor in dear-imgui. This is the results of 1h of playing around.

image

I wanted to have something I could play with in c++. This is fully functional in the network creation, loading, and saving. The backend understands it and runs it. I love that we can swap frontends like this! It would be fantastic to be able to swap backends in the same way.

@luca-heltai

Copy link
Copy Markdown
Collaborator Author
image image image image image

The network file for this is:

{
  "author": "coral-editor",
  "date_time_utc": "2026-01-11T22:34:33.000Z",
  "version": 1,
  "workflow": {
    "edges": {
      "11": {
        "source": 15,
        "source_output": 0,
        "target": 12,
        "target_input": 0
      },
      "12": {
        "source": 16,
        "source_output": 0,
        "target": 13,
        "target_input": 0
      },
      "13": {
        "source": 12,
        "source_output": 0,
        "target": 13,
        "target_input": 1
      }
    },
    "nodes": {
      "12": {
        "name": "Cube",
        "position": {
          "x": 50.0,
          "y": -93.0
        },
        "type": "coral::Network",
        "value": "{\"author\":\"coral-editor\",\"date_time_utc\":\"2026-01-11T22:34:33.000Z\",\"version\":1,\"workflow\":{\"edges\":{\"0\":{\"source\":0,\"source_output\":0,\"target\":3,\"target_input\":0},\"1\":{\"source\":1,\"source_output\":0,\"target\":3,\"target_input\":1},\"2\":{\"source\":2,\"source_output\":0,\"target\":3,\"target_input\":2},\"3\":{\"source\":3,\"source_output\":0,\"target\":5,\"target_input\":0}},\"nodes\":{\"0\":{\"position\":{\"x\":128.0,\"y\":-27.0},\"type\":\"dealii::Triangulation<2, 2>\"},\"1\":{\"position\":{\"x\":128.0,\"y\":58.0},\"type\":\"std::string\",\"value\":\"hyper_cube\"},\"2\":{\"position\":{\"x\":123.0,\"y\":163.0},\"type\":\"std::string\",\"value\":\"0: 1: false\"},\"3\":{\"position\":{\"x\":618.0,\"y\":6.0},\"type\":\"GridGenerator::generate_from_name_and_arguments<2>\"},\"5\":{\"position\":{\"x\":765.0,\"y\":248.0},\"type\":\"Triangulation<2>::refine_global\"}}}}"
      },
      "13": {
        "name": "Vtk",
        "position": {
          "x": 455.0,
          "y": -230.0
        },
        "type": "coral::Network",
        "value": "{\"author\":\"coral-editor\",\"date_time_utc\":\"2026-01-11T22:34:33.000Z\",\"version\":1,\"workflow\":{\"edges\":{\"6\":{\"source\":8,\"source_output\":0,\"target\":9,\"target_input\":0},\"8\":{\"source\":7,\"source_output\":0,\"target\":9,\"target_input\":2}},\"nodes\":{\"7\":{\"position\":{\"x\":8.0,\"y\":98.0},\"type\":\"std::ofstream\"},\"8\":{\"position\":{\"x\":-68.0,\"y\":-206.0},\"type\":\"dealii::GridOut\"},\"9\":{\"position\":{\"x\":440.0,\"y\":-154.0},\"type\":\"GridOut::write_vtk<2>\"}}}}"
      },
      "15": {
        "name": "n_refinements",
        "position": {
          "x": -351.0,
          "y": -14.0
        },
        "type": "unsigned int",
        "value": "2"
      },
      "16": {
        "name": "file_name",
        "position": {
          "x": 114.0,
          "y": -366.0
        },
        "type": "std::string",
        "value": "grid-1.vtk"
      }
    }
  }
}

@luca-heltai

Copy link
Copy Markdown
Collaborator Author

Ps: I did not write a single line of node_editor_main.cc. Just a bit of prompt steering.

@luca-heltai
luca-heltai force-pushed the dear-imgui branch 3 times, most recently from 3825c58 to f6e6e79 Compare January 27, 2026 23:11
@luca-heltai

Copy link
Copy Markdown
Collaborator Author

@pogmat and @pcolt, this has a bit drifted from its original intent...

I have split coral project into

core/tools/gui/backends

and enabled plugin based backends, splitting core coral utilities (coral.h, coral_network.h) from the deal.II backend itself, so that we could in principle have other backends in place that can be loaded at run time.

No change in functionality here, just splitting sources in core/backend, with minimal dependencies in core (no deal.II, no boost, etc.) and deal.II dependencies only in backend.

I also did the same with the ImGui based node editor, and I started working on a mesh manipulator based on vtk.

@luca-heltai
luca-heltai force-pushed the dear-imgui branch 2 times, most recently from bf6c7b1 to 26d2fcc Compare January 27, 2026 23:25
- Split project into core/backends/gui/tools
- Add coral_dump_registry CLI tool
- Add Dear ImGui based node editor
- Add Dealii backend plugin
- Create gui/editor, gui/manipulator subprojects
- Move gtests into core/tests and backend specific tests into respective backend folders
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants