# Update vtkSelectVisiblePoints filter

**URL:** https://discourse.vtk.org/t/update-vtkselectvisiblepoints-filter/2454
**Category:** Support
**Created:** [January 19, 2020, 1:33pm UTC](https://discourse.vtk.org/t/update-vtkselectvisiblepoints-filter/2454 "2020-01-19T13:33:20Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![michael23](https://discourse.vtk.org/user_avatar/discourse.vtk.org/michael23/32/837_2.png) [@michael23](https://discourse.vtk.org/u/michael23)
#### Post date: [January 19, 2020, 1:33pm UTC](https://discourse.vtk.org/t/update-vtkselectvisiblepoints-filter/2454/1 "2020-01-19T13:33:20Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [January 19, 2020, 2:46pm UTC](https://discourse.vtk.org/t/update-vtkselectvisiblepoints-filter/2454/2 "2020-01-19T14:46:58Z")

</div>

We use vtkSelectVisiblePoints in `RenderOpaqueGeometry` method of our widget representations and it works without any problems. See [complete implementation here](https://github.com/Slicer/Slicer/blob/master/Modules/Loadable/Markups/VTKWidgets/vtkSlicerMarkupsWidgetRepresentation3D.cxx). 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](https://youtu.be/dXV8-Z8Z_NM).

---

<div class="post-metadata">

### Author: ![michael23](https://discourse.vtk.org/user_avatar/discourse.vtk.org/michael23/32/837_2.png) [@michael23](https://discourse.vtk.org/u/michael23)
#### Post date: [January 20, 2020, 11:26am UTC](https://discourse.vtk.org/t/update-vtkselectvisiblepoints-filter/2454/3 "2020-01-20T11:26:25Z")

</div>

Thank you so much! It works.
