--- trunk/OOPSE/libBASS/BASS_interface.cpp 2003/08/12 21:44:06 690 +++ trunk/OOPSE/libBASS/BASS_interface.cpp 2004/01/29 23:01:17 998 @@ -1,7 +1,7 @@ -#include -#include -#include +#include +#include +#include #include "Globals.hpp" #include "BASS_interface.h" @@ -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 @@ -100,6 +101,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,9 +118,35 @@ 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 ASSIGNMENT: + handled = the_stamps->rigidBodyAssign( the_event ); + break; + + case MEMBERS: + handled = the_stamps->rigidBodyMembers( 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: @@ -152,8 +184,8 @@ int event_handler( event* the_event ){ handled = the_stamps->bondAssign( the_event ); break; - case MEMBER: - handled = the_stamps->bondMember( the_event ); + case MEMBERS: + handled = the_stamps->bondMembers( the_event ); break; case CONSTRAINT: @@ -180,8 +212,8 @@ int event_handler( event* the_event ){ handled = the_stamps->bendAssign( the_event ); break; - case MEMBER: - handled = the_stamps->bendMember( the_event ); + case MEMBERS: + handled = the_stamps->bendMembers( the_event ); break; case CONSTRAINT: @@ -208,8 +240,8 @@ int event_handler( event* the_event ){ handled = the_stamps->torsionAssign( the_event ); break; - case MEMBER: - handled = the_stamps->torsionMember( the_event ); + case MEMBERS: + handled = the_stamps->torsionMembers( the_event ); break; case CONSTRAINT: