MCPcopy Create free account
hub / github.com/Kitware/VTK / UpdateLookup

Method UpdateLookup

Common/Core/vtkVariantArray.cxx:883–905  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

881
882//------------------------------------------------------------------------------
883void 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//------------------------------------------------------------------------------
908vtkIdType vtkVariantArray::LookupValue(ValueType value)

Callers 1

LookupValueMethod · 0.95

Calls 8

SetNumberOfIdsMethod · 0.80
NewFunction · 0.70
SortFunction · 0.70
GetNumberOfComponentsMethod · 0.45
GetNumberOfTuplesMethod · 0.45
DeepCopyMethod · 0.45
SetIdMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected