<div>I currently have the "forward mapping" from "new id" to "old id":</div><div><br></div><div>vtkIdTypeArray* originalIds = vtkIdTypeArray::SafeDownCast(selected->GetPointData()->GetArray("vtkOriginalPointIds"));</div>
<div><br></div><div> for(vtkIdType i = 0; i < originalIds->GetNumberOfTuples(); i++)</div><div> {</div><div> std::cout << "Point " << i << " was originally point " << originalIds->GetValue(i) << std::endl;</div>
<div> }</div><div><br></div><div>If I want the reverse mapping, i.e. "Which new id corresponds to original id X?", 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 < originalIds->GetNumberOfTuples(); i++)</div><div> {</div><div> if(originalIds->GetValue(i) == X)</div><div> { </div><div> cout << "current ID corresponding to original ID X is " << i << endl;</div>
<div> }</div><div> }</div></div><div><br></div><div>This seems horribly inefficient!</div><br clear="all">Thanks,<br><br>David<br>