| 209 |
|
if( the_event->err_msg != NULL ) return 0; |
| 210 |
|
|
| 211 |
|
addMolStamp( current_mol ); |
| 212 |
+ |
return 1; |
| 213 |
+ |
} |
| 214 |
+ |
|
| 215 |
+ |
int MakeStamps::newRigidBody( event* the_event ){ |
| 216 |
+ |
|
| 217 |
+ |
current_rigidbody = new RigidBodyStamp; |
| 218 |
+ |
|
| 219 |
+ |
the_event->err_msg = current_mol->addRigidBody( current_rigidbody, |
| 220 |
+ |
the_event->evt.blk_index ); |
| 221 |
+ |
if( the_event->err_msg != NULL ) return 0; |
| 222 |
+ |
return 1; |
| 223 |
+ |
} |
| 224 |
+ |
|
| 225 |
+ |
int MakeStamps::rigidBodyPosition( event* the_event ){ |
| 226 |
+ |
|
| 227 |
+ |
current_rigidbody->setPosition( the_event->evt.pos.x, |
| 228 |
+ |
the_event->evt.pos.y, |
| 229 |
+ |
the_event->evt.pos.z ); |
| 230 |
+ |
return 1; |
| 231 |
+ |
} |
| 232 |
+ |
|
| 233 |
+ |
|
| 234 |
+ |
int MakeStamps::rigidBodyOrientation( event* the_event ){ |
| 235 |
+ |
|
| 236 |
+ |
current_rigidbody->setOrientation( the_event->evt.ornt.x, |
| 237 |
+ |
the_event->evt.ornt.y, |
| 238 |
+ |
the_event->evt.ornt.z ); |
| 239 |
+ |
return 1; |
| 240 |
+ |
} |
| 241 |
+ |
|
| 242 |
+ |
int MakeStamps::rigidBodyAssign( event* the_event ){ |
| 243 |
+ |
|
| 244 |
+ |
switch( the_event->evt.asmt.asmt_type ){ |
| 245 |
+ |
|
| 246 |
+ |
case STRING: |
| 247 |
+ |
the_event->err_msg = |
| 248 |
+ |
current_rigidbody->assignString( the_event->evt.asmt.lhs, |
| 249 |
+ |
the_event->evt.asmt.rhs.sval ); |
| 250 |
+ |
if( the_event->err_msg != NULL ) return 0; |
| 251 |
+ |
return 1; |
| 252 |
+ |
break; |
| 253 |
+ |
|
| 254 |
+ |
case DOUBLE: |
| 255 |
+ |
the_event->err_msg = |
| 256 |
+ |
current_rigidbody->assignDouble( the_event->evt.asmt.lhs, |
| 257 |
+ |
the_event->evt.asmt.rhs.dval ); |
| 258 |
+ |
if( the_event->err_msg != NULL ) return 0; |
| 259 |
+ |
return 1; |
| 260 |
+ |
break; |
| 261 |
+ |
|
| 262 |
+ |
case INT: |
| 263 |
+ |
the_event->err_msg = |
| 264 |
+ |
current_rigidbody->assignInt( the_event->evt.asmt.lhs, |
| 265 |
+ |
the_event->evt.asmt.rhs.ival ); |
| 266 |
+ |
if( the_event->err_msg != NULL ) return 0; |
| 267 |
+ |
return 1; |
| 268 |
+ |
break; |
| 269 |
+ |
|
| 270 |
+ |
default: |
| 271 |
+ |
the_event->err_msg = strdup( "MakeStamp error. Invalid rigidBody" |
| 272 |
+ |
" assignment type" ); |
| 273 |
+ |
return 0; |
| 274 |
+ |
break; |
| 275 |
+ |
} |
| 276 |
+ |
return 0; |
| 277 |
+ |
} |
| 278 |
+ |
|
| 279 |
+ |
int MakeStamps::rigidBodyEnd( event* the_event ){ |
| 280 |
+ |
|
| 281 |
+ |
the_event->err_msg = current_rigidbody->checkMe(); |
| 282 |
+ |
if( the_event->err_msg != NULL ) return 0; |
| 283 |
+ |
|
| 284 |
|
return 1; |
| 285 |
|
} |
| 286 |
|
|