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

Method AddPoints

Common/DataModel/vtkStaticPointLocator.cxx:895–921  ·  view source on GitHub ↗

Add points in the bin binIdx. Like GatherPoints(), except at this point maxR2 has been determined. Also will cull entire bins if they are not within the (minR2,maxR2] query footprint.

Source from the content-addressed store, hash-verified

893 // maxR2 has been determined. Also will cull entire bins if they are not
894 // within the (minR2,maxR2] query footprint.
895 void AddPoints(int i, int j, int k, vtkIdType binIdx, int level, double minR2, double maxR2,
896 vtkDist2TupleArray& res)
897 {
898 bool gathering = false;
899
900 // If there is nothing in the bin, or the bin is outside of the search space,
901 // skip processing the bin.
902 vtkIdType numIds = this->Bins->GetNumberOfIds(binIdx);
903 if (numIds <= 0 || this->CanCullBin(gathering, minR2, maxR2, i, j, k, level))
904 {
905 return;
906 }
907
908 // Okay, process the points in the bin.
909 const vtkLocatorTuple<TIds>* ids = this->Bins->GetIds(binIdx);
910 double* pt;
911 for (vtkIdType ii = 0; ii < numIds; ++ii)
912 {
913 vtkIdType ptId = ids[ii].PtId;
914 pt = this->GetPoint(ptId);
915 double d2 = vtkMath::Distance2BetweenPoints(this->X, pt);
916 if (d2 > minR2 && d2 <= maxR2)
917 {
918 res.emplace_back(ptId, d2);
919 } // if within shell footprint
920 } // for all points in this bin
921 }
922}; // ShellIterator
923
924} // anonymous namespace

Callers 1

FindNPointsInShellMethod · 0.45

Calls 5

CanCullBinMethod · 0.95
GetPointMethod · 0.95
GetNumberOfIdsMethod · 0.45
GetIdsMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected