1 # Copyright (C) 2010-2012 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 *
41 if a.startswith("vtk") and (len(a) > 3):
42 classeslistsm.append(a)
44 from paraview.vtk import *
48 if (a not in l1) and a.startswith("vtk"):
49 classeslistvtk.append(a)
53 non_wrap_list = ["vtkVariant", "vtkTimeStamp"]
55 pv_classes_new=classeslistsm
56 while len(pv_classes_new):
57 pv_classes_cur=pv_classes_new
59 for c in pv_classes_cur:
60 ## ignore non wrappable classes
61 if c in non_wrap_list:
63 filename=sys.argv[1]+"/"+c+".h"
64 if os.path.isfile(filename):
68 if re.match('\s*/',line) is None:
69 if re.match('\s*public\s*:',line):
72 m=re.match('\s*class\s+(vtk\w+)\s*;',line)
75 if cn not in dic.keys() and cn not in pv_classes_new and cn in classeslistvtk:
76 pv_classes_new.append(cn)
79 m=re.match('\s*struct\s+(vtk\w+)\s*;',line)
82 if cn not in dic.keys() and cn not in pv_classes_new and cn in classeslistvtk:
83 pv_classes_new.append(cn)
86 m=re.match('\s*#include\s+"(vtk\w+)\.h"',line)
89 if cn not in dic.keys() and cn not in pv_classes_new and cn in classeslistvtk:
90 pv_classes_new.append(cn)
93 cm=re.findall('public\s+(vtk\w+)',line)
97 ## do not extract Call Back classes
98 if cn.count('vtkClassMemberCallback'):
100 if cn not in dic.keys() and cn not in pv_classes_new:
101 pv_classes_new.append(cn)
113 if c not in dic.keys():
115 if len(dic[c][1]) and dic[c][0] == 0:
116 ret+=collect_dic(dic[c][1])
122 pv_classes_sort=collect_dic(dic.keys())
125 if(os.path.exists('wrapfiles.txt')):
126 wf_txt=open('wrapfiles.txt','r')
127 strs=wf_txt.readlines()
133 for c in pv_classes_sort:
140 wf_txt=open('wrapfiles.txt','w')