Proof of concept C++ source code 3D visualization tool.
I imagined immersing myself in visualized software in virtual reality, mainly just for the hell of it but also thinking such possibility could be useful.
I wanted to explore other possible representations of software beside linear source code for software reviewing, development, debugging, monitoring, etc. Specifically in C++ are many concepts that might lend itself nicely to visual representation (e. g. namespaces, inheritance, scopes, variable life-time, call-graph, control-flow graph, etc).
The idea was to use:
- Clang C++ API to get access to compilation unit AST (just call graphs at the moment)
- GNU ld linker to get access to how symbols are linked (unfinished ATM)
- Fast 3D graph layouting algorithm, Harel-Koren method (working prototype with issues)
- Ogre3D game engine to visualize the graph (very basic version implemented)
- ... later to replace the 3D engine with some VR engine (on wishlist)
- https://www.khronos.org/openxr (or some higher abstraction level engine)
Parts 1. and 2. uses BASH script wrapper over clang driver with goal of being build system agnostic. Part 1. is implemented as clang plugin dumping full AST to be later found by python helper script. Main binary is currently implementing AST visiting, graph manipulation, layouting (3.) and visualization (4.) in the best tradition of monolithic design.
PoC quality overall, basically just drawing crude graph very loosely correlated to call graph of single C++ source file.
Numerous conceptual, algorithmic and implementation issues. Beware!
Journey to full linked-together-binary file visualization (and/or source code manipulation) using a VR headset is still a long one yet direction for the next few steps is clear.
- Use Debian based Linux distribution.
- Install all packages from doc/dependencies.MD
- Build Llvm 4.0 https://github.com/llvm-mirror/llvm
- Build Clang 4.0 https://github.com/llvm-mirror/clang
- Build OIS master branch (commit bb75ccc1aabc1c547195579963601ff6080ca2f2) https://github.com/wgois/OIS/branches
- Build Ogre3D v1.10.5 https://github.com/OGRECave/ogre/releases
- Edit llvm_rootdir, ogre_rootdir and ois_rootdir variables in CMakeList.txt
- Edit PluginFolder variable in ogre_conf/plugins.cfg
- Create directory build and run: cd build && cmake .. && make -j
Check doc/user_manual.MD