Hello vtk-Experts,
I’ve encountered yet another interesting problem. For a few years I have been developing an in-house tool using vtk and PyQt5. Currently I do not have a working minimal example, but I will build one if this query does not lead to anything.
My setup is the following: I am using a render viewport to display a box actor. It is a vtkCubeSource internally, coupled with a vtkBoxWidget, so the user can interact with the box the same way users can interact with a clip box in Paraview. I use a boxCallBack just as shown in the python examples at the vtk website. The callback function not only updates the vtkCubeSource but additionally sends the updated bounds of the box to another part of the UI where the numbers are put into QLineEdits. I want the user to be able to adjust the box visually as well as by the numbers in the QLineEdits. Next to the LineEdits, there is a button to update the visuals in the 3d-viewer, to hit by the user when he changed the bounds in the LineEdits (that circular arrow button).
My problem is: visually changing the BoxWidget works perfectly fine and it writes the correct bounds into the QLineEdits. Howevery, even when not manually changing the input, hitting the update button, leads to wrong display of the region, specifially the vtkCubeSource display (in blue) is off, while the BoxWidget remains correctly positioned. When again using one of the handles, the display of the vtkCubeSource jumps back into place.
I have already verified that the bounds send back and fourth are identical, so at no point the vtkCubeSource receives different data than the one shown. When hitting the button, the same bounds values are sent to the CubeSource via the .SetBounds() Method, while vtkBoxWidget is updated via its .PlaceWidget() method.
I am out of ideas why the CubeSource is off after updating and open for any suggestions. Currently the application is running on vtk 9.2.6 because I had issues migrating to a more recent release. My best guess right now is, that this is a bug and I need to get the latest version. However I’d like your opinion first to not waste time hunting down the problems I had migrating.
I have attached a gif of the process.