Quickly looking I am not sure whats wrong. In my code I cannot duplicate this kind of behavior. The lines you posted is exactly what you doing? If thats the case I don't know. <br><br>May be you can post a small program which reproduces this problem? <br>
<br>~Regards, <br>Aashish<br><br><br><br><div class="gmail_quote">On Tue, Mar 30, 2010 at 6:10 PM, David Doria <span dir="ltr"><<a href="mailto:daviddoria%2Bvtk@gmail.com">daviddoria+vtk@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On Tue, Mar 30, 2010 at 5:33 PM, Aashish Chaudhary<br>
<div class="im"><<a href="mailto:aashish.chaudhary@kitware.com">aashish.chaudhary@kitware.com</a>> wrote:<br>
</div><div class="im">> Hi David,<br>
><br>
> As I recall<br>
><br>
> Your AddArray() wont do anything.. because its the same array as before and<br>
> Reset does do much other than setting the MaxId to -1 (which means that you<br>
> will get NumberOfTuples to 0 when you query later)<br>
><br>
> vtkIdType GetNumberOfTuples()<br>
> {return (this->MaxId + 1)/this->NumberOfComponents;}<br>
><br>
> HTH,<br>
> Aashish<br>
<br>
</div>Hmmm. The reason I ask is that I have this code:<br>
<br>
cout << "There are " << g->GetNumberOfEdges() << " edges." << endl; //<br>
outputs 494<br>
cout << "There are " << weights->GetNumberOfTuples() << " weights." <<<br>
endl; //outputs 494<br>
<br>
g->GetEdgeData()->AddArray(weights);<br>
<br>
if(!vtkDoubleArray::SafeDownCast(g->GetEdgeData()->GetArray("Weights")))<br>
{<br>
cout << "No weights!" << endl;<br>
}<br>
else<br>
{<br>
cout << "g has " <<<br>
vtkDoubleArray::SafeDownCast(g->GetEdgeData()->GetArray("Weights"))->GetNumberOfTuples()<br>
<< " weights." << endl; //outputs 289 ??!!<br>
}<br>
<br>
It seems to me like the last output should be the same (494), no?<br>
<br>
Anyone know what could be going wrong?<br>
<br>
Thanks,<br>
<font color="#888888"><br>
David<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>| Aashish Chaudhary <br>| R&D Engineer <br>| Kitware Inc. <br>| <a href="http://www.kitware.com">www.kitware.com</a> <br>