From: dmv Date: Mon, 26 Oct 2009 11:14:25 +0000 (+0000) Subject: 0020550: EDF 1147 GUI: Script example "examplevtk1.py" is not updated X-Git-Tag: RELIQUAT_5x_30102009 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2218b6a7fbf6d72b051c29679abe89dec9116818;p=modules%2Fgui.git 0020550: EDF 1147 GUI: Script example "examplevtk1.py" is not updated --- diff --git a/src/SALOME_SWIG/examplevtk1.py b/src/SALOME_SWIG/examplevtk1.py index 63fafd046..d340da560 100755 --- a/src/SALOME_SWIG/examplevtk1.py +++ b/src/SALOME_SWIG/examplevtk1.py @@ -24,18 +24,22 @@ # Module : SALOME # import libSalomePy -ren=libSalomePy.renderer -#iren=libSalomePy.interactor +import vtk -from libVTKCommonPython import * -from libVTKGraphicsPython import * -cone = vtkConeSource() +# get the "vtkRenderer": an OpenGL rendering context +ren=libSalomePy.getRenderer() + +# create an actor and give it cone geometry +cone = vtk.vtkConeSource() cone.SetResolution(8) -coneMapper = vtkPolyDataMapper() +coneMapper = vtk.vtkPolyDataMapper() coneMapper.SetInput(cone.GetOutput()) -coneActor = vtkActor() +coneActor = vtk.vtkActor() coneActor.SetMapper(coneMapper) +# assign our actor to the renderer ren.AddActor(coneActor) -iren = vtkRenderWindowInteractor() +libSalomePy.fitAll() + +iren = libSalomePy.getRenderWindowInteractor()