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

Method AddPoints

Common/DataModel/vtkStaticPointLocator2D.cxx:820–846  ·  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

818 // maxR2 has been determined. Also will cull entire bins if they are not
819 // within the (minR2,MaxR2] query footprint.
820 void AddPoints(
821 int i, int j, vtkIdType binIdx, int level, double minR2, double maxR2, vtkDist2TupleArray& res)
822 {
823 bool gathering = false;
824
825 // If there is nothing in the bin, or the bin is outside of the
826 // search annulus, skip processing the bin.
827 vtkIdType numIds = this->Bins->GetNumberOfIds(binIdx);
828 if (numIds <= 0 || this->CanCullBin(gathering, minR2, maxR2, i, j, level))
829 {
830 return;
831 }
832
833 // Okay, process the points in the bin.
834 const vtkLocatorTuple<TIds>* ids = this->Bins->GetIds(binIdx);
835 double* pt;
836 for (vtkIdType ii = 0; ii < numIds; ++ii)
837 {
838 vtkIdType ptId = ids[ii].PtId;
839 pt = this->GetPoint(ptId);
840 double d2 = Distance2BetweenPoints2D(this->X, pt);
841 if (d2 > minR2 && d2 <= maxR2)
842 {
843 res.emplace_back(ptId, d2);
844 } // if within annulus footprint
845 } // for all points in this bin
846 }
847}; // AnnulusIterator
848
849} // anonymous namespace

Callers 1

FindNPointsInAnnulusMethod · 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