Are there any good C++ libraries that can be used to visualize a graph of objects that have been instantiated and have random connections to each other? I would also need it to be able to be updated in real-time so that the graph was constantly updated.
+2
A:
If you use the Boost Graph Library then it supports the graphviz dot language. Otherwise it shouldn't be hard to write the code on your own.
wilhelmtell
2010-05-23 20:44:16
I can see how the links can be used to create a single file that can be read by a graphviz dot file, but how would I go about making it update itself regularly.
DistortedLojik
2010-05-23 20:59:55
I think this diverts to a different question and a different topic altogether. Maybe you can update the dot file as part of logging, if it's a debug procedure, so the dot-file update optimizes away in release build. You can set up an observer on the graph that will update the dot-file whenever the graph changes.
wilhelmtell
2010-05-23 21:25:48
Yeah I understand what you are saying and that is the general idea that I had in mind. The only real problem I suppose is way to get the visualizer to constantly refresh itself rather than doing it manually. I guess a better question would have been to see if anyone knew of a dot file viewer that constantly updated itself. Thanks for the input.
DistortedLojik
2010-05-23 21:28:26
Take a look at the Observer pattern (http://en.wikipedia.org/wiki/Observer_pattern#C.2B.2B), because I think it solves what you're after. Once you have a dot-file you convert it to an image such as a png (http://graphviz.org/doc/info/output.html). You can do that by running the dot utility, or generate the image through some library. You can have an image viewer that has the file open. If your file-system (and then you image viewer) support notification then your image viewer should automatically refresh itself whenever the image changes
wilhelmtell
2010-05-24 02:29:44