Ejemplo n.º 1
0
 def takeSnapshot(self):
     _infoer.function = str(self.takeSnapshot)
     _infoer.write("")
     filename = ""
     if covise.coConfigIsOn("vr-prepare.ShowSnapshotDialog", True):
         directory = covise.getCoConfigEntry(
             "COVER.Plugin.PBufferSnapShot.Directory")
         if (directory == None):
             directory = "snapshot.png"
         else:
             directory = directory + "/" + "snapshot.png"
         filenameQt = QtWidgets.QFileDialog.getSaveFileName(
             self, self.__tr('Snapshot'), directory,
             self.__tr('Image (*.png)'), None,
             QtWidgets.QFileDialog.DontConfirmOverwrite)
         if filenameQt == "":
             return
         #filenameQt is filename + extension touple
         filename = filenameQt[0]
         print(filename)
         if not filename.lower().endswith(".png"):
             filename += ".png"
         if os.path.exists(filename):
             asker = ReallyWantToOverrideAsker(self, filename)
             decicion = asker.exec_()
             if decicion == QtWidgets.QDialog.Rejected:
                 self.statusBar().showMessage(
                     self.__tr('Cancelled overwrite of "%s"') % filename)
                 return
     msg = coGRSnapshotMsg(filename, "snapOnce")
     covise.sendRendMsg(msg.c_str())
Ejemplo n.º 2
0
 def takeSnapshot(self):
     _infoer.function = str(self.takeSnapshot)
     _infoer.write("")
     filename = ""
     if covise.coConfigIsOn("vr-prepare.ShowSnapshotDialog", True):
         directory = covise.getCoConfigEntry("COVER.Plugin.PBufferSnapShot.Directory")
         if (directory == None):
             directory = "snapshot.png"
         else:
             directory = directory + "/" + "snapshot.png"  
         filenameQt = QtWidgets.QFileDialog.getSaveFileName(
             self,
             self.__tr('Snapshot'),
             directory,
             self.__tr('Image (*.png)'),
             None,
             QtWidgets.QFileDialog.DontConfirmOverwrite)
         if filenameQt == "":
             return
         #filenameQt is filename + extension touple
         filename = filenameQt[0]
         print(filename)
         if not filename.lower().endswith(".png"):
             filename += ".png"
         if  os.path.exists(filename):
             asker = ReallyWantToOverrideAsker(self, filename)
             decicion = asker.exec_()
             if decicion == QtWidgets.QDialog.Rejected:
                 self.statusBar().showMessage( self.__tr('Cancelled overwrite of "%s"') % filename )
                 return
     msg = coGRSnapshotMsg( filename, "snapOnce" )
     covise.sendRendMsg(msg.c_str())
Ejemplo n.º 3
0
    def capture(self):
        if self.mode == 2:  # free capturing
            if not self.freeCapture:  # start capture and rename button to stop capture
                self.freeCapture = True
                self.widget().buttonCapture.setText(
                    coTranslate("Stop Free Capturing"))
                msg = coGRSnapshotMsg(self.filename, "startCapturing")
                covise.sendRendMsg(msg.c_str())
            else:  # stop capturing
                self.freeCapture = False
                self.widget().buttonCapture.setText(
                    coTranslate("Start Free Capturing"))
                msg = coGRSnapshotMsg(self.filename, "stopCapturing")
                covise.sendRendMsg(msg.c_str())

        elif self.mode == 0:  # turntable animation 10 sec
            if self.freeCapture:
                self.freeCapture = False
                msg = coGRSnapshotMsg(self.filename, "stopCapturing")
                covise.sendRendMsg(msg.c_str())
            msg = coGRSnapshotMsg(self.filename, "startCapturing")
            covise.sendRendMsg(msg.c_str())
            msg = coGRTurnTableAnimationMsg(10.0)
            covise.sendRendMsg(msg.c_str())
        else:  # turntable animation 20 sec
            if self.freeCapture:
                self.freeCapture = False
                msg = coGRSnapshotMsg(self.filename, "stopCapturing")
                covise.sendRendMsg(msg.c_str())
            msg = coGRSnapshotMsg(self.filename, "startCapturing")
            covise.sendRendMsg(msg.c_str())
            msg = coGRTurnTableAnimationMsg(20.0)
            covise.sendRendMsg(msg.c_str())
Ejemplo n.º 4
0
 def capture(self):    
     if self.mode == 2: # free capturing
         if  not self.freeCapture: # start capture and rename button to stop capture
             self.freeCapture = True
             self.widget().buttonCapture.setText(coTranslate("Stop Free Capturing"))
             msg = coGRSnapshotMsg(self.filename, "startCapturing")
             covise.sendRendMsg(msg.c_str())
         else: # stop capturing
             self.freeCapture = False
             self.widget().buttonCapture.setText(coTranslate("Start Free Capturing"))
             msg = coGRSnapshotMsg(self.filename, "stopCapturing")
             covise.sendRendMsg(msg.c_str())
             
     elif self.mode == 0: # turntable animation 10 sec
         if self.freeCapture:
             self.freeCapture = False
             msg = coGRSnapshotMsg(self.filename, "stopCapturing")
             covise.sendRendMsg(msg.c_str())
         msg = coGRSnapshotMsg(self.filename, "startCapturing")
         covise.sendRendMsg(msg.c_str())
         msg = coGRTurnTableAnimationMsg(10.0)
         covise.sendRendMsg(msg.c_str())
     else:  # turntable animation 20 sec
         if self.freeCapture:
             self.freeCapture = False
             msg = coGRSnapshotMsg(self.filename, "stopCapturing")
             covise.sendRendMsg(msg.c_str())
         msg = coGRSnapshotMsg(self.filename, "startCapturing")
         covise.sendRendMsg(msg.c_str())
         msg = coGRTurnTableAnimationMsg(20.0)
         covise.sendRendMsg(msg.c_str())
Ejemplo n.º 5
0
 def selectMode(self):
     self.mode =  self.widget().comboBox.currentIndex()
     if self.mode == 2:
         # free capturing, disable preview, rename the capture button
         self.widget().buttonCapture.setText(coTranslate("Start Free Capturing"))
         self.widget().buttonPreview.setVisible(False)
     else:    
         self.widget().buttonPreview.setVisible(True)
         self.widget().buttonCapture.setText(coTranslate("Capture Animation"))
         if self.freeCapture:
             # stop capturing
             msg = coGRSnapshotMsg(self.filename, "stopCapturing")
             covise.sendRendMsg(msg.c_str())
Ejemplo n.º 6
0
 def selectMode(self):
     self.mode = self.widget().comboBox.currentIndex()
     if self.mode == 2:
         # free capturing, disable preview, rename the capture button
         self.widget().buttonCapture.setText(
             coTranslate("Start Free Capturing"))
         self.widget().buttonPreview.setVisible(False)
     else:
         self.widget().buttonPreview.setVisible(True)
         self.widget().buttonCapture.setText(
             coTranslate("Capture Animation"))
         if self.freeCapture:
             # stop capturing
             msg = coGRSnapshotMsg(self.filename, "stopCapturing")
             covise.sendRendMsg(msg.c_str())
Ejemplo n.º 7
0
 def snapAll(self):
     _infoer.function = str(self.snapAll)
     _infoer.write("")
     #theGuiMsgHandler().sendKeyWord("snapAll")
     msg = coGRSnapshotMsg("", "snapAll")
     covise.sendRendMsg(msg.c_str())
Ejemplo n.º 8
0
 def snapAll(self):
     _infoer.function = str(self.snapAll)
     _infoer.write("")
     #theGuiMsgHandler().sendKeyWord("snapAll")
     msg = coGRSnapshotMsg( "", "snapAll" )
     covise.sendRendMsg(msg.c_str())