[vtkusers] Why are clipping planes not taken into account by vtkVisibleCellSelector and vtkAreaPicker?

Denis Barbier bouzim at gmail.com
Wed Nov 12 17:49:35 EST 2008


Hi,

It seems that clipping planes are discarded by vtkVisibleCellSelector.
In my application, I can select cells whereas they are removed from
normal rendering by clipping planes. Is there some way to fix that?

Here is a small test case to demonstrate this problem, it involves
vtkAreaPicker instead of vtkVisibleCellSelector, but hopefully this
is the same problem.
The tcl script below draws 2 enclosed spheres and adds a clipping plane.
One can pick either the inner or the outer sphere.
After commenting out the line
    #iren SetPicker picker
one can no more select inner sphere.
Thanks for your help.

Program test.tcl:
package require vtk

vtkPlane clipPlane
    clipPlane SetOrigin 0.0 0.0 0.0
    clipPlane SetNormal 1.0 0.0 0.0

vtkSphereSource sphere1
    sphere1 SetRadius 1.0
vtkPolyDataMapper   sphereMapper1
    sphereMapper1 SetInputConnection [sphere1 GetOutputPort]
    sphereMapper1 AddClippingPlane clipPlane
vtkActor sphereActor1
    sphereActor1 SetMapper sphereMapper1
    [sphereActor1 GetProperty] SetColor 0.0 1.0 0.0

vtkSphereSource sphere2
    sphere2 SetRadius 2.0
vtkPolyDataMapper   sphereMapper2
    sphereMapper2 SetInputConnection [sphere2 GetOutputPort]
    sphereMapper2 AddClippingPlane clipPlane
vtkActor sphereActor2
    sphereActor2 SetMapper sphereMapper2
    [sphereActor2 GetProperty] SetColor 1.0 0.0 0.0

vtkRenderer ren
vtkRenderWindow renWin
    renWin AddRenderer ren

vtkAreaPicker picker
vtkRenderWindowInteractor iren
    iren SetRenderWindow renWin
    #iren SetPicker picker

ren AddActor sphereActor1
ren AddActor sphereActor2
renWin SetSize 300 300

ren ResetCamera
iren Initialize



More information about the vtkusers mailing list