<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> vtkSmartPointer<vtkTable> Table = vtkSmartPointer<vtkTable>::New();<br>
vtkSmartPointer<vtkVariantArray> Row =<br>
vtkSmartPointer<vtkVariantArray>::New();<br>
<br>
Row->SetNumberOfValues(3);<br>
//Row->SetNumberOfTuples(0);<br>
Row->SetValue(0, vtkVariant(1.0));<br>
Row->SetValue(1, vtkVariant(2.0));<br>
Row->SetValue(2, vtkVariant(3.0));<br>
<br>
Table->SetNumberOfRows(1);<br>
Table->SetRow(0, Row);<br>
//Table->InsertNextRow(Row);<br>
<br>
vtkstd::cout << "NumRows: " << Table->GetNumberOfRows() << vtkstd::endl;<br>
vtkstd::cout << "NumCols: " << Table->GetNumberOfColumns() << vtkstd::endl;<br>
<br>
Table->Dump(3);<br>
<br>
I get an error macro that says "Incorrect number of tuples in SetRow"<br>
<br>
Can anyone see what is wrong with that?<br>
</blockquote><div><br></div><div>A vtkTable is a collection of arrays (the columns). Each column has a specific type (there is no default), so currently you must explicitly add each column array. In this code, you have no columns when you call SetNumberOfRows(). Essentially you have created a 1-by-0 table. In the call to SetRow(), the number of elements in the row array (3) must match the number of columns in the table (0), so that is why you get an error. To make it work, you must add columns first, which may simply be empty arrays.</div>
<div><br></div><div>Jeff</div><div><br></div></div>