本文整理匯總了Python中volumina.view3d.volumeRendering.RenderingManager.invalidateObject方法的典型用法代碼示例。如果您正苦於以下問題:Python RenderingManager.invalidateObject方法的具體用法?Python RenderingManager.invalidateObject怎麽用?Python RenderingManager.invalidateObject使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類volumina.view3d.volumeRendering.RenderingManager
的用法示例。
在下文中一共展示了RenderingManager.invalidateObject方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: CarvingGui
# 需要導入模塊: from volumina.view3d.volumeRendering import RenderingManager [as 別名]
# 或者: from volumina.view3d.volumeRendering.RenderingManager import invalidateObject [as 別名]
#.........這裏部分代碼省略.........
dialog.Ok.setEnabled(False)
dialog.warning.setVisible(True)
dialog.isDisabled = True
elif dialog.isDisabled:
dialog.Ok.setEnabled(True)
dialog.warning.setVisible(False)
dialog.isDisabled = False
dialog.lineEdit.textChanged.connect(validate)
result = dialog.exec_()
if result:
return str(dialog.lineEdit.text())
def onSaveButton(self):
logger.info( "save object as?" )
if self.topLevelOperatorView.dataIsStorable():
prevName = ""
if self.topLevelOperatorView.hasCurrentObject():
prevName = self.topLevelOperatorView.currentObjectName()
if prevName == "<not saved yet>":
prevName = ""
name = self.saveAsDialog(name=prevName)
if name is None:
return
objects = self.topLevelOperatorView.AllObjectNames[:].wait()
if name in objects and name != prevName:
QMessageBox.critical(self, "Save Object As", "An object with name '%s' already exists.\nPlease choose a different name." % name)
return
self.topLevelOperatorView.saveObjectAs(name)
logger.info( "save object as %s" % name )
if prevName != name and prevName != "":
self.topLevelOperatorView.deleteObject(prevName)
elif prevName == name:
self._renderMgr.removeObject(prevName)
self._renderMgr.invalidateObject(prevName)
self._shownObjects3D.pop(prevName, None)
else:
msgBox = QMessageBox(self)
msgBox.setText("The data does not seem fit to be stored.")
msgBox.setWindowTitle("Problem with Data")
msgBox.setIcon(2)
msgBox.exec_()
logger.error( "object not saved due to faulty data." )
def onShowObjectNames(self):
'''show object names and allow user to load/delete them'''
dialog = uic.loadUi(self.dialogdirCOM)
listOfItems = self.topLevelOperatorView.AllObjectNames[:].wait()
dialog.objectNames.addItems(sorted(listOfItems))
def loadSelection():
selected = [str(name.text()) for name in dialog.objectNames.selectedItems()]
dialog.close()
for objectname in selected:
self.topLevelOperatorView.loadObject(objectname)
def deleteSelection():
items = dialog.objectNames.selectedItems()
if self.confirmAndDelete([str(name.text()) for name in items]):
for name in items:
name.setHidden(True)
dialog.close()
dialog.loadButton.clicked.connect(loadSelection)
dialog.deleteButton.clicked.connect(deleteSelection)
dialog.cancelButton.clicked.connect(dialog.close)
dialog.exec_()