This repository has been archived by the owner on Dec 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
interface.py
154 lines (99 loc) · 3.58 KB
/
interface.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
import os
from pyplusplus import module_builder
import fnmatch
#generates bzrrev.h:
import bzrrev
#Creating an instance of class that will help you to expose your declarations
mb = module_builder.module_builder_t( [os.path.abspath('./ptools.h'), os.path.abspath('./py_details.h')]
, gccxml_path=r""
, define_symbols=[] )
#Well, don't you want to see what is going on?
#mb.print_declarations()
mb.classes().exclude()
mb.free_functions().exclude()
coord3D = mb.class_("Coord3D")
coord3D.include()
normalize = coord3D.member_function("Normalize")
normalize.call_policies = module_builder.call_policies.return_internal_reference()
coordsarray = mb.class_("CoordsArray")
coordsarray.include()
#matrix44xVect = coordsarray.member_function
rigidbody = mb.class_("Rigidbody")
#getatom = rigidbody.member_function("GetAtomReference")
#getatom.call_policies = module_builder.call_policies.return_internal_reference()
rigidbody.include()
attractrigidbody=mb.class_("AttractRigidbody")
attractrigidbody.include()
Region = mb.class_("Region")
Region.include()
Mcoprigid=mb.class_("Mcoprigid")
Mcoprigid.include()
atomproperty=mb.class_("Atomproperty")
atomproperty.include()
atom = mb.class_("Atom")
atom.include()
#attractEuler = mb.free_functions("AttractEuler")
#attractEuler.include()
forceField = mb.class_("ForceField")
forceField.include()
mb.class_("BaseAttractForceField").include()
attractForceField1 = mb.class_("AttractForceField1")
attractForceField1.include()
attractForceField2 = mb.class_("AttractForceField2")
attractForceField2.include()
McopForceField = mb.class_("McopForceField")
McopForceField.include()
AtomPair = mb.class_("AtomPair")
AtomPair.include()
#this will introduce the PairList template
#this is tricky and quite ugly. Looking for a better alternative
#pairlist = mb.class_("T_PairList<PTools::Rigidbody>") #regular pairlist (for Rigidbody)
#pairlist.include()
#att2pairlist=mb.class_("T_PairList<PTools::AttractRigidbody>") #the new Attract 2 pairlist (works with AttractRigidbody)
attpairlist=mb.class_("AttractPairList")
attpairlist.include()
#mb.namespace( 'py_details' ).exclude() #exclude the py_details ugly namespace
lbfgs = mb.class_("Lbfgs")
lbfgs.include()
rmsd = mb.free_function("Rmsd")
rmsd.include()
Norm = mb.free_function("Norm")
Norm.include()
Norm2 = mb.free_function("Norm2")
Norm2.include()
Dist = mb.free_function("Dist").include()
Dist2 = mb.free_function("Dist2").include()
mb.free_function("Dihedral").include()
mb.free_function("Angle").include()
PrintCoord=mb.free_function("PrintCoord")
PrintCoord.include()
WritePDB=mb.free_function("WritePDB")
WritePDB.include()
atomselection = mb.class_("AtomSelection")
atomselection.include()
screw =mb.class_("Screw")
printscrew = screw.member_function("print")
printscrew.rename("Print")
screw.include()
superpose_t = mb.class_("Superpose_t")
superpose_t.include()
superpose=mb.free_functions("superpose")
superpose.include()
surf=mb.class_("Surface")
surf.include()
Matrix=mb.class_("Array2D<double>")
Matrix.include()
Matrix.alias = "Matrix"
Matrix.operators("()", arg_types=["int","int"]).exclude()
Matrix.member_function("id").exclude()
Version = mb.class_("Version").include()
try:
surreal = mb.class_("surreal")
surreal.include()
except :
print "no surreal type this time."
#Creating code creator. After this step you should not modify/customize declarations.
mb.build_code_creator( module_name='_ptools' )
mb.code_creator.replace_included_headers( ["ptools.h"] )
#Writing code to file.
mb.split_module( 'Pybindings' )