<P>Hi,</P>
<P>I have problems accessing the vtkDataArray class instance in my program. <BR>I have a structured Grid data file that I read with the help of the vtkStructuredGridReader class. The points in the file are of type double. <BR>I want to copy some of the points from the vtkDoubleArray, ( I presume that the (x,y,z) point coordinates are stored after structuredGridReader reads the file), into my own double array. <BR><BR>It looks like it is possible to get points of type float or int using the code below but there is no method that returns points of type double.<BR><BR>****<BR>        vtkStructuredGridReader *reader = vtkStructuredGridReader::New();<BR> reader->SetFileName("../../../vtk32/java/frame51.vtk");<BR> reader->SetScalarsName("sc2");<BR> reader->Update();<BR>        vtkStructuredGrid *structGrid = vtkStructuredGrid::New();<BR>         structGrid = reader->GetOutput();</P>
<P> structGrid->GetPoint (vtkIdType ptId, float p[3]); // some variable ptId .<BR><BR></P>
<P> I want to get type double points that I initially had on the file. Is there a way to do this ? ( I want to use the StructuredGridReader object so that I can get the structuredGrid that I intend to use for finding cell connectivity later ). <BR><BR>I tested using the ReadArray(const char* dataType, int numTuples, int numComponents) in the vtkDataReader class but the method seems to dump core.<BR><BR>The code is given below. If anyone knows a way to get the point coordinates as type double, please let me know.<BR></P>
<P>Thanks in advance for any help.<BR><BR>Regards,<BR>Joseph.<BR><BR>*************************************************<BR><BR>        vtkStructuredGridReader *reader = vtkStructuredGridReader::New();<BR>        <BR> reader->SetFileName("../../../vtk32/java/frame51.vtk");<BR> reader->SetScalarsName("sc2");<BR> reader->Update();<BR>        vtkStructuredGrid *structGrid = vtkStructuredGrid::New();<BR> structGrid = reader->GetOutput();<BR>                 <BR>        int dimensions[3];<BR>         structGrid->GetDimensions(dimensions);<BR>         static int totalPoints = 1;<BR>         for(int i=0; i<3; i++)<BR>         totalPoints = totalPoints * dimensions[i];<BR><BR> cout << "total Points is " << totalPoints <<endl;<BR><BR>        vtkDataArray *dataArray;<BR><BR>        dataArray = vtkDoubleArray::New();<BR>                 <BR>        dataArray = reader->ReadArray("double", totalPoints, 3);<BR></P><p><br><hr size=1><b>Do You Yahoo!?</b><br>
<a href="http://rd.yahoo.com/welcome/*http://fifaworldcup.yahoo.com/fc/en/spl">Sign-up for Video Highlights</a> of 2002 FIFA World Cup