[vtkusers] SetArray const'ness

Nico Schlömer nico.schloemer at gmail.com
Sat Nov 21 16:13:44 EST 2009


Hi,

I'm trying to get some data printed to a VTK file, and in the process of 
generating it I'm using a vtkDoubleArray to pass the data to the writer 
(e.g., vtkStructuredPointsWriter). Now, what confuses me is the fact 
that the array, as set by

      double* array = // [...];
      vtkDoubleArray * scalars = vtkDoubleArray::New();
      scalars->SetArray( array, size, save );
      spData->GetPointData()->SetScalars(scalars);
[...]
      writer->SetInput(spData);

is non-const, although there's actually just data by be written, not 
modified in any form.

Does anyone know of a const equivalent for the above?

Cheers,
Nico



More information about the vtkusers mailing list