[vtkusers] vtkDoubleArray[]...

Said. Said.El_Kasmi at sophia.inria.fr
Mon Oct 20 06:47:00 EDT 2003


Hi vtkusers,

In this method I instanciate an attay of vtkDoubleArray class.

  System.out.println(solution.length); ==> 8 OK.

The problem here is, when I try call a method on solution[counter]
object like this: 
solution[counter].SetNumberOfValues(nv);

I get a NullPointerException. Does any of you have an idea ?

Thanks.

private void initDataArray(int nv){
    solution = new vtkDoubleArray[NUMBER_OF_ARRAYS];
    System.out.println(solution.length);
    int counter = 0;
    String[] names = new
String[]{"Ex","Ey","Ez","||E||","Hx","Hy","Hz","||H||"};
    for(counter = 0; counter < NUMBER_OF_ARRAYS; counter++){
      solution[counter].SetNumberOfValues(nv);
      solution[counter].SetName(names[counter]);
    }
    for(counter=0; counter < nv;counter++){
      solution[counter].SetValue(counter,0);
    }
  }



More information about the vtkusers mailing list