--- trunk/OOPSE/libBASS/BASS_interface.cpp 2003/10/28 16:03:06 828 +++ trunk/OOPSE/libBASS/BASS_interface.cpp 2004/01/26 18:52:42 981 @@ -15,7 +15,8 @@ typedef enum { GLOBAL_BLK, MOLECULE_BLK, ATOM_BLK, BON // Globals ************************************************ typedef enum { GLOBAL_BLK, MOLECULE_BLK, ATOM_BLK, BOND_BLK, BEND_BLK, - TORSION_BLK, COMPONENT_BLK, ZCONSTRAINT_BLK } block_type; + TORSION_BLK, COMPONENT_BLK, ZCONSTRAINT_BLK, + RIGIDBODY_BLK } block_type; block_type current_block = GLOBAL_BLK; #define MAX_NEST 20 // the max number of nested blocks @@ -55,6 +56,11 @@ int event_handler( event* the_event ){ incr_block( ZCONSTRAINT_BLK ); handled = the_globals->newZconstraint( the_event ); break; + + case RIGIDBODY: + incr_block( RIGIDBODY_BLK ); + handled = the_stamps->newRigidBody( the_event ); + break; case COMPONENT: incr_block( COMPONENT_BLK ); @@ -82,7 +88,7 @@ int event_handler( event* the_event ){ case ATOM: incr_block( ATOM_BLK ); - handled = the_stamps->newAtom( the_event ); + handled = the_stamps->newAtomInMolecule( the_event ); break; case BOND: @@ -100,6 +106,11 @@ int event_handler( event* the_event ){ handled = the_stamps->newTorsion( the_event ); break; + case RIGIDBODY: + incr_block( RIGIDBODY_BLK ); + handled = the_stamps->newRigidBody( the_event ); + break; + case ASSIGNMENT: handled = the_stamps->moleculeAssign( the_event ); break; @@ -112,10 +123,45 @@ int event_handler( event* the_event ){ default: the_event->err_msg = strdup( "Not a valid molecule event\n" ); + return 0; + } + break; + + + case RIGIDBODY_BLK: + + switch( the_event->event_type ){ + + case ATOM: + incr_block( ATOM_BLK ); + handled = the_stamps->newAtomInRigidBody( the_event ); + break; + + case POSITION: + handled = the_stamps->rigidBodyPosition( the_event ); + break; + + case ORIENTATION: + handled = the_stamps->rigidBodyOrientation( the_event ); + break; + + case ASSIGNMENT: + handled = the_stamps->rigidBodyAssign( the_event ); + break; + + case BLOCK_END: + decr_block(); + handled = the_stamps->rigidBodyEnd( the_event ); + break; + + default: + the_event->err_msg = + strdup( "Not a valid RigidBody event\n" ); return 0; } break; + case ATOM_BLK: switch( the_event->event_type ){