From 2218b6a7fbf6d72b051c29679abe89dec9116818 Mon Sep 17 00:00:00 2001 From: dmv Date: Mon, 26 Oct 2009 11:14:25 +0000 Subject: [PATCH] 0020550: EDF 1147 GUI: Script example "examplevtk1.py" is not updated --- src/SALOME_SWIG/examplevtk1.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) 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() -- 2.39.2