[vtkusers] Visual debugging

David Doria daviddoria at gmail.com
Tue Oct 19 18:46:55 EDT 2010


This is a pattern I have found very useful to keep things organized.
The idea is to be able to "look at" the state of the "scene" as you
manipulate it inside of an algorithm - but without having to do the
visualization work inside the algorithm. All I do is invoke an event
which tells the rendering code (outside of the algorithm) to update
based on the current state of the algorithm. Of course you have to
expose the data that is being updated (I have provided a
GetIntermediateOutput function).

Here is a demo:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Demos/VisualDebugging

The only thing I don't understand is why the camera doesn't refresh
despite the calls to intermediate->Modified() and
this->Renderer->ResetCamera();, but in most cases the scene won't be
growing (as in this example) this much so it works pretty well even
without this.

I just wanted to share, as I feel that this is a very valuable thing
to know how to do. If anyone has a better way to do the same thing,
I'd love to see it!

David



More information about the vtkusers mailing list