imgui-vtk
imgui-vtk copied to clipboard
test on how to integrate vtk into glfw + imgui project
trafficstars
imgui-vtk
- Incorporate VTK's dataset visualization capabilities with versatility of Dear ImGui
- Multiple independent
VtkViewerinstances can be used in the same program to display multiple VTK scenes simultaneously
- Multiple independent
- Uses VTK's OpenGLRenderWindow class
- Renders to texture and displays the texture natively with ImGui
- Compatible with both ImGui's
mainanddockingbranches

Usage:
- CMake
- Build separately & link
- Build your executable, imgui, your OpenGL Loader (e.g., gl3w), and imgui-vtk. Make sure to link imgui-vtk against imgui, your OpenGL Loader (e.g., gl3w), and VTK!
- See
CMakeLists.txtfor more details
- Build together
- Build your executable, imgui, your OpenGL Loader (e.g., gl3w), and imgui-vtk all together, from source.
- See
CMakeLists-alt.txtfor more details
- See
main.cpp
Notes
imgui,gl3w, andglfware included in this repository as git submodules- For integration into an existing project, only
VtkViewer.handVtkViewer.cppare needed. However, they will need to be linked with or built alongside Dear ImGui and VTK
- For integration into an existing project, only
- Dependencies are built separately in
CMakeLists.txtthen linked together as static librariesCMakeLists-alt.txtbuilds everything together from source
- Usage (see
main.cppfor details)- You must create and end ImGui windows yourself
- Allows for other widgets to be placed in the same ImGui window as the VTK "viewport"
- Allows for full control over window size, behavior, etc. via Dear ImGui API
- You must create and end ImGui windows yourself
- Note: For the sake of cleanliness and readability, most ImGui preprocessor directives were removed. Files no longer auto-detect your OpenGL loader. While everything is currently set up for OpenGL3 + GLFW + GL3W, you may need to adjust
#includestatements, etc. to match your use case.