def __init__(self, module_manager):
     SimpleVTKClassModuleBase.__init__(
         self, module_manager,
         vtk.vtkRectilinearSynchronizedTemplates(), 'Processing.',
         ('vtkRectilinearGrid',), ('vtkPolyData',),
         replaceDoc=True,
         inputFunctions=None, outputFunctions=None)
Ejemplo n.º 2
0
 def __init__(self, module_manager):
     SimpleVTKClassModuleBase.__init__(
         self,
         module_manager,
         vtk.vtkRectilinearSynchronizedTemplates(),
         'Processing.', ('vtkRectilinearGrid', ), ('vtkPolyData', ),
         replaceDoc=True,
         inputFunctions=None,
         outputFunctions=None)
#!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()

# create pipeline - rectilinear grid
#
rgridReader = vtk.vtkRectilinearGridReader()
rgridReader.SetFileName("" + str(VTK_DATA_ROOT) + "/Data/RectGrid2.vtk")
rgridReader.Update()
contour = vtk.vtkRectilinearSynchronizedTemplates()
contour.SetInputConnection(rgridReader.GetOutputPort())
contour.SetValue(0, 1)
contour.ComputeScalarsOff()
contour.ComputeNormalsOn()
contour.ComputeGradientsOn()
cMapper = vtk.vtkPolyDataMapper()
cMapper.SetInputConnection(contour.GetOutputPort())
cActor = vtk.vtkActor()
cActor.SetMapper(cMapper)
# Create the RenderWindow, Renderer and both Actors
#
ren1 = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren1)
renWin.SetSize(200, 200)
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)
ren1.AddActor(cActor)
iren.Initialize()
#!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()

# create pipeline - rectilinear grid
#
rgridReader = vtk.vtkRectilinearGridReader()
rgridReader.SetFileName("" + str(VTK_DATA_ROOT) + "/Data/RectGrid2.vtk")
rgridReader.Update()
contour = vtk.vtkRectilinearSynchronizedTemplates()
contour.SetInputConnection(rgridReader.GetOutputPort())
contour.SetValue(0,1)
contour.ComputeScalarsOff()
contour.ComputeNormalsOn()
contour.ComputeGradientsOn()
cMapper = vtk.vtkPolyDataMapper()
cMapper.SetInputConnection(contour.GetOutputPort())
cActor = vtk.vtkActor()
cActor.SetMapper(cMapper)
# Create the RenderWindow, Renderer and both Actors
#
ren1 = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren1)
renWin.SetSize(200,200)
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)
ren1.AddActor(cActor)
iren.Initialize()