------------------------------------------------------------------------------
| 881 | |
| 882 | //------------------------------------------------------------------------------ |
| 883 | void vtkVariantArray::UpdateLookup() |
| 884 | { |
| 885 | if (!this->Lookup) |
| 886 | { |
| 887 | this->Lookup = new vtkVariantArrayLookup(); |
| 888 | this->Lookup->SortedArray = vtkVariantArray::New(); |
| 889 | this->Lookup->IndexArray = vtkIdList::New(); |
| 890 | } |
| 891 | if (this->Lookup->Rebuild) |
| 892 | { |
| 893 | int numComps = this->GetNumberOfComponents(); |
| 894 | vtkIdType numTuples = this->GetNumberOfTuples(); |
| 895 | this->Lookup->SortedArray->DeepCopy(this); |
| 896 | this->Lookup->IndexArray->SetNumberOfIds(numComps * numTuples); |
| 897 | for (vtkIdType i = 0; i < numComps * numTuples; i++) |
| 898 | { |
| 899 | this->Lookup->IndexArray->SetId(i, i); |
| 900 | } |
| 901 | vtkSortDataArray::Sort(this->Lookup->SortedArray, this->Lookup->IndexArray); |
| 902 | this->Lookup->Rebuild = false; |
| 903 | this->Lookup->CachedUpdates.clear(); |
| 904 | } |
| 905 | } |
| 906 | |
| 907 | //------------------------------------------------------------------------------ |
| 908 | vtkIdType vtkVariantArray::LookupValue(ValueType value) |
no test coverage detected