<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><DIV>Thank you Michael for your help.</DIV>
<DIV>Can you tell me if i want to store the value of 'myArray-&gt;GetTuple(i,pt)' into a variable to make a test, waht type should i use?</DIV>
<DIV>&nbsp;</DIV>
<DIV>In fact, i want to do this:</DIV>
<DIV>if (this_value&lt;0) : delete the point(i) of the ploydata</DIV>
<DIV><BR><BR>--- En date de&nbsp;: <B>Lun 27.10.08, Michael Jackson <I>&lt;mike.jackson@bluequartz.net&gt;</I></B> a écrit&nbsp;:<BR></DIV>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(16,16,255) 2px solid">De: Michael Jackson &lt;mike.jackson@bluequartz.net&gt;<BR>Objet: Re: [vtkusers] What to use: 'vtkDataArray' or 'vtkDoubleArray'?<BR>À: butterfly.1688@yahoo.fr, vtkusers@vtk.org<BR>Date: Lundi 27 Octobre 2008, 13h24<BR><BR><PRE>vtkDoubleArray is a high level class that hides the actual array  
implementation.

What you probably want to do is this:
vtkDoubleArray* myArray=vtkDoubleArray::SafeDownCast(myPolyData- 
 &gt;GetPoints());
if (NULL == myArray)
{
        Error ....
}
vtkIdType nPoints = myArray-&gt;GetNumberOfTuples();
double pt[3];
for (vtkIdType i = 0; i &lt; nPoints; ++i)
{
     myArray-&gt;GetTuple(i,pt);
// Do something with pt.
}


The above code is from memory but should be pretty close.

If you really just want to access the data from the Data array then  
you can do the following:

vtkDoubleArray* myArray=vtkDoubleArray::SafeDownCast(myPolyData- 
 &gt;GetPoints());
if (NULL == myArray)
{
    Error...
}
double* pts = static_cast&lt;double*&gt;(myArray-&gt;GetVoidPointer());

That should get you a raw pointer to the data. So as long as you  
understand the how the data is stored in that pointer you can iterate  
over the pointer.

_________________________________________________________
Mike Jackson                  mike.jackson@bluequartz.net
BlueQuartz Software                    www.bluequartz.net
Principal Software Engineer                  Dayton, Ohio



On Oct 27, 2008, at 6:41 AM, B. C. wrote:

&gt; Hi everyone.
&gt; I want to save the values of the points of a polydata in an array  
&gt; and then access to each one. I used this:
&gt;
&gt; double curveValue;
&gt; vtkDoubleArray *myArray;
&gt; for (int i=0; i&lt;myPolydata-&gt;GetNumberOfPoints(); i++)
&gt; {
&gt;   myArray[i] = myPolyData-&gt;GetPoints()-&gt;GetPoint(i);
&gt;   curveValue = myArray-&gt;GetValue(i);
&gt; }
&gt;
&gt; I have this error:
&gt; binary '=' : no operator defined which takes a right-hand operand
of  
&gt; type 'double *'
&gt;
&gt; When i change the array type to 'vtkDataArray', i have this code:
&gt; double *curveValue;
&gt; vtkDataArray *myArray = myPolyData-&gt;GetPoints()-&gt;GetData();
&gt; for (int i=0; i&lt;myPolyData-&gt;GetNumberOfPoints(); i++)
&gt; {
&gt;   curveValue = myArray-&gt;GetTuple(i);
&gt; }
&gt;
&gt; I have no more errors, but when i run the program, i have a bug and  
&gt; the cursor indicates this line:
&gt; vtkDataArray *myArray = myPolyData-&gt;GetPoints()-&gt;GetData();
&gt;
&gt; I don't understand any one of the 2 error cases!!!
&gt; Please, can someone tell me what type of array should i use? and how  
&gt; to rectify the code
&gt; to have no more errors?
&gt;
&gt; Thank you for you help
&gt;
&gt; _______________________________________________
&gt; This is the private VTK discussion list.
&gt; Please keep messages on-topic. Check the FAQ at:
http://www.vtk.org/Wiki/VTK_FAQ
&gt; Follow this link to subscribe/unsubscribe:
&gt; http://www.vtk.org/mailman/listinfo/vtkusers

</PRE></BLOCKQUOTE></td></tr></table><br>