Feature Request: Ability to render Polyscope viewer in multiple ImGui windows
还没有人认领这个 Issue。
- 主要语言
- C++
- 星标
- 2.2k
- 派生
- 242
- 平均合并
- 11 分钟
- 30 天内合并 PR
- 1
描述
Hello Polyscope maintainers and community,
I'm using Polyscope to visualize point cloud data within a GUI application.
Currently, Polyscope encapsulates its own window and event loop and doesn't provide an API to render into multiple ImGui windows. In my case, I would like to show the 3D data in one window alongside 2 other windows to show the two 2D cameras windows. Specifically, I'm looking to render different Polyscope visualizations in separate ImGui windows within the same GUI.
I understand that this feature might involve significant changes to Polyscope's architecture, but I believe the added flexibility would benefit many users and use cases. I look forward to hearing your thoughts on this suggestion.
Thank you for your time and the excellent work on Polyscope!
This is the implementation of two different windows in the same GUI using ImGUI, GLFW and OpenGL3:
// main.cpp
#include "imgui.h"
#include "imgui_impl_glfw.h"
#include "imgui_impl_opengl3.h"
#include <GLFW/glfw3.h>
int main() {
// Set up window
glfwInit();
GLFWwindow* window = glfwCreateWindow(1280, 720, "Hello", NULL, NULL);
glfwMakeContextCurrent(window);
glfwSwapInterval(1); // Enable vsync
// Set up Dear ImGui context
IMGUI_CHECKVERSION();
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO();
// Set up Platform/Renderer bindings
ImGui_ImplGlfw_InitForOpenGL(window, true);
ImGui_ImplOpenGL3_Init("#version 130");
while (!glfwWindowShouldClose(window)) {
glfwPollEvents();
// Start ImGui frame
ImGui_ImplOpenGL3_NewFrame();
ImGui_ImplGlfw_NewFrame();
ImGui::NewFrame();
// Here we construct our GUI
ImGui::SetNextWindowPos(ImVec2(0, 0));
ImGui::SetNextWindowSize(ImVec2(640, 720));
ImGui::Begin("Window 1");
ImGui::Text("This is window 1");
ImGui::End();
ImGui::SetNextWindowPos(ImVec2(640, 0));
ImGui::SetNextWindowSize(ImVec2(640, 720));
ImGui::Begin("Window 2");
ImGui::Text("This is window 2");
ImGui::End();
// Render ImGui frame
ImGui::Render();
int display_w, display_h;
glfwGetFramebufferSize(window, &display_w, &display_h);
glViewport(0, 0, display_w, display_h);
glClearColor(0.45f, 0.55f, 0.60f, 1.00f);
glClear(GL_COLOR_BUFFER_BIT);
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
glfwSwapBuffers(window);
}
// Cleanup
ImGui_ImplOpenGL3_Shutdown();
ImGui_ImplGlfw_Shutdown();
ImGui::DestroyContext();
glfwDestroyWindow(window);
glfwTerminate();
return 0;
}
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
先从 issue 中的 main.cpp ImGui、GLFW 和 OpenGL3 示例开始,然后检查 Polyscope 当前如何管理其窗口和事件循环。确定在多个 ImGui 窗口中渲染独立可视化所需的架构入口点;当所请求的多窗口渲染 API 能够在一个 GUI 中工作时,即视为完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- cpp
- 领域
- computer-graphics, desktop
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100