[vtkusers] What to use: 'vtkDataArray' or 'vtkDoubleArray'?

B. C. butterfly.1688 at yahoo.fr
Mon Oct 27 06:41:17 EDT 2008


Hi everyone.
I want to save the values of the points of a polydata in an array and then access to each one. I used this:
 
double curveValue;
vtkDoubleArray *myArray;
for (int i=0; i<myPolydata->GetNumberOfPoints(); i++)
{
  myArray[i] = myPolyData->GetPoints()->GetPoint(i); 
  curveValue = myArray->GetValue(i);
}
 
I have this error:
binary '=' : no operator defined which takes a right-hand operand of type 'double *' 
 
When i change the array type to 'vtkDataArray', i have this code:
double *curveValue;
vtkDataArray *myArray = myPolyData->GetPoints()->GetData(); 
for (int i=0; i<myPolyData->GetNumberOfPoints(); i++)
{
  curveValue = myArray->GetTuple(i);
}
 
I have no more errors, but when i run the program, i have a bug and the cursor indicates this line:
vtkDataArray *myArray = myPolyData->GetPoints()->GetData(); 

 
I don't understand any one of the 2 error cases!!!
Please, can someone tell me what type of array should i use? and how to rectify the code 
to have no more errors?
 
Thank you for you help


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081027/d5c2d578/attachment.htm>


More information about the vtkusers mailing list