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 vtkPVClientServerCorePython import *
28 from vtkPVServerImplementationPython import *
29 from vtkPVServerManagerPython import *
30 from vtkPVCommonPython import *
34 if a.startswith("vtk") and (len(a) > 3):
35 classeslistsm.append(a)
37 from paraview.vtk import *
41 if (a not in l1) and a.startswith("vtk"):
42 classeslistvtk.append(a)
46 non_wrap_list = ["vtkVariant", "vtkTimeStamp"]
48 pv_classes_new=classeslistsm
49 while len(pv_classes_new):
50 pv_classes_cur=pv_classes_new
52 for c in pv_classes_cur:
53 ## ignore non wrappable classes
54 if c in non_wrap_list:
56 filename=sys.argv[1]+"/"+c+".h"
57 if os.path.isfile(filename):
61 if re.match('\s*/',line) is None:
62 if re.match('\s*public\s*:',line):
65 m=re.match('\s*class\s+(vtk\w+)\s*;',line)
68 if cn not in dic.keys() and cn not in pv_classes_new and cn in classeslistvtk:
69 pv_classes_new.append(cn)
72 m=re.match('\s*struct\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*#include\s+"(vtk\w+)\.h"',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 cm=re.findall('public\s+(vtk\w+)',line)
90 ## do not extract Call Back classes
91 if cn.count('vtkClassMemberCallback'):
93 if cn not in dic.keys() and cn not in pv_classes_new:
94 pv_classes_new.append(cn)
106 if c not in dic.keys():
108 if len(dic[c][1]) and dic[c][0] == 0:
109 ret+=collect_dic(dic[c][1])
115 pv_classes_sort=collect_dic(dic.keys())
118 if(os.path.exists('wrapfiles.txt')):
119 wf_txt=open('wrapfiles.txt','r')
120 strs=wf_txt.readlines()
126 for c in pv_classes_sort:
133 wf_txt=open('wrapfiles.txt','w')