12 |
|
unhandled = NULL; |
13 |
|
have_position = 0; |
14 |
|
have_orientation = 0; |
15 |
– |
have_name = 0; |
15 |
|
have_atoms = 0; |
16 |
|
have_extras = 0; |
17 |
|
} |
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; |
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 |
|
|
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; |
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; |
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; |
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 |
|
|