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

Method UpdateLookup

Common/Core/vtkBitArray.cxx:755–782  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

753
754//------------------------------------------------------------------------------
755void vtkBitArray::UpdateLookup()
756{
757 if (!this->Lookup)
758 {
759 this->Lookup = new vtkBitArrayLookup();
760 this->Lookup->ZeroArray = vtkIdList::New();
761 this->Lookup->OneArray = vtkIdList::New();
762 }
763 if (this->Lookup->Rebuild)
764 {
765 int numComps = this->GetNumberOfComponents();
766 vtkIdType numTuples = this->GetNumberOfTuples();
767 this->Lookup->ZeroArray->Allocate(numComps * numTuples);
768 this->Lookup->OneArray->Allocate(numComps * numTuples);
769 for (vtkIdType i = 0; i < numComps * numTuples; i++)
770 {
771 if (this->GetValue(i))
772 {
773 this->Lookup->OneArray->InsertNextId(i);
774 }
775 else
776 {
777 this->Lookup->ZeroArray->InsertNextId(i);
778 }
779 }
780 this->Lookup->Rebuild = false;
781 }
782}
783
784//------------------------------------------------------------------------------
785vtkIdType vtkBitArray::LookupValue(vtkVariant var)

Callers 2

LookupValueMethod · 0.95
LookupValueFunction · 0.45

Calls 6

GetValueMethod · 0.95
InsertNextIdMethod · 0.80
NewFunction · 0.70
GetNumberOfComponentsMethod · 0.45
GetNumberOfTuplesMethod · 0.45
AllocateMethod · 0.45

Tested by

no test coverage detected