[vtkusers] Picking makeover - large check-in

Will Schroeder will.schroeder at kitware.com
Thu Jun 8 08:59:54 EDT 2000


Hi Folks-

The picking in VTK has been heavily worked over. This is likely to disrupt the nightly builds for a couple of days.

The motivation for the changes are as follows:

- Improve picking speed, use hardware-assisted picking as default.

- Support picking of any type of vtkProp (2D, volumes, and of course 3D) in a unified manner.

- Modify the interactor styles to reflect these items.

- Rearchitect the picking classes to differentiate between the different types of picking. For example, there are pickers than can pick instances of vtkProp (e.g., vtkCellPicker) and those that cannot (vtkWorldPointPicker).

- Change the way assemblies are built. Assemblies (vtkPropAssembly and vtkAssembly) use to be quite different in implementation, and do bad things like use actor's UserMatrix to build the assembly.

- Enable the picking to work better with an assembly. For example, you'd like to be able to pick an assembly, and any part in that assembly down to the leaf nodes. This also means getting at the concatenated matrices. (See the example PickTest.tcl).) This is achieved by creating and returning information about assembly paths.

- Avoid making copies of actors during the creation of assembly paths. This screws up the PickMethods (since the method operates on the copy, not the original actor).

- Create assemblies of any combination of vtkProp3D (e.g., volumes and actors).

These goals have been met, although there are a couple of potential problems.

- Hardware-assisted picking works great except that I have found at least one case where the OpenGL driver does not properly implement some of the OpenGL calls necessary to support picking (ELSA Erasor X). This requires using a different picker (like vtkCellPicker)....but it can be horrible to track down if it happens to you.

- vtkAssembly used to support a mapper plus its list of parts. This is no longer the case. To do the same thing, you'll have to create an actor, assign the mapper to the actor, and then assign the actor to the assembly. (See the example assembly.tcl or assembly2.tcl.)

There is one other thing that I'm not completely happy about. If you pick an assembly, and then go into actor (or Object) mode, and then try and rotate the assembly, the rotation behavior is not good. Now that we can pick and manipulate assemblies in a much cleaner way, we may want to rethink how the interactor styles work with the assembly. (See the example assembly.tcl.)

I'd appreciate it if any folks out there who use CVS or download the nightly builds could test this out and report to me or the list.

Will





More information about the vtkusers mailing list