# Clipping a pointset with labels with vtkBoxWidget

**URL:** https://discourse.vtk.org/t/clipping-a-pointset-with-labels-with-vtkboxwidget/10031
**Category:** Support
**Created:** [December 1, 2022, 11:30am UTC](https://discourse.vtk.org/t/clipping-a-pointset-with-labels-with-vtkboxwidget/10031 "2022-12-01T11:30:34Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![CharInt0](https://discourse.vtk.org/user_avatar/discourse.vtk.org/charint0/32/2983_2.png) [@CharInt0](https://discourse.vtk.org/u/CharInt0)
#### Post date: [December 1, 2022, 11:30am UTC](https://discourse.vtk.org/t/clipping-a-pointset-with-labels-with-vtkboxwidget/10031/1 "2022-12-01T11:30:34Z")

</div>

Hello,  
I am using a vtkBoxWidget to clip actors in the 3D scene. I simply get the planes from the vtkBoxWidget and pass them to the mapper:  
`actor->GetMapper()->SetClippingPlanes(planes);`  
this works smooth.  
However when clipping points with labels I have a problem: passing the clipping planes to the labels’ mapper has no effect and the labels keep showing.

 ![image](https://discourse.vtk.org/uploads/default/original/2X/3/37ebced3e1d8c5e3ef247973dbb4342a85701e72.png)  
To add some details: I am using vtkPointSetToLabelHierarchy and vtkLabelPlacementMapper to manage the labels:

```auto
// Text settings
const auto& txtProperties = properties.textProperties;

auto* textProp = vtkTextProperty::New(); // will be passed to vtkSmartPointer

// Generate the label hierarchy.
auto pointSetToLabelHierarchyFilter = vtkSmartPointer<vtkPointSetToLabelHierarchy>::New();
pointSetToLabelHierarchyFilter->SetInputData(polydata);
pointSetToLabelHierarchyFilter->SetLabelArrayName("labels");
pointSetToLabelHierarchyFilter->SetTextProperty(textProp);
pointSetToLabelHierarchyFilter->SetMaximumDepth(15);

pointSetToLabelHierarchyFilter->Update();

// Create a mapper and actor for the labels.
auto labelMapper = vtkSmartPointer<vtkLabelPlacementMapper>::New();
labelMapper->SetInputConnection(pointSetToLabelHierarchyFilter->GetOutputPort());

auto labelActor = vtkSmartPointer<vtkActor2D>::New();
labelActor->SetMapper(labelMapper);

```

Thank you.  
Carlo
