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

Method InsertNextPoint

Common/DataModel/vtkPointLocator.cxx:1197–1214  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Incrementally insert a point into search structure. The method returns the insertion location (i.e., point id). 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 hav

Source from the content-addressed store, hash-verified

1195// supplied, the bounds has been set properly, and that divs are
1196// properly set. (See InitPointInsertion().)
1197vtkIdType vtkPointLocator::InsertNextPoint(const double x[3])
1198{
1199 vtkIdType idx;
1200 vtkIdList* bucket;
1201
1202 idx = this->GetBucketIndex(x);
1203
1204 if (!(bucket = this->HashTable[idx]))
1205 {
1206 bucket = vtkIdList::New();
1207 bucket->Allocate(this->NumberOfPointsPerBucket / 2, this->NumberOfPointsPerBucket / 3);
1208 this->HashTable[idx] = bucket;
1209 }
1210
1211 bucket->InsertNextId(this->InsertionPointId);
1212 this->Points->InsertPoint(this->InsertionPointId, x);
1213 return this->InsertionPointId++;
1214}
1215
1216//------------------------------------------------------------------------------
1217// Incrementally insert a point into search structure with a particular

Callers 5

InsertUniquePointMethod · 0.95
GetBucketNeighborsMethod · 0.45
GetOverlappingBucketsMethod · 0.45
GenerateFaceMethod · 0.45

Calls 5

InsertNextIdMethod · 0.80
NewFunction · 0.50
GetBucketIndexMethod · 0.45
AllocateMethod · 0.45
InsertPointMethod · 0.45

Tested by

no test coverage detected