#ifndef _DEF_UniformScale_TXX #define _DEF_UniformScale_TXX #include "Def_UniformScale.h" namespace mial { // constructor: template Def_UniformScale ::Def_UniformScale() { this->name = "Def_UniformScale"; } template bool Def_UniformScale ::run(typename Deformation::deformationIn* i,typename Deformation::DefArgSet* org, std::stringstream *s) { DefArgSet* orgUp = reinterpret_cast(org); typename deformationIn::Pointer in; if(i !=NULL && s != NULL) { Error e; e.msg = "Only one of struct or stream input may be provided."; e.name = "Def_UniformScale"; throw e; } else if(i !=NULL) in = reinterpret_cast(i); //Typecast the input to its desired form else if( s!= NULL) { in = deformationIn::New(); in->fillFromStream(*s); } else { Error e; e.msg = "Either struct or stream input must be provided."; e.name = "Def_UniformScale"; throw e; } int numSprings = orgUp->springsRest->size(); //Apply the force to the model for( unsigned int i=0; ispringsRest->put(i,orgUp->springsRest->get(i)*in->scaleAmount); } return false; } } // end namespace mial #endif