本文整理汇总了Python中vtk.qt4.QVTKRenderWindowInteractor.QVTKRenderWindowInteractor.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python QVTKRenderWindowInteractor.__init__方法的具体用法?Python QVTKRenderWindowInteractor.__init__怎么用?Python QVTKRenderWindowInteractor.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vtk.qt4.QVTKRenderWindowInteractor.QVTKRenderWindowInteractor
的用法示例。
在下文中一共展示了QVTKRenderWindowInteractor.__init__方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from vtk.qt4.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor [as 别名]
# 或者: from vtk.qt4.QVTKRenderWindowInteractor.QVTKRenderWindowInteractor import __init__ [as 别名]
def __init__(self, parent):
QVTKRenderWindowInteractor.__init__(self, parent)
self.renderer = vtk.vtkRenderer()
self.GetRenderWindow().AddRenderer(self.renderer)
interactor = vtk.vtkInteractorStyleSwitch()
self._Iren.SetInteractorStyle(interactor)
self.surface = None
# Remainng calls set up axes.
tprop = vtk.vtkTextProperty()
tprop.SetColor(1,1,1)
# Create a faint outline to go with the axes.
self.outline = vtk.vtkOutlineFilter()
# Initially set up with a box as input. This will be changed
# to a plot once the user clicks something.
self.box = vtk.vtkBox()
self.box.SetBounds(0,10,0,10,0,10)
sample = vtk.vtkSampleFunction()
sample.SetImplicitFunction(self.box)
sample.SetSampleDimensions(2,2,2)
sample.SetModelBounds(0,10,0,10,0,5)
sample.ComputeNormalsOff()
self.outline.SetInputConnection(sample.GetOutputPort())
mapOutline = vtk.vtkPolyDataMapper()
mapOutline.SetInputConnection(self.outline.GetOutputPort())
self.outlineActor = vtk.vtkActor()
self.outlineActor.SetMapper(mapOutline)
self.outlineActor.GetProperty().SetColor(1,1,1)
self.outlineActor.GetProperty().SetOpacity(.25)
self.renderer.AddActor(self.outlineActor)
self.axes = vtk.vtkCubeAxesActor2D()
self.axes.SetCamera(self.renderer.GetActiveCamera())
self.axes.SetFlyModeToOuterEdges()
self.axes.SetLabelFormat("%6.4g")
self.axes.SetFontFactor(0.8)
self.axes.SetAxisTitleTextProperty(tprop)
self.axes.SetAxisLabelTextProperty(tprop)
self.axes.SetXLabel("MPI Rank")
self.axes.SetYLabel("Progress")
self.axes.SetZLabel("Effort")
self.axes.SetInput(sample.GetOutput())
self.renderer.AddViewProp(self.axes)
# Keep original camera around in case it gets changed
self.originalCamera = self.renderer.GetActiveCamera()
self.renderer.GetActiveCamera().Pitch(90) # Want effort to be vertical
self.renderer.GetActiveCamera().OrthogonalizeViewUp()
self.renderer.ResetCamera()
self.renderer.GetActiveCamera().Elevation(15) # Be slightly above the data
示例2: __init__
# 需要导入模块: from vtk.qt4.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor [as 别名]
# 或者: from vtk.qt4.QVTKRenderWindowInteractor.QVTKRenderWindowInteractor import __init__ [as 别名]
def __init__(self, widget, graph, app=None, parent = None):
QVTKRenderWindowInteractor.__init__(self, widget)
self._vta_graph = graph
self._scoresim = None
self._scores = None
self._graph = None
self.actor = None
self.app = app
self.pick_radius = 0
示例3: __init__
# 需要导入模块: from vtk.qt4.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor [as 别名]
# 或者: from vtk.qt4.QVTKRenderWindowInteractor.QVTKRenderWindowInteractor import __init__ [as 别名]
def __init__(self):
QVTKRenderWindowInteractor.__init__(self)
self.AddObserver("LeftButtonPressEvent", self.leftPressed)
self.Initialize()
self.Render()