Well, I’d add bookkeeping code to the program. Whenever you create a vtkActor
/vtkMapper
alongside a vtkShader
in your scene-building code, you could add the two objects to some indexed STL container (using the vtkShader
pointers as key). So, when you get a vtkShader
via GetVertexShader()
, GetFragmentShader()
or GetGeometryShader()
via vtkShaderProgram
in your callback, simply query the index to find the corresponding vtkActor
/vtkMapper
. I know it’s dirty, but I couldn’t think of a better way to do what you want.
Edit: It’s not Python, it’s C++.