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 } 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 MEMBERS: |
135 |
+ |
handled = the_stamps->rigidBodyMembers( the_event ); |
136 |
+ |
break; |
137 |
+ |
|
138 |
+ |
case BLOCK_END: |
139 |
+ |
decr_block(); |
140 |
+ |
handled = the_stamps->rigidBodyEnd( the_event ); |
141 |
+ |
break; |
142 |
+ |
|
143 |
+ |
default: |
144 |
+ |
the_event->err_msg = |
145 |
+ |
strdup( "Not a valid RigidBody event\n" ); |
146 |
+ |
return 0; |
147 |
+ |
} |
148 |
+ |
break; |
149 |
+ |
|
150 |
+ |
|
151 |
|
case ATOM_BLK: |
152 |
|
|
153 |
|
switch( the_event->event_type ){ |
184 |
|
handled = the_stamps->bondAssign( the_event ); |
185 |
|
break; |
186 |
|
|
187 |
< |
case MEMBER: |
188 |
< |
handled = the_stamps->bondMember( the_event ); |
187 |
> |
case MEMBERS: |
188 |
> |
handled = the_stamps->bondMembers( the_event ); |
189 |
|
break; |
190 |
|
|
191 |
|
case CONSTRAINT: |
212 |
|
handled = the_stamps->bendAssign( the_event ); |
213 |
|
break; |
214 |
|
|
215 |
< |
case MEMBER: |
216 |
< |
handled = the_stamps->bendMember( the_event ); |
215 |
> |
case MEMBERS: |
216 |
> |
handled = the_stamps->bendMembers( the_event ); |
217 |
|
break; |
218 |
|
|
219 |
|
case CONSTRAINT: |
240 |
|
handled = the_stamps->torsionAssign( the_event ); |
241 |
|
break; |
242 |
|
|
243 |
< |
case MEMBER: |
244 |
< |
handled = the_stamps->torsionMember( the_event ); |
243 |
> |
case MEMBERS: |
244 |
> |
handled = the_stamps->torsionMembers( the_event ); |
245 |
|
break; |
246 |
|
|
247 |
|
case CONSTRAINT: |
259 |
|
return 0; |
260 |
|
} |
261 |
|
break; |
262 |
+ |
|
263 |
+ |
case ZCONSTRAINT_BLK: |
264 |
+ |
|
265 |
+ |
switch( the_event->event_type ){ |
266 |
+ |
|
267 |
+ |
case ASSIGNMENT: |
268 |
+ |
handled = the_globals->zConstraintAssign( the_event ); |
269 |
+ |
break; |
270 |
+ |
|
271 |
+ |
case BLOCK_END: |
272 |
+ |
decr_block(); |
273 |
+ |
handled = the_globals->zConstraintEnd( the_event ); |
274 |
+ |
break; |
275 |
+ |
|
276 |
+ |
default: |
277 |
+ |
the_event->err_msg = |
278 |
+ |
strdup( "not a valid zConstraint event\n" ); |
279 |
+ |
return 0; |
280 |
+ |
} |
281 |
+ |
break; |
282 |
|
|
283 |
|
case COMPONENT_BLK: |
284 |
|
|
288 |
|
handled = the_globals->componentAssign( the_event ); |
289 |
|
break; |
290 |
|
|
234 |
– |
case START_INDEX: |
235 |
– |
handled = the_globals->componentStartIndex( the_event ); |
236 |
– |
break; |
237 |
– |
|
291 |
|
case BLOCK_END: |
292 |
|
decr_block(); |
293 |
|
handled = the_globals->componentEnd(the_event ); |