[vtkusers] CellData null pointer?

Brett Tully brett.tully at oxyntix.com
Mon May 14 14:05:32 EDT 2012


I have been staring at this for a while and could be making a really dumb
error, but can anyone explain why the last line segfaults please...? I am
guessing that I need to initialise something?

    vtkSmartPointer<vtkImageData> imageData
= vtkSmartPointer<vtkImageData>::New();
    imageData->SetExtent(0, 10, 0, 10, 0, 0);
    imageData->SetOrigin(0.0, 0.0, 0.0);
    imageData->SetSpacing(0.1, 0.1, 0.0);
    imageData->SetScalarTypeToDouble();
    vtkSmartPointer<vtkCellData> cellData = imageData->GetCellData();
    cout << cellData->GetNumberOfArrays() << endl;

Thanks,
Brett.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120514/b83c4aed/attachment.htm>


More information about the vtkusers mailing list