<div>I currently have the &quot;forward mapping&quot; from &quot;new id&quot; to &quot;old id&quot;:</div><div><br></div><div>vtkIdTypeArray* originalIds = vtkIdTypeArray::SafeDownCast(selected-&gt;GetPointData()-&gt;GetArray(&quot;vtkOriginalPointIds&quot;));</div>
<div><br></div><div>  for(vtkIdType i = 0; i &lt; originalIds-&gt;GetNumberOfTuples(); i++)</div><div>    {</div><div>    std::cout &lt;&lt; &quot;Point &quot; &lt;&lt; i &lt;&lt; &quot; was originally point &quot; &lt;&lt; originalIds-&gt;GetValue(i) &lt;&lt; std::endl;</div>
<div>    }</div><div><br></div><div>If I want the reverse mapping, i.e. &quot;Which new id corresponds to original id X?&quot;, is there a better way to do it than a linear search through the array?</div><div><br></div><div>
<div>  for(vtkIdType i = 0; i &lt; originalIds-&gt;GetNumberOfTuples(); i++)</div><div>    {</div><div>    if(originalIds-&gt;GetValue(i) == X)</div><div>      { </div><div>      cout &lt;&lt; &quot;current ID corresponding to original ID X is &quot; &lt;&lt; i &lt;&lt; endl;</div>
<div>      }</div><div>    }</div></div><div><br></div><div>This seems horribly inefficient!</div><br clear="all">Thanks,<br><br>David<br>