Adding Image/Polydata in HyperTreeGrid

I am reaching out to ask for some help with CxxHyperTreeGridExample/FEAdaptor.cxx example.

I am new to the hyper grid topic and like to know that how can I use my points from image or polydata to create the hyper tree grid. By looking at the code, it looks like I need to first create a new array of my points in FillHTG() as the author did for Levels and Ids, and then in AddData() insert points at idx if the cursor is a leaf, maybe?

Kindly point me in the right direction if this would be the correct way to add polydata/image points in the hyper tree? My goal is to convert to this filled hypertree grid to an unstructured grid.

HyperTreeGrids (htgs) are under heavy code refactoring. When everything is clean and stable, we’ll add some examples. As for now, you can look at how the htgs are being created from scratch in a plugin of ParaView. Look for vtkResampleToHyperTreeGrid.cxx in the master branch, and in particular at method vtkResampleToHyperTreeGrid::GenerateTrees.

I can also point you to a code example I posted here.

In short, you need to initialize a cursor that allows you to subdivide htg leaves and recursively walk in the trees. You can get a global index from the cursors that you can map to you scalar fields (see vtkResampleToHyperTreeGrid::SubdivideLeaves for an example).

If you need any more help to get started, please let me know, I’ll be happy to help.