------------------------------------------------------------------------------
| 221 | |
| 222 | //------------------------------------------------------------------------------ |
| 223 | vtkIdType vtkIncrementalOctreePointLocator::FindClosestInsertedPoint(const double x[3]) |
| 224 | { |
| 225 | if (this->OctreeRootNode == nullptr || this->OctreeRootNode->GetNumberOfPoints() == 0 || |
| 226 | this->OctreeRootNode->ContainsPoint(x) == 0) |
| 227 | { |
| 228 | return -1; |
| 229 | } |
| 230 | |
| 231 | double miniDist2 = this->OctreeMaxDimSize * this->OctreeMaxDimSize * 4.0; |
| 232 | double elseDist2; // inter-node search |
| 233 | vtkIdType elsePntId; // inter-node search |
| 234 | |
| 235 | vtkIncrementalOctreeNode* pLeafNode = this->GetLeafContainer(this->OctreeRootNode, x); |
| 236 | vtkIdType pointIndx = this->FindClosestPointInLeafNode(pLeafNode, x, &miniDist2); |
| 237 | |
| 238 | if (miniDist2 > 0.0) |
| 239 | { |
| 240 | if (pLeafNode->GetDistance2ToInnerBoundary(x, this->OctreeRootNode) < miniDist2) |
| 241 | { |
| 242 | elsePntId = |
| 243 | this->FindClosestPointInSphereWithoutTolerance(x, miniDist2, pLeafNode, &elseDist2); |
| 244 | if (elseDist2 < miniDist2) |
| 245 | { |
| 246 | pointIndx = elsePntId; |
| 247 | miniDist2 = elseDist2; |
| 248 | } |
| 249 | } |
| 250 | } |
| 251 | |
| 252 | pLeafNode = nullptr; |
| 253 | return pointIndx; |
| 254 | } |
| 255 | |
| 256 | //------------------------------------------------------------------------------ |
| 257 | void vtkIncrementalOctreePointLocator::PrintSelf(ostream& os, vtkIndent indent) |
nothing calls this directly
no test coverage detected