# Highlighting the edges of an actor

**URL:** <https://discourse.vtk.org/t/highlighting-the-edges-of-an-actor/1343>\
**Category:** Development\
**Created:** [July 15, 2019, 8:50pm UTC](https://discourse.vtk.org/t/highlighting-the-edges-of-an-actor/1343 "2019-07-15T20:50:54Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![at123](https://discourse.vtk.org/user_avatar/discourse.vtk.org/at123/32/748_2.png) [@at123](https://discourse.vtk.org/u/at123)\
**Post date:** [July 15, 2019, 8:50pm UTC](https://discourse.vtk.org/t/highlighting-the-edges-of-an-actor/1343/1 "2019-07-15T20:50:54Z")

</div>

Hello,

I am trying to highlight the edges of an actor when I select it with the cursor. Is there a method that has this functionality?

I would greatly appreciate any help.  
Thanks.

---

<div class="post-metadata">

**Author:** ![mchinand](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/a587f6/32.png) [@mchinand](https://discourse.vtk.org/u/mchinand)\
**Post date:** [July 15, 2019, 9:10pm UTC](https://discourse.vtk.org/t/highlighting-the-edges-of-an-actor/1343/2 "2019-07-15T21:10:18Z")

</div>

Check out this example:  
[https://lorensen.github.io/VTKExamples/site/Cxx/PolyData/Silhouette/](https://lorensen.github.io/VTKExamples/site/Cxx/PolyData/Silhouette/)

---

<div class="post-metadata">

**Author:** ![lorensen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lorensen/32/20_2.png) [@lorensen](https://discourse.vtk.org/u/lorensen)\
**Post date:** [July 16, 2019, 5:25am UTC](https://discourse.vtk.org/t/highlighting-the-edges-of-an-actor/1343/3 "2019-07-16T05:25:14Z")

</div>

Do you mean the edges of each triangle or the silhouette?

---

<div class="post-metadata">

**Author:** ![lorensen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lorensen/32/20_2.png) [@lorensen](https://discourse.vtk.org/u/lorensen)\
**Post date:** [July 16, 2019, 7:01pm UTC](https://discourse.vtk.org/t/highlighting-the-edges-of-an-actor/1343/4 "2019-07-16T19:01:11Z")

</div>

[Here is an example](https://lorensen.github.io/VTKExamples/site/Cxx/Picking/HighlightPickedActor/) from the [VTKExamples Project](https://lorensen.github.io/VTKExamples/site/) that highlights a picked actor. The example subclasses [vtkInteractorStyleTrackballCamera](http://www.vtk.org/doc/nightly/html/classvtkInteractorStyleTrackballCamera.html#details).

---

<div class="post-metadata">

**Author:** ![at123](https://discourse.vtk.org/user_avatar/discourse.vtk.org/at123/32/748_2.png) [@at123](https://discourse.vtk.org/u/at123)\
**Post date:** [July 17, 2019, 1:37am UTC](https://discourse.vtk.org/t/highlighting-the-edges-of-an-actor/1343/5 "2019-07-17T01:37:48Z")

</div>

When I click on the actor, I want there to be an outline around the actor. So I guess the silhouette.

---

<div class="post-metadata">

**Author:** ![at123](https://discourse.vtk.org/user_avatar/discourse.vtk.org/at123/32/748_2.png) [@at123](https://discourse.vtk.org/u/at123)\
**Post date:** [July 17, 2019, 12:14pm UTC](https://discourse.vtk.org/t/highlighting-the-edges-of-an-actor/1343/6 "2019-07-17T12:14:08Z")

</div>

Will the silhouette move along with the actor that I am trying to outline if I apply transformations to the actor, or will I have to apply the same transformation to the silhouette?

Update: The silhouette does not move along with the actor. Do you know a function that simplifies the task, instead of copy the code for the transformation of the actor for the silhouette?

---

<div class="post-metadata">

**Author:** ![lorensen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lorensen/32/20_2.png) [@lorensen](https://discourse.vtk.org/u/lorensen)\
**Post date:** [July 17, 2019, 11:20pm UTC](https://discourse.vtk.org/t/highlighting-the-edges-of-an-actor/1343/7 "2019-07-17T23:20:43Z")

</div>

I’ve added an new example to the [VTK Examples Project](https://lorensen.github.io/VTKExamples/site/). [HighlightWithSilhouette](https://lorensen.github.io/VTKExamples/site/Cxx/Picking/HighlightWithSilhouette/) adds a silhouette to the picked actor. I think this is what you were looking for?  
Here is a [youtube video of the interaction](https://www.youtube.com/watch?v=ATjYDzk9llk&feature=youtu.be).

Enjoy VTK,

Bill

---

<div class="post-metadata">

**Author:** ![at123](https://discourse.vtk.org/user_avatar/discourse.vtk.org/at123/32/748_2.png) [@at123](https://discourse.vtk.org/u/at123)\
**Post date:** [July 18, 2019, 1:18am UTC](https://discourse.vtk.org/t/highlighting-the-edges-of-an-actor/1343/8 "2019-07-18T01:18:42Z")

</div>

Thank you so much! Is there a Python version of the source code by any chance?

---

<div class="post-metadata">

**Author:** ![lorensen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lorensen/32/20_2.png) [@lorensen](https://discourse.vtk.org/u/lorensen)\
**Post date:** [July 18, 2019, 3:31am UTC](https://discourse.vtk.org/t/highlighting-the-edges-of-an-actor/1343/9 "2019-07-18T03:31:11Z")

</div>

Maybe @amaclean will make a python version.

---

<div class="post-metadata">

**Author:** ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)\
**Post date:** [July 18, 2019, 4:04am UTC](https://discourse.vtk.org/t/highlighting-the-edges-of-an-actor/1343/10 "2019-07-18T04:04:26Z")

</div>

Will do, I’ll let you when it’s done.

---

<div class="post-metadata">

**Author:** ![lorensen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lorensen/32/20_2.png) [@lorensen](https://discourse.vtk.org/u/lorensen)\
**Post date:** [July 18, 2019, 4:06am UTC](https://discourse.vtk.org/t/highlighting-the-edges-of-an-actor/1343/11 "2019-07-18T04:06:04Z")

</div>

I think is a neat way to show the highlighted actor.

---

<div class="post-metadata">

**Author:** ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)\
**Post date:** [July 18, 2019, 4:12am UTC](https://discourse.vtk.org/t/highlighting-the-edges-of-an-actor/1343/12 "2019-07-18T04:12:11Z")

</div>

It’s impressive.

Andrew Maclean

---

<div class="post-metadata">

**Author:** ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)\
**Post date:** [July 18, 2019, 7:25am UTC](https://discourse.vtk.org/t/highlighting-the-edges-of-an-actor/1343/13 "2019-07-18T07:25:21Z")

</div>

All done. It should appear when the next sync is done for the VTKExamples web page. See `/src/Python/Picking/HighlightWithSilhouette.py` in the VTKExamples folder.

---

<div class="post-metadata">

**Author:** ![lorensen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lorensen/32/20_2.png) [@lorensen](https://discourse.vtk.org/u/lorensen)\
**Post date:** [July 18, 2019, 3:41pm UTC](https://discourse.vtk.org/t/highlighting-the-edges-of-an-actor/1343/14 "2019-07-18T15:41:31Z")

</div>

@amaclean I have synced the site. Nice work!

Old Guys Rule!

---

<div class="post-metadata">

**Author:** ![lorensen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lorensen/32/20_2.png) [@lorensen](https://discourse.vtk.org/u/lorensen)\
**Post date:** [July 18, 2019, 3:43pm UTC](https://discourse.vtk.org/t/highlighting-the-edges-of-an-actor/1343/15 "2019-07-18T15:43:37Z")

</div>

@at123 The python version is available [here](https://lorensen.github.io/VTKExamples/site/Python/Picking/HighlightWithSilhouette/)

---

<div class="post-metadata">

**Author:** ![rvilums](https://discourse.vtk.org/user_avatar/discourse.vtk.org/rvilums/32/688_2.png) [@rvilums](https://discourse.vtk.org/u/rvilums)\
**Post date:** [March 10, 2022, 11:47am UTC](https://discourse.vtk.org/t/highlighting-the-edges-of-an-actor/1343/16 "2022-03-10T11:47:16Z")

</div>

The link has changed  
[https://kitware.github.io/vtk-examples/site/Cxx/Picking/HighlightWithSilhouette/](https://kitware.github.io/vtk-examples/site/Cxx/Picking/HighlightWithSilhouette/)

---

<div class="post-metadata">

**Author:** ![jerichoi224](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jerichoi224/32/7367_2.png) [@jerichoi224](https://discourse.vtk.org/u/jerichoi224)\
**Post date:** [June 28, 2023, 2:14am UTC](https://discourse.vtk.org/t/highlighting-the-edges-of-an-actor/1343/17 "2023-06-28T02:14:01Z")

</div>

Would there be anyway to have something like this in vtk.js as well?
