[vtkusers] Crashed on vtkDataArray::SetName(...)
Weiguang Guan
guanw at rhpcs.mcmaster.ca
Wed Feb 11 15:45:26 EST 2009
I used vtk 5.0.4. I've found that in vtkDataArray.h
virtual void SetNumberOfTuples (vtkIdType number)=0
But this pure virtual function is never defined in vtkFloatArray.h. How
could that be possbile!!! Why doesn't c++ compiler complain about this?
I'm confused!
Weiguang
On Wed, 11 Feb 2009, Weiguang Guan wrote:
> Can anyone tell me what's wrong with the following code section:
>
> // allocate the new scalars
> vtkDataArray* scalars = vtkDataArray::CreateDataArray(dataType);
> scalars->SetNumberOfComponents(numComponents);
>
> // allocate enough memory
> scalars->SetNumberOfTuples(numTuples);
> scalars->SetName("first");
>
> I got "Segmentation fault" when it executes scalars->SetName("first").
> dataType is VTK_FLOAT, numComponents = 1, numTuples = 6000000.
>
> Thanks.
>
> Weiguang
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
More information about the vtkusers
mailing list