本文整理汇总了Python中vtk.qt4.QVTKRenderWindowInteractor.QVTKRenderWindowInteractor.setGeometry方法的典型用法代码示例。如果您正苦于以下问题:Python QVTKRenderWindowInteractor.setGeometry方法的具体用法?Python QVTKRenderWindowInteractor.setGeometry怎么用?Python QVTKRenderWindowInteractor.setGeometry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vtk.qt4.QVTKRenderWindowInteractor.QVTKRenderWindowInteractor
的用法示例。
在下文中一共展示了QVTKRenderWindowInteractor.setGeometry方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Ui_MainWindow
# 需要导入模块: from vtk.qt4.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor [as 别名]
# 或者: from vtk.qt4.QVTKRenderWindowInteractor.QVTKRenderWindowInteractor import setGeometry [as 别名]
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName(_fromUtf8("MainWindow"))
MainWindow.resize(800, 600)
self.centralwidget = QtGui.QWidget(MainWindow)
self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
self.pushButton = QtGui.QPushButton(self.centralwidget)
self.pushButton.setGeometry(QtCore.QRect(10, 230, 121, 41))
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/rc/Resource/Science.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.pushButton.setIcon(icon)
self.pushButton.setObjectName(_fromUtf8("pushButton"))
self.vtkWidget = QVTKRenderWindowInteractor(self.centralwidget)
self.vtkWidget.setGeometry(QtCore.QRect(200, 100, 521, 391))
self.vtkWidget.setObjectName(_fromUtf8("widget"))
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtGui.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 23))
self.menubar.setObjectName(_fromUtf8("menubar"))
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtGui.QStatusBar(MainWindow)
self.statusbar.setObjectName(_fromUtf8("statusbar"))
MainWindow.setStatusBar(self.statusbar)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow", None))
self.pushButton.setText(_translate("MainWindow", "PushButton", None))
示例2: Ui_TestbedWindow
# 需要导入模块: from vtk.qt4.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor [as 别名]
# 或者: from vtk.qt4.QVTKRenderWindowInteractor.QVTKRenderWindowInteractor import setGeometry [as 别名]
class Ui_TestbedWindow(object):
def setupUi(self, TestbedWindow):
TestbedWindow.setObjectName(_fromUtf8("TestbedWindow"))
TestbedWindow.resize(789, 590)
TestbedWindow.setWindowTitle(QtGui.QApplication.translate("TestbedWindow", "MainWindow", None, QtGui.QApplication.UnicodeUTF8))
self.centralwidget = QtGui.QWidget(TestbedWindow)
self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
self.renderView = QVTKRenderWindowInteractor(self.centralwidget)
self.renderView.setGeometry(QtCore.QRect(0, 0, 781, 541))
self.renderView.setObjectName(_fromUtf8("renderView"))
TestbedWindow.setCentralWidget(self.centralwidget)
self.menubar = QtGui.QMenuBar(TestbedWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 789, 27))
self.menubar.setObjectName(_fromUtf8("menubar"))
self.menuData = QtGui.QMenu(self.menubar)
self.menuData.setTitle(QtGui.QApplication.translate("TestbedWindow", "Data", None, QtGui.QApplication.UnicodeUTF8))
self.menuData.setObjectName(_fromUtf8("menuData"))
TestbedWindow.setMenuBar(self.menubar)
self.statusbar = QtGui.QStatusBar(TestbedWindow)
self.statusbar.setObjectName(_fromUtf8("statusbar"))
TestbedWindow.setStatusBar(self.statusbar)
self.actionLoad = QtGui.QAction(TestbedWindow)
self.actionLoad.setCheckable(False)
self.actionLoad.setText(QtGui.QApplication.translate("TestbedWindow", "Load...", None, QtGui.QApplication.UnicodeUTF8))
self.actionLoad.setToolTip(QtGui.QApplication.translate("TestbedWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:\'Sans Serif\'; font-size:10pt; font-weight:400; font-style:normal;\">\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-style:italic;\">Load dataset</span></p></body></html>", None, QtGui.QApplication.UnicodeUTF8))
self.actionLoad.setShortcut(QtGui.QApplication.translate("TestbedWindow", "F2", None, QtGui.QApplication.UnicodeUTF8))
self.actionLoad.setObjectName(_fromUtf8("actionLoad"))
self.menuData.addAction(self.actionLoad)
self.menubar.addAction(self.menuData.menuAction())
self.retranslateUi(TestbedWindow)
QtCore.QMetaObject.connectSlotsByName(TestbedWindow)
def retranslateUi(self, TestbedWindow):
pass
示例3: Ui_MainWindow
# 需要导入模块: from vtk.qt4.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor [as 别名]
# 或者: from vtk.qt4.QVTKRenderWindowInteractor.QVTKRenderWindowInteractor import setGeometry [as 别名]
class Ui_MainWindow(QtGui.QMainWindow):
def __init__(self):
QtGui.QMainWindow.__init__(self)
self.setupUi(self)
def setupUi(self, MainWindow):
MainWindow.setObjectName(_fromUtf8("MainWindow"))
MainWindow.resize(912, 640)
#centralWidget
self.centralWidget = QtGui.QWidget(MainWindow)
self.centralWidget.setObjectName(_fromUtf8("centralWidget"))
self.m_label = QtGui.QLabel(self.centralWidget)
self.m_label.setGeometry(QtCore.QRect(750, 70, 91, 17))
self.m_label.setObjectName(_fromUtf8("m_label"))
self.m_pushButton = QtGui.QPushButton(self.centralWidget)
self.m_pushButton.setGeometry(QtCore.QRect(740, 110, 99, 27))
self.m_pushButton.setObjectName(_fromUtf8("m_pushButton"))
#vtkWidget
self.m_widget = QVTKRenderWindowInteractor(self.centralWidget)
self.m_widget.setGeometry(QtCore.QRect(60, 60, 591, 501))
self.m_widget.setObjectName(_fromUtf8("m_widget"))
self.setvtkWidget()
MainWindow.setCentralWidget(self.centralWidget)
#menuBar
self.menuBar = QtGui.QMenuBar(MainWindow)
self.menuBar.setGeometry(QtCore.QRect(0, 0, 912, 25))
self.menuBar.setObjectName(_fromUtf8("menuBar"))
MainWindow.setMenuBar(self.menuBar)
#toolBar
self.mainToolBar = QtGui.QToolBar(MainWindow)
self.mainToolBar.setObjectName(_fromUtf8("mainToolBar"))
MainWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.mainToolBar)
#statusBar
self.statusBar = QtGui.QStatusBar(MainWindow)
self.statusBar.setObjectName(_fromUtf8("statusBar"))
MainWindow.setStatusBar(self.statusBar)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow", None))
self.m_label.setText(_translate("MainWindow", "Hello world", None))
self.m_pushButton.setText(_translate("MainWindow", "Say Hi!", None))
def setvtkWidget(self):
self.ren = vtk.vtkRenderer()
self.m_widget.GetRenderWindow().AddRenderer(self.ren)
self.iren = self.m_widget.GetRenderWindow().GetInteractor()
# The car model (includes a plate, two poles and four wheel)
# Plate of the car
# Create source
plate = vtk.vtkCubeSource()
plate.SetXLength(100)
plate.SetYLength(60)
plate.SetZLength(6)
plate.SetCenter(50, 0, -3)
# Create a mapper
plateMapper = vtk.vtkPolyDataMapper()
plateMapper.SetInputConnection(plate.GetOutputPort())
# Create a transform
plateTransform = vtk.vtkTransform()
# Create an actor
self.plateActor = vtk.vtkActor()
self.plateActor.SetMapper(plateMapper)
self.plateActor.SetUserTransform(plateTransform)
self.plateActor.GetProperty().SetColor(0.69, 0.77, 0.87)
self.ren.AddActor(self.plateActor)
# Two poles
# Left pole
# Create source
poleL = vtk.vtkCylinderSource()
poleL.SetRadius(1.0)
poleL.SetHeight(50.0)
poleL.SetCenter(10, 0, 0)
poleL.SetResolution(100.0)
# Create a mapper
poleLMapper = vtk.vtkPolyDataMapper()
poleLMapper.SetInputConnection(poleL.GetOutputPort())
# Create a transform
poleLTransform = vtk.vtkTransform()
poleLTransform.SetInput(plateTransform)
# Create an actor
poleLActor = vtk.vtkActor()
poleLActor.SetMapper(poleLMapper)
#.........这里部分代码省略.........
示例4: Ui_MainWindow
# 需要导入模块: from vtk.qt4.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor [as 别名]
# 或者: from vtk.qt4.QVTKRenderWindowInteractor.QVTKRenderWindowInteractor import setGeometry [as 别名]
class Ui_MainWindow(QtGui.QMainWindow):
""" The main window class"""
def __init__(self):
QtGui.QMainWindow.__init__(self)
# member variables definition
self.M1 = 0.0
self.M2 = 0.0
self.L1 = 0.0
self.L2 = 0.0
self.th1 = 0.0
self.th2 = 0.0
self.w1 = 0.0
self.w2 = 0.0
self.ts = 0.0
self.te = 0.0
self.dt = 0.0
# setup timer
self.timer = QtCore.QTimer(self)
self.timer.timeout.connect(self.timerCallback)
self.timer_count = 0
self.current_time = 0.0
# dimension of the vtk view
self.len_convert_factor = 100.0 # length convert factor 1m = 100 pixels
self.X_lim = 500.0
self.Y_lim = 300.0
# archive (history) of the results
self.archive = archive()
# Setup UI widgets
self.setupUi(self)
def setupUi(self, MainWindow):
# mainwindow
MainWindow.setObjectName(_fromUtf8("MainWindow"))
MainWindow.resize(1203, 694)
# centralWidget
self.centralWidget = QtGui.QWidget(MainWindow)
self.centralWidget.setObjectName(_fromUtf8("centralWidget"))
MainWindow.setCentralWidget(self.centralWidget)
# left setting panel
# frame
self.settingFrame = QtGui.QFrame(self.centralWidget)
self.settingFrame.setGeometry(QtCore.QRect(10, 10, 301, 581))
self.settingFrame.setFrameShape(QtGui.QFrame.StyledPanel)
self.settingFrame.setFrameShadow(QtGui.QFrame.Raised)
self.settingFrame.setObjectName(_fromUtf8("settingFrame"))
# system parameter group
self.groupBox_system = QtGui.QGroupBox(self.settingFrame)
self.groupBox_system.setGeometry(QtCore.QRect(20, 20, 261, 121))
self.groupBox_system.setStyleSheet(_fromUtf8("QGroupBox{border: 1px solid rgb(192, 192, 192); border-radius:9px; font: bold}+ QGroupBox::title{subcontrol-origin: margin; left: 10px; padding: 0px 3px 0 3px}"))
self.groupBox_system.setObjectName(_fromUtf8("groupBox_system"))
self.label_M1 = QtGui.QLabel(self.groupBox_system)
self.label_M1.setGeometry(QtCore.QRect(10, 40, 21, 17))
self.label_M1.setObjectName(_fromUtf8("label_M1"))
self.label_M2 = QtGui.QLabel(self.groupBox_system)
self.label_M2.setGeometry(QtCore.QRect(140, 40, 21, 17))
self.label_M2.setObjectName(_fromUtf8("label_M2"))
self.label_L1 = QtGui.QLabel(self.groupBox_system)
self.label_L1.setGeometry(QtCore.QRect(10, 90, 21, 17))
self.label_L1.setObjectName(_fromUtf8("label_L1"))
self.label_L2 = QtGui.QLabel(self.groupBox_system)
self.label_L2.setGeometry(QtCore.QRect(140, 90, 21, 17))
self.label_L2.setObjectName(_fromUtf8("label_L2"))
self.lineEdit_M1 = QtGui.QLineEdit(self.groupBox_system)
self.lineEdit_M1.setGeometry(QtCore.QRect(40, 30, 71, 27))
self.lineEdit_M1.setObjectName(_fromUtf8("lineEdit_M1"))
self.lineEdit_M2 = QtGui.QLineEdit(self.groupBox_system)
self.lineEdit_M2.setGeometry(QtCore.QRect(170, 30, 71, 27))
self.lineEdit_M2.setObjectName(_fromUtf8("lineEdit_M2"))
self.lineEdit_L1 = QtGui.QLineEdit(self.groupBox_system)
self.lineEdit_L1.setGeometry(QtCore.QRect(40, 80, 71, 27))
self.lineEdit_L1.setObjectName(_fromUtf8("lineEdit_L1"))
self.lineEdit_L2 = QtGui.QLineEdit(self.groupBox_system)
self.lineEdit_L2.setGeometry(QtCore.QRect(170, 80, 71, 27))
self.lineEdit_L2.setObjectName(_fromUtf8("lineEdit_L2"))
# initial condition group
self.groupBox_init = QtGui.QGroupBox(self.settingFrame)
self.groupBox_init.setGeometry(QtCore.QRect(20, 170, 261, 121))
self.groupBox_init.setStyleSheet(_fromUtf8("QGroupBox{border: 1px solid rgb(192, 192, 192); border-radius:9px; font: bold}+ QGroupBox::title{subcontrol-origin: margin; left: 10px; padding: 0px 3px 0 3px}"))
self.groupBox_init.setObjectName(_fromUtf8("groupBox_init"))
self.label_th1 = QtGui.QLabel(self.groupBox_init)
self.label_th1.setGeometry(QtCore.QRect(10, 40, 31, 17))
self.label_th1.setObjectName(_fromUtf8("label_th1"))
self.label_th2 = QtGui.QLabel(self.groupBox_init)
self.label_th2.setGeometry(QtCore.QRect(140, 40, 31, 17))
self.label_th2.setObjectName(_fromUtf8("label_th2"))
self.label_w1 = QtGui.QLabel(self.groupBox_init)
self.label_w1.setGeometry(QtCore.QRect(10, 90, 21, 17))
#.........这里部分代码省略.........