Ejemplo n.º 1
0
 def __init__(self, module_manager):
     SimpleVTKClassModuleBase.__init__(
         self, module_manager,
         vtk.vtkEllipticalButtonSource(), 'Processing.',
         (), ('vtkPolyData',),
         replaceDoc=True,
         inputFunctions=None, outputFunctions=None)
Ejemplo n.º 2
0
 def __init__(self, module_manager):
     SimpleVTKClassModuleBase.__init__(self,
                                       module_manager,
                                       vtk.vtkEllipticalButtonSource(),
                                       'Processing.', (), ('vtkPolyData', ),
                                       replaceDoc=True,
                                       inputFunctions=None,
                                       outputFunctions=None)
Ejemplo n.º 3
0
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()

# Test the button source
# The image to map on the button
r = vtk.vtkJPEGReader()
r.SetFileName("" + str(VTK_DATA_ROOT) + "/Data/beach.jpg")
r.Update()
t = vtk.vtkTexture()
t.SetInputConnection(r.GetOutputPort())
dims = r.GetOutput().GetDimensions()
d1 = lindex(dims, 0)
d2 = lindex(dims, 1)
# The first elliptical button
bs = vtk.vtkEllipticalButtonSource()
bs.SetWidth(2)
bs.SetHeight(1)
bs.SetDepth(0.2)
bs.SetCircumferentialResolution(64)
bs.SetRadialRatio(1.1)
bs.SetShoulderResolution(8)
bs.SetTextureResolution(4)
bs.TwoSidedOn()
bMapper = vtk.vtkPolyDataMapper()
bMapper.SetInputConnection(bs.GetOutputPort())
b1 = vtk.vtkActor()
b1.SetMapper(bMapper)
b1.SetTexture(t)
# The second elliptical button
bs2 = vtk.vtkEllipticalButtonSource()
# Test the button source
# The image to map on the button
r = vtk.vtkJPEGReader()
r.SetFileName(VTK_DATA_ROOT + "/Data/beach.jpg")
r.Update()

t = vtk.vtkTexture()
t.SetInputConnection(r.GetOutputPort())

dims = r.GetOutput().GetDimensions()
d1 = dims[0]
d2 = dims[1]

# The first elliptical button
bs = vtk.vtkEllipticalButtonSource()
bs.SetWidth(2)
bs.SetHeight(1)
bs.SetDepth(0.2)
bs.SetCircumferentialResolution(64)
bs.SetRadialRatio(1.1)
bs.SetShoulderResolution(8)
bs.SetTextureResolution(4)
bs.TwoSidedOn()

bMapper = vtk.vtkPolyDataMapper()
bMapper.SetInputConnection(bs.GetOutputPort())

b1 = vtk.vtkActor()
b1.SetMapper(bMapper)
b1.SetTexture(t)