viz3D is a lightweight C++ GUI library, integrating Dear ImGUI (The amazing graphical interface library for C++), ImPlot (Which provides interactive plotting library) and VTK, the Visualization ToolKit.
The library is a simple application layer the singleton
GUI
, which opens aGLFW
window, and manages a set of user-definedImGUIWindow
s.We integrate ImGui with the branch
docking
, allowing the creation of multiple viewport and the customization of the layout.A specialized
VTKWindow
extends anImGUIWindow
, and allows the creation and visualization of multiple VTK Pipelines integrated with the ImGui managed layout of windows. The pipelines are rendered offscreen in a texture, and then copied in the available space of the window.
install.sh
andinstall.bat
provide complete installation scripts for Linux and Windows. They first install the external dependencies (VTK, GLFW, and GLAD), then build the project. The install destination is set by default to./install
.
The
viz3d::GUI
singleton manages a set ofviz3d::GUI::ImGuiWindow
. Child classes ofviz3d::GUI::ImGuiWindow
must specify inDrawImGuiContent
the ImGui components to appear on screen.
// std::thread gui_thread {viz3d::GUI::LaunchMainLoop, "GUI"}; //< Launches the GUI in separate different thread
auto gui = viz3d::GUI::Instance(); //< Initialize the GUI Singleton
gui.AddWindow(std::make_shared<TestWindow>("Test Window")); //< Add a custom ImGui window which specifying the ImGui components to draw
auto vtk_window = std::make_shared<viz3d::VTKWindow>("VTK Window"); //< Creates a VTKWindow
vtk_window->AddActor(GetConeActor()); //< Add an actor to the window
gui.AddWindow(vtk_window); //< Add the window to the GUI
gui.MainLoop(); //< Launches the MainLoop
// gui_thread.join();
See
example.cpp
for more details.The interactor style used for each VTKWindow is the vtkInteractorStyleMultiTouchCamera. Which works as specified below:
Left Mouse Button Pressed
: Rotates the CameraShift Key
+Left Mouse Button Pressed
: Translates the cameraCtrl Key
+Left Mouse Button Pressed
: Rotates the camera
- Add convenient methods to create richer VTK actors