Salome HOME
Fixing presentations.py to the correct version.
[modules/paravis.git] / src / PV_SWIG / paravis.py
index db3ad3159d56175de598415c38c87e62bfb5a51f..da1119a1943270836bbb4713feb23049446343b3 100644 (file)
@@ -67,12 +67,31 @@ def ImportFile(theFileName):
     "Import a file of any format supported by ParaView"
     myParavis.ImportFile(theFileName)
 
-## Initialize PARAVIS interface  
+
+def createFunction(theName):
+    "Create function - constructor of Paravis object"
+    def MyFunction():
+        return myParavis.CreateClass(theName)
+    return MyFunction
+
+
+def createConstructors():
+    "Create constructor functions according to list of extracted classes"
+    g = globals()
+    aClassNames = myParavis.GetClassesList();
+    for aName in aClassNames:
+        g[aName] = createFunction(aName)
+
+## Initialize of a PARAVIS interface  
 myParavis = Initialize(orb, naming_service,lcc,myStudyManager,myStudy, 2)
 
+## Initialize constructor functions
+createConstructors()
+
 ## Initialize Paravis static objects
-#vtkSMObject = vtkSMObject()
-#vtkProcessModule = vtkProcessModule()
-#vtkPVPythonModule = vtkPVPythonModule()
-#vtkSMProxyManager = vtkSMProxyManager()
+vtkSMObject = vtkSMObject()
+vtkProcessModule = vtkProcessModule()
+vtkPVPythonModule = vtkPVPythonModule()
+vtkSMProxyManager = vtkSMProxyManager()
+