Commit 7fec293a authored by Andreas Buykx's avatar Andreas Buykx
Browse files

Reuse temporary data structures for non-linear cells

When extracting surface geometry of non-linear cells it is not
necessary to allocate temporary instances of vtkCell etc. for each
non-linear cell. Instead these are created before iterating over
the unstructured grid and deleted when all work is done.
parent 83dddfb9
......@@ -717,6 +717,12 @@ void vtkGeometryFilter::UnstructuredGridExecute(vtkDataSet *dataSetInput,
}//for all cells
}//if not all visible
// Used for nonlinear cells only
vtkGenericCell *cell = vtkGenericCell::New();
vtkIdList *ipts = vtkIdList::New();
vtkPoints *coords = vtkPoints::New();
vtkIdList *icellIds = vtkIdList::New();;
// These store the cell ids of the input that map to the
// new vert/line/poly/strip cells, for copying cell data
// in appropriate order.
......@@ -1003,11 +1009,7 @@ void vtkGeometryFilter::UnstructuredGridExecute(vtkDataSet *dataSetInput,
case VTK_BIQUADRATIC_QUADRATIC_WEDGE:
case VTK_BIQUADRATIC_QUADRATIC_HEXAHEDRON:
{
vtkGenericCell *cell = vtkGenericCell::New();
input->GetCell(cellId,cell);
vtkIdList *ipts = vtkIdList::New();
vtkPoints *coords = vtkPoints::New();
vtkIdList *icellIds = vtkIdList::New();
if ( cell->GetCellDimension() == 1 )
{
......@@ -1053,16 +1055,21 @@ void vtkGeometryFilter::UnstructuredGridExecute(vtkDataSet *dataSetInput,
}
}
} //3d cell
icellIds->Delete();
coords->Delete();
ipts->Delete();
cell->Delete();
}
break; //done with quadratic cells
} //switch
} //if visible
} //for all cells
icellIds->Delete();
icellIds = nullptr;
coords->Delete();
coords = nullptr;
ipts->Delete();
ipts = nullptr;
cell->Delete();
cell = nullptr;
// Update ourselves and release memory
//
output->SetVerts(verts);
......
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