def __init__(self, module_manager): SimpleVTKClassModuleBase.__init__( self, module_manager, vtk.vtkPLOT3DReader(), 'Reading vtkPLOT3D.', (), ('vtkPLOT3D',), replaceDoc=True, inputFunctions=None, outputFunctions=None)
def __init__(self, module_manager): SimpleVTKClassModuleBase.__init__(self, module_manager, vtk.vtkPLOT3DReader(), 'Reading vtkPLOT3D.', (), ('vtkPLOT3D', ), replaceDoc=True, inputFunctions=None, outputFunctions=None)
#!/usr/bin/env python # Perform psuedo volume rendering in a structured grid by compositing # translucent cut planes. This same trick can be used for unstructured # grids. Note that for better results, more planes can be created. Also, # if your data is vtkImageData, there are much faster methods for volume # rendering. import vtk from vtk.util.colors import * from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # Create pipeline. Read structured grid data. pl3d = vtk.vtkPLOT3DReader() pl3d.SetXYZFileName(VTK_DATA_ROOT + "/Data/combxyz.bin") pl3d.SetQFileName(VTK_DATA_ROOT + "/Data/combq.bin") pl3d.SetScalarFunctionNumber(100) pl3d.SetVectorFunctionNumber(202) pl3d.Update() # A convenience, use this filter to limit data for experimentation. extract = vtk.vtkExtractGrid() extract.SetVOI(1, 55, -1000, 1000, -1000, 1000) extract.SetInputConnection(pl3d.GetOutputPort()) # The (implicit) plane is used to do the cutting plane = vtk.vtkPlane() plane.SetOrigin(0, 4, 2) plane.SetNormal(0, 1, 0)
import vtk from vtk.util.misc import vtkGetDataRoot # create planes # Create the RenderWindow, Renderer # ren = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren) iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) # create pipeline # pl3d = vtk.vtkPLOT3DReader() pl3d.SetXYZFileName(vtkGetDataRoot() + '/Data/combxyz.bin') pl3d.SetQFileName(vtkGetDataRoot() + '/Data/combq.bin') pl3d.SetScalarFunctionNumber(100) pl3d.SetVectorFunctionNumber(202) pl3d.Update() outline = vtk.vtkStructuredGridOutlineFilter() outline.SetInputConnection(pl3d.GetOutputPort()) outlineMapper = vtk.vtkPolyDataMapper() outlineMapper.SetInputConnection(outline.GetOutputPort()) outlineActor = vtk.vtkActor() outlineActor.SetMapper(outlineMapper)