ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libBASS/RigidBodyStamp.cpp
(Generate patch)

Comparing trunk/OOPSE/libBASS/RigidBodyStamp.cpp (file contents):
Revision 981 by gezelter, Mon Jan 19 16:08:21 2004 UTC vs.
Revision 982 by gezelter, Mon Jan 26 21:26:40 2004 UTC

# Line 12 | Line 12 | RigidBodyStamp::RigidBodyStamp(){
12    unhandled = NULL;
13    have_position = 0;
14    have_orientation = 0;
15  have_name = 0;
15    have_atoms = 0;
16    have_extras = 0;
17   }
# Line 38 | Line 37 | void RigidBodyStamp::setOrientation( double x, double
37    have_position = 1;
38   }
39  
40 < void RigidBodyStamp::setOrientation( double x, double y, double z ){
40 > void RigidBodyStamp::setOrientation( double phi, double theta, double psi ){
41  
42 <  ornt[0] = x;
44 <  ornt[1] = y;
45 <  ornt[2] = z;
42 >  // in order of application (see Goldstein)
43  
44 +  ornt[0] = phi;
45 +  ornt[1] = theta;
46 +  ornt[2] = psi;
47 +
48    // Do I tell atoms about this?
49  
50    have_orientation = 1;
# Line 51 | Line 52 | char* RigidBodyStamp::assignString( char* lhs, char* r
52  
53   char* RigidBodyStamp::assignString( char* lhs, char* rhs ){
54  
55 <  if( !strcmp( lhs, "name" ) ){
56 <    strcpy( name, rhs );
57 <    have_name = 1;
57 <  }
58 <  else{
59 <    if( unhandled == NULL ) unhandled = new LinkedAssign( lhs, rhs );
60 <    else unhandled->add( lhs, rhs );
61 <    have_extras = 1;
62 <  }
55 >  if( unhandled == NULL ) unhandled = new LinkedAssign( lhs, rhs );
56 >  else unhandled->add( lhs, rhs );
57 >  have_extras = 1;
58    return NULL;
59   }
60  
# Line 72 | Line 67 | char* RigidBodyStamp::assignDouble( char* lhs, double
67      if( have_atoms ){
68        sprintf( errMsg,
69                 "RigidBodyStamp error, n_atoms already declared"
70 <               "for RigidBody: %s\n",
76 <               name);
70 >               " for this RigidBody.\n");
71        return strdup( errMsg );
72      }
73      have_atoms = 1;
# Line 97 | Line 91 | char* RigidBodyStamp::assignInt( char* lhs, int rhs ){
91      if( have_atoms ){
92        sprintf( errMsg,
93                 "RigidBodyStamp error, n_atoms already declared for"
94 <               " RigidBody: %s\n",
101 <               name);
94 >               " this RigidBody.\n");
95        return strdup( errMsg );
96      }
97      have_atoms = 1;
# Line 133 | Line 126 | char* RigidBodyStamp::checkMe( void ){
126    int i;
127    short int no_atom;
128    
129 <  if( !have_name || !have_atoms ){
130 <    if( !have_name ) return strdup( "RigidBodyStamp error. RigidBody's name"
138 <                                    " was not given.\n" );
139 <    else return strdup( "RigidBodyStamp error. RigidBody contains no atoms." );
129 >  if( !have_atoms ){
130 >    return strdup( "RigidBodyStamp error. RigidBody contains no atoms." );
131    }
132    
133    no_atom = 0;
# Line 147 | Line 138 | char* RigidBodyStamp::checkMe( void ){
138    if( no_atom ){
139      sprintf( errMsg,
140               "RigidBodyStamp error. Not all of the atoms were"
141 <             " declared in RigidBody \"%s\".\n", name );
141 >             " declared in this RigidBody.");
142      return strdup( errMsg );
143    }
144    

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines