Пример #1
0
 def __init__(self, module_manager):
     SimpleVTKClassModuleBase.__init__(
         self, module_manager,
         vtk.vtkOBBDicer(), 'Processing.',
         ('vtkDataSet',), ('vtkDataSet',),
         replaceDoc=True,
         inputFunctions=None, outputFunctions=None)
Пример #2
0
 def __init__(self, module_manager):
     SimpleVTKClassModuleBase.__init__(
         self,
         module_manager,
         vtk.vtkOBBDicer(),
         "Processing.",
         ("vtkDataSet",),
         ("vtkDataSet",),
         replaceDoc=True,
         inputFunctions=None,
         outputFunctions=None,
     )
Пример #3
0
Файл: dicer.py Проект: 0004c/VTK
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()

# Create the RenderWindow, Renderer and both Actors
#
ren1 = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren1)
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)
# create pipeline
#
reader = vtk.vtkSTLReader()
reader.SetFileName("" + str(VTK_DATA_ROOT) + "/Data/42400-IDGH.stl")
dicer = vtk.vtkOBBDicer()
dicer.SetInputConnection(reader.GetOutputPort())
dicer.SetNumberOfPointsPerPiece(1000)
dicer.Update()
isoMapper = vtk.vtkDataSetMapper()
isoMapper.SetInputConnection(dicer.GetOutputPort())
isoMapper.SetScalarRange(0,dicer.GetNumberOfActualPieces())
isoActor = vtk.vtkActor()
isoActor.SetMapper(isoMapper)
isoActor.GetProperty().SetColor(0.7,0.3,0.3)
outline = vtk.vtkOutlineCornerFilter()
outline.SetInputConnection(reader.GetOutputPort())
outlineMapper = vtk.vtkPolyDataMapper()
outlineMapper.SetInputConnection(outline.GetOutputPort())
outlineActor = vtk.vtkActor()
outlineActor.SetMapper(outlineMapper)
Пример #4
0
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()

# Create the RenderWindow, Renderer and both Actors
#
ren1 = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren1)
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)
# create pipeline
#
reader = vtk.vtkSTLReader()
reader.SetFileName("" + str(VTK_DATA_ROOT) + "/Data/42400-IDGH.stl")
dicer = vtk.vtkOBBDicer()
dicer.SetInputConnection(reader.GetOutputPort())
dicer.SetNumberOfPointsPerPiece(1000)
dicer.Update()
isoMapper = vtk.vtkDataSetMapper()
isoMapper.SetInputConnection(dicer.GetOutputPort())
isoMapper.SetScalarRange(0, dicer.GetNumberOfActualPieces())
isoActor = vtk.vtkActor()
isoActor.SetMapper(isoMapper)
isoActor.GetProperty().SetColor(0.7, 0.3, 0.3)
outline = vtk.vtkOutlineCornerFilter()
outline.SetInputConnection(reader.GetOutputPort())
outlineMapper = vtk.vtkPolyDataMapper()
outlineMapper.SetInputConnection(outline.GetOutputPort())
outlineActor = vtk.vtkActor()
outlineActor.SetMapper(outlineMapper)