#ifndef _Beh_UniformScale_txx #define _Beh_UniformScale_txx #include "Beh_UniformScale.h" namespace mial { template Beh_UniformScale::Beh_UniformScale() :Behavior("Beh_UniformScale") { //Default constructor startTime =0; endTime =0; } template bool Beh_UniformScale::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_UniformScale"; 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_UniformScale"; throw e; } startTime = this->physLayer->getTime(); endTime = startTime+in->duration; std::stringstream defArgs; defArgs << in->scaleAmount; std::cout << "Runing Beh_UniformScale" << std::endl; this->physLayer->runDeformation("Def_UniformScale",NULL,&defArgs);//Indicate that arg list is a stream return false; } template void Beh_UniformScale::cleanUp() { startTime =0; endTime =0; } }//end namespace mial #endif