<div><span class="Apple-tab-span" style="white-space:pre">I</span> get an vtkIdTypeArray called "ids" like this:</div><div><br></div><div>vtkIdTypeArray* ids;</div><div>ids = vtkIdTypeArray::SafeDownCast(selectedGraph->GetVertexData()->GetArray("vtkIdFilter_Ids"));</div>
<div><br></div><div>Then I check that it is valid:</div><div><br></div><div>if(!ids)</div><div> break;</div><div><br></div><div>Then I check that it has the correct number of tuples:</div><div><br></div><div>std::cout << "ids has " << ids->GetNumberOfTuples() << " tuples." << std::endl;</div>
<div> </div><div>Then I try to get a value from it:</div><div> </div><div> for(vtkIdType i = 0; i < ids->GetNumberOfTuples(); i++)</div><div> {</div><div> vtkIdType id = ids->GetValue(i); //segfault occurs here</div>
<div><br></div><div>but a segfault occurs where indicated above.</div><div><br></div><div>Anyone know why this might happen? Or what other conditions to check before trying to access the data?</div><div><br></div>Thanks,<br>
<br>David<br>