[vtkusers] Get Tuple of vtkDataArray
    Bayliss, Chris (Chicago) 
    cbayliss at gnresound.com
       
    Thu May 17 15:51:10 EDT 2012
    
    
  
I am trying to create a two column, 5 row dataset with vtkDataArray.
However, when I try to access the data in the second column, I get some
garble like: 05BCBE88.  Am I accessing the data incorrectly?  The data
from the first column is fine.
 
vtkDoubleArray * distvals = vtkDoubleArray::New();
distvals->SetNumberOfComponents(2);
distvals->SetName("distvals");
 
double dist = sqrt((points[0]-pathpoint[0])*(points[0]-pathpoint[0]) +
(points[1]-pathpoint[1])*(points[1]-pathpoint[1]) +
(points[2]-pathpoint[2])*(points[2]-pathpoint[2]));
 
distvals->InsertTuple2(i, dist, i);
 
for (vtkIdType c=0 ; c < 5 ; c++)
{
std::cout << "list: " << distvals->GetTuple1(c) << " , " <<
distvals->GetTuple2(c) << std::endl;
}
 
Why does GetTuple2(c) not return the data that was entered?  Is this a
simple conversion issue?  If so how would I convert that number for
output?
 
Thanks,
 
Chris
 
 
**** GN GROUP NOTICE - AUTOMATICALLY INSERTED **** 
The information in this e-mail (including attachments, if any) is considered confidential and is intended only for the recipient(s) listed above. Any review, use, disclosure, distribution or copying of this e-mail is prohibited except by or on behalf of the intended recipient. If you have received this email in error, please notify me immediately by reply e-mail, delete this e-mail, and do not disclose its contents to anyone. Any opinions expressed in this e-mail are those of the individual and not necessarily the GN group. Thank you. 
******************** DISCLAIMER END ************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120517/a2419306/attachment.htm>
    
    
More information about the vtkusers
mailing list