Say I have a vtp file which contains 100 points (and vertices). I know how to add a vector of the same length with information about each point, but is there a way to add just a single integer or double or something? For example, if I want to know this was the 4th file, I would want to store FileIndex=4 in the file. If I add a vtkIntArray with only one element, paraview gets mad when I open the file because that array is not the same length as the point array.<br>
<br>This is what I was doing:<br>vtkSmartPointer<vtkIntArray> FileIndex = vtkSmartPointer<vtkIntArray>::New();<br> FileIndex->SetNumberOfComponents(1);<br> FileIndex->SetName("FileIndex");<br>
FileIndex->InsertNextValue(4);<br> pdata->GetPointData()->AddArray(FileIndex);<br><br>What I want to do would be something like this:<br> pdata->AddData("FileIndex")->AddValue(4); //this is not valid VTK syntax<br>
<br>Is there any way to do this?<br><br clear="all">Thanks,<br><br>David<br>