[vtk-developers] Problem in derived class

Martin Waitzbauer mazzok at gmx.at
Mon Dec 20 17:54:57 EST 2010


Hello

Im still quite new to VTK; but i hope you can help me on that

i wrote a vtkClass derived from vtkRenderView, creating a 2d plot Rendering
When filling the vtkTable with values, an error occurs in the following code

void vtkContextView2::SetGaussDataColumn(double variance){

	  vtkSmartPointer<vtkFloatArray> arrC =vtkSmartPointer<vtkFloatArray>::New();
	  this->Table->AddColumn(arrC);
	  int column = Table->GetNumberOfColumns();
	  for(int i =0; i < 512;i++){
		  double gauss =  some double
		  this->Table->SetValue(i,0,gauss);      <--- ERROR
		 
	  }
	  vtkPlot *line = this->chart->AddPlot(vtkChart::LINE);
	  line->SetInput(this->Table, 0, 0);
      line->SetColor(0, 255, 0, 255);
      line->SetWidth(1.0);
}
THe Error shows an unexpected handling and acces violation ( i was not able to get a proper errormessge via try/catch)
but i could see on the console that the loop is broken if i == 0, so something seems not to be right with teh initiation of Table maybe?
this->Table is an vtkTable, initialized in the constructor, and there set also to
	this->Table->SetNumberOfRows(512);
so it should be there, or?

i call this metod once on the object from a main method, thats why for the line->SetInput(this->Table, 0, 0); and this->Table->SetValue(i,0,gauss)

I dont really see what the problem could be, maybe your experienced eyes can do better?
Thanks!

Regards,Maz
-- 
GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt auch mit 
gratis Notebook-Flat! http://portal.gmx.net/de/go/dsl



More information about the vtk-developers mailing list