61 if (this->AssociatedArray != array)
64 this->AssociatedArray = array;
71 auto indices = FindIndexVec(elem);
72 if (indices ==
nullptr)
76 return indices->front();
83 auto indices = FindIndexVec(elem);
87 for (
auto index : *indices)
100 this->ValueMap.clear();
101 this->NanIndices.clear();
111 if (!this->AssociatedArray || (this->AssociatedArray->GetNumberOfTuples() < 1) ||
112 (!this->ValueMap.empty() || !this->NanIndices.empty()))
117 vtkIdType num = this->AssociatedArray->GetNumberOfValues();
118 this->ValueMap.reserve(num);
121 auto value = this->AssociatedArray->GetValue(i);
124 NanIndices.push_back(i);
126 this->ValueMap[
value].push_back(i);
132 std::vector<vtkIdType>* FindIndexVec(
ValueType value)
134 std::vector<vtkIdType>* indices{
nullptr };
137 indices = &this->NanIndices;
139 const auto& pos = this->ValueMap.find(value);
140 if (pos != this->ValueMap.end())
142 indices = &pos->second;
147 ArrayTypeT* AssociatedArray{
nullptr };
148 std::unordered_map<ValueType, std::vector<vtkIdType>> ValueMap;
149 std::vector<vtkIdType> NanIndices;