[vtkusers] vtkSelection

Bryn Lloyd blloyd at vision.ee.ethz.ch
Thu Nov 13 11:37:58 EST 2008


Hi David,

Thanks a lot for your reply.

> 
> You might not need to use AreaPicker. It's job is to pick entire
> Props, you seem more interested in cells and points on a particular
> prop. VisibleCellSelector can determine props on its own if you want
> it to, and the FrustumExtractor could be reapplied to all the props in
> the scene if you don't end up using AreaPicker to narrow down the
> list.
> 
> The InteractorStyle is useful for giving the user a rubber band to
> draw on the screen with, so you might as well use that part.
> Converting that 2D rectangle into a 3D rectangle is only needed if you
> are selecting through. The AreaPicker can help with that if you need
> it.

I need to select through (i.e. non-visible). So I could use the 
AreaPicker to calculate the Frustum and pass it to the 
vtkExtractSelectedFrustum object in order to select the points or cells?

So vtkExtractSelectedFrustum knows the Frustum, how do I setup the 
vtkSelection object?

My guess is:

   selection->SetContentType(vtkSelection::FRUSTUM);
   if(mode==POINTS)
     selection->SetFieldType(vtkSelection::POINT);
   else
     selection->SetFieldType(vtkSelection::CELL);

But what about the SetSelectionList? Is this where I need to set the 
parameters of the Frustum (again)?, or will vtkExtractSelectedFrustum 
ignore this list, since it already knows the Frustum?



> Take a look at TestExtraction first to investigate what Selections and
> Extraction are and how to use them,
> 
> Then take a look at TestAreaSelections to see how to use them to grab
> things that the user identifies behind the rubber band.

I have looked at these tests, and the java example 
Examples/Infovis/Java/Focus.java.

There are, however, many different combinations of 
vtkSelection::SetContentType, vtkSelection::SetFieldType and it is not 
clear how the SelectionList must be created for each situation, or if it 
must be set at all.


Thanks,

Bryn








More information about the vtkusers mailing list