1 |
|
|
2 |
< |
#include <cstring> |
3 |
< |
#include <cstdio> |
4 |
< |
#include <cstdlib> |
2 |
> |
#include <string.h> |
3 |
> |
#include <stdio.h> |
4 |
> |
#include <stdlib.h> |
5 |
|
|
6 |
|
#include "Globals.hpp" |
7 |
|
#include "BASS_interface.h" |
15 |
|
// Globals ************************************************ |
16 |
|
|
17 |
|
typedef enum { GLOBAL_BLK, MOLECULE_BLK, ATOM_BLK, BOND_BLK, BEND_BLK, |
18 |
< |
TORSION_BLK, COMPONENT_BLK } block_type; |
18 |
> |
TORSION_BLK, COMPONENT_BLK, ZCONSTRAINT_BLK, |
19 |
> |
RIGIDBODY_BLK, MEMBER_BLK } block_type; |
20 |
|
|
21 |
|
block_type current_block = GLOBAL_BLK; |
22 |
|
#define MAX_NEST 20 // the max number of nested blocks |
51 |
|
incr_block( MOLECULE_BLK ); |
52 |
|
handled = the_stamps->newMolecule( the_event ); |
53 |
|
break; |
54 |
+ |
|
55 |
+ |
case ZCONSTRAINT: |
56 |
+ |
incr_block( ZCONSTRAINT_BLK ); |
57 |
+ |
handled = the_globals->newZconstraint( the_event ); |
58 |
+ |
break; |
59 |
|
|
60 |
|
case COMPONENT: |
61 |
|
incr_block( COMPONENT_BLK ); |
101 |
|
handled = the_stamps->newTorsion( the_event ); |
102 |
|
break; |
103 |
|
|
104 |
+ |
case RIGIDBODY: |
105 |
+ |
incr_block( RIGIDBODY_BLK ); |
106 |
+ |
handled = the_stamps->newRigidBody( the_event ); |
107 |
+ |
break; |
108 |
+ |
|
109 |
|
case ASSIGNMENT: |
110 |
|
handled = the_stamps->moleculeAssign( the_event ); |
111 |
|
break; |
122 |
|
} |
123 |
|
break; |
124 |
|
|
125 |
+ |
|
126 |
+ |
case RIGIDBODY_BLK: |
127 |
+ |
|
128 |
+ |
switch( the_event->event_type ){ |
129 |
+ |
|
130 |
+ |
case ASSIGNMENT: |
131 |
+ |
handled = the_stamps->rigidBodyAssign( the_event ); |
132 |
+ |
break; |
133 |
+ |
|
134 |
+ |
case MEMBER: |
135 |
+ |
incr_block( MEMBER_BLK ); |
136 |
+ |
handled = the_stamps->rigidBodyMember( the_event ); |
137 |
+ |
break; |
138 |
+ |
|
139 |
+ |
case BLOCK_END: |
140 |
+ |
decr_block(); |
141 |
+ |
handled = the_stamps->rigidBodyEnd( the_event ); |
142 |
+ |
break; |
143 |
+ |
|
144 |
+ |
default: |
145 |
+ |
the_event->err_msg = |
146 |
+ |
strdup( "Not a valid RigidBody event\n" ); |
147 |
+ |
return 0; |
148 |
+ |
} |
149 |
+ |
break; |
150 |
+ |
|
151 |
+ |
|
152 |
|
case ATOM_BLK: |
153 |
|
|
154 |
|
switch( the_event->event_type ){ |
185 |
|
handled = the_stamps->bondAssign( the_event ); |
186 |
|
break; |
187 |
|
|
188 |
< |
case MEMBER: |
189 |
< |
handled = the_stamps->bondMember( the_event ); |
188 |
> |
case MEMBERS: |
189 |
> |
handled = the_stamps->bondMembers( the_event ); |
190 |
|
break; |
191 |
|
|
192 |
|
case CONSTRAINT: |
213 |
|
handled = the_stamps->bendAssign( the_event ); |
214 |
|
break; |
215 |
|
|
216 |
< |
case MEMBER: |
217 |
< |
handled = the_stamps->bendMember( the_event ); |
216 |
> |
case MEMBERS: |
217 |
> |
handled = the_stamps->bendMembers( the_event ); |
218 |
|
break; |
219 |
|
|
220 |
|
case CONSTRAINT: |
241 |
|
handled = the_stamps->torsionAssign( the_event ); |
242 |
|
break; |
243 |
|
|
244 |
< |
case MEMBER: |
245 |
< |
handled = the_stamps->torsionMember( the_event ); |
244 |
> |
case MEMBERS: |
245 |
> |
handled = the_stamps->torsionMembers( the_event ); |
246 |
|
break; |
247 |
|
|
248 |
|
case CONSTRAINT: |
260 |
|
return 0; |
261 |
|
} |
262 |
|
break; |
263 |
+ |
|
264 |
+ |
case MEMBER_BLK: |
265 |
|
|
266 |
+ |
switch( the_event->event_type ){ |
267 |
+ |
|
268 |
+ |
case ASSIGNMENT: |
269 |
+ |
handled = the_stamps->memberAssign( the_event ); |
270 |
+ |
break; |
271 |
+ |
|
272 |
+ |
case BLOCK_END: |
273 |
+ |
decr_block(); |
274 |
+ |
handled = the_stamps->memberEnd(the_event ); |
275 |
+ |
break; |
276 |
+ |
|
277 |
+ |
default: |
278 |
+ |
the_event->err_msg = |
279 |
+ |
strdup( "not a valid member event\n" ); |
280 |
+ |
return 0; |
281 |
+ |
} |
282 |
+ |
break; |
283 |
+ |
|
284 |
+ |
case ZCONSTRAINT_BLK: |
285 |
+ |
|
286 |
+ |
switch( the_event->event_type ){ |
287 |
+ |
|
288 |
+ |
case ASSIGNMENT: |
289 |
+ |
handled = the_globals->zConstraintAssign( the_event ); |
290 |
+ |
break; |
291 |
+ |
|
292 |
+ |
case BLOCK_END: |
293 |
+ |
decr_block(); |
294 |
+ |
handled = the_globals->zConstraintEnd( the_event ); |
295 |
+ |
break; |
296 |
+ |
|
297 |
+ |
default: |
298 |
+ |
the_event->err_msg = |
299 |
+ |
strdup( "not a valid zConstraint event\n" ); |
300 |
+ |
return 0; |
301 |
+ |
} |
302 |
+ |
break; |
303 |
+ |
|
304 |
|
case COMPONENT_BLK: |
305 |
|
|
306 |
|
switch( the_event->event_type ){ |
309 |
|
handled = the_globals->componentAssign( the_event ); |
310 |
|
break; |
311 |
|
|
234 |
– |
case START_INDEX: |
235 |
– |
handled = the_globals->componentStartIndex( the_event ); |
236 |
– |
break; |
237 |
– |
|
312 |
|
case BLOCK_END: |
313 |
|
decr_block(); |
314 |
|
handled = the_globals->componentEnd(the_event ); |