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

Method SearchRegionForDuplicate

Common/DataModel/vtkKdTree.cxx:2006–2026  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

2004
2005//------------------------------------------------------------------------------
2006int vtkKdTree::SearchRegionForDuplicate(float* point, int* pointsSoFar, int len, float tolerance2)
2007{
2008 int duplicateFound = -1;
2009 int id;
2010
2011 for (id = 0; id < len; id++)
2012 {
2013 int otherId = pointsSoFar[id];
2014
2015 float* otherPoint = this->LocatorPoints + (otherId * 3);
2016
2017 float distance2 = vtkMath::Distance2BetweenPoints(point, otherPoint);
2018
2019 if (distance2 <= tolerance2)
2020 {
2021 duplicateFound = otherId;
2022 break;
2023 }
2024 }
2025 return duplicateFound;
2026}
2027
2028//------------------------------------------------------------------------------
2029int vtkKdTree::SearchNeighborsForDuplicate(

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected