View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014034VTK(No Category)public2013-04-25 04:302013-10-24 11:58
Reportersantosh 
Assigned ToDan Lipsa 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionunable to reproduce 
PlatformOSOS Version
Product Version5.10.0 
Target VersionFixed in Version 
Summary0014034: Bug in vtkCellArray::WritePointer function
DescriptionIn 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;
}
Additional InformationIndeed vtkCellArray::WritePointer resets the InsertLocation member variable. While this decision can be questioned, it is not necessary a bug.
Changing this behavior, might cause problems for other code that depends on it.

Please provide us with more information if you have a test case where this causes problems in VTK.

Note that you can use vtkPolyData::InsertNextCell (without calling WritePointer) to insert cells beyond the original number of allocated cells as this takes care of the reallocation and also maintains the InsertLocation variable correctly.
TagsNo tags attached.
ProjectTBD
Typeincorrect functionality
Attached Files

 Relationships

  Notes
(0031049)
Dave DeMarle (administrator)
2013-06-25 12:08

Would you please submit the patch in the form of a gerrit topic to facilitate automated testing and review?
For details on how to do so see http://www.vtk.org/Wiki/VTK/Git/Develop [^]
Please also provide code that exercises the fault.

 Issue History
Date Modified Username Field Change
2013-04-25 04:30 santosh New Issue
2013-06-25 12:08 Dave DeMarle Note Added: 0031049
2013-10-21 13:39 Dan Lipsa Assigned To => Dan Lipsa
2013-10-21 13:39 Dan Lipsa Status backlog => tabled
2013-10-21 14:18 Dave DeMarle Status tabled => backlog
2013-10-24 11:58 Dan Lipsa Status backlog => closed
2013-10-24 11:58 Dan Lipsa Resolution open => unable to reproduce
2013-10-24 11:58 Dan Lipsa Additional Information Updated


Copyright © 2000 - 2018 MantisBT Team