------------------------------------------------------------------------------ Incrementally insert a point into search structure with a particular index value. You should use the method IsInsertedPoint() to see whether this point has already been inserted (that is, if you desire to prevent duplicate points). Before using this method you must make sure that newPts have been supplied, the bounds ha
| 1221 | // newPts have been supplied, the bounds has been set properly, and that |
| 1222 | // divs are properly set. (See InitPointInsertion().) |
| 1223 | void vtkPointLocator::InsertPoint(vtkIdType ptId, const double x[3]) |
| 1224 | { |
| 1225 | vtkIdType idx; |
| 1226 | vtkIdList* bucket; |
| 1227 | |
| 1228 | idx = this->GetBucketIndex(x); |
| 1229 | |
| 1230 | if (!(bucket = this->HashTable[idx])) |
| 1231 | { |
| 1232 | bucket = vtkIdList::New(); |
| 1233 | bucket->Allocate(this->NumberOfPointsPerBucket, this->NumberOfPointsPerBucket / 3); |
| 1234 | this->HashTable[idx] = bucket; |
| 1235 | } |
| 1236 | |
| 1237 | bucket->InsertNextId(ptId); |
| 1238 | this->Points->InsertPoint(ptId, x); |
| 1239 | } |
| 1240 | |
| 1241 | //------------------------------------------------------------------------------ |
| 1242 | // Determine whether point given by x[3] has been inserted into points list. |