[vtkusers] Selection model interaction between infovis views and non-infovis views

Eric E. Monson emonson at cs.duke.edu
Thu Aug 26 14:04:30 EDT 2010


Hey Byron,

This may not be exactly what you're after, but if you want something that already has selections built in and should link up easily with the Infovis stuff, take a look at vtkRenderedSurfaceRepresentation:

http://www.vtk.org/doc/nightly/html/classvtkRenderedSurfaceRepresentation.html

and the one test listed there, [vtk_source]/Views/Testing/Cxx/TestRenderView.cxx

This uses a vtkRenderView, which is the same display method as all of the Infovis stuff, and the vtkDataRepresentation subclasses have a built-in annotation link.

The selections are "cell selections", so I just tried modifying the above-mentioned test to have a point cloud instead of a sphere as one of the representations, running the point cloud through a triangle filter to create one cell for each vertex instead of the whole point cloud being one single cell, and it works fine. Here is the beginning of my hack-y TestRenderView function (I also added vtkPointSource.h and vtkTriangleFilter.h to the #includes):

int TestRenderView(int argc, char* argv[])
{
  VTK_CREATE(vtkAnnotationLink, link);
  VTK_CREATE(TestRenderViewUpdater, updater);
  
  VTK_CREATE(vtkPointSource, pts);
  pts->SetRadius(1);
  pts->SetNumberOfPoints(100);
  VTK_CREATE(vtkTriangleFilter, sphere);
  sphere->SetInputConnection(pts->GetOutputPort());
  VTK_CREATE(vtkCubeSource, cube);
  cube->SetCenter(2, 0, 0);
  
This will not give you a very fancy 3D scatter plot, but it's pretty easy and already supports selections and should work with the view updater.

Good luck,
-Eric

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


On Aug 25, 2010, at 1:51 PM, Byron Ponten wrote:

> New to vtk.
> 
> Would like to sync up selections between all views (i.e. plots/tables/graphs).    For the most part we would like to use infovis views (charts, 2D scatter, etc.) but also need to create a 3D scatter plot – which I’m assuming cannot be done within the infovis arena.
> 
> I’ve managed to link selections between “InfoVis” views by mimicking the strategy as outlined in various infovis examples.
> 
> 1.  Creating top-level vtkAnnotationLink and vtkViewUpdater entities
> 2.  Use SetAnnotationLink in each view’s representation
> 3.  Adding each view to the view updater.
> 
> So my question is, if it is indeed not possible to create a 3D scatter plot within the infovis arena (and thus have access to it’s representation), how do I connect the selection model (as maintained by the vtkAnnotationLink object) with a 3D scatter plot?
> 
> Thanks!
> 
> -byron
> 
> 
> _______________________________________________
> 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