Update vtkSelectVisiblePoints filter

Hello,

I am using vtkSelectVisiblePoints and vtkLabeledDataMapper to label visible points.

Unfortunately, the labels actor with the vtkSelectVisiblePoints filter must be added last to the renderer in order to get the correct label visibility. Nevertheless I want to dynamically add new actors which might hide some labels and therefore the vtkSelectVisiblePoints filter must be updated somehow.

I tried many combinations of ->Update() and ->Modified() calls on all objects connected to the labels actor, but the only thing which worked was calling ->RemoveActor(‘LabelsActors’) followed by ->AddActor(‘LabelsActor’) after a new actor (which hides some label points) was added.

What is the correct way to update the vtkSelectVisiblePoints filter such that actors are taken into account which were added after the labels actor?

Thank you.

We use vtkSelectVisiblePoints in RenderOpaqueGeometry method of our widget representations and it works without any problems. See complete implementation here. This is used in 3D Slicer for displaying point cloud, line, angle, and curve widgets, with labelled, interactive control points, which work fast even with tens of thousands of points, synchronized in multiple views, intermixed with semitransparent polygonal geometry and volume-rendered actors - see demo here.

Thank you so much! It works.