[vtkusers] traversing cellArray crashes ... ???

Marcel Weiss mweiss at cbs.mpg.de
Sun Jul 5 12:17:35 EDT 2009


Dear users,

i´ve problems traversing a vtkCellArray (lines) containing polygonal lines of an vtkPolyData object (input). (see code below!!!)

Although links and cells were built and update() was called the result of GetTraversalLocation() might exceed the limit of "nLines".

The polydata was created by streamling through an scalar image.

What might go wrong and WHY?!

Thanks a lot
Marcel


...
input = xmlPolyReader -> GetOutput();
input -> BuildCells();
input -> BuildLinks();
input -> UpdateInformation();
input -> Update();
...
vtkIdType     nLines= input -> GetNumberOfLines();
vtkCellArray* lines = input -> GetLines();

bool use_profile[nLines];

lines -> InitTraversal();		
while (lines -> GetNextCell(anz, line_points)){
	location = lines -> GetTraversalLocation();
	use_profile[location] = true;   // SIGSEGV possible !!! WHY?
        ...
}



Marcel Weiss
PhD student
Department of Neurophysics
Max Planck Institute for Human Cognitive and Brain Sciences 



More information about the vtkusers mailing list