# Questions about how to achieve fast pre selection

**URL:** https://discourse.vtk.org/t/questions-about-how-to-achieve-fast-pre-selection/6113
**Category:** Support
**Tags:** jobs
**Created:** [July 1, 2021, 5:13am UTC](https://discourse.vtk.org/t/questions-about-how-to-achieve-fast-pre-selection/6113 "2021-07-01T05:13:25Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![yuhaoqiu](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/y/3e96dc/32.png) [@yuhaoqiu](https://discourse.vtk.org/u/yuhaoqiu)
#### Post date: [July 1, 2021, 5:13am UTC](https://discourse.vtk.org/t/questions-about-how-to-achieve-fast-pre-selection/6113/1 "2021-07-01T05:13:25Z")

</div>

Hello, I am a student, and I am trying to use vtk to render and select from more than one million units model.  
After reading this article:

> **[ParaView fast preselection - Kitware Blog](https://blog.kitware.com/paraview-fast-preselection/#comment-9243)**
>
> Introduction When selecting points or cells from the render view, ParaView currently executes internally an “Extract Selection” filter to display the primitive under the mouse ... Read More

I am very interested in the feature of fast preselection. I tried to use the method of the vtkOpenGLIndexBufferObject class, and got the IndexBufferObject corresponding to the result of the HardwareSelector selection from vtkOpenGLPolyDataMapper. But I am not sure how to use this IndexBufferObject (Besides, I am not sure whether the extracted IndexBufferObject is correct). Therefore, I would like to ask how to use IndexBufferObject and VertexBufferObject to render and change the color of the rendered object.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [July 1, 2021, 7:47am UTC](https://discourse.vtk.org/t/questions-about-how-to-achieve-fast-pre-selection/6113/2 "2021-07-01T07:47:01Z")

</div>

You can take a look into ParaView implementation here:  
[https://gitlab.kitware.com/paraview/paraview/-/blob/master/Qt/ApplicationComponents/pqRenderViewSelectionReaction.cxx#L745](https://gitlab.kitware.com/paraview/paraview/-/blob/master/Qt/ApplicationComponents/pqRenderViewSelectionReaction.cxx#L745)

---

<div class="post-metadata">

### Author: ![yuhaoqiu](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/y/3e96dc/32.png) [@yuhaoqiu](https://discourse.vtk.org/u/yuhaoqiu)
#### Post date: [July 1, 2021, 8:22am UTC](https://discourse.vtk.org/t/questions-about-how-to-achieve-fast-pre-selection/6113/3 "2021-07-01T08:22:33Z")

</div>

Thank you for your reply sincerely! 😃 I checked this code, and here are some of my thoughts. I think it may be using methods such as HardwareSelector to select some things, and then use UpdateVTKObjects to update them. But I didn’t find any operation related to openglbuffer-according to my understanding, I think this is the key to achieve fast pre-selection. Similarly, I did not find any operation for the rendering pipeline. Does the pre-selected object create an actor? How does it change the color of the preselected part? If possible, I hope to get more tips.
