Bug in vtkCellArray::WritePointer function
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
In vtkCellArray::WritePointer function the InsertLocation member variable is becoming zero. After using WritePointer function if user use vtkCellArray::GetInsertLocation, it is giving incorrect location as InsertLocation is not getting updated.
I got this issue when I was using output of vtkAppendPolyData. I am inserting new linked polys using vtkPolyData::InsertNextLinkedCell. While using this API the cells are not getting updated correctly and because of which I was getting issues in my algorithm which is based on topological information.
I have modified function vtkCellArray::WritePointer and everything is working fine. Following is the modified code of the function
inline vtkIdType vtkCellArray::WritePointer(const vtkIdType ncells, const vtkIdType size) { this->NumberOfCells = ncells; this->TraversalLocation = 0; vtkIdType pIdArray = this->Ia->WritePointer(0,size); this->InsertLocation = this->Ia->GetMaxId() + 1; return pIdArray; }