[vtkusers] Java SIGSEGV with vtkDataArray setNumberOfComponents

Leguay Romain romain.leguay at etu.u-bordeaux1.fr
Mon Jun 6 08:49:46 EDT 2011


Hello everyone,
I try to do a CGNS reader for vtk. Actually, I manage to read the data (points and cells) and put it inside a vtkDataSet (unstructured grid or polydata). I manage to read attributes from a cgns file but when I try to put the data inside a vtkDataArray, I have a Sigsegv error.

It's my code example:

double[] attributesData = getAttributesData(attributeName); // OK

vtkDataArray array = new vtkDataArray();
array.SetNumberOfComponents(cellDim); //cellDim = 1, 2 or 3 but I obtain a SigSegv
if (cellDim == 3) {
   int currentPos = 0;
   while(attributesData.lenght > currentPos) {
      vDataArray.InsertNextTuple3(attributesData[currentPos], attributesData[currentPos+1], attributesData[currentPos+2])
      currentPos +=3;
   }
}


I don't understand why I have got some sigSegv errors when I do SetNumberOfComponents...

Has anyone got any ideas?

Thanks,
Romain



More information about the vtkusers mailing list