[vtkusers] Get a list of selected graph vertices

Eric E. Monson emonson at cs.duke.edu
Sun Sep 19 15:12:51 EDT 2010


Hey David,

In principle, I think you need to get the vtkRenderedGraphRepresentation from the graph layout view with rep = view->GetRepresentation(int), and then from that rep you need to do GetAnnotationLink(). You can set an observer for AnnotationChangedEvent on the annotation link, and then in your callback you can grab the selection list from the link's selection node, and this should contain the selected ids. 

I think there are some other subtleties necessary, but that should be the basic idea. I'll let you know if I get a Python version working and this should help guide.

Talk to you later,
-Eric

------------------------------------------------------
Eric E Monson
Duke Visualization Technology Group


On Sep 19, 2010, at 2:35 PM, David Doria wrote:

>> There are restrictions documented for the vtkHardwareSelector, I am not sure
>> graph vertices are candidates for selection.
>> 
>> Hope that helps,
>> Jim
> 
> I am not sure using the Selector directly is the best way to go - that
> was just where my search through the code led me. I see now that the
> Selector is a member of the Renderer, that takes away one level of my
> mess :)
> 
> One of the objects already knows about the selection, because the
> default behavior is to highlight the selected vertices/edges! All I
> want to know is the IDs of these things that have been selected. The
> selection shouldn't have to be performed again.
> 
> David
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list