I know this question is raised before but I still cannot find definite answer how to use hardwareselector.
I’m using ActiViz 9.2 and have the same problem discussed here
How to select a hexahedral cell using HardwareSelector.
I’m using vtkgeometryfilter to triangulate unstructured grids and I do set PassThroughCellIdsOn() in order to preserve original cell id, but vtkSelectionNode always returns the ID of the triangle used to represent faces of the hexahedral or polyhedral cell. Here use the peace of the code I have so far.
vtkHardwareSelector hs = vtkHardwareSelector.New();
hs.SetRenderer(renderer);
hs.SetFieldAssociation(1);
hs.SetArea((uint)pos[0], (uint)pos[1], (uint)(pos[0]+1), (uint)(pos[1])+1);
vtkSelection selection = hs.Select();
vtkSelectionNode SelectionNode = selection.GetNode(0);
Previously I was using vtkStaticCellLocator this works fine hexahedral cells, but in case of polyhedral cell type, cell picking is very sketchy and inaccurate. The same issue is with vtkCellPicker
I tested the same polyhedral unstructured grid in ParaView and as expected works perfectly.
Can anybody please share ideas how they do it or is that heavily guarded secret.
Thanks in advance.
MK