1 # Copyright (C) 2010-2013 CEA/DEN, EDF R&D
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 import paraview, os, sys
27 from vtkPVCommonPython import *
28 from vtkPVClientServerCoreCorePython import *
29 from vtkPVClientServerCoreDefaultPython import *
30 from vtkPVClientServerCoreRenderingPython import *
31 from vtkPVServerImplementationCorePython import *
32 from vtkPVServerImplementationDefaultPython import *
33 from vtkPVServerImplementationRenderingPython import *
34 from vtkPVServerManagerApplicationPython import *
35 from vtkPVServerManagerCorePython import *
36 from vtkPVServerManagerDefaultPython import *
37 from vtkPVServerManagerRenderingPython import *
39 from vtkPVVTKExtensionsCorePython import *
43 from vtkPVVTKExtensionsDefaultPython import *
47 from vtkPVVTKExtensionsRenderingPython import *
51 from vtkPVVTKExtensionsWebGLExporterPython import *
57 if a.startswith("vtk") and (len(a) > 3):
58 classeslistsm.append(a)
60 from paraview.vtk import *
64 if (a not in l1) and a.startswith("vtk"):
65 classeslistvtk.append(a)
69 non_wrap_list = ["vtkVariant", "vtkTimeStamp"]
71 pv_classes_new=classeslistsm
72 while len(pv_classes_new):
73 pv_classes_cur=pv_classes_new
75 for c in pv_classes_cur:
76 ## ignore non wrappable classes
77 if c in non_wrap_list:
79 filename=sys.argv[1]+"/"+c+".h"
80 if os.path.isfile(filename):
84 if re.match('\s*/',line) is None:
85 if re.match('\s*public\s*:',line):
88 m=re.match('\s*class\s+(vtk\w+)\s*;',line)
91 if cn not in dic.keys() and cn not in pv_classes_new and cn in classeslistvtk and issubclass(globals()[cn], vtkObjectBase):
92 pv_classes_new.append(cn)
95 m=re.match('\s*struct\s+(vtk\w+)\s*;',line)
98 if cn not in dic.keys() and cn not in pv_classes_new and cn in classeslistvtk and issubclass(globals()[cn], vtkObjectBase):
99 pv_classes_new.append(cn)
102 m=re.match('\s*#include\s+"(vtk\w+)\.h"',line)
105 if cn not in dic.keys() and cn not in pv_classes_new and cn in classeslistvtk and issubclass(globals()[cn], vtkObjectBase):
106 pv_classes_new.append(cn)
109 cm=re.findall('public\s+(vtk\w+)',line)
113 ## do not extract Call Back classes
114 if cn.count('vtkClassMemberCallback'):
116 if cn not in dic.keys() and cn not in pv_classes_new:
117 pv_classes_new.append(cn)
129 if c not in dic.keys():
131 if len(dic[c][1]) and dic[c][0] == 0:
132 ret+=collect_dic(dic[c][1])
138 pv_classes_sort=collect_dic(dic.keys())
141 if(os.path.exists('wrapfiles.txt')):
142 wf_txt=open('wrapfiles.txt','r')
143 strs=wf_txt.readlines()
149 for c in pv_classes_sort:
156 wf_txt=open('wrapfiles.txt','w')