]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
0020550: EDF 1147 GUI: Script example "examplevtk1.py" is not updated RELIQUAT_5x_30102009
authordmv <dmv@opencascade.com>
Mon, 26 Oct 2009 11:14:25 +0000 (11:14 +0000)
committerdmv <dmv@opencascade.com>
Mon, 26 Oct 2009 11:14:25 +0000 (11:14 +0000)
src/SALOME_SWIG/examplevtk1.py

index 63fafd04695bd7c052e6744fb6101faa7f08746e..d340da560ab59131d8492d56faca36e3cbb86e44 100755 (executable)
 #  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()