[vtkusers] vtkXMLUnstructuredGridReader withe large number of cells + cell data causes exception

Nathan__ reeves_nathan at hotmail.com
Wed Jul 14 03:13:22 EDT 2010


I am having some problems reading in a moderatly  sized data set.  The
exception is thrown by 
int GetNumberOfComponents() { return this->NumberOfComponents; }
in vtkabstractarray.h

With the cause being Access Violation.

The problem occurs when I add extra data arrays.  At 5 per cell, it works
fine. When I increase it throws an exception.

Are there some upper limits on how many data array elements I can use ? Do I
need to allocate any memory anywhere ? I have tried increaseing the stack
size just in case, but no luck here. My reading code is pretty standard I
think. It crashes during the reader->update().


int main( void)
{
  // Standard rendering classes
  vtkRenderer *renderer = vtkRenderer::New();
  vtkRenderWindow *renWin = vtkRenderWindow::New();
  renWin->AddRenderer(renderer);
  vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
  iren->SetRenderWindow(renWin);
  // Load the mesh geometry and data from a file
  vtkXMLUnstructuredGridReader *reader =
vtkXMLUnstructuredGridReader::New();
  reader->SetFileName( "data.vtu" );
  

  // Force reading
  reader->Update();
	
  vtkDataSetMapper *mapper = vtkDataSetMapper::New();
  mapper->SetInput(reader->GetOutput());
  
   vtkActor *actor = vtkActor::New();
  actor->SetMapper(mapper);
  renderer->AddActor(actor);
  
  // Standard testing code.
  renderer->SetBackground(0.5,0.5,0.5);
  renWin->SetSize(300,300);
  renWin->Render();
    iren->Start();
  // Cleanup
  
  renderer->Delete();
  renWin->Delete();
  iren->Delete();
  mapper->Delete();
  actor->Delete();

  return 1;
}

Thanks
-- 
View this message in context: http://old.nabble.com/vtkXMLUnstructuredGridReader-withe-large-number-of-cells-%2B-cell-data-causes-exception-tp29158751p29158751.html
Sent from the VTK - Users mailing list archive at Nabble.com.




More information about the vtkusers mailing list