#ifndef _Beh_TranslateAll_txx #define _Beh_TranslateAll_txx #include "Beh_TranslateAll.h" namespace mial { template Beh_TranslateAll::Beh_TranslateAll() :Behavior("Beh_TranslateAll") { //Default constructor startTime =0; endTime =0; } template bool Beh_TranslateAll::run(typename Behavior::behaviorIn * i,std::stringstream *s) { typename behaviorIn::Pointer in; //TODO: Make sure the null works. if(i != NULL && s != NULL) { Error e; e.msg = "Only one of struct or stream input may be provided."; e.name = "Beh_TranslateAll"; throw e; } else if(i != NULL) in = reinterpret_cast(i); //Typecast the input to its desired form else if( s!= NULL) { in = behaviorIn::New(); in->fillFromStream(*s);//in = &behaviorIn(*(reinterpret_cast(s))); } else { Error e; e.msg = "Either struct or stream input must be provided."; e.name = "Beh_TranslateAll"; throw e; } input = in; startTime = this->physLayer->getTime(); endTime = startTime+in->duration; std::stringstream defArgs; for(int i=0;itranslateAmount[i] << " "; } std::cout << "Runing Beh_TranslateAll" << std::endl; this->physLayer->runDeformation("Def_Translation",NULL,&defArgs);//Indicate that arg list is a stream return false; } template bool Beh_TranslateAll::update() { std::stringstream defArgs; for(int i=0;itranslateAmount[i] << " "; } this->physLayer->runDeformation("Def_Translation",NULL,&defArgs);//Indicate that arg list is a stream return false; } template void Beh_TranslateAll::cleanUp() { startTime =0; endTime =0; } }//end namespace mial #endif