[vtkusers] Interactively updating the edge colors of a graph
Steffen Oeltze
stoeltze at isg.cs.uni-magdeburg.de
Tue Feb 8 11:18:15 EST 2011
Dear VTK-users
I have written an application that displays a graph with colored edges.
The application is interactive and I would like to change the edge
coloring depending on some user interaction. The coloring is
accomplished via a vtkLookupTable and a vtkViewTheme. I tried two
different strategies so far. Unfortunately, only the second one works
which I guess is slower and less effective than the first one. The first
one only works if I manually enforce a new rendering of the graph by
selecting, e.g., an edge. In my source code, I tried several update
mechanisms, e.g., calling Modified() on the vtkViewTheme after
reassigning the modified vtkLookupTable, but none of them worked. Any
help on how I can imitate the update-mechanism which is initiated after
edge selection is deeply appreciated.
1.) (works only after manual update)
- generate the vtkLookupTable, a vtkViewTheme, and a vtkGraphLayoutView
- assign the vtkLookupTable to the vtkViewTheme
- assign the vtkViewTheme to the vtkGraphLayoutView
- render the graph
...user interaction...
- update the vtkLookupTable
- render the graph again
2.) (works)
- generate the vtkLookupTable, a vtkViewTheme, and a vtkGraphLayoutView
- assign the vtkLookupTable to the vtkViewTheme
- assign the vtkViewTheme to the vtkGraphLayoutView
- delete the vtkViewTheme
- render the graph
...user interaction...
update the vtkLookupTable
- generate a new vtkViewTheme
- assign the modified vtkLookupTable to the new vtkViewTheme
- assign the new vtkViewTheme to the vtkGraphLayoutView
- delete the new vtkViewTheme
- render the graph again
Steffen
--
Dr.-Ing. Steffen Oeltze
Department of Simulation and Graphics, School of Computer Science
Otto-von-Guericke-University Magdeburg
Universitätsplatz 2, 39106 Magdeburg
GERMANY
Phone: (+49-391) 67-1 25 27
Fax: (+49 391) 67-1 11 64
Email: stoeltze at isg.cs.uni-magdeburg.de
Web: http://www.vismd.de/
More information about the vtkusers
mailing list