Commit 78748c5b authored by David C. Lonie's avatar David C. Lonie
Browse files

Improve contouring locator performance.

Use the number of input points as the estimated number of
points when setting up the point locator for the contour
filters, rather than the cell-based estimate used previously.

On a wavelet data set with 1M points and 1M hex cells, the
locator ended up holding 1.5M points -- far exceeding the
estimated 62K points. This caused bucket sizes to grow to
~120 points per bucket in cases, while the locator only expects
around 3 points per bucket. This resulted in a ~10% speedup
of the filter updates.

Change-Id: I3fde70306b046d9f3c79a3fbc4cfbd5c3a230028
parent 99101fdf
......@@ -482,7 +482,8 @@ int vtkContourFilter::RequestData(
this->CreateDefaultLocator();
}
this->Locator->InitPointInsertion (newPts,
input->GetBounds(),estimatedSize);
input->GetBounds(),
input->GetNumberOfPoints());
// interpolate data along edge
// if we did not ask for scalars to be computed, don't copy them
......
......@@ -165,7 +165,8 @@ void vtkContourGridExecute(vtkContourGrid *self, vtkDataSet *input,
cellScalars->Allocate(VTK_CELL_SIZE*inScalars->GetNumberOfComponents());
// locator used to merge potentially duplicate points
locator->InitPointInsertion (newPts, input->GetBounds(),estimatedSize);
locator->InitPointInsertion (newPts, input->GetBounds(),
input->GetNumberOfPoints());
// interpolate data along edge
// if we did not ask for scalars to be computed, don't copy them
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment