Commit a4371fd3 authored by Andrew Bauer's avatar Andrew Bauer
Browse files

Fixing compile issue

parent 609c46b2
Pipeline #57974 passed with stage
...@@ -2783,19 +2783,20 @@ static int insideBoxFunction(vtkIdType cellId, vtkUnstructuredGrid *grid, void * ...@@ -2783,19 +2783,20 @@ static int insideBoxFunction(vtkIdType cellId, vtkUnstructuredGrid *grid, void *
void vtkDistributedDataFilter::AddConstantUnsignedCharPointArray( void vtkDistributedDataFilter::AddConstantUnsignedCharPointArray(
vtkUnstructuredGrid *grid, const char *arrayName, unsigned char val) vtkUnstructuredGrid *grid, const char *arrayName, unsigned char val)
{ {
vtkUnsignedCharArray *Array = vtkUnsignedCharArray::New();
Array->SetName(arrayName);
vtkIdType npoints = grid->GetNumberOfPoints(); vtkIdType npoints = grid->GetNumberOfPoints();
if (npoints)
unsigned char *vals = new unsigned char [npoints];
if(npoints)
{ {
unsigned char *vals = new unsigned char [npoints];
memset(vals, val, npoints); memset(vals, val, npoints);
Array->SetArray(vals, npoints, 0,
vtkUnsignedCharArray::VTK_DATA_ARRAY_DELETE);
} }
vtkUnsignedCharArray *Array = vtkUnsignedCharArray::New();
Array->SetName(arrayName);
Array->SetArray(vals, npoints, 0,
vtkUnsignedCharArray::VTK_DATA_ARRAY_DELETE);
grid->GetPointData()->AddArray(Array); grid->GetPointData()->AddArray(Array);
Array->Delete(); Array->Delete();
...@@ -2805,18 +2806,19 @@ void vtkDistributedDataFilter::AddConstantUnsignedCharPointArray( ...@@ -2805,18 +2806,19 @@ void vtkDistributedDataFilter::AddConstantUnsignedCharPointArray(
void vtkDistributedDataFilter::AddConstantUnsignedCharCellArray( void vtkDistributedDataFilter::AddConstantUnsignedCharCellArray(
vtkUnstructuredGrid *grid, const char *arrayName, unsigned char val) vtkUnstructuredGrid *grid, const char *arrayName, unsigned char val)
{ {
vtkUnsignedCharArray *Array = vtkUnsignedCharArray::New();
Array->SetName(arrayName);
vtkIdType ncells = grid->GetNumberOfCells(); vtkIdType ncells = grid->GetNumberOfCells();
if (ncells)
unsigned char *vals = new unsigned char [ncells];
if(ncells)
{ {
unsigned char *vals = new unsigned char [ncells];
memset(vals, val, ncells); memset(vals, val, ncells);
Array->SetArray(vals, ncells, 0, vtkUnsignedCharArray::VTK_DATA_ARRAY_DELETE);
} }
vtkUnsignedCharArray *Array = vtkUnsignedCharArray::New();
Array->SetName(arrayName);
Array->SetArray(vals, ncells, 0, vtkUnsignedCharArray::VTK_DATA_ARRAY_DELETE);
grid->GetCellData()->AddArray(Array); grid->GetCellData()->AddArray(Array);
Array->Delete(); Array->Delete();
......
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