Skip to content

Loading meshes interactively with PyQt #1185

Answered by marcomusy
CorpsSansOrganes asked this question in Q&A
Discussion options

You must be logged in to vote

You probably just need to reset the camera.. Check out this example:

import sys
import numpy as np
from PyQt5 import Qt
from vtk.qt.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor
from vedo import Plotter, Sphere, Cone, printc

class MainWindow(Qt.QMainWindow):

    def __init__(self, parent=None):

        Qt.QMainWindow.__init__(self, parent)
        self.frame = Qt.QFrame()
        self.layout = Qt.QVBoxLayout()
        self.vtkWidget = QVTKRenderWindowInteractor(self.frame)

        # Create renderer and add the vedo objects and callbacks
        self.plt = Plotter(qt_widget=self.vtkWidget)
        self.id1 = self.plt.add_callback("mouse click", self.onMouseClick)
        s…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@CorpsSansOrganes
Comment options

Answer selected by CorpsSansOrganes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants