# PolydataMapper vs DataSetMapper

**URL:** https://discourse.vtk.org/t/polydatamapper-vs-datasetmapper/3991
**Category:** Support
**Created:** [August 17, 2020, 2:42am UTC](https://discourse.vtk.org/t/polydatamapper-vs-datasetmapper/3991 "2020-08-17T02:42:28Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![j-miguel](https://discourse.vtk.org/user_avatar/discourse.vtk.org/j-miguel/32/3199_2.png) [@j-miguel](https://discourse.vtk.org/u/j-miguel)
#### Post date: [August 17, 2020, 2:42am UTC](https://discourse.vtk.org/t/polydatamapper-vs-datasetmapper/3991/1 "2020-08-17T02:42:28Z")

</div>

I’ve seen some examples using `vtkDataSetMapper` and others using `vtkPolyDataMapper`.  
(On a closer look to the `vtkDataSetMapper` implementation, I see that it actually creates a `vtkPolyDataMapper` and I noticed there is already a check to prevent the input from passing through the geometry filter if it’s a `vtkPolyData`.)

With that been said, should I use `vtkPolyDataMapper` directly when the input is a `vtkPolyData` or can I use `vtkDataSetMapper` for all cases? What’s the common practice for this?

Context: I’m starting to use VTK and trying to implement an internal abstraction for mapper/actor generation. Using a common mapper could simplify this process.

---

<div class="post-metadata">

### Author: ![Yohann\_Bearzi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/yohann_bearzi/32/671_2.png) [@Yohann\_Bearzi](https://discourse.vtk.org/u/Yohann_Bearzi)
#### Post date: [August 17, 2020, 4:13pm UTC](https://discourse.vtk.org/t/polydatamapper-vs-datasetmapper/3991/2 "2020-08-17T16:13:38Z")

</div>

`vtkDataSetMapper` always internally uses a `vtkPolyDataMapper`. If the input is not a `vtkPolyData`, it calls a `vtkDataSetSurfaceFilter` to generate a `vtkPolyData` that is then getting plugged into a `vtkPolyDataMapper`. If not, it skips this last step and directly uses the `vtkPolyDataMapper`.

So you can use a `vtkDataSetMapper` in all instances.

---

<div class="post-metadata">

### Author: ![j-miguel](https://discourse.vtk.org/user_avatar/discourse.vtk.org/j-miguel/32/3199_2.png) [@j-miguel](https://discourse.vtk.org/u/j-miguel)
#### Post date: [August 17, 2020, 4:49pm UTC](https://discourse.vtk.org/t/polydatamapper-vs-datasetmapper/3991/3 "2020-08-17T16:49:05Z")

</div>

Thanks for the confirmation! Just wanted to make sure before following this path.
