[vtkusers] Java SIGSEGV with vtkDataArray setNumberOfComponents

Sebastien Jourdain sebastien.jourdain at kitware.com
Mon Jun 6 08:59:56 EDT 2011


Hi Romain,

You can not create an abstract class (new vtkDataArray()). You have to
create a DataArray with a given type, such as vtkDoubleArray.

Seb

On Mon, Jun 6, 2011 at 8:49 AM, Leguay Romain
<romain.leguay at etu.u-bordeaux1.fr> wrote:
> 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
> _______________________________________________
> 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