Beispiel #1
0
    def __init__(self,
                 mainWindow,
                 viewportMngr,
                 vpType,
                 prototypeMngr,
                 isViewport=False,
                 parent=None):
        """ Initialization of the CompositionView class
			
		Parameters:
			mainWindow - main window of the application, necessary for updating
			viewportMngr - the manager of the viewports where the composition view can reside in
			vpType - type of this view
			prototypeMngr - the manager of the prototypes is used to obtain the results of the solver
			parent - parent of this dialog
		"""
        QtGui.QDialog.__init__(self, parent)
        self.mainWindow = mainWindow
        self.prototypeManager = prototypeMngr
        self.viewportManager = viewportMngr
        self.setWindowFlags(QtCore.Qt.Window)
        self.ui = Ui_SolutionView()
        self.ui.setupUi(self)
        self.settings = Settings()

        self.solutionWidget = SolutionGLViewport(
            self, ViewportType.SOLUTION, None,
            QtOpenGL.QGLFormat(QtOpenGL.QGL.SampleBuffers), self)
        self.solutionWidget.gridVisible = False
        self.ui.vboxlayout.addWidget(self.solutionWidget, 200)

        self.updateAction = UpdateActionCommand(self.getMainWindow())
        self.isViewport = isViewport
        self.solutionObjects = []

        if not self.isViewport:
            self.moveActive = False
            self.zoomActive = False
            self.rotateActive = False
            self.createTriggers()
        else:
            self.removeInterfaceItems()

        self.createSolution()