# Except cell scalar value as color,are there any other way to highlight/mark a cell when it is clicked?

**URL:** https://discourse.vtk.org/t/except-cell-scalar-value-as-color-are-there-any-other-way-to-highlight-mark-a-cell-when-it-is-clicked/11165
**Category:** Support
**Created:** [April 8, 2023, 4:04am UTC](https://discourse.vtk.org/t/except-cell-scalar-value-as-color-are-there-any-other-way-to-highlight-mark-a-cell-when-it-is-clicked/11165 "2023-04-08T04:04:28Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![AlexLuya](https://discourse.vtk.org/user_avatar/discourse.vtk.org/alexluya/32/4036_2.png) [@AlexLuya](https://discourse.vtk.org/u/AlexLuya)
#### Post date: [April 8, 2023, 4:04am UTC](https://discourse.vtk.org/t/except-cell-scalar-value-as-color-are-there-any-other-way-to-highlight-mark-a-cell-when-it-is-clicked/11165/1 "2023-04-08T04:04:28Z")

</div>

Hello,I want to highlight a cell when it is clicked,and I knew that the scalar value can be used.The question is that if doing it like this,the two faces of same cell can’t have different colors which is is must-have feature in my current project.So question is:

Except cell scalar value as color,are there any other way to highlight/mark a cell when it is clicked?

---

<div class="post-metadata">

### Author: ![Jens\_Munk\_Hansen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jens_munk_hansen/32/1215_2.png) [@Jens\_Munk\_Hansen](https://discourse.vtk.org/u/Jens_Munk_Hansen)
#### Post date: [April 8, 2023, 5:11pm UTC](https://discourse.vtk.org/t/except-cell-scalar-value-as-color-are-there-any-other-way-to-highlight-mark-a-cell-when-it-is-clicked/11165/2 "2023-04-08T17:11:14Z")

</div>

You can create a new `vtkPolyData` containing the marked cells and display it on top. To ensure that it always placed nicely on top, you can set the following properties on the mapper for the overlay.

```auto
mapper->SetRelativeCoincidentTopologyLineOffsetParameters(0, -60000);
mapper->SetRelativeCoincidentTopologyPolygonOffsetParameters(0, -60000);
mapper->SetRelativeCoincidentTopologyPointOffsetParameter(-60000);

```

---

<div class="post-metadata">

### Author: ![AlexLuya](https://discourse.vtk.org/user_avatar/discourse.vtk.org/alexluya/32/4036_2.png) [@AlexLuya](https://discourse.vtk.org/u/AlexLuya)
#### Post date: [April 9, 2023, 12:07am UTC](https://discourse.vtk.org/t/except-cell-scalar-value-as-color-are-there-any-other-way-to-highlight-mark-a-cell-when-it-is-clicked/11165/3 "2023-04-09T00:07:44Z")

</div>

Thanks,you mean to create another actor like the official highlight example

---

<div class="post-metadata">

### Author: ![Jens\_Munk\_Hansen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jens_munk_hansen/32/1215_2.png) [@Jens\_Munk\_Hansen](https://discourse.vtk.org/u/Jens_Munk_Hansen)
#### Post date: [April 9, 2023, 12:25pm UTC](https://discourse.vtk.org/t/except-cell-scalar-value-as-color-are-there-any-other-way-to-highlight-mark-a-cell-when-it-is-clicked/11165/4 "2023-04-09T12:25:09Z")

</div>

Yes, it allows for more flexibility

---

<div class="post-metadata">

### Author: ![AlexLuya](https://discourse.vtk.org/user_avatar/discourse.vtk.org/alexluya/32/4036_2.png) [@AlexLuya](https://discourse.vtk.org/u/AlexLuya)
#### Post date: [April 14, 2023, 1:19am UTC](https://discourse.vtk.org/t/except-cell-scalar-value-as-color-are-there-any-other-way-to-highlight-mark-a-cell-when-it-is-clicked/11165/5 "2023-04-14T01:19:51Z")

</div>

Thanks,this solution will cause many design issues
