How to get the id of points after append filter?

Hello!

I have dataset of composite type, and in order to use my algorithms which work wih Unordered grid, I use vtkAppendFilter. However, I also need some points ids which are stored in scalar in each of the datasets, and are present in appended dataset also, but I dont know how to map these old IDs to the new dataset

Help me very please, I ve spent many days and still have not found out how to do this

Thanks!

Hello,

If I understood it right, you can’t. Those IDs are actually indexes like an array’s indexes. Normally, you can only access the original dataset IDs by previously storing them a scalar field like you did and query the original ID values later.

best,

PC

Hello,

If you don’t want point merging, why not use vtkGroupDataSets to generate a vtkPartitionedDataSetCollection?

Otherwise, add another scalar array for all your datasets which denotes the dataset index, use a name like “DataSetId”. After that, apply VTK: vtkGenerateGlobalIds Class Reference on each input dataset. That algorithm adds a new “GlobalPointIds” array with point IDs. Then add all those into vtkAppendFilter. One thing to note is that you cannot rely upon vtkAppendFilter to merge coincident points if MergePoints is on and the inputs have the “GlobalPointIds”.

Use at the “DataSetId” and the “GlobalPointIds” array to map points on the output back to a point in the input dataset.