------------------------------------------------------------------------------
| 92 | |
| 93 | //------------------------------------------------------------------------------ |
| 94 | void vtkKdTreePointLocator::BuildLocatorInternal() |
| 95 | { |
| 96 | if (!this->DataSet || (this->DataSet->GetNumberOfPoints()) < 1) |
| 97 | { |
| 98 | vtkErrorMacro(<< "No points to build"); |
| 99 | return; |
| 100 | } |
| 101 | // Prepare |
| 102 | this->FreeSearchStructure(); |
| 103 | |
| 104 | vtkPointSet* pointSet = vtkPointSet::SafeDownCast(this->GetDataSet()); |
| 105 | if (!pointSet) |
| 106 | { |
| 107 | vtkErrorMacro("vtkKdTreePointLocator requires a PointSet to build locator."); |
| 108 | return; |
| 109 | } |
| 110 | this->KdTree = vtkKdTree::New(); |
| 111 | this->KdTree->SetUseExistingSearchStructure(this->UseExistingSearchStructure); |
| 112 | this->KdTree->BuildLocatorFromPoints(pointSet); |
| 113 | this->KdTree->GetBounds(this->Bounds); |
| 114 | this->BuildTime.Modified(); |
| 115 | } |
| 116 | |
| 117 | //------------------------------------------------------------------------------ |
| 118 | void vtkKdTreePointLocator::GenerateRepresentation(int level, vtkPolyData* pd) |
no test coverage detected