Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

methods of QtInteractor #17

Open
andrea-bistacchi opened this issue Jun 16, 2020 · 8 comments
Open

methods of QtInteractor #17

andrea-bistacchi opened this issue Jun 16, 2020 · 8 comments

Comments

@andrea-bistacchi
Copy link

Hello, I'm testing some methods of QtInteractor from the new spin-off pyvistaqt library.

BTW, it is more clear to have it in a dedicated library. Thanks!

First I create a plotter widget in a Qt QMainWindow created with Qt Designer:

class View3D(QMainWindow, Ui_ThreeDWindow):
    def __init__(self, parent=None, *args, **kwargs):
        super(View3D, self).__init__(parent, *args, **kwargs)
        self.setupUi(self)
        self.plotter = QtInteractor(self.ViewFrame)
        self.ViewFrameLayout.addWidget(self.plotter.interactor)

Then I am able to add some actor and everything works very well!

self.plotter.add_mesh(<vtk_object>, name=<vtk_object_name>)

However some of the methods inherited from BasePlotter() crash the application.

Tested working:
self.plotter.show_axes_all()
self.plotter.hide_axes_all()
self.plotter.add_bounding_box()
self.plotter.show_bounds()
self.plotter.show_grid()
self.plotter.add_floor()
self.plotter.add_scalar_bar()

Tested crashing:
self.plotter.add_orientation_widget()
self.plotter.add_toolbars()
self.plotter.add_menu_bar()
self.plotter.add_legend()
self.plotter.default_camera_tool_bar()

@GuillaumeFavelier
Copy link
Contributor

Hi @bistek, thanks for doing this manual testing and I'm surprised by the outcome. I think it could be a good idea to have automatic testing for this then once it is fixed.

Among the methods crashing, add_toolbars() and add_menu_bar() are not inherited from BasePlotter. Also AFAIK, default_camera_tool_bar is not a function.

@akaszynski
Copy link
Member

Looks like we indeed need to add automated testing for this. Thanks for discovering this!

@andrea-bistacchi
Copy link
Author

I'm happy to help, if I can. Actually YOU are the one who are doing a great job for the community!

@dominicjtriana
Copy link

I made another issue but I would add:
self.plotter.disable_eye_dome_lighting() throws errors but doesn't crash. There are some negative visual artifacts as well.

@condoratberlin
Copy link

Hi, I goning to embedd pyvistaqt in an gui framework an discovered some similar problems.
Especially add_toolbars() requires a self.app_window attribute, were the mainwindow is stored, but the pyvista QtInteractor don't allow to set such a parameter to the init method.

@GuillaumeFavelier
Copy link
Contributor

I agree with @condoratberlin in here, the add_toolbars() and add_menu_bar() functions depends on app_window internally. Those should not be declared as QtInteractor methods.

I see two ways to deal with this at the moment:

  1. Just move those 2 to BackgroundPlotter (that's where they are used after all)
  2. Find a way to refactor the functions to make them useful to QtInteractor (requires Qt gymnastics)

About EDL, this was fixed in pyvista/pyvista#1113

@GuillaumeFavelier
Copy link
Contributor

Option 1 was implemented in #78

@GuillaumeFavelier
Copy link
Contributor

As of now, is there any confusion about the methods of QtInteractor?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants