Example #1
0
    def change(self):
        _infoer.function = str(self.change)
        _infoer.write("")
        # add asker
        msgBox = QtWidgets.QMessageBox(Application.vrpApp.mw)
        msgBox.setWindowTitle(self.__tr("Save changed viewpoint"))
        msgBox.setText(
            self.__tr("Do you want to save this view for the viewpoint?"))
        msgBox.setStandardButtons(QtWidgets.QMessageBox.Save
                                  | QtWidgets.QMessageBox.Cancel)
        msgBox.setDefaultButton(QtWidgets.QMessageBox.Save)
        acceptedOrRejected = msgBox.exec_()
        if acceptedOrRejected == QtWidgets.QMessageBox.Save:
            # take eighter current key or if selection in list is disabled use the latest
            key = -1
            if self._currentKey != -1:
                key = self._currentKey
            elif self.lastKey != -1:
                key = self.lastKey

            if key > -1:
                # get COVER id
                id = ObjectMgr().getParamsOfObject(key).id
                msg = coGRChangeViewpointMsg(id)
                covise.sendRendMsg(msg.c_str())
Example #2
0
    def change(self):

        # for change viewpoint send msg to COVER with ViewpointID
        # get COVER id of viewpoint for message
        id = -1
        for key, param in self.params.status.items():
            # viewpoints have parameter 'view', the viewpoint connected to this step is visible
            if hasattr(param, 'view') and hasattr(
                    param, 'isVisible') and param.isVisible == True:
                id = param.id
        # send ChangeViewpointMsg
        if id != -1:
            msg = coGRChangeViewpointMsg(id)
            covise.sendRendMsg(msg.c_str())

        # find the number of all keys
        numkeys = len(globalKeyHandler().getAllElements())
        if numkeys < 1:  # if that goes wrong, use only the keys in this step
            numkeys = self.key

        # walk through all keys, even if they are not allready in the step
        for key in range(numkeys):
            obj = globalKeyHandler().getObject(key)
            if obj:
                if not hasattr(obj.params, 'view') and objIsRelevant(obj):
                    self.params.status[key] = CopyParams(obj.params)
Example #3
0
    def change(self):

        # for change viewpoint send msg to COVER with ViewpointID
        # get COVER id of viewpoint for message
        id = -1
        for key, param in self.params.status.items():
            # viewpoints have parameter 'view', the viewpoint connected to this step is visible
            if hasattr(param, 'view') and hasattr(param, 'isVisible') and param.isVisible == True:
                id = param.id
        # send ChangeViewpointMsg
        if id != -1:
            msg = coGRChangeViewpointMsg( id )
            covise.sendRendMsg(msg.c_str())

        # find the number of all keys
        numkeys = len(globalKeyHandler().getAllElements())
        if numkeys <1: # if that goes wrong, use only the keys in this step
            numkeys = self.key

        # walk through all keys, even if they are not allready in the step
        for key in range(numkeys):
            obj = globalKeyHandler().getObject(key)
            if obj:
                if not hasattr(obj.params, 'view') and objIsRelevant(obj):
                    self.params.status[key] = CopyParams(obj.params)
Example #4
0
    def change(self):
        _infoer.function = str(self.change)
        _infoer.write("")
        # add asker
        msgBox = QtWidgets.QMessageBox(Application.vrpApp.mw)
        msgBox.setWindowTitle(self.__tr("Save changed viewpoint"))
        msgBox.setText(self.__tr("Do you want to save this view for the viewpoint?"))
        msgBox.setStandardButtons(QtWidgets.QMessageBox.Save | QtWidgets.QMessageBox.Cancel)
        msgBox.setDefaultButton(QtWidgets.QMessageBox.Save)
        acceptedOrRejected = msgBox.exec_()
        if acceptedOrRejected == QtWidgets.QMessageBox.Save:
            # take eighter current key or if selection in list is disabled use the latest
            key = -1
            if self._currentKey != -1:
                key = self._currentKey
            elif self.lastKey != -1:
                key = self.lastKey

            if key > -1:
                # get COVER id
                id = ObjectMgr().getParamsOfObject(key).id
                msg = coGRChangeViewpointMsg( id )
                covise.sendRendMsg(msg.c_str())