# HighlightSelection example not rendering properly

**URL:** https://discourse.vtk.org/t/highlightselection-example-not-rendering-properly/6604
**Category:** Support
**Created:** [September 10, 2021, 4:13pm UTC](https://discourse.vtk.org/t/highlightselection-example-not-rendering-properly/6604 "2021-09-10T16:13:58Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Drew](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/d/b19c9b/32.png) [@Drew](https://discourse.vtk.org/u/Drew)
#### Post date: [September 10, 2021, 4:13pm UTC](https://discourse.vtk.org/t/highlightselection-example-not-rendering-properly/6604/1 "2021-09-10T16:13:58Z")

</div>

This is in regards to the Cxx example HighlightSelection which can be found at

[https://kitware.github.io/vtk-examples/site/Cxx/Picking/HighlightSelection/](https://kitware.github.io/vtk-examples/site/Cxx/Picking/HighlightSelection/)

When you select cells the user does not see those cells highlighted. If you switch to wireframe mode and then back you can now see the highlighted cells. If I add this manual method in code to the example via

Code fragment from `class HighlightInteractorStyle : public vtkInteractorStyleRubberBandPick`

```auto
      this->GetInteractor()
          ->GetRenderWindow()
          ->GetRenderers()
          ->GetFirstRenderer()
          ->AddActor(this->SelectedActor);
          
      this->SelectedActor->GetProperty()->SetRepresentationToWireframe();
      this->SelectedActor->GetProperty()->SetRepresentationToSurface();

      this->GetInteractor()->GetRenderWindow()->Render();
      this->HighlightProp(NULL);

```

then the user gets to see what is highlighted without manually switching. If you highlight in wireframe mode the wires are highlighted. The problem only occurs in the surface mode. I have also seen (almost similar problems in the CellPicking example).

I am using the latest vtk compiled from source on a mac. Is anyone also seeing this problem? My fix is clearly a hack. I am interested in a better solution.

---

<div class="post-metadata">

### Author: ![Drew](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/d/b19c9b/32.png) [@Drew](https://discourse.vtk.org/u/Drew)
#### Post date: [September 11, 2021, 1:26am UTC](https://discourse.vtk.org/t/highlightselection-example-not-rendering-properly/6604/2 "2021-09-11T01:26:57Z")

</div>

Well, I went back looking through the code and noticed that the following line was included

```auto
this->SelectedActor->GetProperty()->SetRepresentationToWireframe();

```

just after the color was set for the SelectedActor. This appears to be the issue and so my hack above was essentially undoing this “feature”. So the above should be removed from the example to make it work the way in which I was expecting
