Hi,<br><br>I'm currently trying to plot the output of a vtkProbeFilter with the new chart API using a vtkDataObjectToTable filter and I'm having difficulties getting a vtkTable that will be accepted by the plotter. I get errors like:<br>
<br>ERROR: In /home/marc/tmp/vtk/VTK/Filtering/vtkAlgorithm.cxx, line 460<br>vtkContextMapper2D (0xd0d630): Attempt to get an input array for an index that has not been specified<br><br>ERROR: In /home/marc/tmp/vtk/VTK/Charts/vtkPlotPoints.cxx, line 600<br>
vtkPlotLine (0xcf9ca0): No Y column is set (index 1).<br><br>ERROR: In /home/marc/tmp/vtk/VTK/Filtering/vtkAlgorithm.cxx, line 460<br>vtkContextMapper2D (0xd0d630): Attempt to get an input array for an index that has not been specified<br>
....<br><br>The code looks like this: <br>// Convert the polydata to a vtkTable using points data<br>mPath->toTable = vtkDataObjectToTable::New();<br>mPath->toTable->SetInputConnection(mProbeFilter->GetOutputPort());<br>
mPath->toTable->SetFieldType(vtkDataObjectToTable::POINT_DATA);<br>mPath->toTable->Update();<br><br>// Test<br>vtkTable *table = mPath->toTable->GetOutput();<br>qDebug() << table->GetNumberOfColumns(); // returns 2<br>
qDebug() << table->GetNumberOfRows(); // returns 6<br>qDebug() << table->GetValue(0, 0).GetTypeAsString(); // returns: "short"<br>qDebug() << table->GetValue(0, 1).GetTypeAsString(); // returns: "char" <-- weird?!<br>
<br>mPath->view = vtkContextView::New();<br>mPath->view->GetRenderer()->SetBackground(0.5, 0.5, 0.5);<br> <br>mPath->chartxy = vtkChartXY::New();<br>mPath->view->GetScene()->AddItem(mPath->chartxy);<br>
vtkPlot* line = mPath->chartxy->AddPlot(vtkChart::LINE);<br>line->SetUseIndexForXSeries(true);<br>line->SetInput(mPath->toTable->GetOutput());<br>line->SetColor(0.0, 255, 0.0, 255);<br>line->SetWidth(1.0);<br>
<br>FYI: The old XYPlot actor was working correctly with the same probe filter input.<br><br>So my question is: What am I doing wrong here? Also, is there an example somewhere showing how to correctly use a vtkProbeFilter and the new charting API?<br>
<br>Regards,<br><br>Marc<br>